classitem variable substitution

Steve Lime steve.lime at DNR.STATE.MN.US
Wed Oct 19 09:26:00 PDT 2005


If you want to replace the whole item name you could do something like:

  map_elevation_classitem=xxxx

with the same effect.

Steve

>>> Charlton Purvis <cplist at EARTHLINK.NET> 10/18/05 9:03 PM >>>
Goodness bless open source.

mapserv.c after line 1615 (MapServer version 4.6.1)

added

if(map->layers[j].classitem && (strstr(map->layers[j].classitem, tmpstr) !=
NULL)) map->layers[j].classitem = gsub(map->layers[j].classitem, tmpstr,
msObj->request->ParamValues[i]);

It didn't seem to break anything and DID seem to work!

Charlton

> -----Original Message-----
> From: UMN MapServer Users List [mailto:MAPSERVER-USERS at LISTS.UMN.EDU] On
> Behalf Of Charlton Purvis
> Sent: Tuesday, October 18, 2005 4:45 PM
> To: MAPSERVER-USERS at LISTS.UMN.EDU 
> Subject: [UMN_MAPSERVER-USERS] classitem variable substitution
> 
> Hi, folks:
> 
> I poked around on the archives and couldn't find a post related to this.
> I'm sure it's there, and I apologize for not laying my finger on it.
> 
> But is a variable substitution on a CLASSITEM not allowed?  Var. sub.
> works
> fine elsewhere, just not here.
> 
> I am trying to hit a .shp and have the CLASSITEM be dependant on one of
> its
> columns or whatever they're called in the .shp world.
> 
> Error . . .
> 
> msDBFGetItemIndex(): DBASE file error. Item '%TARGETTIME%' not found.
> 
> .map excerpt . . .
> 
>   LAYER
>     NAME elevation
>     PROJECTION
>       "proj=latlong"
>     END
>     DATA
> "/home/cpurvis/scoop/adcirc/SADCec95-UNC_WNAHNOPR-
> NCP_%STARTTIME%_20051017T1
> 300_20051022T1200_elev_ZGIS-ele"
>     TYPE POLYGON
>     STATUS DEFAULT
>     CLASSITEM "%TARGETTIME%"
>     CLASS
>       STYLE END
>       OUTLINECOLOR 0 0 0
>     END
>   END
> 
> I have tried playing around w/ single and double quotes, but no luck.
> 
> I'm used to PostGIS, and I could jolly well do this on the DATA line as an
> alias, but staying w/i the shapefile world for this project is probably
> the
> way to go.
> 
> Thanks!
> 
> Charlton



More information about the MapServer-users mailing list