[Mapserver-users] Mapserver + PostGIS for dummies.

Eric Bridger eric at gomoos.org
Thu Jan 15 14:13:45 EST 2004


Just started using postgis recently and the error messages are a bit
cryptic.  Just yesterday I spent an hour staring at a simliar error (you
can try running the query i.e. everything after BINARY CURSOR FOR from
psql to see if it works).  Until I checked the postgres log and realized
that the table created by shp2pgsql had not granted permissions for my
web user.  GRANT SELECT ON .... TO PUBLIC fixed the problem.

The using clauses are for advance queries with a sub-select. You are
probably using the (1) the_geom from [table_name] form of query.

Note: there is a postgis list at:
http://postgis.refractions.net/mailman/listinfo/postgis-users

On Thu, 2004-01-15 at 13:39, Jason M. Nielsen wrote:
> First I would like to say mapserver and all its associated software is awsome.
> Its incredible what a community can accomplish when working towards a common
> goal using truly open standards.  Very impressive.
> 
> Is there any holding your hand walk throughs on implementing a Mapserver +
> PostGIS system? Looking for something where we can dump SHP files into the db as
> well as rasters then view them.
> 
> At the moment I have mapserver compiled with most of the required options
> (missing PHP/Mapscript support, having a hell of time getting it to compile due
> to some axps deal in my current php setup), Postgresql is installed running and
> being used, PostGIS is installed and appears to work.
> 
> I have actually dumped shp files into the database no problem with shp2pgsql but
> I was never able to get the connection to work nor could I envision in my head
> how it all linked together or would be. It appears there is something I have to
> do with indexing but I havent the slightest clue where to begin or how it
> applies to querying the PostGIS DB similar to just having shp files.
> 
> I have the demo working apparently perfectly and even setup my own map with
> layers without a hitch using map and shp files.
> 
> Below is the error I get now when trying to pull the data from the postgis db. I
> have tried "the_geom" and "geometry_column". I also queried the table and the
> field name is "the_geom". The list 1 and 2(below) I do not understand what
> exactly they are referring to. That is, where do I do this? What exactly is it?
> 
> http://postgis.refractions.net/docs/x556.html
> 
> I checked the above site and perhaps I am just not reading it carefully enough
> but even once I create these indexes it seems like I need to do something
> somewhere else if for no other reason than creating them had no affect on the
> outcome of my query.
> 
> -----------------------
> msDrawMap(): Image handling error. Failed to draw layer named 'Utah Geological
> Study'.
> prep_DB(): Query error. Error executing POSTGIS DECLARE (the actual query)
> statement: 'DECLARE mycursor BINARY CURSOR FOR SELECT
> name::text,asbinary(force_collection(force_2d(the_geom)),'NDR'),OID::text from
> s81 WHERE the_geom && setSRID('BOX3D(1781048.9509602
> 472006.998403,2143367.3005688 833751.562963)'::BOX3D,
> find_srid('','s81','the_geom') )'
> 
> Postgresql reports the error ''
> 
> More Help:
> 
> Error with POSTGIS data variable. You specified '<check your .map file>'.
> 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 June 12/2003. 
> -----------------------
> Where do these two "using" clauses go?
> 
> 
> Thanks,
> Jason Nielsen
> 
> -------------------------------------------------
> This mail sent through IMP: http://horde.org/imp/
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
> 





More information about the mapserver-users mailing list