I want to convert a raster file (100x100m pixel size) which contains population counts as pixel values. I need a vector-based file of the 100x100m grids and the population as attributes.

I tried different conversion methods in QGIS, but there will always be pixels merged together.

Is there a way to create a vector grid and assign the raster values to them?

  • 2
    Adjacent pixels with the same values are merged together when converted to polygons? You could create a fishnet and intersect with output to recreate the grid
    – BERA
    Aug 31, 2018 at 10:37
  • Thank you. Do you know how to create the fishnet to match it with the same position as the raster cells?
    – boondigga
    Aug 31, 2018 at 10:41
  • Please, do not forget about "What should I do when someone answers my question?"
    – Taras
    Nov 19, 2022 at 22:03

3 Answers 3


Yet another option would be SAGA Raster values to points tool (QGIS Processing Toolbox | SAGA | Vector <-> raster). Choose [1] cells as Type option.

SAGA - Raster values to points

enter image description here

note white moth-eaten appearance, which is nodata holes.

It was not clear what particular tools you have already tried, but one of them might have been GRASS r.to.vect tool (Type: area), which yields something like you have described: GRASS - r.to.vect

enter image description here

note internal nodata cells are treated as independent parts by GRASS


Since QGIS 3.4 there is an algorithm called "Raster pixels to polygons".

You can find it in the Processing Toolbox -> Vector creation -> Raster pixels to polygons

enter image description here

For more details check the pull requests on GitHub.


Alternatively you can do it directly with OpenJUMP Plus. Open your raster as a Sextante raster layer and use this tool

enter image description here

As a result you'll get a polygon layer that contains the pixel values as attributes. The other option "Create Lattice" creates points instead of polygons. In the image below blue rectangles are the generated polygons and attribute info is shown from the two selected and highlighted polygons.

enter image description here

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.