[postgis-users] Mapserver / PostGIS Layer

Lowther, David W dlowther at ou.edu
Mon Jan 6 08:07:11 PST 2003


Hi List and Happy New Year!

I have been struggling with a situation related to Mapserver and PostGIS
layers and I was hoping someone might help me out.

I have PostGIS running on Redhat. I have 2 web/mapserver (3.6.3) servers
(Intel WinNT4.0 IIS4.0) that access this PostGIS database. One is a test
server (located in the same domain as the PostGIS server) and one is a live
server (located in a separate domain from the PostGIS server). Using the
same connection information in a mapfile the test server can access and map
the PostGIS database with no problem - as could the live server when it was
in the domain - but the live server fails to connect with an error
(msPOSTGISLayerOpen(): Query error. Error parsing POSTGIS connection
information.) now that it is outside the domain. I am stressing the domain
issue here because I can't think of any other difference in the two servers.

- PGAdmin from the live server connects with no problem.
- ODBC connectivity from the live server works fine.
- The mapfiles on the test and live servers are identical except for
necessary directory differences.
- Checked password, hostname, connection type, socket connections enabled as
instructed in debug version of Mapserver build, but if they work on the test
server shouldn't they work on the live?
- Added live server to pg_hba.conf although test server does not appear and
connects successfully:
	 host        all      216.226.17.176   255.255.255.0      trust
- Initialize postmaster with -i option to allow tcp/ip connections.
- tcpip_socket=true in postgresql.conf.
- Tried using port=5432 in the CONNECTION param for mapfile - no difference
in behaviour.

Heres the layer from the mapfile:
### ROADS ###
LAYER
	GROUP "Selected"
	NAME "gradyRoads"
	CONNECTIONTYPE postgis
	CONNECTION "user=*** password=*** dbname=*** host=***"
	DATA "the_geom from (select oid,* from roads) as foo"

	TYPE LINE
	STATUS OFF
	PROJECTION #GEOGRAPHIC NAD83
		proj=longlat
		ellps=GRS80 
		no_defs 
	END
	TEMPLATE "IDgradyRoads.htm"
	CLASS#
		NAME "Grady Roads"
		SYMBOL "line"
		SIZE 2
		OUTLINECOLOR -1 -1 -1
		COLOR 10 200 100 
	END
	METADATA
		legend_order "5"
	END
END

Would anyone be willing to try connecting to the PostGIS server using
Mapserver if I were to provide ip, db, un, and pwd info? I'm just completely
stuck at this point.

Thanks so much for everyone's help getting me to this point and thanks in
advance for all your help with this issue,

David Lowther
Software Engineer
GEO Information Systems
University of Oklahoma
dlowther at ou.edu
(405) 325-3131
http://www.geo.ou.edu






More information about the postgis-users mailing list