[mapserver-users] Problem with PostGIS layer

Tyler Mitchell TMitchell at lignum.com
Tue Aug 6 10:29:11 PDT 2002


I'm not sure but I suspect your user: thaechl doesn't have permission?  I
would create a db user with the same name as the web server user, giving
him read-only access.
>createuser nobody (or apache)
Then I'd make sure that this user can read the postgis tables
>psql test
#grant select on borderline to nobody;

Maybe that will help.  Doing it this way, you don't need to put in a real
system user/password in your map file!  Just plunk in "user=nobody"
instead.



                                                                                                                                
                      Thomas Haechler                                                                                           
                      <thaechl at geo.unizh.ch>              To:       mapserver-users <mapserver-users at lists.gis.umn.edu>         
                      Sent by:                            cc:                                                                   
                      owner-mapserver-users at lists.        Fax to:                                                               
                      gis.umn.edu                         Subject:  [mapserver-users] Problem with PostGIS layer                
                                                                                                                                
                                                                                                                                
                      08/06/2002 09:17 AM                                                                                       
                                                                                                                                
                                                                                                                                




hello list,

I just start to use postgis with mapserver and can't seem to make it
work. I get a blank browser window and in the source code the following
error message:

MapServer Error in msPOSTGISLayerOpen(): Error parsing POSTGIS
connection information.

Can anyone please tell me what I am missing?

Thank you in advance,

Thomy


P.S.:
I am using php/mapscript version 3.6.1 and this is what I did:

test=# \! createlang plpgsql test
test=# \! psql -d test -f postgis.sql
test=# \! shp2pgsql borderline.shp borderline test | psql test

test=# CREATE INDEX gist_index
test-# ON borderline
test-# USING GIST ( the_geom GIST_GEOMETRY_OPS );

test=# CREATE INDEX oid_index ON borderline ( oid );

test=# VACUUM ANALYZE;


Mapfile:
# ***********************************
# testlayer postgresql
# ***********************************

LAYER
             NAME "borderline2"
             CONNECTIONTYPE postgis
             CONNECTION "user=thaechl password=***** dbname=test
host=localhost
port=5432"
             DATA "the_geom from borderline"
             STATUS DEFAULT
             TYPE LINE
             METADATA
                         "TITLE"           "Grenze SNP"
             END #Metadata
             CLASS
                         NAME 'Grenze SNP'
                         COLOR 220 20 60
                         SYMBOL 13
                         SIZE 2
             END #Class
END #Layer






--

THOMAS HAECHLER

Geographic Information Systems Division
Institute of Geography
University of Zurich
Switzerland

thomas.haechler at geo.unizh.ch








More information about the MapServer-users mailing list