[postgis-users] How to access PostGIS directly from R (rgdal)

Jan Hartmann j.l.h.hartmann at uva.nl
Wed Oct 29 02:28:19 PDT 2008


Found the following package, which seems to do what you want, although 
not for PostGIS, but for SQLite. It imports WKT geometries into R SP 
objects. Should be relatively easy to port to PostGIS.

http://cran-r.c3sl.ufpr.br/web/packages/SQLiteMap/index.html

Jan
> 
> 
> 
> pcreso at pcreso.com wrote:
>> Thanks Regina,
>>  
>>  PL/R is not a solution in this case. We want to be able to
>>  load PostGIS geometries as R objects, not return the result
>>  of an R function applied to PostGIS data via SQL.
>>  
>>  The idea is to use PostGIS to manage all the data &
>>  have R access it natively. We can then have one PostGIS
>>  cluster to maintain, and our QGIS/gvSIG/JUMP/uDIG users can
>>  access it natively, Mapinfo & ESRI users can access it
>>  via WMS/WFS as appropriate, GMT users can use ogr2ogr &
>>  R users can use rgdal.
>>  
>>  It will be pretty neat if we can get it all working
>>  smoothly. We are also looking at using PostGIS as our ESRI
>>  geodatabase, but still providing access via the same
>>  protocols to all the other apps. Much better than
>>  shapefiles, etc being passed around...
>>  
>>  
>>  Cheers,
>>  
>>     Brent Wood
>>  
>>  --- On Wed, 10/29/08, Paragon Corporation
>>  <lr at pcorp.us> wrote:
>>  
>>  > From: Paragon Corporation <lr at pcorp.us>
>>  > Subject: RE: [postgis-users] How to access PostGIS
>>  directly from R (rgdal)
>>  > To: "'PostGIS Users Discussion'"
>>  <postgis-users at postgis.refractions.net>
>>  > Date: Wednesday, October 29, 2008, 2:13 PM
>>  > Brent,
>>  > I suppose calling RGDAL from PostgreSQL is not an
>>  option?  >
>>  > 
>> http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgresql_plr_tut03 
>>
>>  >  >  > Hope that helps,
>>>> Regina
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: postgis-users-bounces at postgis.refractions.net
>>>> [mailto:postgis-users-bounces at postgis.refractions.net]
>>> On
>>>> Behalf Of
>>>> pcreso at pcreso.com
>>>> Sent: Tuesday, October 28, 2008 8:15 PM
>>>> To: PostGIS Users Discussion
>>>> Subject: [postgis-users] How to access PostGIS
>>> directly
>>>> from R (rgdal)
>>>>
>>>> Hi,
>>>>
>>>> This may be better suited to the R or GDAL lists, but
>>> I
>>>> don't frequent
>>>> those, so I'll try here first.
>>>>
>>>> We have PostGIS databases we are looking to use behind
>>> a
>>>> WMS/WFS server & as
>>>> a generic spatial data repository for my organisation.
>>>>
>>>> We have a lot of R users, & I'd like to be
>>> able to
>>>> have them able to access
>>>> the topo data (coastlines, roads, rivers, lakes,
>>> cities,
>>>> etc) for use with
>>>> some of our R mapping functionality.
>>>>
>>>> I had hoped rgdal would support this, but having
>>> installed
>>>> it, it does not
>>>> support Postgres/PostGIS databases as an OGR source.
>>> We
>>>> could use something
>>>> like shapefiles as an intermediate format if there is
>>>> nothing better, but
>>>> I'm hoping for some pointers in how to enable
>>> Postgis
>>>> access directly.
>>>>
>>>> We can use ODBC, via dbi, etc, but this means
>>> reinventing
>>>> ways of
>>>> interpreting geometry datatype data.
>>>>
>>>> Does anyone have any suggestions?
>>>>
>>>> Thanks,
>>>>
>>>>    Brent Wood
>>>> _______________________________________________
>>>> postgis-users mailing list
>>>> postgis-users at postgis.refractions.net
>>>>
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>>>
>>>>
>>>> _______________________________________________
>>>> postgis-users mailing list
>>>> postgis-users at postgis.refractions.net
>>>>
>>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
>>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 



More information about the postgis-users mailing list