Skip to content

OGR dataset to R

5 messages · Jean-Denis Giguere, Edzer Pebesma, Roger Bivand

#
On Tue, 6 Dec 2005, Jean-Denis Giguere wrote:

            
Please look at Barry Rowlingson's Rmap at:

http://www.maths.lancs.ac.uk/Software/Rmap/

You will need to build/compile it yourself, on Linux/Unix feasible, on 
Windows I'm not sure, but since you are using PostGIS, I guess you are 
using Linux.
We looked briefly at reading data via OGR and Rmap into package "sp" 
classes this time last year - from there movement to spatstat and splancs 
is feasible. With a little work, moving points through OGR and Rmap into 
SpatialPoints or SpatialPointsDataFrame objects should be possible. The 
same applies to polygons for study area boundaries.
PostgreSQL seems to be being actively used on BioConductor:

http://www.bioconductor.org/packages/bioc/1.8/html/RdbiPgSQL.html
http://www.bioconductor.org/packages/bioc/1.8/html/Rdbi.html

apart from additional work done by Markus Neteler.

  
    
#
Jean-Denis,

currently, as fas as I know, there is only Rmap -- see
http://www.maths.lancs.ac.uk/Software/Rmap/

but that does not live on CRAN, meaning that it may
be outdated in some respects. On my linux box, which
has a recent gdal installed, it does not compile.

Also, rgdal does not read anything through OGR,
currently. Anyone who wants to take this up?
#
I must correct -- I did manage to compile Rmap after outcommenting
the line

SHAPE = -lshp

in Rmap/src/Makevars
--
Edzer
Jean-Denis Giguere wrote:

            
#
On Tue, 6 Dec 2005, Edzer J. Pebesma wrote:

            
Yes, I can confirm this, building against gdal and proj works for me too, 
as does Barry's nice subsetting. So maybe your database link will be quite 
good - the [.ogr function makes an ogr object for the subset, and only 
when you do as.data.frame() og the ogr object does the data get read into 
R.

Roger