[mapserver-users] Rendering order of objects in a layer

Thomas Bonfort thomas.bonfort at camptocamp.com
Wed Jun 10 14:54:36 EDT 2009


three different layers is not optimal, as the outlines won't join
nicely together (of course, if you aren't using outlines, then no
problem).

You can do this in mapserver with a postgis query:

DATA "the_geom from (select gid, the_geom, ... from roads order by
importance asc )as foo using unique gid

the  "importance" column in your database should have small values for
minor roads, and larger values for major ones.

by the way, the order of the classes has no effect on the order in
which features are drawn. the order is only used for selecting which
class is applied for any given feature: the first class which matches
min/max scale and expression is used for that feature.

regards,

thomas

www.camptocamp.com
+33 4 79 26 57 97



On Wed, Jun 10, 2009 at 18:08, Dan Little<danlittle at yahoo.com> wrote:
>
> If you're already pulling from a view, you might want to consider three views:
> interstates
> highways
> local roads
>
> (or how ever you layer it)
>
> Then create three separate layers for each one of the views.
>
>
> ----- Original Message ----
>> From: David Nugent <davidn at datalinktech.com.au>
>> To: mapserver-users at lists.osgeo.org
>> Sent: Wednesday, June 10, 2009 8:41:48 AM
>> Subject: [mapserver-users] Rendering order of objects in a layer
>>
>> Hello all,
>>
>> Is there any way in which the rendering order of objects in a layer can be
>> determined by mapserver?
>>
>> For example, I want to ensure that major roads (highways, arterials) are
>> rendered after local/minor/unimproved roads when all are rendered as a single
>> layer; which tends to make joins between them look much nicer if the major roads
>> are rendered first.
>>
>> This is for vector data coming from postgis, which ultimately results in
>> executing the query on a view. I hesitate to fiddle with forcing index use here
>> as I would think the gist queries on the geometry field would come into play.
>> However, the results in the query seem to drop by chance regardless if the order
>> of CLASS sections in the mapfile (which is what I would expect).
>>
>> Regards,
>> David
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>


More information about the mapserver-users mailing list