pgis2slin: Load a linestring geometry stored in a PostgreSQL database...

Description Usage Arguments Value Examples

Description

Load a linestring geometry stored in a PostgreSQL database into R.

Usage

1
2
pgis2slin(conn, table, geom = "geom", gid = "gid", proj = NULL,
  other.cols = "*", query = NULL)

Arguments

conn

A connection object created in RPostgreSQL package.

table

character, Name of the schema-qualified table in Postgresql holding the geometry.

geom

character, Name of the column in 'table' holding the geometry object (Default = 'geom')

gid

character, Name of the column in 'table' holding the ID for each line. Should be unique if additional columns of unique data are being appended. (Default = 'gid')

proj

numeric, Can be set to TRUE to automatically take the SRID for the table in the database. Alternatively, the number of EPSG-specified projection of the geometry (Default is NULL, resulting in no projection.)

other.cols

character, names of additional columns from table (comma-seperated) to append to dataset (Default is all columns, NULL returns a SpatialLines object)

query

character, additional SQL to append to modify select query from table

Value

SpatialLinesDataFrame or SpatialLines

Examples

1
2
3
4
5
6
#library(RPostgreSQL)
#drv<-dbDriver("PostgreSQL")
#conn<-dbConnect(drv,dbname='dbname',host='host',port='5432',user='user',password='password')

#pgis2slin(conn,'schema.tablename')
#pgis2slin(conn,'schema.roads',geom='roadgeom',gid='road_ID',proj=4326,other.cols=NULL, query = "AND field = \'highway\'")

dnbucklin/pgis2r documentation built on May 15, 2019, 9:38 a.m.