Description Usage Arguments Value Examples
Load a linestring geometry stored in a PostgreSQL database into R.
1 2 |
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 |
SpatialLinesDataFrame or SpatialLines
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\'")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.