[mapserver-users] Different SIZEUNITS for line width and label fontsize

Vladimir Cvejanovic vladimir at gessolutions.com
Tue Feb 3 06:53:16 EST 2009


Hi Thomas,

Thanks for elaborating on that, I was under the false impression that 
MINSIZE worked similar to MINSCALE in that it defined minimum criteria 
for the class to be applied.

Will try this now. Thanks again!
Vladimir

thomas bonfort wrote:
> Hi again,
>
> using:
> size 8
> minsize 8
> maxsize 8
>
> is *exactly* the same as using only size 8 with pixel sizeunits
> i.e. this effectively prevents the labels scaling at all
>
> regards,
> thomas
>
> On Tue, Feb 3, 2009 at 12:41, Vladimir Cvejanovic
> <vladimir at gessolutions.com> wrote:
>   
>> Hi Thomas,
>>
>> Thanks for your reply. I have already plaid around with MINSIZE and MAXSIZE.
>> They are a good way to avoid the labels being displayed when they are too
>> small to read. Also coupled with MINSCALE and MAXSCALE class definitions I
>> was able to set up three classes for large, medium and small text depending
>> on the scale used.
>>
>> This isn't a bad solution at all but I wanted to see if there is away to
>> prevent the labels scaling at all within the same layer definition as the
>> scalable (real-world sized) lines.
>>
>> Thanks,
>> Vladimir
>>
>>
>> thomas bonfort wrote:
>>     
>>> hi,
>>> you can use minsize and maxsize in your label: these are always pixels:
>>>
>>> size 8
>>> minszie 8
>>> maxsize 8
>>>
>>> regards,
>>> thomas
>>>
>>> On Tue, Feb 3, 2009 at 12:17, Vladimir Cvejanovic
>>> <vladimir at gessolutions.com> wrote:
>>>
>>>       
>>>> Hi All,
>>>>
>>>> In the Mapfile, Is it possible to have different SIZEUNTIS for line width
>>>> and label font in the same layer? The example is below.
>>>>
>>>> I have managed to solve this by defining two layers one which only
>>>> displays
>>>> the line and one which only displays the labels however this seems like a
>>>> hack and very inefficient from a processing / querying point of view.
>>>>
>>>> The context is a line layer containing road lines which have a width in
>>>> meters but labels in pixels. This would make things scale nicely Can this
>>>> be
>>>> done? Does anyone have a better approach?
>>>>
>>>> Thanks,
>>>> Vladimir
>>>>
>>>> LAYER
>>>>  NAME 'highway'
>>>>  TYPE LINE
>>>>  DATA 'highway.shp'
>>>>
>>>>  STATUS DEFAULT
>>>>  TRANSPARENCY 30
>>>>
>>>>  LABELITEM "NAME"
>>>>  SIZEUNITS meters
>>>>
>>>>  CLASS
>>>>     NAME 'highway'
>>>>     STYLE
>>>>       WIDTH 5 #WANT THESE TO BE METERS
>>>>       COLOR 55 55 55
>>>>     END
>>>>     LABEL
>>>>      TYPE TRUETYPE
>>>>      FONT FreeSans
>>>>      SIZE 08 # WANT THESE TO BE PIXELS
>>>>      COLOR 0 0 0
>>>>      OUTLINECOLOR 255 255 255
>>>>      ANTIALIAS TRUE
>>>>      ANGLE AUTO
>>>>      MINFEATURESIZE AUTO
>>>>      FORCE true
>>>>    END
>>>>  END
>>>>  END
>>>> _______________________________________________
>>>> 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