[R-sig-Geo] Error in readOGR / ogrInfo

Ben Madin lists at remoteinformation.com.au
Thu Oct 21 14:13:39 CEST 2010


G'day all,

I am having a problem with using the rgdal function readOGR, but the error message actually relates to using ogrInfo.

> backgroundmap <- readOGR("PG:dbname=gms user=benmadin password=xdi4frt", "seaplus_countries")
Error in ogrInfo(dsn = dsn, layer = layer, input_field_name_encoding = input_field_name_encoding) : 
  
	GDAL Error 1: No field definitions found for 'seaplus_countries', is it a table?
> ogrInfo("PG:dbname=gms user=benmadin password= xdi4frt", "seaplus_countries", input_field_name_encoding=UTF-8)
Error in ogrInfo("PG:dbname=gms user=benmadin password= xdi4frt", "seaplus_countries",  : 
  
	GDAL Error 1: No field definitions found for 'seaplus_countries', is it a table?


Yet when I use ogrInfo from the command line it shows me the information :

warrambat:~ benmadin$ ogrinfo "PG:dbname=gms user=benmadin password= xdi4frt"
INFO: Open of `PG:dbname=gms user=benmadin password= xdi4frt'
      using driver `PostgreSQL' successful.

rows deleted

20: public.country (Multi Polygon)
21: public.seaplus_countries (Multi Polygon)
22: public.worldboundaries (Multi Polygon)

and I can load the layer and display it in QGIS or uDig.

The problem occurs both in the GUI and the command line versions of R. 

> sessionInfo()
R version 2.11.1 Patched (2010-09-30 r53084)
Platform: x86_64-apple-darwin9.8.0/x86_64 (64-bit)

locale:
[1] en_AU.UTF-8/en_AU.UTF-8/C/C/en_AU.UTF-8/en_AU.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] rgdal_0.6-28 sp_0.9-72   

loaded via a namespace (and not attached):
[1] grid_2.11.1     lattice_0.19-13

I have tried this with a number of postgis tables in different databases, and it is not working. I am trying to re-run code that has previously worked fine, but I am on a new computer and using R2.11 and a more recent version of rgdal.

My first question is - what does the error message mean?

My second question - why is it occurring in R, but not (apparently) a problem outside of R?

My third question - am I on the right list?

cheers

Ben



More information about the R-sig-Geo mailing list