[mapserver-users] Σχετ: Σχετ: Σχετ: Mapfile CLASS hierarchy

Stefanos Anastasiou emperor_stef at yahoo.gr
Mon Jan 23 10:33:05 PST 2017


Yes, that's it.  Thank you very much. It's working..!!!!Although everything looks really really small on the smallest scale like 1:60.000 (which is my default scale on first load) but I guess that's how things are looking from an altitude of approximately 16 Km, right?   :-)   :-) 

Regards,-Stefanos

    Στις 7:49 μ.μ. Δευτέρα, 23 Ιανουαρίου 2017, ο/η Stephen Woodbridge <woodbri at swoodbridge.com> έγραψε:
 

 Sorry my bad, that should be SIZEUNITS

Read the section on SIZE and WIDTH
http://mapserver.org/mapfile/style.html

It explains how SIZEUNITS is used.

On 1/23/2017 11:20 AM, Stefanos Anastasiou wrote:
> You are probably referring to the MAP level UNITS object.... Yes, I've
> already set that in meters. I've also set the
>    PROJECTION
>          "init:epsg=2100"
>  END
> in both the MAP level and the LAYER level. My extent is in meters too,
> obtained from the ogrinfo -al -so command.
>
> but still..... the same effect......
>
> Στις 5:11 π.μ. Δευτέρα, 23 Ιανουαρίου 2017, ο/η Stephen Woodbridge
> <woodbri at swoodbridge.com> έγραψε:
>
>
> On 1/22/2017 6:33 PM, Stefanos Anastasiou wrote:
>> 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...
>
> Yes this all correct.
>
>> 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 ?
>
> By default units are in pixels, so a road 12 pixels width is 12 pixels
> wide regardless of zoom level. Set UNITS meter and now you road width
> will be in ground units and get width on the map as you zoom in. Youcan
> also use MINSIZE and MAXSIZE to limit the width of the roads to some
> number of pixels.
>
> -Steve
>
>> 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
> <mailto:woodbri at swoodbridge.com>
>> <mailto:woodbri at swoodbridge.com <mailto:woodbri at swoodbridge.com>>>
>>> Till: mapserver-users at lists.osgeo.org
> <mailto:mapserver-users at lists.osgeo.org>
>> <mailto:mapserver-users at lists.osgeo.org
> <mailto: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
> <mailto:mapserver-users at lists.osgeo.org>
>> <mailto:mapserver-users at lists.osgeo.org
> <mailto: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
> <mailto:mapserver-users at lists.osgeo.org>
> <mailto:mapserver-users at lists.osgeo.org
> <mailto: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
> <mailto:mapserver-users at lists.osgeo.org>
> <mailto:mapserver-users at lists.osgeo.org
> <mailto:mapserver-users at lists.osgeo.org>>
>>> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>
>> --
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org
> <mailto:mapserver-users at lists.osgeo.org>
> <mailto:mapserver-users at lists.osgeo.org
> <mailto:mapserver-users at lists.osgeo.org>>
>> https://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>> Στις 12:25 μ.μ. Κυριακή, 22 Ιανουαρίου 2017, ο/η
>> "lars.schylberg at blixtmail.se <mailto:lars.schylberg at blixtmail.se>"
> <lars.schylberg at blixtmail.se <mailto:lars.schylberg at blixtmail.se>> έγραψε:
>
>>
>>
>>
>>
>> _______________________________________________
>> mapserver-users mailing list
>> mapserver-users at lists.osgeo.org <mailto: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 <mailto: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



   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170123/6f87c10b/attachment-0001.html>


More information about the mapserver-users mailing list