[mapserver-users] mapserv CGI - msPostGISLayerWhichShapes(): Item query error.

Paul Deschamps pdescham49 at gmail.com
Wed Feb 29 12:13:28 PST 2012


Hi List,

This looks familiar to me but it's eluding my brain right now as to why.
Mapserver / Postgis is generating an invalid SQL when trying to do an
itemquery a layer.

Here's the error from mapserv cgi

msPostGISLayerWhichShapes(): Query error. Error (ERROR: argument of AND
must be type boolean, not type integer LINE 1:
...29.8659509))',find_srid('',
'parcel','the_geom')) and (50105) ^ ) executing query: select
"id","transid","qpid","gis_acres","lastmodified",encode(ST_AsBinary(ST_Force_2D("the_geom"),'NDR'),'hex')
as geom,"id" from (select * from parcel) as foo where the_geom &&
GeomFromText('POLYGON((382577.69492276 1555529.8659509,382577.69492276
1851596.8951139,832467.25879056 1851596.8951139,832467.25879056
1555529.8659509,382577.69492276
1555529.8659509))',find_srid('','parcel','the_geom')) and (50105)

Notice the end of the sql it is missing (qpid = 50105) qpid being set as
qitem is that not supposed to be there :)

Any assistance would be greatly appreciated :)

Paul

Here's the layer and versions ----

CGI params of interest:
&mode=itemquery&qitem=qpid&qstring=50105&qformat=parcel_as_html&qlayer=qparcel

Here's the layer:
-->
  LAYER
    NAME 'qparcel'

    INCLUDE 'projection.inc'
    INCLUDE 'dbconnection.inc'
    DATA 'the_geom from (select * from parcel) as foo using unique id'

    TYPE POLYGON
    STATUS OFF
    METADATA
      qstring_validation_pattern '.' # should set this to a regex specific
for this county
    END
    CLASS
      NAME 'Selected Parcel'
      OUTLINECOLOR 255 0 0
      SYMBOL "circle"
      SIZE 3
      LABEL
        COLOR 0 0 0
        SIZE SMALL
        MINDISTANCE 100
      END
    END
    TEMPLATE 'void'

  END
---->

Postgis ver:
"POSTGIS="1.5.3" GEOS="3.3.1-CAPI-1.7.1" PROJ="Rel. 4.7.1, 23 September
2009" LIBXML="2.7.6" USE_STATS"

MapServer ver:
MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML
SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=CAIRO SUPPORTS=FREETYPE SUPPORTS=ICONV
SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER
SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=THREADS SUPPORTS=GEOS
INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20120229/43c48621/attachment.htm>


More information about the MapServer-users mailing list