[Gdal-dev] Connecting to PostGIS using rgdal

Frank Warmerdam warmerdam at pobox.com
Wed May 30 13:32:15 EDT 2007


Mike Leahy wrote:
> Hello,
> 
> I am trying to see if I can access a table from PostGIS using rgdal in
> the R statistics program.  I've been able to read information from
> shapefiles, as the example below demonstrates.  However, whenever I try
> to read from a PG connection, I get a message saying it cannot open the
> file (also in my output below).  I'm on WinXP, running R-2.5.0, rgdal
> 0.5-9 installed from CRAN, and I have FWTools 1.3.1 installed.  Output
> from ogrinfo (from FWTools) reports information from the same PG
> connection/dataset I'm trying to access using rgdal without any trouble.
> 
> I'm wondering what step I've missed in the setup of R, rgdal, or
> FWTools/GDAL.  I have added the FWTools bin folder to my Path
> environment variable, as well as added GDAL_DATA, but that doesn't seem
> to help.  Is there anything I'm likely to have missed?  I checked the
> output from ogrDrivers(), and it looks like PostgreSQL isn't included -
> so would this mean that I have to compile rgdal myself?  If so, are
> there instructions for this?

Mike,

Based on the ogrDrivers() output, it would appear that the rgdal
package you installed came with it's own copy of GDAL/OGR and that
does not include Postgis support.  Note that FWTools purposefully
uses it's own name for the GDAL DLL (gdal_fw.dll) to avoid conflicts
with other packages.  But this makes it hard to use FWTools DLLs
as replacements for other shipped DLLs.

Best regards,

>> ogrDrivers()
>              name write
> 1          AVCBin FALSE
> 2             CSV  TRUE
> 3             DGN  TRUE
> 4  ESRI Shapefile  TRUE
> 5             GML  TRUE
> 6             KML  TRUE
> 7    MapInfo File  TRUE
> 8          Memory  TRUE
> 9             REC FALSE
> 10            S57  TRUE
> 11           SDTS FALSE
> 12          TIGER  TRUE
> 13        UK .NTF FALSE
> 14            VRT FALSE
> 
> 
> 
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
> 


-- 
---------------------------------------+--------------------------------------
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    | President OSGeo, http://osgeo.org




More information about the Gdal-dev mailing list