I have a raster layer with two values, 0 and 1. I want to create a polygon shape from all the 1 values.

I expected the "raster to vector" tool to achieve this, but this created another grid as a shapefile (i.e. every square of the raster became its own polygon).

Am I using the correct tool and/or the correct settings?

1 Answer 1


You can use Menu Raster / Converstion / Vectorize raster layer (screenshot 1). On the output layer, apply Select Features by Expression… and insert "DN" = 0 to the expression editor (screenshot 2), thus selecting all polygons where the raster value is 0: these are the ones you want to delete. Now delete the selected features and you are left just with the polygons representing raster values = 1.

enter image description here

enter image description here

  • For whatever reason, the first time I tried using the 'Raster to vector' tool, a set of square polygons were produced. This time it seems to have worked, I must have had the wrong layer attribute selected when using the tool.
    – jserv
    Dec 27, 2020 at 20:28

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.