Learn R Programming

rpostgis (version 1.0.0)

pgGetPts: Load a PostGIS point geometry from a PostgreSQL table/view into R.

Description

Load a PostGIS point geometry from a PostgreSQL table/view into R.

Usage

pgGetPts(conn, name, geom = "geom", gid = NULL, other.cols = "*", clauses = NULL)

Arguments

Value

Spatial(Multi)PointsDataFrame or Spatial(Multi)Points

Examples

Run this code
## Not run: 
# ## Retrieve a SpatialPointsDataFrame with all data from table
# ## 'schema.tablename', with geometry in the column 'geom'
# pgGetPts(conn, c("schema", "tablename"))
# ## Return a SpatialPointsDataFrame with columns c1 & c2 as data
# pgGetPts(conn, c("schema", "tablename"), other.cols = "c1,c2")
# ## Return a SpatialPoints, retaining id from table as rownames
# pgGetPts(conn, c("schema", "tablename"), gid = "table_id", other.cols = FALSE)
# ## End(Not run)

Run the code above in your browser using DataLab