dbReadSpatial: Read spatial data from a PostGIS table

Description Usage Arguments Details Value

Description

dbReadSpatial returns a Spatial*DataFrame

Usage

1
2
dbReadSpatial(con, schemaname = "public", tablename, geomcol = "geom",
  idcol = NULL)

Arguments

con

A valid PostgreSQL connection (from RPostgreSQL)

schemaname

Schema where the specified table of interest resides

tablename

Name of the database table. must contain a single geometry column

geomcol

Name of the geometry column in the specified table (target table may not have more than one geometry column!) defaults to the standard 'geom'

idcol

Name of the column with unique IDs. This usually corresponds to the specified primary key.

Details

This is a function for reading spatial data directly from a PostgreSQL/PostGIS table and returning the appropriate Spatial*DataFrame. The function relies on the ST_AsGeoJSON function with PostGIS to return the spatial data as a GeoJSON object. The non-geometry columns in the table are read via the RPostgreSQL package.

Value

A Spatial Data Frame object


jmlondon/Rpostgis documentation built on May 19, 2019, 1:53 p.m.