Select to view content in your preferred language

Adding two rasters and getting no data value in the points that both have values

842
1
08-23-2013 10:57 AM
KarimAlizad
New Contributor
I am developing a model in ArcGIS and using the python scripting to generate a toolbox.

Some calculations are done by reading the elevations and points from a triangular mesh and generating some rasters based on those points.

The code generates 3 rasters, which two of them were generated using IDW interpolation and one of them is made by extracting points to raster. Then I add two of those rasters (one from IDW and the other from extract points to rasters). I use the same cell size for both IDW and extraction. The rasters show me the elevation in every point and I did the Raster calculation manually and it did work but when I run the code, the result for that summation for some points shows no data value (-9999) for some points.

If I change the cell size, the location and number of these points change . This problem has not happened for another mesh that I used before but this time it is happening and I have no idea about it. Can anyone help?
0 Kudos
1 Reply
curtvprice
MVP Alum
The code generates 3 rasters, which two of them were generated using IDW interpolation and one of them is made by extracting points to raster. Then I add two of those rasters (one from IDW and the other from extract points to rasters). I use the same cell size for both IDW and extraction. The rasters show me the elevation in every point and I did the Raster calculation manually and it did work but when I run the code, the result for that summation for some points shows no data value (-9999) for some points.


It's a little unclear to me what the issue is, but here goes. (I'm assuming you are using 10.x):

When creating rasters it's good practice to set both the Cell Size and the Snap Raster environment. This ensures when you do a vector to raster conversion (for example, points to raster) the output raster will not only match in cell size, but the new raster cells will "line up" with another raster (for example, the IDW raster you want to process with it).

The ExtractByPoints tool creates a raster that is mostly NoData, except for the locations that overlap with the input points. If you want to add these two together, but not get NoData cells, you may want to try the Focal Statistics tool with the "NODATA" option. (This will treat the NoData cells as zero.)
0 Kudos