Partial labels in mapserver/mapfile

Stephen Woodbridge woodbri at SWOODBRIDGE.COM
Thu Jan 18 06:26:50 PST 2007


Frode Wiseth Jørgensen wrote:
> Hi!
> 
> Is it possible to label objects (in mapfile) from a shape-file, by using
> only part of an attribute, or may be manipulate the attribute?
> 
> E.g:
> - Only the first two letters of av word
> - Round numbers (as labeling a numberfield with decimals in a dbf-file,
> would force decimals even if the current attribute has decimals or not)
> 
> 
> Thanks
> FrodeWJ
> 
No, I believe your best bet is to write a script that adds a new column 
to the shapefile and populates it with the value that you want to use 
for labeling.

You can join multiple fields together, but I don't think you can take a 
substring of a field.

You can write the script in mapscript. I don't have any examples handy, 
but you should be able to pull some from the list archive or ask the list.

-Steve W.



More information about the MapServer-users mailing list