Zsort ?

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Thu May 17 09:15:27 EDT 2007


Attila Csipa wrote:
> Maybe this would require a RFC, but I do not see this issue addressed in 
> existing .map references or RFC, I wanted to hear your opinion on this (there 
> was a short discussion about this, but a lot has changed in Mapserver since 
> then).
> 
> What would you say if we introduced a drawing sort order inside layers ? As it 
> is now, all the features are drawn by their order in the data storage. If 
> using SQL queries one can define a sort order, but for shapefiles or other 
> local file storages this is not an option. This would mean introducing a sort 
> of ORDERITEM keyword (or an 'order' binding if we are thinking along the 
> lines of RFC19) which, if present, would be used to build a sorting table, 
> and then provide a seek function which would help the nextItem approach for 
> these data storages.
> 
> The advantages of this should be obvious - for example if you have an area 
> column in your dbf you could draw large polygons first so you would not 
> obstruct small ones, or if you need to sort on a timestamp, etc.

Couple of thoughts on this.

1) have you thought about sorting objects in Z coordinate value? would 
you sort by bbox of the shape? min or max value? etc.

2) a slight expansion of scope, if mapserver supported indexes, then you 
could simply apply a fetch from the index to do this and avoid building 
and sorting the data on every hit.

3) if we supported indexes, we might be able to also do joins with some 
efficiency during rendering.

-Steve W



More information about the mapserver-dev mailing list