rpostgis (version 1.4.3)

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

Author

David Bucklin david.bucklin@gmail.com

Mathieu Basille basille@ufl.edu

Examples

Run this code
if (FALSE) {
## 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)
}

Run the code above in your browser using DataCamp Workspace