2

Two rasters

  1. slope (black and white grid with slope values)
  2. rasterized property (red, values do not matter)

I want to erase the red raster from the slope raster enter image description here

I found this thread

https://community.esri.com/thread/190381-how-to-perform-reverse-clip

and they suggested something like this (for my case block is the red raster and buff is the slope)

Con(IsNull("block.tif"),"buff.tif")

this produces the output in the multi colors. But it is not the full erase, part of the buff/slope is missing

I do not want to go the vector conversion route.

Answer needs to use Raster Calculator syntax

enter image description here

Vince
  • 20,017
  • 15
  • 45
  • 64
ziggy
  • 4,515
  • 3
  • 37
  • 83

1 Answers1

1

Use the Reclassify tool to turn your red areas into NoData values and the red area NoData values to zeros. Before you do this ensure use the geoprocessing settings to ensure the output from the Reclassify has the same extent at both data sets. Then add the resulting reclassified surface with your slope using the Plus tool.

Con(IsNull("block.tif"), "buff.tif")
ziggy
  • 4,515
  • 3
  • 37
  • 83
GBG
  • 9,737
  • 1
  • 15
  • 44
  • 1
    need this in raster calculator – ziggy Dec 10 '19 at 15:42
  • 1
    @ziggy Why are you restricted to only using the raster calculator? If you are using the raster calculator you also have access to Modelbuilder and the Spatial Analyst toolbox. But in any case, you can turn your NoData values to 0 with Con(IsNull(raster), 0, raster). You can also use SetNull in the raster calculator to generate the NoData values but that expression would depend on the values in your red area. See here; lhttp://desktop.arcgis.com/en/arcmap/10.3/tools/spatial-analyst-toolbox/setting-cell-values-to-nodata-with-setnull.htm. – GBG Dec 10 '19 at 16:05
  • 1
    I am actually doing this whole process in PostGIS but not as many people answer the PostGIS raster questions so I am getting the raster calculator syntax down in ArcGIS 1st and then will apply it to PostGIS – ziggy Dec 10 '19 at 16:10
  • 1
    as for this Con(IsNull(raster), 0, raster) I am getting the exact same results I posted in the 2nd pic of the question – ziggy Dec 10 '19 at 16:10
  • Both raster values in this con function are pointing to the same 'red raster' ? This function Con(IsNull(raster), 0, raster) is looking at the red raster, converting any NoData values to 0, and leaving any data values in there original state. If that is not the case maybe you have chosen a symbology that is not showing all the data in the 'red raster'. – GBG Dec 10 '19 at 18:52
  • I am not trying to delete the red raster out of the black/white grid – ziggy Dec 10 '19 at 19:13
  • Sorry, I am unclear what your question is then because you state on line three 'I want to erase the red raster from the slope raster'. – GBG Dec 10 '19 at 19:36
  • yes correct, so i want the slope raster with NO red raster covering it – ziggy Dec 10 '19 at 20:11
  • add the raster calculator syntax to your answer and I will accept – ziggy Dec 18 '19 at 14:20