PHP_Mapscript QueryByAttributes on PostGIS layer - bug or feature?
Delfos, Jacob
Jacob.Delfos at MAUNSELL.COM
Wed Sep 20 16:29:00 PDT 2006
Hi Sergio,
Thanks for that. I am not sure if a QueryByPoint would help for me, but I just change the querystring for PostGIS. It's not clean and abstract, but for now that will have to do.
I didn't manage to find the post you mentioned. Was it on the MapServer list?
regards,
Jacob
________________________________
From: Sergio López [mailto:sergiodlopez at yahoo.com]
Sent: 20 September 2006 23:39
To: Delfos, Jacob
Subject: Re: [UMN_MAPSERVER-USERS] PHP_Mapscript QueryByAttributes on PostGIS layer - bug or feature?
Jacob
I had the same problem, and I think is a bug. I've solved it by implementing a query by point using POSTGIS spatial queries, because I use only Postgis layers. There is a post with the explanation (in spanish, i'm afraid). search the list , the subject of the post was "Possible bug", in may 2006.
Sergio
"Delfos, Jacob" <Jacob.Delfos at MAUNSELL.COM> escribió:
Hi List,
I'm trying to perform a QueryByAttributes operation on a PostGIS layer, but I get an error. Basically, it seems that the where clause being generated leaves out the attribute name and operator. Am I doing something wrong?
My code is:
$gotResult = $oLayer->queryByAttributes("roadname","EMERALD RD",MS_MULTIPLE);
My PHP error is:
[19-Sep-2006 08:53:34] PHP Warning: [MapServer Error]: prepare_database(): Error executing POSTGIS DECLARE (the actual query) statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT roadname::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),gid::text from roads WHERE (EMERALD RD) and (the_geom && setSRID( 'BOX3D(-149999998.5 -99999999,149999998.5 99999999)'::BOX3D,find_srid('','roads','the_geom') ))' <br><br>
It works if I do:
$oLayer->queryByAttributes("roadname","roadname like 'EMERALD RD'",MS_MULTIPLE);
Am I supposed to perform the QueryByAttributes operation differently for different data sources? It gets more difficult if I don't know in advance whether the type is text or number....
I searched the list and bugzilla for something similar, but couldn't find it. I'm using php_mapscript 4.8.3 (I tried using 4.10beta2, but all my mapfiles get invalid map extent errors for some reason).
Regards,
Jacob
JACOB DELFOS
GIS ANALYST
Maunsell Australia Pty Ltd
629 Newcastle Street, Leederville, WA 6007
PO Box 81, Leederville, WA 6902
Western Australia
ABN 20 093 846 925
Tel + 61 8 9281 6185
Fax + 61 8 9281 6297
jacob.delfos at maunsell.com
________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
Probalo ya! <http://ar.answers.yahoo.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20060921/44b50b0b/attachment.htm>
More information about the MapServer-users
mailing list