Filter in Mapserver 4.10.0

Andreas Albarello andreas.albarello at TERRITORIUMONLINE.COM
Thu Oct 19 15:21:12 EDT 2006


Sture Dingsøyr wrote:
> The code below fails:
> $poLayer = $mapObject->getLayerByName($layerId[$i]);
> $poLayer->set("status", 1);			
> $poLayer->setFilter("navn = 'Fjaler'");
> 
> I get this error message:
> DECLARE mycursor BINARY CURSOR FOR SELECT asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from (SELECT * FROM n2000ko_f) AS n2000ko_f WHERE (navn = ) and (the_geom && setSRID( 'BOX3D(-647132 6410334.17468806,1689132 7988665.82531194)'::BOX3D,32633) )

Sture,

I've experienced exactly the same problem with Mapserver 4.10.0. Don't 
know if this should be considered a bug, but it is a backwards 
compatibility issue with existing mapscript applications at least. I 
believe this behavior has been caused by some recent changes to the 
mapfile lexer.

There's however a workaround for this. The following should do the trick:

$poLayer->setFilter("\"navn = 'Fjaler'\"");

Best regards,
-- 
--------------------------------------------------------------------
Andreas Albarello
Analysis & SW Development

Territorium Online srl/GmbH
Via Buozzi/Buozzistraße 12 - I 39100 Bolzano/Bozen
email: andreas.albarello at territoriumonline.com
web:   www.territoriumonline.com
--------------------------------------------------------------------



More information about the mapserver-dev mailing list