I classified my raster-DHM into elevation levels using colormap. Its not a "real" classification, just a colormap. So I can't vectorize the classes to get polygons for every class.

What's the best way, to classify and vectorize a raster? The Rastercalculator? How to use it, if I want to classify my DHM in elevation gradation like: 1000-1200m; 1200-1400m?

  • You had another question about working with contours you generated - are those not the 'vectors' you'd like to produce?
    – Simbamangu
    May 16, 2012 at 9:05
  • Not exactly :) I need polygones. The elevation-difference is progressive increasing. Im looking for a way to classify the raster, and verctorize the result. I need it in that case, and I need it later for vectorization of classified slopes.
    – MartinMap
    May 16, 2012 at 9:59

2 Answers 2


You can use GRASS r.to.vect

There is already a question (and answer) for that, here


Newer versions of QGIS also provide a GDAL algorithm to do the same. Is called Polygonize (Raster to Vector). You can find it in the GDAL > Raster Conversion group in the processing toolbox.

  • Yes, thats right! I have not seen it :) But what about qgis? Is there also a way to do that?
    – MartinMap
    May 16, 2012 at 11:35
  • Well you ca use grass in Qgis, using the grass plugin. Or easier using grass in Qgis with SEXTANTE toolbox. That way you don't even have to import your raster in to a grass database. May 16, 2012 at 13:31

The experimental Sextante toolbox for QGIS is really getting useful now. Using r.reclass with a rules text file allows one to do want you want. The following rules produced the raster shown below (I've coloured this using colormap). The colours are elevation bands at vertical intervals of 200 metres. It should be no problem to polygonize the raster but I can't check this (the raster polygonizer is one of several tools that isn't working here at present). Nick.

0 thru 200 = 1
201 thru 400 = 2
401 thru 600 = 3
601 thru 800 = 4
801 thru 1000 = 5
1001 thru 1200 = 6
1201 thru 1400 = 7

enter image description here

  • 1
    In fact in the end I did manage to polygonise the raster, using the Polygonize tool from under the Raster menu. This was with 1.7.4 under Vista. It looks good.
    – nhopton
    May 17, 2012 at 7:57

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.