1

I am trying to convert a raster into different polygons. The raster is based on a DEM and only contains three classes (each pixel has value 1, 2 or 3, obtained by using the raster calculator).

I want to create three polygons out of this (so just one shapefile with three features) but when I use the polygonize processing tool the result is a different ID for each pixel and as an attribute the value 1,2 or 3.

However in a later step I want to assign an average point value to each polygon and in this way it is not working.

1
  • 1
    Polygonize from GDAL in the processing toolbox seems to work for me and creates polygons out of connected cells with the same values. Are the areas holding the individual values connected in your data? If you only want to end up with three polygons you need continuous areas of each value. – humperderp Nov 9 '19 at 21:08
1

Use the dissolve tool on the output from the polygonize tool, using the raster value field as the dissolve field. This will combine all the polygons with value = 1 into a single polygon (or multipolygon if they're discontinuous), all the polygons with value = 2 into a different (multi)polygon, and so on.

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.