[mapserver-users] postgis problem

Kevin Webb kpw at jump9.com
Sat Nov 30 13:00:14 EST 2002


Hi,

I am running into some strange problems with PostGIS connectivity in
Mapserver 3.6.3.

I've created a simple one table PostGIS dataset using the shapefiles from
the Itasca demo (lakespy2) and have edited my mapfile reflect my PostGIS
server as the datasource for this layer (see layer config info below).
However whenever I try to generate my map I get the following error:

msPOSTGISLayerWhichShapes(): Query error. prep_DB:Error executing POSTGIS
DECLARE statement (0.6 failed - retried 0.5 and it failed too). DECLARE
mycursor BINARY CURSOR FOR SELECT
asbinary(force_collection(force_2d()),'NDR'),OID::text from WHERE &&
setSRID('BOX3D(310076.012720145 5100431.37679792,638159.168888574
5428514.53296635)'::BOX3D, find_srid('','','') )

What's odd is that it is missing any references to the table or field names
(no references to the_geom or my table lakespy2 anywhere in the query). If I
run the select portion of my query manually against my postgis server after
adding in the table and field names then everything works fine.

Any thoughts on why mapserver would be omitting the table and field names? I
assume I've just done something stupid with my map configuration, but I
can't figure out what..

Here's my layer config:

LAYER
CONNECTIONTYPE postgis
NAME lakespy2
TYPE POLYGON
STATUS ON
CONNECTION "user=postgres dbname=geodb"
DATA "the_geom FROM lakespy2"

CLASS
NAME 'Lakes & Rivers'
TEMPLATE "lakespy2.html"
COLOR 49 117 185
END

HEADER "lakespy2_header.html"
FOOTER "lakespy2_footer.html"

TOLERANCE 3

DUMP TRUE # allow GML export

METADATA
WMS_TITLE "Lakes and Rivers"
WMS_ABSTRACT "DLG lake and river polygons for Itasca County. See
http://deli.dnr.state.mn.us/metadata/full/dlglkpy2.html for more
information."
WMS_SRS "EPSG:26915"
END
END # lakes


Thanks in advance,
Kevin Webb



--
e: kpw at jump9.com
p: (919)260-8375

w: kpw.jump9.com




More information about the mapserver-users mailing list