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

Ben Madin lists at remoteinformation.com.au
Fri Oct 22 02:44:50 CEST 2010


Thanks Roger,

On 22/10/2010, at 5:06 AM, Roger Bivand wrote:

> I don't run PostGIS, so cannot tell, nor OSX. Is the table named as given (what does the "public." prefix mean)? Can you use ogrinfo to examine the table itself rather than the list of tables? I assume that you know what you are doing; PostGIS is not something I know about.

the public. bit refers to the database schema - not something you probably wanted or needed to know, but ironically the clue to the problem - it seems that the tables had at some point (I'm not sure why or how, but I'm doing a few late nights) migrated to the public schema, but they were registered in the geometry columns table as being in the gms. schema. the ogrinfo looked for them, but couldn't find them, and just returned the full list of tables.

It seems that the R ogrInfo() might have stopped if they weren't in the geometry columns table. I don't know why, but they are now all in the same schema and it seems happy enough. Specifying the different schemas in the dsn (schemas=gms,public) didn't seem to overcome this issue.

>> My second question - why is it occurring in R, but not (apparently) a problem outside of R?
> 
> Most likely the OGR drivers in the GDAL shared object used by rgdal are not the same as those used by ogrinfo, QGIS, etc., elsewhere. How did you install rgdal - as a binary package (from where) or as a source package? If the latter, do you have multiple GDAL shared objects on your system?

The OGR box and dice (GDAL & rgdal) were installed using William Kyngesbury's Frameworks (R was from Simon Urbanek's page). It doesn't appear that this was the problem, the frameworks are the only gdal I can find.

>> My third question - am I on the right list?
> 
> Yes.

Thanks - I'm trying to finish my thesis, and I appreciate the speedy responses!

cheers

Ben



More information about the R-sig-Geo mailing list