[Mapserver-users] Error with MapServer and PostGIS in Query
rsanabria at prosis.com
rsanabria at prosis.com
Mon Jan 19 16:05:26 PST 2004
Hi,
I'm trying to execute a spatial query with MapServer on PostGIS and I received
the following error message:
Content-type: text/html msPOSTGISLayerGetShape(): Query error. Error executing
POSTGIS SQL statement (in FETCH ALL): EXPLAIN VERBOSE SELECT * FROM nfs - Error
with POSTGIS data variable. You specified ''.
Standard ways of specifiying are :
(1) 'geometry_column from geometry_table'
(2) 'geometry_column from (<sub query>) as foo using unique <column name> using
SRID=<srid#>'
Make sure you put in the 'using unique <column name>' and 'using SRID=#' clauses in.
For more help, please see http://postgis.refractions.net/documentation.php
Mappostgis.c - version of Nov 15/2002.
I read the postgis documentation and I tried to create the indexes for the table
but it didn't work, I created the indexes the following way:
CREATE INDEX inx_nfs ON nfs ( oid );
CREATE INDEX GIST_inx_nfs ON nfs USING GIST (the_geom GIST_GEOMETRY_OPS );
where nfs is our table.
The definition of the layer in the map file is:
LAYER # States polygon layer begins here
NAME nfs
CONNECTIONTYPE postgis
CONNECTION "user=xxxx dbname=xxxxx"
DATA "the_geom from nfs"
STATUS OFF
TYPE POLYGON
CLASS
COLOR 255 0 0
OUTLINECOLOR 0 0 0
NAME "Ninos Fuera del Sistema"
TEMPLATE "nfs.html"
END
HEADER "nfs_header.html"
FOOTER "nfs_footer.html"
TOLERANCE 3
DUMP TRUE
END
Some idea?
Thanks a lot!
Ricardo
More information about the MapServer-users
mailing list