[postgis-users] use mapserver with Postgis data

Hankley, Chip Chip.Hankley at GASAI.Com
Fri Jun 28 06:43:00 PDT 2002


Cedric -

There are a couple of docs you might refer to:

The postGIS docs have a section on working w/ MapServer
  http://postgis.refractions.net/docs/x424.html#AEN489

The following document also has a sample layer definition for MapServer
  http://www.gasai.com/gisapps/WindowsHowTo.html#BuildaTable

I've just gone through this process myself, the big thing for me was the
following statement in the layer definition:

  CONNECTIONTYPE postgis
  CONNECTION "user=postgres dbname=myGISdb host=localhost"

These two lines are the keys... they are really the only thing that seems to
separate the layer definition from a regular layer... the CONNECTION line
can be a little tricky. The PostGIS docs say that some of these are
optional... this was the only combination that I could get to work, and I
HAD to specify "localhost" as the host... my regular machine name would NOT
work. Note that for my setup, PostGIS and MapServer are running ON THE SAME
MACHINE. That is the only reason why LOCALHOST will work (I think). 

Apparently to be able to use different machines, you have to change
something on the PostgreSQL side to allow other connections, but I haven't
figured that out.

Anyway, try those layer definitions. If it doesn't work, MS should return
some errors - search the PostGIS and MapServer archives using these errors
and they should help you figure it out.

Chip

-----Original Message-----
From: Cedric BERNIER [mailto:cedric.bernier at thales-is.com]
Sent: Friday, June 28, 2002 8:27 AM
To: postgis-users at postgis.refractions.net
Cc: gleeming at refractions.net
Subject: [postgis-users] use mapserver with Postgis data


Hi all !

I would like to visualize my data stored with PostGIS using mapserver.

I have installed and configured mapserver (itasca demo works fine), is
anyone
could tell me how to use my data stored in my database as input of the
mapserver
?
Maybe something to read before ?

I have configure mapserver with --postgis flag and it seems to be ok.






More information about the postgis-users mailing list