5

I've seen many ask how to clip a raster via a polygon mask but have yet to find the opposite operation. How does one clip a polygon layer via raster? ta Specifically how does one clip a polygon layer via certain raster values?

For example imagine a flooding model. I would like to get the polygon shape that represents a "safe" area in a certain region. I would have to clip the raster extent against a certain elevatio value in the raster.

Any ideas?

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
jhc
  • 409
  • 4
  • 12
  • There is no tool to do that, you need to convert your raster into a polygon then clip your polygon with a polygon. You can use your QGIS raster calculator to create a binary raster from your elevation then polygonize that. – Michael Stimson Jul 24 '15 at 04:14
  • Won't converting a raster to a polygon simply give it's extents? – jhc Jul 24 '15 at 04:18
  • No. You end up with a polygon for each cell in the raster dissolved by values. No data is lost. Read http://gis.stackexchange.com/questions/54362/how-to-make-polygon-from-cells-of-a-raster – Michael Stimson Jul 24 '15 at 04:39
  • 1
    You could use raster calculator to find certain areas based on the elevation values. The return values are a raster with the values of 1 and 0. eg if you put in an expression "DEM >= 5" any areas with elevation of 5 or greater will be shown as the 1 values (true) and everything else 0 values (false). – TsvGis Jul 24 '15 at 04:41

2 Answers2

7

This is how you can use raster calculator to find "safe area" (note: basic analysis) using ArcGIS 10.2.

  • Load your DEM into ArcGIS Desktop

[enter image description here]

  • Open Raster Calculator and enter the conditions that you want to find. In the example below, I want to find areas of elevation from the DEM that are equal to or greater than 186m (186 is the level that my flood water reaches)

enter image description here

  • The results returned from the Raster Calculator process is a new raster with the values of 1 and 0. Values of 1 represent all areas that are equal to or greater than 186m (True - see green areas in example below) and the 0 represent values that are less than 186m (False - see pink areas).

enter image description here

  • The next step is to convert this new raster ("Area_Above_Flood_lvl.img") to a polygon shapefile using the Raster to Polygon Tool

enter image description here

  • and then delete the 0 values in the field "GRIDCODE".

enter image description here

  • The final result is a polygon showing the safe areas above my flood heights.

enter image description here

TsvGis
  • 2,079
  • 18
  • 35
  • Thank's for the help. Worked perfectly.Can't give a +1 to you though as I don't have enough rep on this account. – jhc Jul 24 '15 at 17:03
1

You were nearly there when you said clip a raster by a polygon. Essentially they're the same operation: you can clip your raster to the polygon and then mask the result to the values you require. This masked raster can then either be converted into a polygon or kept as a raster. Note, it may be easier if you convert your polygon to a raster first.

MikeRSpencer
  • 972
  • 6
  • 12