[mapserver-users] Itemquery and postGIS

iomeneandrei aborruso at tin.it
Mon May 23 02:12:51 PDT 2011


Dear all,
I have a strange problem using Itemquery and postGIS.
I make a query using this URL:
http://localhost/cgi-bin/mapserv.exe?map=/mymap.map&mode=ITEMQUERY&QLAYER=Utenz&QITEM=ulm&QSTRING=130

I have this error:
prepare_database(): Query error. Error declaring cursor: ERROR: argument of
AND must be type boolean, not type integer LINE 1: ... = "V_D_Bo"."gid_civ")
as subquery WHERE (504421) an... ^ With query string: DECLARE mycursor
BINARY CURSOR FOR SELECT
"ulm"::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),ULM::text
from (SELECT "V_Utenze".the_geom AS the_geom, "V_Utenze".gid AS gid,
"V_D_Bo"."ULM" AS ULM FROM public."V_Utenze", public."V_D_Bo" WHERE
"V_Utenze".gid_civ = "V_D_Bo"."gid_civ") as subquery WHERE (504421) and
(the_geom && setSRID( 'BOX3D(2375322.8 4218981.98,2377763.97
4220813.62)'::BOX3D,3004) )

What I see is that mapserver does not write well the where condition of the
subquery. Mapserver writes "WHERE (504421)" and it should be "WHERE
(ulm=504421)". It seems it does not pass the QITEM parameter.

I'm using MapServer version 5.2.1 for windows.

My mapserver layer is a postgis layer based on a postgis view. This is its
definition:
DATA 'the_geom from (SELECT "V_Utenze".the_geom AS the_geom, "V_Utenze".gid
AS gid, "V_D_Bo"."ULM" AS ULM FROM public."V_Utenze", public."V_D_Bo" WHERE  
"V_Utenze".gid_civ = "V_D_Bo"."gid_civ") as subquery using unique ULM using
srid=3004'

Do you have some advice for me?

Thank you very much,

Andrea




-----
Andrea Borruso

----------------------------------------------------
email: aborruso at tin.it
website: http://blog.spaziogis.it
my 2.0 life: http://aborruso.spaziogis.it
feed: http://feeds2.feedburner.com/Tanto
38° 7' 48" N, 13° 21' 9" E
----------------------------------------------------
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Itemquery-and-postGIS-tp6393666p6393666.html
Sent from the Mapserver - User mailing list archive at Nabble.com.



More information about the MapServer-users mailing list