1

In ArcGIS 10.2, using the Con tool, I ran a conditional statement to return RasterA where RasterB value >0. That worked fine. Transferring the code into python, the statement reads something like:

arcpy.gp.Con_sa()

BUT, I don't want to write the output to disk yet, so I'm going to use:

outraster = arcpy.sa.Con()

To see if the output is right, I save this to disk:

ouraster.save(output location)

The resulting output does not ignore NoData, it repalces it with value 0. arcpy.gp.Con_sa() successfully ignores NoData values and transfers them to the output raster as NoData. arcpy.sa.Con() fills all the NoData values with 0 in the output. This increases processing time and is unnecessary.

Any idea why this is happening?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.