Bug report #17846

Polygonize (raster to vector) fails

Added by Andreas Neumann almost 5 years ago. Updated almost 4 years ago.

Affected QGIS version:master Regression?:No
Operating System:Windows 7 (OSGeo4W) Easy fix?:No
Pull Request or Patch supplied:No Resolution:fixed/implemented
Crashes QGIS or corrupts data:No Copied to github as #:25741


When running the Menu "Raster" --> "Conversion" --> "Polygonize (raster to vector)" command, which internally uses "gdal_polygonize" the algorithm fails with the following error message:

Processing algorithm...
Algorithm 'Polygonize (raster to vector)' starting...
Input parameters:
{ 'INPUT' : 'C:/temp/dtm_extract_test.tif', 'BAND' : 1, 'FIELD' : 'DN', 'EIGHT_CONNECTEDNESS' : True, 'OUTPUT' : 'C:/temp/test_hs.shp' }

GDAL command:
cmd.exe /C gdal_polygonize.bat C:/temp/dtm_extract_test.tif "C:/temp/test_hs.shp" -8 -b 1 -f "ESRI Shapefile" None DN
GDAL command output:
File "C:\Program Files\OSGEO4~1\apps\Python36\lib\site.py", line 177 
SyntaxError: invalid syntax 
Execution completed in 0.19 seconds
{'OUTPUT': <QgsProcessingOutputLayerDefinition {'sink':C:/temp/test_hs.shp, 'createOptions': {'fileEncoding': 'UTF-8'}}>}

Loading resulting layers
The following layers were not correctly generated.
You can check the 'Log Messages Panel' in QGIS main window to find more information about the execution of the algorithm.

See also the screenshot attached for the same error message in a screenshot.

gdal_polygonize_error.png (54.3 KB) Andreas Neumann, 2018-01-12 11:57 AM

dtm_extract_test.zip - Binary GeoTiff for raster to vector conversion (114 KB) Andreas Neumann, 2018-01-12 11:59 AM

Related issues

Related to QGIS Application - Bug report #17298: Processing: gdal merge python error on QGIS 3 Closed 2017-10-17


#1 Updated by Andreas Neumann almost 5 years ago

attaching sample file for raster to vector conversion (binary Geotiff)

#2 Updated by Antonio Viscomi almost 5 years ago

Also in Windows10(1709)x64 (QGIS Master build fa2aff18e5) polygonize do not works and came out with the same error log

#3 Updated by Alexander Bruy almost 5 years ago

This same issue as #17298 and probably not related to the Processing itself.

#4 Updated by Alexander Bruy almost 5 years ago

#5 Updated by Nyall Dawson almost 4 years ago

  • Resolution set to fixed/implemented
  • Status changed from Open to Closed

This should be fixed in recent releases

Also available in: Atom PDF