Select to view content in your preferred language

Clipped raster cell values differ from original

670
2
08-05-2020 12:41 PM
JoeBriggs1
Occasional Contributor

I am using python and clipping a tif with the clip tool. However, the output (clipped) raster is altered. The raster properties appear identical, both 16bit signed. Cell sizes are the same etc. Here is the relevant code including environment parameters:

arcpy.env.compression = "NONE"
arcpy.env.pyramid = "NONE"
arcpy.Clip_management(pl_rasters[0], buffExtentStrip, pluvial_final+".tif",nodata_value=-9999,maintain_clipping_extent="NO_MAINTAIN_EXTENT")

The following images show the original and clipped.

Original:

enter image description here

Clipped:

enter image description here

Any help is greatly appreciated.

Tags (1)
0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor
NO_MAINTAIN_EXTENT —The cell alignment of the input raster will be maintained and the output extent will be adjusted accordingly.

The description for the tool describes several examples where the extent and/or cell size can be altered during the process.  Your code example provides several opportunities for that to occur.  It might be worth while to experiment by setting your environment parameters explicitly in the code (ie cell size, alignment and the clip extent)


... sort of retired...
0 Kudos
DanPatterson
MVP Esteemed Contributor

resolved?


... sort of retired...
0 Kudos