VS: [mapserver-users] Tileindex and drawing order of overlapping images

Frank Warmerdam warmerdam at pobox.com
Fri Aug 14 09:32:06 EDT 2009


On Fri, Aug 14, 2009 at 8:44 AM, Rahkonen
Jukka<Jukka.Rahkonen at mmmtike.fi> wrote:
> Frank Warmerdam wrote:
>
> Rahkonen Jukka wrote:
>>> Hi,
>>>
>>> If have overlapping images from different years. Can I control in some
>>> easy and reliable way that the new images will get drawn on top, for
>>> example by writing tileindex shapefiles so that new images have bigger
>>> fid values?
>
>>Jukka,
>
>> The order of images in the tileindex shapefile will be the order
>> they are drawn - if - you do not build a spatial index on the
>> shapefile.  If you have a spatial index the drawing order
>> becomes essentially random, and of course if you have a lot
>> of images a spatial index is quite valuable.
>
> Damn, I need spatial index for sure. Any idea about how to get them both? Perhaps taking tile index with ordered query from Oracle, PostGIS or even SpatiaLite?

Jukka,

I have dug deeper and I'm afraid I mislead you.  It turns out that
both the MapServer shapefile code and OGR inherently sort
the results of the spatial index query so shapes are always
returned in order.  In OGR a sort is done explicitly while
in MapServer selected shapes are tracked in a bit vector so
they are always sorted in the end.

I have not experimented, so you should confirm, but it should
be sufficient to order the index entries based on the order you
want things drawn.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent


More information about the mapserver-users mailing list