Summary
Creates a raster object by modifying the projection of the input raster.
Discussion
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.
Syntax
Reproject (raster, {spatial_reference}, {x_cell_size}, {y_cell_size}, {x_registration_point}, {y_registration_point})
Parameter | Explanation | Data Type |
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}. (The default value is 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. (The default value is 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. (The default value is 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. (The default value is 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. (The default value is 0) | Double |
Data Type | Explanation |
Raster | The reprojected raster object. |
Code sample
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")