More

Clipping polygon layer by raster value


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?


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

[]

  • 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)

  • 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).

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

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

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


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.


Watch the video: Clip a Raster Layer in QGIS three different ways (October 2021).