Creating polygons representing specific range of values within raster using QGIS?

by Pascal Royer-Boutin   Last Updated September 11, 2019 22:22 PM

Using QGIS, I started with LIDAR points (every 5 m) on a 90’000 ha area and then converted it in a raster of elevation (interpolating to fill some holes in LIDAR data). Now, I want to get a polygon representing the surface for which the cell value is equal or below a given threshold value.

I tried two methods:

  1. Creating contours at the threshold value from the raster and converting these contours to polygons.
  2. Polygonizing the raster reclassified as zeros (cell > x) and ones (cell =< x) and then simplifying it to a more contour-like shape.

Using method 1, the result is really close to what I want. Polygons are created but polygons that should be holes within a polygon, or islands within a hole, are created as separate polygons. Is there a way to convert contour lines into polygons while keeping holes and islands? If not, is there a way to correct this afterwards?

Method 2 seems a good approach in theory although very time consuming (in processing time). I found instructions proposed previously by « Lars » using GRASS (GRASS v.generalize method=douglas not working as expected). I’m satisfied with the result I got using a sampled polygon, but it doesn’t seem to work when using complete dataset : the processing of « v.generalize » seems to either crash or stop, and it happens when topology is building. I wonder if it’s only a matter of file size and computing limitations or if it’s a little more complicated than that.

v.generalize -c [email protected] output= generalized_RASTER method=douglas threshold=5

Answers 2

It seems I found an answer to my question. Before converting the contour lines of a given elevation value in polygons, I used the following function in QGIS: Vector -> Geometry Tools -> Single parts to multipart.

Pascal Royer-Boutin
Pascal Royer-Boutin
September 29, 2015 20:21 PM

enter image description hereThis method did not work for me. The

Steve Martell
Steve Martell
September 11, 2019 22:16 PM

Related Questions

Polygonize a multi-band raster

Updated June 22, 2018 15:22 PM

How to convert a line to points?

Updated July 23, 2018 09:22 AM

Multipoint to point tool in Qgis

Updated December 10, 2018 15:22 PM