[mapserver-users] Faster tileindex layer with reverse painter's algorithm

Rahkonen Jukka (MML) jukka.rahkonen at maanmittauslaitos.fi
Thu Nov 22 03:25:29 PST 2018


Hi,

Currently raster tileindex layers are rendered according to painter's algorithm. First image that it found from the tileindex is rendered first, then pixels from the next image are added by method "b over a" which is the default https://mapserver.org/uk/development/rfc/ms-rfc-113.html#rfc113 until the last image is processed. The end result is fine and if user wants to get a result that is composed from the newest available images overall it can be done by reading the tileindex sorted by time "select * from tileindex order by time".

Unfortunately the service gets pretty slow when the tileindex contains lots of overlapping images from different times because every image that gets selected by the bounding box gets also rendered even if all the pixels from some image will get overwritten later.  Setting a lower limit for time does not resolve our problem because the newest image can be quite old in some places.

I would like to see suggestions about how to implement a fast pre-selection that discards all the images which will not have any effect on the final raster. Ideally Mapserver would do it natively if the default blend mode is used but SQL or function for PostGIS or Spatialite would suit me as well. I have been thinking that some sort of pre-selection with the reverse painter's method might do for this purpose: test the footprints of the images from top to bottom, skip images which are covered by the growing union of footprints and stop when the whole BBOX is full.

-Jukka Rahkonen-

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20181122/82f94d9c/attachment-0001.html>


More information about the mapserver-users mailing list