I'm trying to polygonize a bunch of rasters over the weekend (crunch time) and was curious what the thinking is regarding speed of polygonizing rasters in GDAL.

Based on your knowledge, if the raster had internal LZW compression, would the process be faster, slower, or the same? My rasters are very large (55500x55500 pixels) and since that will take a while to polygonize, I'm interested in making it as fast as possible.

I'm going to run a test on a subset but wanted to see if anyone who is familiar with compression (I'm not) and GDAL could answer this question.

  • 1
    When it comes to subsets and compression, you need to be careful to make the subset representative, or your test will be misleading.
    – Vince
    Apr 23, 2017 at 0:13

1 Answer 1


I don't think the compression will make a difference. If you look in the source for the algorithm, you'll see that it loads whole lines of the raster, then hands them off to a complex polygonization routine. The bottleneck is very likely to be in the vector-processing operations, not in the reading of raster pixels.

Also, according to the docs (and the code), processing large rasters will imply very heavy memory usage, so if a lot of paging occurs, your process will take a virtual eternity to complete. You can break your rasters into smaller tiles and then merge the resulting vectors. Here's an answer from a user who did just that.

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.