Description Usage Arguments Value Examples
Load a point 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 point geometry. 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, other.cols=NULL returns a SpatialPoints object) |
query |
character, additional SQL to append to modify select query from table |
SpatialPointsDataFrame or SpatialPoints
1 2 3 4 5 6 | #library(RPostgreSQL)
#drv<-dbDriver("PostgreSQL")
#conn<-dbConnect(drv,dbname='dbname',host='host',port='5432',user='user',password='password')
#pgis2spts(conn,'schema.tablename')
#pgis2spts(conn,'schema.cities',geom='citygeom',gid='city_ID',proj=4326,query = "AND city_population > 10000")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.