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

8
  • 1
    Set extent to Union of inputs and repeat.
    – FelixIP
    Dec 10, 2019 at 18:52
  • @FelixIP i am not sure what you mean
    – ziggy
    Dec 10, 2019 at 18:53
  • Environment extent.
    – FelixIP
    Dec 10, 2019 at 18:54
  • 1
    See comments to gis.stackexchange.com/questions/150103/… you need extent equal one of grey thing.
    – FelixIP
    Dec 10, 2019 at 18:56
  • @FelixIP Con(IsNull("block.tif"), "buff.tif") where block is the red I am trying to erase from the buff
    – ziggy
    Dec 10, 2019 at 19:03

1 Answer 1

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")
9
  • 1
    need this in raster calculator
    – ziggy
    Dec 10, 2019 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, 2019 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, 2019 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, 2019 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, 2019 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.