I am trying to use the Polygonize (raster to vector) tool in QGIS. An error does not show up, however it is stuck on 10% no matter how long I wait. It shows:

QGIS version: 3.22.9-Białowieża
QGIS code revision: a8e9e6fa
Qt version: 5.15.3
Python version: 3.9.5
GDAL version: 3.5.1
GEOS version: 3.10.3-CAPI-1.16.1
PROJ version: Rel. 9.0.1, June 15th, 2022
PDAL version: 2.3.0 (git-version: 988ee3)
Algorithm started at: 2022-08-02T22:15:30
Algorithm 'Polygonize (raster to vector)' starting…
Input parameters:
{ 'BAND' : 1, 'EIGHT_CONNECTEDNESS' : False, 'EXTRA' : '', 'FIELD' : 'DN', 'INPUT' : 'C:/Users/[redacted]/Desktop/test.tif', 'OUTPUT' : 'TEMPORARY_OUTPUT' }

GDAL command:
gdal_polygonize.bat C:\Users\[redacted]\Desktop\test.tif -b 1 -f "GPKG" C:/Users/[redacted]/AppData/Local/Temp/processing_JyIyqj/2722604aa8f04f4fac4a52b5b31a6450/OUTPUT.gpkg OUTPUT DN
GDAL command output:

I used to have this problem before, which was solved by reinstalling QGIS. Things then worked fine, before the problem restarting again. I do not want to have to constantly reinstall QGIS, is there another solution?

  • 1
    First I would try again, but make sure you save the file to somewhere as a .shp. Looks like you are just running it and it's getting stored in your temp. Then I would suggest using just the command line or python. gdal_polygonize.py
    – Binx
    Aug 2 at 22:23
  • @Binx What should I be saving as an .shp? .shp does not show up in the lift of allowed filetypes to either Export/Save As raster layers, or Save As the whole document. Aug 3 at 0:58
  • Check out my answer for clarification, but I would suggest using @BERA solution. What is the size of your .tif?
    – Binx
    Aug 3 at 17:36

2 Answers 2


Within the tool you will want to set your parameters and then click on the 3 ... (circled in red) to open up a file explore window asking you where you want to save the output. Name the file name and notice the "Save as Type" is .shp not .GPKG. I used a 50MB file and it took a couple of minutes, but the output file size was just over 3GB.

I tried running the processes without saving it and it's been processing for 30 minutes (I eventually stopped it).

That being said, I suggest using BERA answer; tile it and run each tile through, then merge if need be.

For a programmatic solution using python, I would suggest tiling it with gdal_retile.py and then using a for loop with gdal_polygonize.py.

enter image description here

enter image description here

enter image description here

  • Thank you! This eventually solved it. Aug 5 at 2:24

Maybe the raster is to big to process in one go.

You can create a grid covering the raster and use the grid to process smaller parts of the raster, then merge all the output polygon layers, dissolve then multipart to singlepart.

This model will for each input grid polygon, clip the raster, convert that part of the raster to polygons then move on to the next grid and do the same:

Add two inputs, one "Vector Features", with Advanced ticked, and one raster layer input. Clip raster by extent and raster pixel to polygons.

enter image description here

When you execute the model make sure to activate "Iterate over this layer...":

enter image description here

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.