How could I specify raster's origin, while using arcpy.TinRaster_3d?
closed as off-topic by PolyGeo♦ Oct 20 '18 at 10:04
This question appears to be off-topic. The users who voted to close gave this specific reason:
- "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – PolyGeo
You can define the origin as the Xmin, Ymin (or Left & Bottom) of the extent environment setting. Click the Environment button at the bottom of the tool's interface, click Processing Extent and fill in the extent properties. You have to indicate Xmax & Ymax (Right, Top) as well:
import arcpy InRaster = "c:\\some\\path\\to\\raster.tif" DescObj = arcpy.Describe(InRaster) arcpy.env.extent = DescObj.extent # match the extent of the input raster arcpy.env.snapRaster = InRaster # match the edges of the raster
Note that this method of setting the extent works with any feature or raster data but the value of the snap raster must be a raster.
Extents of data can include a healthy buffer around the data so setting the output extent alone is good but specifying a snap raster is better!
The snapRaster ensures that the cells of the raster align at the origin; if the cell size is the same then the rasters will perfectly overlay. When using snapRaster you will get the most use if the raster to be produced is either the same, a factor of or a multiple of the snap rasters' cell size.