[mapserver-users] [EXTERNAL] Re: the lines one above other

Eichner, Andreas - SID Andreas.Eichner at sid.sachsen.de
Fri Feb 13 05:43:14 PST 2015


> It seems I found how to display multilevel junction of highway with "ORDER
> BY" in the case using a one layer. Adding "order by id desc" or "order by
> id asc" in subquery
 
> $highwayLayer->set("data","geom from (select id, 'id = '||id as name, geom
> from my_table
> where ST_Intersects(geom, !BOX!) order by id desc) as subquery using
> unique id using srid=3857");

Be careful with that as you cannot expect this to work consistently as long as MapServer wraps it in a subquery. The database will likely return your features either in storage order or in index order depending if it uses a sequential scan or the index. You should not rely on an ORDER BY within a subquery...


More information about the MapServer-users mailing list