Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

con statement outputs using arcpy.sa.Con doesn't ignore NoData

$
0
0

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?


Viewing all articles
Browse latest Browse all 767

Latest Images

Trending Articles



Latest Images