Reproject

サマリー

Creates a raster object by modifying the projection of the input raster.

説明

For more information about how this function works, see the Reproject raster function.

The referenced raster dataset for the raster object is temporary. To make it permanent, you can call the raster object's save method.

構文

Reproject (raster, {spatial_reference}, {x_cell_size}, {y_cell_size}, {x_registration_point}, {y_registration_point})
パラメーター説明データ タイプ
raster

The input raster.

Raster
spatial_reference

The coordinate system used to reproject the data. This value is provided as a Python dictionary with the well-known ID (wkid). Optionally, you can include the latest well-known ID (latestWkid), or the current wkid value associated with the same spatial reference.

For example, the WGS 1984 Web Mercator Auxiliary Sphere projection has a wkid of 102100 and a latestWKid of 3857. To reproject the input raster object into Web Mercator, use {"wkid" : 102100} or {"wkid" : 102100, "latestWkid" : 3857}.

(デフォルト値は次のとおりです None)

Dictionary
x_cell_size

The cell size in the x-dimension to use if resampling the data. If no value is provided or the value is 0, the output envelope (extent and cell sizes) is calculated from the input raster.

(デフォルト値は次のとおりです 0)

Integer
y_cell_size

The cell size in the y-dimension to use if resampling the data. If no value is provided or the value is 0, the output envelope (extent and cell sizes) is calculated from the input raster.

(デフォルト値は次のとおりです 0)

Integer
x_registration_point

The x-coordinate used to define the upper left corner of the dataset. The coordinate must be in the units of the new spatial reference. If both x_cell_size and y_cell_size are defined and greater than 0, they are used along with the x_registration_point and y_registration_point arguments to define the output envelope.

(デフォルト値は次のとおりです 0)

Double
y_registration_point

The y-coordinate used to define the upper left corner of the dataset. The coordinate must be in the units of the new spatial reference. If both x_cell_size and y_cell_size are defined and greater than 0, they are used along with the x_registration_point and y_registration_point arguments to define the output envelope.

(デフォルト値は次のとおりです 0)

Double
戻り値
データ タイプ説明
Raster

The reprojected raster object.

コードのサンプル

Reproject example

Reprojects a raster to the WGS 1984 UTM Zone 11N coordinate system.

# Import system modules
import arcpy
from arcpy.ia import *

input_raster = arcpy.Raster("LasVegas_LandCover.tif")

# reproject the input raster to WGS 1984 UTM Zone 11N 
reprojected_raster = arcpy.ia.Reproject(input_raster, {"wkid" : 32611})

# verify the new coordinate system
prj = print(arcpy.Describe(reprojected_raster).spatialReference.name)

# save the output
reprojected_raster.save("C:/arcpyExamples/outputs/LasVegas_LandCover_UTM11N.tif")