I am trying to create a shapefile with polygons representing areas of different slopes. I am running into some problems using the following workflow.

  1. I start with a digital elevation model and using Raster>Analysis>Slope I am converting to a slope raster.

  2. I am using "Layer Properties" to assign different colors to different slopes. Layer Properties So far everything looks right. enter image description here

  3. Next, I'm using Raster>Conversion>Polygonize. The result shows many polygons where only one field of color existed in the raster. enter image description here I want a single closed polygon for each field of color.

Does anyone know how to achieve this?

  • 1
    Welcome to GIS SE! You could classify the pixel values with the raster calculator, then polygonize. Do you feel comfortable handling the raster calculator? – Gabriel De Luca Dec 1 '19 at 4:05
  • I did manage to use the raster calculator to classify the pixels first and then polygonize but this requires that I classify for each slope range. This would add a lot of extra steps and I need to do this for many rasters. Is there not a way to directly polygonize from a single raster? – David Koch Dec 1 '19 at 4:26

After reclass your data, you can use r.to.vect from GRASS in Processing


Assigning new colors to the grid does not mean that the pixel values are categorized. The raster values remain untouched. The polygonize tool does not know anything about this categorization.

So first you need to reclassify the raster. Check this: Link and do it with the Grass r.reclass tool --> it works perfectly. Once you have the ammount of categories you want you can polygonize the raster.


You could classify your raster trough the raster calculator with a simple formula like this:

("Slopes@1" > 15) + ("Slopes@1" > 30) + ("Slopes@1" > 45) + ("Slopes@1" > 60) + ("Slopes@1" > 100)

Each condition returns a 1 if true, so the raster output will have 0 values for source pixels less or equal to 15, 1 values for source pixels greater than 15 but less or equal to 30, 2 values for source pixels greater than 30 but less or equal to 45, etc.

Then, polygonize that raster.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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