pgisGetBbox: Get bbox of a table

Description Usage Arguments Value Examples

View source: R/geometry.R

Description

Get the extent of the geometry of a PostGIS table, in the same EPSG than table.

Usage

1
pgisGetBbox(conn, tbl, geom.col = "geometry")

Arguments

conn

a PostgreSQLConnection object.

tbl

character; table name.

geom.col

character; name of the geometry column (default: 'geometry).

Value

a bbox class object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(spData)
library(sf)
library(RPostgreSQL)
data(seine)
conn = dbConnect(drv=dbDriver("PostgreSQL"), host="localhost", port=5432,
                dbname="foodflows", user="milo", password="postgres")
dbWriteTable(conn, name="seine", seine, overwrite=TRUE)
bb = pgisGetBbox(conn, "seine")
(class(bb)=="bbox")
dbDisconnect(conn)

MiloMonnier/postgisr documentation built on Feb. 16, 2021, 8:03 p.m.