pgGetBoundary: Retrieve bounding envelope of geometries or rasters.

View source: R/pgGetBoundary.R

pgGetBoundaryR Documentation

Retrieve bounding envelope of geometries or rasters.

Description

Retrieve bounding envelope (rectangle) of all geometries or rasters in a PostGIS table as a sfc object.

Usage

pgGetBoundary(conn, name, geom = "geom", clauses = NULL, returnclass = "sf")

Arguments

conn

A connection object to a PostgreSQL database

name

A character string specifying a PostgreSQL schema and table/view name holding the geometry (e.g., name = c("schema","table"))

geom

A character string specifying the name of the geometry column in the table name (Default = "geom"). Note that for raster objects you will need to change the default value

clauses

character, additional SQL to append to modify select query from table. Must begin with an SQL clause (e.g., "WHERE ...", "ORDER BY ...", "LIMIT ..."); same usage as in pgGetGeom.

returnclass

'sf' by default; 'terra' for SpatVector; or 'sp' for sp objects.

Value

object of class sfc (list-column with geometries); SpatVector or sp object

Author(s)

David Bucklin david.bucklin@gmail.com and Adrian Cidre González adrian.cidre@gmail.com

Examples

## Not run: 
pgGetBoundary(conn, c("schema", "polys"), geom = "geom")
pgGetBoundary(conn, c("schema", "rasters"), geom = "rast")

## End(Not run)

mablab/rpostgis documentation built on Jan. 15, 2024, 10:14 p.m.