0

I want to convert a raster (agric.tif) to a polygon layer (agric.shp). I want to use gdal in command line since the QGIS (raster to polygon) seems to takes for ever (still running over an hour).

I am trying to use gdal_polygonize.py . Is this working in command line? I get en error "the command not found".

gdal_polygonize.py $outdir/"agric.tif" -f "ESRI Shapefile" agric.shp

  • 1
    Well, (how) did you install GDAL? – bugmenot123 Jun 6 at 11:48
  • @bugmenot123 OK, it seems that the GEOS support was the problem. with GDAL with GEOS support works. However, it seems also very slow. Is it recommended for large files? e.g. on a european basis with high resolution (<1km) – nat Jun 6 at 11:56
  • 1
    Think about what the script is doing: is converts each pixel into a polygon and merges adjacent polygons if they have the same pixel values.It is a big job with large files and perhaps that python script is not optimized for speed. I suggest to make some tests with increasing image size for finding reasonable limits. – user30184 Jun 6 at 12:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.