[gdal-dev] Improving usage of GDAL in Mapnik

Robert Coup robert.coup at koordinates.com
Thu Oct 30 12:55:11 PDT 2014


Hi team,

Fixing a bug in the Mapnik GDAL code (
https://github.com/mapnik/mapnik/tree/master/plugins/input/gdal) where the
return value of RasterIO() isn't checked (so eg. if a component TIFF in a
VRT is unavailable it just trucks right along rendering blank images
without error) and it appears to me like the usage of GDAL could be
optimised a bit in
https://github.com/mapnik/mapnik/blob/master/plugins/input/gdal/gdal_featureset.cpp


I'm curious whether any of the following will actually make much
difference, or whether GDALs caching nullifies most of it already? Or
whether there are potentially other obvious performance optimisations?

* Favouring dataset.RasterIO() over band.RasterIO() to prevent up to 4x
raster reads
* Use of GetBlockSize() to read on block boundaries, then cropping data
later.
* Use GetMaskBand()/GetMaskFlags() to simplify nodata/alpha handling
(probably won't impact performance but might get rid of a bunch of code)

Cheers,

Rob :)
-- 

*Koordinates*PO Box 1604, Shortland St, Auckland 1140, New Zealand
Phone +64-9-966 0433 koordinates.com <https://koordinates.com/about>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20141031/af0c2265/attachment.html>


More information about the gdal-dev mailing list