Monday 31 October 2016

arcgis desktop - Changing raster cells values inside of a polygon to the closest cells just outside the polygon!


I have been wrestling with this for a while and couldn't find out how I can do this. I want each cell of a raster inside of a polygon boundary to have the value of the closest cell just outside of the polygon.



I think the closest answer was the one at this question, but I couldn't apply it!


My plan was:



  1. Use "Polygon to Raster" to change the polygon to a raster. The cells inside the polygon become 1 and the points outside of the polygon are nodata.

  2. Use Con(IsNull(Raster),0,NULL) and assign it to Raster2

  3. Add Raster1 and Raster2 to get nodata inside the polygon

  4. It should be easy from here with nodata inside the polygon. We just use "Euclidean Allocation" and it does the job.


I'm stuck at step 2 and get an error:




[SELECT * FROM VAT_Extent_RAS WHERE IsNull( "Value" )] Failed to execute (Con).



Do you have any thoughts? Is there an easier way to do this?


Update:


I'll try to summarize my progress here. I want to change all raster cells inside the polygon to "nodata" while the raster cells outside of the polygon remain the same. I used polygon to raster function first. This gives me a raster with 0 cell inside the polygon and "nodata" outside of the polygon. What do I do next?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...