Clip a raster and change cell size?

05-03-2013 09:37 AM
New Contributor
I'm trying to script the clipping of a large raster into tiles with simultaneous resampling. A script that includes these lines:

[INDENT]print 'Clipping to '+clipExtent
print arcpy.Describe(sourceGrid+'/Band_1').meanCellWidth
arcpy.env.cellSize = 1.0
print arcpy.env.cellSize
print arcpy.Describe(clippedGrid+'/Band_1').meanCellWidth

gives the following output (annotated):
[INDENT]Clipping to 230000 3970000 240000 3980000
0.5      (sourceGrid cell size)
1        (arcpy.env.cellSize}
0.5      (clippedGrid cell size)[/INDENT]

Why does Clip_management appear not to honor the arcpy.env.cellSize setting? What am I not understanding?
0 Kudos
1 Reply
Occasional Contributor II
This is simply because the Clip_Management tool doesn't honour the Cell Size Environment setting. To see which Environment settings are honoured by a tool, check the "Environments" section near the bottom of any tool's Help page. For Clip_Management, you can see that Cell Size is not included in this section:

To change the cell size, you would therefore need to use the Resample tool:

... where you can specify Cell Size as one of the parameters.
0 Kudos