postGIStools: Tools for interacting with PostgreSQL / PostGIS Databases

Description

postGIStools facilitates the import/export of data tables between R and PostgreSQL, in particular those with associated geometries (PostGIS extension) and hstore (key-value pairs) type columns.

Key Functions

get_postgis_query works like dbGetQuery, with the additional benefit of parsing hstore types (as a list-column in the resulting R data frame) and geometry types (producing a spatial data frame in R).

%->% reproduces the behavior of the PostgreSQL hstore -> key operator.

postgis_insert and postgis_update respectively insert new rows or update existing rows in a PostgreSQL table based on the contents of a R data frame. For spatial data and hstore columns, they performs the same conversions as get_postgis_query, in reverse.