How can I convert a raster file to a vector file without making same value cells into one polygon?

enter image description here In the attached image, the values "2124", "2269", "2321", "2634", and "2920" are the polygons automatically combined. Is there any way to convert each pixel to one polygon?

  • Welcome to GIS.SE. This appears to be two different questions, and the Q&A format of this site works best with only one question per Question. I'd recommend that you concentrate on one of them and research the other one separately, alternatively post as a separate question.
    – Martin
    Feb 10, 2014 at 9:42
  • 1
    Are you sure that you need this ? Cell based analysis will be more efficient in the raster format.
    – radouxju
    Feb 10, 2014 at 11:11
  • 1
    Hi radouxju, thanks for your comment. I'd like to display cells' values. I couldn't find any option for raster files to display them but for polygons as labels, that's why I need to convert.
    – user26767
    Feb 11, 2014 at 13:35
  • @user26767 You should specify what tool you used to create the undesired above result. I assume you used the GDAL polygonize. Jun 9, 2022 at 0:49

2 Answers 2

  1. Create a fishnet with the Vector grid tool in the Vector->Research Tools menu.
  2. Assign raster values to the polygons with the "Add grid values to shapes" tool in the Processing Toolbox (Simplified interface, GeoAlgorithms, Raster-vector, Raster->vector operations).
  • Thank you very much for your answer, Luke. I was able to get the result which I exactly wanted. And now I know the there is such toolbox.
    – user26767
    Feb 12, 2014 at 2:24

Another very good solution out there is to use the native QGIS Toolbox--> Vector Creation--> Raster pixels to polygons. As of QGIS 3.24, this algorithm still splits each cell into a separate polygon, unlike the GDal polygonize (Raster to Vector) function which I assume you used.

Depending on what you were trying to do, either function could be useful since I ironically was directed to this post when trying to research how to get like cells to cluster together. Also see this post for visuals.

  • This is a better answer than the accepted one. Oct 17 at 15:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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