Title: PHP_Mapscript QueryByAttributes on PostGIS layer - bug or feature?
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:[EMAIL PROTECTED]
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" <[EMAIL PROTECTED]> 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
[EMAIL PROTECTED]


Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
Probalo ya!

Reply via email to