Description Usage Arguments Details Value
dbReadSpatial
returns a Spatial*DataFrame
1 2 | dbReadSpatial(con, schemaname = "public", tablename, geomcol = "geom",
idcol = NULL)
|
con |
A valid PostgreSQL connection (from RPostgreSQL) |
schemaname |
Schema where the specified table of interest resides |
tablename |
Name of the database table. must contain a single geometry column |
geomcol |
Name of the geometry column in the specified table (target table may not have more than one geometry column!) defaults to the standard 'geom' |
idcol |
Name of the column with unique IDs. This usually corresponds to the specified primary key. |
This is a function for reading spatial data directly from a
PostgreSQL/PostGIS table and returning the appropriate Spatial*DataFrame.
The function relies on the ST_AsGeoJSON
function with PostGIS to
return the spatial data as a GeoJSON object. The non-geometry columns in
the table are read via the RPostgreSQL
package.
A Spatial Data Frame object
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.