Hi,
can someone explain me the difference in using between gp.mask and ExtractByMask_SA ?
These are some statements about my understanding of mask & ExtractByMask_SA:
- gp.mask is an environment setting, not a tool
- gp.mask is in effect for following raster processes until it is re-/undefined
- gp.mask redefines raster extents
- ExtractByMask_SA is a 'rasterdata-clipping-tool'.
- ExtractByMask_SA has no effect to following tools
- in Python there is no difference between
shpMask = 'E:/region.shp'
rastOperateAS = 'E:/demInAspect'
rastDestAS = E:'E:/demOutAspect'
rastOperateAS = 'E:/demInSlope'
rastDestSL = E:'E:/demOutSlope'
gp.mask = 'E:/region.shp' # define the mask
gp.aspect_SA(rastOperateAS,rastDestAS) # operating data
gp.slope_SA(rastOperateSL, rastDestSL, "Degree","1") #operating data
and
shpMask = 'E:/region.shp'
rastOperateAS = 'E:/demInAspect'
rastDestAS = E:'E:/demOutAspect'
rastOperateAS = 'E:/demInSlope'
rastDestSL = E:'E:/demOutSlope'
gp.ExtractByMask_SA(rastOperateAs, shpMask, rastMaskedAS) # clipping the source
gp.aspect_SA(rastMaskedAS,rastDestAS) # operating masked data
gp.delete_Management(rastMaskedAS) # cast away masked source
gp.ExtractByMask_SA(rastOperateAs, shpMask, rastMaskedAS) # clipping the source
gp.slope_SA(rastMasked,rastDestSL, "Degree","1") # operating masked data
gp.delete_Management(rastMaskedSL) # cast away masked source
If this statements are correct:
Is there any reason, except having a operating data permanently in masked form, using ExtractByMask_SA in Python (stability, performance) ?
Any input would be appreciated.
Lothar