[mapserver-users] LABEL-formatting options

Lars Lingner ml at lingner.eu
Tue Mar 9 09:46:00 PST 2010


Stephan Holl schrieb:
> Hello mapservers,
> 
> we are using MapServer for visualizing shapefiles with double entries
> inside.
> 
> Mainly this are contour-lines from waterdepth. The double values have
> 32 decimal places and mapserver tries to render them _all_ along a
> contourline.
> This does not look nice...
> 
> Is there an option to trim the values with a dedicated
> mapfile-parameter, e.g. where a prinft-syntax can be used to format the
> values?
> 
> The shapefiles are generated automatically so adding another column with
> trunc()ed or round()ed values is no option.
> 
> Are there any options to format label-values/strings? I have not found
> anything in the docs.
> 

AFAIK there isn't a trim/cut function.
If the numbers have the same ending you could define them as WARP
character and they would be replaced by a line break.

Would mapscript help you here?


Or to make things more complicated: Couldn't you write the the
shapefiles into an database? Then you could use trim/cut the value
within your sql statement.


Lars



More information about the MapServer-users mailing list