AW: [Mapserver-users] setExpression

robert fritz robert-fritz at web.de
Wed Feb 18 09:13:34 EST 2004


Hello,

the problem which i have described seems to be a typical oversight.
The layer has one class in the mapfile. There is no expression defined for this class. If a new class is added dynamically, this class is masked by the first class.  So I have to set a expression for both classes, something like this:


$layerO->set(classitem,$qitem);
$classO = ms_newclassobj($layerO);
$classO->set(name,"H");
$styleO = ms_newStyleObj($classO);
$styleO->color->setRGB(255,255,0);
$styleO->outlinecolor->setRGB(0,0,0);
$styleO->set(symbolname,"dashed1");

$query="H";		
$classO->setExpression($query);

		
$classO=$layerO->getclass(0);	
$not_expr =  "(!('[".$qitem."]' =~ /".$query."/))"; 
$classO->setExpression($not_expr);

Robert



-----Ursprüngliche Nachricht-----
Von: mapserver-users-admin at lists.gis.umn.edu
[mailto:mapserver-users-admin at lists.gis.umn.edu]Im Auftrag von robert
fritz
Gesendet: Mittwoch, 18. Februar 2004 12:40
An: Mapserver-users at lists.gis.umn.edu
Betreff: [Mapserver-users] setExpression


  Hello,

again a question about regular expressions....

Searching for one attribute works:
$query="H";
$classO->setExpression("\"$query\"");

I want to search for more than one attribute, but I do not know how to set the expression correctly:
$query="H|F";  // does not work
$query="/H|F/"; // does not work

$classO->setExpression("\"$query\"");


Mapserver 4.

Thank you,
Robert

______________________________________________________________________________
Nachrichten, Musik und Spiele schnell und einfach per Quickstart im 
WEB.DE Screensaver - Gratis downloaden: http://screensaver.web.de/?mc=021110





More information about the mapserver-users mailing list