[mapserver-users] String manipulation before label display????
mckenna at dmsolutions.ca
Tue Oct 9 13:23:57 EDT 2001
Greg Fausak wrote:
> I'm using 3.5 mapscript php...
> I've downloaded the road dataset from nationalatlas.gov.
> It has the road names listed like:
> 'Interstate Route 35, US Route 77'
> 'Interstate Route 30'
> 'Interstate Route 45'
> I'd like to run a little manipulation on the
> strings before the fit and display are run on
> the map. That is, something like:
> NAME =~ s/^Interstate Route //;
> NAME =~ s/,.*//;
> which would cause the about list to now be:
> These numbers will fit on the interstate symbol...
> Is there any way to do this? Something similar to the
> EXPRESSION keyword.
> Greg Fausak
> August.Net Services, LLC
> lgfausak at august.net
I'm not sure about the MapServer aspect of your question, but what I
would do is do some preproccessing of the data first (to extract the
highway number string). For example, with ArcView I would:
- make a new field named 'hwynum'
- using the Field Calculator set hwynum = hwy.extract(2) (hwy being the
field with the full string names of the highways)
- then set hwynum = hwynum.substitute(",", "")
This would make a new field containing just your highway numbers.
DM Solutions Group Inc.
More information about the mapserver-users