[Mapserver-users] Accessing PostGIS layers via OGR in MapServer

Mike Leahy mgleahy at fes.uwaterloo.ca
Tue Apr 6 13:18:16 PDT 2004


I was sure of that - I played around with orginfo and ogr2ogr exporting
tables to shapefiles and such before I got to trying it in MapServer.  Could
it be my setup?  I.e., does the mapserv.exe in my Inetpub/Scripts folder for
IIS actually use the OGR I compiled in Cygwin?  I think maybe not...

Here's what ogrinfo --formats returns:

Loaded OGR Format Drivers:
  -> "ESRI Shapefile" (read/write)
  -> "UK .NTF" (readonly)
  -> "SDTS" (readonly)
  -> "TIGER" (read/write)
  -> "S57" (read/write)
  -> "MapInfo File" (read/write)
  -> "DGN" (read/write)
  -> "VRT" (readonly)
  -> "AVCBin" (readonly)
  -> "REC" (readonly)
  -> "Memory" (read/write)
  -> "GML" (read/write)
  -> "PostgreSQL" (read/write)

-----Original Message-----
From: Frank Warmerdam [mailto:warmerdam at pobox.com] 
Sent: April 6, 2004 4:02 PM
To: Mike Leahy
Cc: mapserver-users at lists.gis.umn.edu
Subject: Re: [Mapserver-users] Accessing PostGIS layers via OGR in MapServer

Mike Leahy wrote:
> Hello list,
> 
> I'm trying to see if I can access PostGIS layers via the OGR input type in
> the MapServer 4.1 development version.  The warning message below is about
> as far as I can get:
> 
> Warning: [MapServer Error]: msOGRFileOpen(): Open failed for OGR
connection
> `PG:dbname=educal user=Administrador host=localhost'. File not found or
> unsupported format
> 
> I've tried several formats of connection strings in addition to the one in
> the example above:
> 
> PG:'dbname=educal user=Administrador host=localhost'
> PG:dbname=educal;user=Administrador;host=localhost
> PG:dbname=educal
> 
> So far, none have worked.  I've got PostGIS 0.8 installed as well as GDAL
in
> CygWin, with MapServer running as CGI in IIS on WinXP.  I can run OGR
> components from CygWin okay (e.g., ogr2ogr), but I just don't seem to have
> any luck with it in MapServer yet.  I'm hoping it's just a problem with my
> connection string.  When I connect using PostGIS directly, the connection
> string "user=Administrador dbname=educal host=localhost" works fine.

Mike,

How confident are you that your OGR build includes PostGIS support?  Try
"ogrinfo --formats" and see if there is a "PostgreSQL" driver listed.

Best regards,
-- 
---------------------------------------+------------------------------------
--
I set the clouds in motion - turn up   | Frank Warmerdam,
warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent





More information about the MapServer-users mailing list