[mapserver-users] Using a attribute substring for labeling

Michael Smith michael.smith.erdc at gmail.com
Sun Feb 28 23:04:42 PST 2016


Lars,

I've looked through my mapfiles and it looks like I have always
accomplished this with sql manipulation. Not using mapserver string
functions.

However, Steve Lime or Jeff McKenna might know an innovative way of using
tostring() that I don't. They are very good with that kind of thing.

----
Michael Smith

US Army Corps
Remote Sensing GIS/Center
michael.smith at usace.army.mil




-----Original Message-----
From: mapserver-users <mapserver-users-bounces at lists.osgeo.org> on behalf
of lars lingner <gislars+list at gmail.com>
Date: Monday, February 29, 2016 at 2:02 PM
To: <mapserver-users at lists.osgeo.org>
Subject: [mapserver-users] Using a attribute substring for labeling

>Hello,
>
>while using a ShapeFile, created with gdaltindex, as data source for a
>layer I'd like to use a substring of the location attribute for labeling.
>
>I could (and probably will) preprocess the ShapeFile to add the label
>text as additional attribute. But I wanted to try this step within
>MapServer first.
>
>My current example contains a path and file name. The file name has a 4
>digit number in it I would like to use as label. To make it more
>complicated, the substring has various positions within the whole string.
>Maybe there is a way with tostring() which accepts sprintf formatting,
>but I couldn't figure out the correct syntax yet.
>
>With a database layer of course I would be able to use SQL to extract a
>substring and pass it as additional attribute, but not with a ShapeFile.
>
>Is there a way to extract a substring from an attribute value and use it
>as label? It would be nice to have a function available to use in
>EXPRESSION or TEXT parameter.
>
>Thank you in advance for any hints.
>
>Lars
>_______________________________________________
>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