dbreadspatial: Read a spatial vector data from postgres

Description Usage Arguments Author(s)

Description

it returns the spatialPolygonDataFrame with its projection, but it only works if there is one single projection system in the table

Usage

1
dbwritespatial(con, myspatialdata.spdf, schemaname="myschema", tablename="myspatialdata", replace=FALSE)

Arguments

con

set the connection with the database: con <- dbConnect(dbDriver("PostgreSQL"), dbname="postgis", port=5432, host="localhost", user="postgres", password="pw")

schemaname

name of the schema in which the table is stored. 'public' is the default

tablename

string name of the table to be imported

geomcol

the field name in which geometry info are stored

idcol

Name of the column with unique IDs to be used in the ID slot of the spatial objects (not relevant for point data)

Author(s)

Philipp Hunziker <https://philipphunziker.wordpress.com/2014/07/20/transferring-vector-data-between-postgis-and-r/>


cyrilmi/myfunctions documentation built on May 14, 2019, 1:39 p.m.