[mapserver-users] Mapfile CLASS hierarchy

Stephen Woodbridge woodbri at swoodbridge.com
Sat Jan 21 20:34:59 PST 2017


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



More information about the mapserver-users mailing list