PHP_Mapscript QueryByAttributes on PostGIS layer

Andreas Albarello andreas.albarello at TERRITORIUMONLINE.COM
Tue Oct 24 10:43:18 EDT 2006


Delfos, Jacob wrote:
> My QueryByAttributes PostGIS problem seems to be worse in version 4.10. 
> In 4.8.4, at least I could do:
> [...]  
> My query does:
>  
> $gotResult = $oLayer->queryByAttributes("pglayer","name like 'new 
> layer'",MS_MULTIPLE);
>  
> My log says:
> [24-Oct-2006 16:08:28] PHP Warning: [MapServer Error]: 
> prepare_database(): Error executing POSTGIS DECLARE (the actual query) 
> statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT 
> "name"::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text 
> from pgpoly WHERE (name like ) and (the_geom && setSRID( 
> 'BOX3D(-149999998.5 -99999999,149999998.5 
> 99999999)'::BOX3D,find_srid('','pgpoly','the_geom') ))' Postgresql 
> reports the error as 'ERROR: syntax error at or near ")" at character 148

Jacob,

this issue has been already discussed on the USERS mailing list during 
the last few days in a thread with the title "Filter in Mapserver 4.10.0".

Today Steve replied to the DEV mailing list that he fixed this in CVS in 
both 4.10 and 5.0 branches. So, if you can, grab yourself a copy of the 
source from CVS and recompile, that way all should be working again as 
it did in 4.8.

Otherwise, you might try the following workaround until the next release:

$gotResult = $oLayer->queryByAttributes("pglayer","\"name like 'new
layer'\"",MS_MULTIPLE);

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-users mailing list