#5716 closed enhancement (fixed)
[PATCH] faster gdal_rasterize for a large number of small geometries
Reported by: | youri | Owned by: | warmerdam |
---|---|---|---|
Priority: | normal | Milestone: | 2.3.0 |
Component: | Algorithms | Version: | svn-trunk |
Severity: | normal | Keywords: | faster, rasterize |
Cc: |
Description (last modified by )
Big performances enhancement for large number of small polygons.
The main idea is to loop over the geometries instead to loop over the pixels (by the way skipping out-of-scope geometries), and to write only concerned raster blocks. Very efficient for large files compared to original method. The old algorithm can theoretically still be more efficient for very large geometries (to be checked).
The attached files are working on svn-trunk rev 33442.
The default behaviour is to use the original algorithm when nb features < 1000, then use the new one. The algorithm can be explicitly set with the '-optim' param.
I hope this will help ! (some processes simply crash without this mod)
Attachments (5)
Change History (13)
by , 9 years ago
Attachment: | gdal_rasterize.cpp added |
---|
comment:1 by , 9 years ago
Summary: | faster gdal_rasterize for a large number of small geometries → [PATCH] faster gdal_rasterize for a large number of small geometries |
---|
comment:2 by , 9 years ago
by , 8 years ago
Attachment: | gdalrasterize.cpp added |
---|
by , 8 years ago
Attachment: | gdal_rasterize_bin.cpp added |
---|
by , 8 years ago
Attachment: | gdal_rasterize_lib.cpp added |
---|
by , 8 years ago
Attachment: | gdal_alg_priv.h added |
---|
comment:3 by , 8 years ago
Description: | modified (diff) |
---|---|
Version: | unspecified → svn-trunk |
comment:4 by , 7 years ago
Hello,
as it is quite time-consuming to adapt this mod for each version of gdal, is it possible to integrate it in the next stable version?
as written before, some applications just crash without it, and most-if-not-all runs see significant gain in processing time.
Thank you in advance !
comment:5 by , 7 years ago
Could you submit it possibly as a pull request over the github mirror at https://github.com/OSGeo/gdal ? This would help reviewing your changes and make sure they comply with existing enforced coding rulesand don't cause known regressions. Adding a new test case in the gdalautotest suite (e.g in autotest/alg/rasterize.py) to test your code would be needed too.
comment:6 by , 7 years ago
I just submitted a pull request. However, it is quite complex to add a test on speed as it concern large datasets (and quite large computing time for an autotest). We can however consider a test to ensure that the output results are similar.
comment:8 by , 7 years ago
Milestone: | → 2.3.0 |
---|
Hi, Might you be able to provide a compiled replacement gdal_rasterize.py file with which those with no programming knowledge can make use of your enhancements? Best regards.