[mapserver-users] update (regex solution) RE: multiple matches in $classObj->setexp ression

Puneet Kishor pkishor at GeoAnalytics.com
Fri Apr 5 18:09:34 EST 2002


the following works...

$str = "/foo|bar|baz/";

I am still curious to know if a more traditional SQL-ish construct would
work? And why my attempts below are failing.

TIa,

pk/

> -----Original Message-----
> From: Puneet Kishor 
> Sent: Friday, April 05, 2002 4:41 PM
> To: MapServer List (E-mail)
> Subject: multiple matches in $classObj->setexpression
> 
> 
> with the following in my map file...
> 
> LAYER
>   NAME "parcels_highlight"
>   TYPE polygon
>   DATA parcel
>   STATUS off
> 	CLASSITEM "OWNER"
>   CLASS
>     OUTLINECOLOR 255 0 0
>     COLOR 255 255 0
>   END
>   TEMPLATE "parcels.php"
> END
> 
> The following works fine...
> 
> $str = "foo";
> $classObj->setexpression("\"$str\"");
> $layerObj->set("status", 1);
> 
> But I want to do the following, which, needless to say, does 
> not work...
> 
> $str = "([GIS_KEY] in (\"foo\", \"bar\", \"baz\"))";
> $classObj->setexpression("\"$str \"");
> $layerObj->set("status", 1);
> 
> 
> In fact, I can't even get the following to work...
> 
> $str = "([GIS_KEY] eq \"foo\")"; OR
> $str = "([GIS_KEY] == \"foo\")"; OR 
> $str = "([GIS_KEY] eq 'foo')"; etc.
> 
> 
> What am I missing here? And if the "in" clause is not 
> supported (doesn't seem to be per the docs), would I need to 
> do the following...
> 
> $str = "(([GIS_KEY] eq \"foo\") or ([GIS_KEY] eq \"bar\") or 
> ([GIS_KEY] eq \"baz\"))";
> 
> Tia,
> 
> pk/
> 



More information about the mapserver-users mailing list