Reproject function
The Reproject function modifies the projection of a raster dataset, mosaic dataset, or raster item in a mosaic dataset. It can also resample the data to a new cell size and define an origin.
The inputs for this function are the following:
- Input Raster
- Spatial Reference—The coordinate system used to reproject the data.
- X Cell Size—The x-dimension to which the data should be resampled. This is optional. If the value is 0 or less, then the output envelope (extent and cell sizes) is calculated from the input raster.
- Y Cell Size—The y-dimension to which the data should be resampled. This is optional. If the value is 0 or less, then the output envelope (extent and cell sizes) is calculated from the input raster.
- X Origin—The x-coordinate used to define the upper left corner of the dataset. This coordinate must be defined in the units of the new spatial reference. If both the X Cell Size and Y Cell Size parameters are greater than 0, then they are used along with the X Origin and Y Origin to define the output envelope.
- Y Origin—The y-coordinate used to define the upper left corner of the dataset. This coordinate must be defined in the units of the new spatial reference. If both the X Cell Size and Y Cell Size parameters are greater than 0, then they are used along with the X Origin and Y Origin to define the output envelope.
The x,y origin is mainly used to enforce pixel alignment between multiple scenes, as in a cache. Therefore, if two images use the same origin and cell sizes, the pixels from the resampled images will coincide exactly in the overlap area, even if they came from images with different pixel sizes.
The Reproject function can be used when creating a cache from a raster or mosaic dataset that is not in the required projection. For example, when creating a cached image service that may be integrated by applications with other cached services, it's important that they all be in the same projection. This is often a Web Mercator projection. Since the mosaic dataset cannot be reprojected, you can do one of two things—either create a referenced mosaic dataset from your mosaic dataset in the projection needed, or add the Reproject function to the mosaic dataset's function chain. Another example uses this function on the raster item in a mosaic dataset. When using the Cached Raster function, you may want to insert the Reproject function so the cache is created in the new projection. Raster items in a mosaic dataset can be cached when the processing is intense and you are trying to publish an image service that is fast, without caching the entire image service.
You could also use the Reproject function if you're working with a raster or mosaic dataset via a scripting environment that needs to be reprojected.