[mapserver-users] multiple matches in $classObj->setexpression

Puneet Kishor pkishor at GeoAnalytics.com
Fri Apr 5 17:41:04 EST 2002


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