The paper on our rpostgis package is out in the R journal! This package provides an interface between R and PostGIS databases, with bidirectional transfer of both vector (points, lines, polygons) and raster data!
The paper provides a detailed overview of the package capabilities, with functions dedicated to spatial data, as well as general PostgreSQL management:
- PostGIS management:
- Check and create PostGIS extension:
pgPostGIS - List geometries/rasters:
pgListGeomandpgListRast - Find (or create) PostGIS SRID based on CRS object:
pgSRID - Spatial data transfer (vector data):
pgInsertandpgGetGeom - Spatial data transfer (raster data):
pgWriteRastandpgGetRast - Bounding box retrieval:
pgGetBoundary - Add a POINT or LINESTRING geometry field:
pgMakePtsandpgMakeStp
- Check and create PostGIS extension:
- PostgreSQL functions and wrappers:
- Storing R data.frames in PostgreSQL:
dbWriteDataFrameanddbReadDataFrame - Check and create schema:
dbSchema - Comment on table/view/schema:
dbComment - Add or remove a column:
dbColumn - Add a primary or foreign key:
dbAddKey - Create an index:
dbIndex - Convert to timestamp:
dbAsDate - Garbage-collect and analyze a database (VACUUM):
dbVacuum - Drop table/view/schema:
dbDrop - Get information about table columns:
dbTableInfo
- Storing R data.frames in PostgreSQL:
See all the details of our paper here, with a link to the PDF and additional resources.
Mathieu