[mapserver-users] update (regex solution) RE: multiple matches in $classObj->setexpression
Stephen Woodbridge
woodbri at swoodbridge.com
Fri Apr 5 17:08:58 PST 2002
Ooops, that's what I get for not reading all my email before I respond
:), glad you got it working.
-Steve
Puneet Kishor wrote:
>
> 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