[mapserver-users] Unexpected result from overlapping images in tile index

thomas bonfort thomas.bonfort at gmail.com
Thu Jan 19 03:31:18 PST 2017


Peter, if I understand correctly....
I'm not aware that there is any documentation or requirement that using a
tileindex with mapserver garantees any ordering in the stacking of the
images returned by the tileindex. Namely, if your tileindex returns your
gray (opaque) image after (i.e. on top of) your black/white image, then
your black/white image will be completely obscured by your gray image.
This is what I'd try:
- try using the sortshp utility on your tileindex (once in ascending order,
once in descending) and see if the resulting image is affected
- use a postgis based tileindex layer with explicit ORDER BY clauses to
enforce that transparent images get rendered after opaque ones

--
thomas

On Thu, Jan 19, 2017 at 12:31 AM Peter Schmitt <pschmitt at gmail.com> wrote:

> Hi,
>
> I have a tile index to render a layer from two images.  The images are
> black.png
> https://github.com/pedros007/mapserver-tindex-problem/blob/master/black.png?raw=true
> which has NODATA values over the white areas and grayscale pixels with
> intensity 1 and gray.png with intensity 128 and zero NODATA values in the
> image
> https://github.com/pedros007/mapserver-tindex-problem/blob/master/gray.png?raw=true
>
> I have a tileindex http://bl.ocks.org/d/968e0f11f1fd9b02444c3765bbb285a1
> that basically stacks/flattens the black image on top of the gray one.
> However, when I make a WMS request to the layer:
>
> LAYER
>         NAME my_layer
>         TYPE RASTER
>         TILEINDEX tindex.shp
>         TILEITEM "location"
>         OFFSITE 0 0 0
>         STATUS OFF
>     END
> END
>
> I get only the gray image.  In other words, I expected to get this:
>
> https://github.com/pedros007/mapserver-tindex-problem/blob/master/expected.png?raw=true
>
> but instead I get this:
>
> https://github.com/pedros007/mapserver-tindex-problem/blob/master/gray.png?raw=true
>
> I have a couple of work-arounds that I'm not crazy about:
>
> 1. Add Layer masks http://www.mapserver.org/development/rfc/ms-rfc-79.html to
> two separate layers, make two WMS requests and stack the results client
> side. I have gotten this working for two layers. However, I may need to
> render a very large number of such layers and think this wont work
> client-side (via OpenLayers-3).
> 2. I could burn in NODATA values (or use a mask) to gray.tif, but I'd
> rather not modify my source data.
>
> A version of this email & example files are in a GitHub repo:
> https://github.com/pedros007/mapserver-tindex-problem
>
> --
> Pete
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170119/9f508c94/attachment.htm>


More information about the MapServer-users mailing list