[mapserver-users] Σχετ: Mapfile CLASS hierarchy
Stefanos Anastasiou
emperor_stef at yahoo.gr
Sun Jan 22 15:33:21 PST 2017
Thank you for the replies.
This means that regardless of the layer's CLASS hierachy, the attributes will be rendered according to the sorting rule, which is predefined in your data. If the data are not sorted in advance, the rendering will never be right. Correct? If this is the case, then +1 for the sortshp. It worked out well in my mapfile and roads are rendered properly. However it appears that in PostGIS data, the sorting happens in the DATA section of the mapfile, and the data need not be pre-sorted. It works this way here, at least with the following rule: DATA 'geom from (SELECT * FROM roads ORDER BY category desc) AS foo using unique id using srid=2100' On the other hand, I didn't quite catch the z-index part in Simon's tutorial. I don't have have z values... I'm also curious for one more thing. As more as I zoom in on my map, the roads are getting smaller instead of getting bigger. Imagine a highway looking pretty wide and as you zoom in the width is reducing. I've only set color and width in STYLE object of my mapfile. Am I missing any configuration ?
This blog entry from Simon Mercier describes how this works.
http://www.mapgears.com/en/blog/archive/2013-03-05-roads_network_mapping
Lars S.
-----Originalmeddelande-----
> Från: "Stephen Woodbridge" <woodbri at swoodbridge.com>
> Till: mapserver-users at lists.osgeo.org
> Datum: 2017-01-22 05:35
> Ämne: Re: [mapserver-users] Mapfile CLASS hierarchy
>
> Oh, and I forgot to mention that if you want objects rendered in a
> particular order, then your should sort the data in the sources in that
> order. You can do this with order by clause on SQL based data sources
> and using shpsort for shapefiles, ogr2ogr and also sort data.
>
> On 1/21/2017 10:03 PM, Stephen Woodbridge wrote:
> > Within a layer objects are always drawn in the order they are delivered
> > from the datasource. Think of the CLASSes are an IF-ELSEIF-BLOCK, when
> > an object is presented each CLASS is tested and the first one the
> > accepts the object renders it.
> >
> > I often up a default class at then end that has no expression ans render
> > it in red just so I can see if I missed any cases, but remove it when
> > I'm done developing the mapfile.
> >
> > -Steve W
> >
> > On 1/21/2017 8:48 PM, Stefanos Anastasiou wrote:
> >> Hi list,
> >> according to the documentation, the first layer in the mapfile is
> >> drawn first, and the second is drawn on top of that and so on... I was
> >> wondering if the same principle applies to the CLASS object as well. For
> >> example: I have a "Roads" layer stored in PostGIS with a "Category"
> >> column representing the different types of roads. So a category 3 is
> >> very small roads, category 2 is city roads, 1 is major roads and 0 is
> >> highways and on the same layers I create four CLASS objects with
> >> different styles for each Road category. But regardless the order of the
> >> classes (either I draw the small roads first or the highways) the same
> >> effect insists: the small roads are drawn over the highways. So what
> >> is the solution here? Create different layers of the same dataset
> >> representing the various values of the "Category" column ??
> >>
> >>
> >> Regards,
> >> -Stefanos
> >>
> >>
> >> _______________________________________________
> >> mapserver-users mailing list
> >> mapserver-users at lists.osgeo.org
> >> https://lists.osgeo.org/mailman/listinfo/mapserver-users
> >>
> >
> >
> > ---
> > This email has been checked for viruses by Avast antivirus software.
> > https://www.avast.com/antivirus
> >
> > _______________________________________________
> > mapserver-users mailing list
> > mapserver-users at lists.osgeo.org
> > https://lists.osgeo.org/mailman/listinfo/mapserver-users
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users
--
_______________________________________________
mapserver-users mailing list
mapserver-users at lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/mapserver-users
Στις 12:25 μ.μ. Κυριακή, 22 Ιανουαρίου 2017, ο/η "lars.schylberg at blixtmail.se" <lars.schylberg at blixtmail.se> έγραψε:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170122/08a5f972/attachment.htm>
More information about the MapServer-users
mailing list