<div dir="ltr">Peter, if I understand correctly....<div>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.</div><div>This is what I'd try:</div><div>- try using the sortshp utility on your tileindex (once in ascending order, once in descending) and see if the resulting image is affected</div><div>- use a postgis based tileindex layer with explicit ORDER BY clauses to enforce that transparent images get rendered after opaque ones</div><div><br></div><div>--</div><div>thomas</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 19, 2017 at 12:31 AM Peter Schmitt <<a href="mailto:pschmitt@gmail.com">pschmitt@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg">Hi,<div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I have a tile index to render a layer from two images.  The images are black.png  <a href="https://github.com/pedros007/mapserver-tindex-problem/blob/master/black.png?raw=true" class="gmail_msg" target="_blank">https://github.com/pedros007/mapserver-tindex-problem/blob/master/black.png?raw=true</a> 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 <a href="https://github.com/pedros007/mapserver-tindex-problem/blob/master/gray.png?raw=true" class="gmail_msg" target="_blank">https://github.com/pedros007/mapserver-tindex-problem/blob/master/gray.png?raw=true</a></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I have a tileindex <a href="http://bl.ocks.org/d/968e0f11f1fd9b02444c3765bbb285a1" class="gmail_msg" target="_blank">http://bl.ocks.org/d/968e0f11f1fd9b02444c3765bbb285a1</a> that basically stacks/flattens the black image on top of the gray one.  However, when I make a WMS request to the layer:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">LAYER</div><div class="gmail_msg">        NAME my_layer</div><div class="gmail_msg">        TYPE RASTER</div><div class="gmail_msg">        TILEINDEX tindex.shp</div><div class="gmail_msg">        TILEITEM "location"</div><div class="gmail_msg">        OFFSITE 0 0 0</div><div class="gmail_msg">        STATUS OFF</div><div class="gmail_msg">    END</div><div class="gmail_msg">END</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">I get only the gray image.  In other words, I expected to get this:</div><div class="gmail_msg"><a href="https://github.com/pedros007/mapserver-tindex-problem/blob/master/expected.png?raw=true" class="gmail_msg" target="_blank">https://github.com/pedros007/mapserver-tindex-problem/blob/master/expected.png?raw=true</a><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">but instead I get this: </div><div class="gmail_msg"><a href="https://github.com/pedros007/mapserver-tindex-problem/blob/master/gray.png?raw=true" class="gmail_msg" target="_blank">https://github.com/pedros007/mapserver-tindex-problem/blob/master/gray.png?raw=true</a></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><div class="gmail_msg">I have a couple of work-arounds that I'm not crazy about:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">1. Add Layer masks <a href="http://www.mapserver.org/development/rfc/ms-rfc-79.html" class="gmail_msg" target="_blank">http://www.mapserver.org/development/rfc/ms-rfc-79.html</a> 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).</div><div class="gmail_msg">2. I could burn in NODATA values (or use a mask) to gray.tif, but I'd rather not modify my source data.</div></div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">A version of this email & example files are in a GitHub repo: <a href="https://github.com/pedros007/mapserver-tindex-problem" class="gmail_msg" target="_blank">https://github.com/pedros007/mapserver-tindex-problem</a></div><div class="gmail_msg"><div class="gmail_msg"><br class="gmail_msg"></div>-- <br class="gmail_msg"><div class="m_4277929752198678022gmail_signature gmail_msg">Pete</div><div class="m_4277929752198678022gmail_signature gmail_msg"><br class="gmail_msg"></div>
</div></div>
_______________________________________________<br class="gmail_msg">
mapserver-users mailing list<br class="gmail_msg">
<a href="mailto:mapserver-users@lists.osgeo.org" class="gmail_msg" target="_blank">mapserver-users@lists.osgeo.org</a><br class="gmail_msg">
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" class="gmail_msg" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a></blockquote></div>