pgGetRast | R Documentation |
Retrieve rasters from a PostGIS table into a terra SpatRaster
object
pgGetRast(
conn,
name,
rast = "rast",
bands = 1,
boundary = NULL,
clauses = NULL,
returnclass = "terra",
progress = TRUE
)
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., |
rast |
Name of the column in |
bands |
Index number(s) for the band(s) to retrieve (defaults to 1).
The special case ( |
boundary |
|
clauses |
character, optional SQL to append to modify select query from table. Must begin with 'WHERE'. |
returnclass |
'terra' by default; or 'raster' for |
progress |
whether to show a progress bar (TRUE by default). The progress bar mark the progress of reading bands from the database. |
Since version 1.5.0, this function retrieve SpatRaster objects from
terra
package by default. The argument returnclass
can be
used to return raster
objects instead.
The argument bands
can take as argument:
* The index of the desirable band (e.g. bands = 2 will fetch the second band of the raster).
* More than one index for several bands (e.g. bands = c(2,4) will return a
SpatRaster
with two bands).
* All bands in the raster (bands = TRUE).
SpatRaster
; raster
; or RasterStack
object
David Bucklin david.bucklin@gmail.com and Adrián Cidre González adrian.cidre@gmail.com
## Not run:
pgGetRast(conn, c("schema", "tablename"))
pgGetRast(conn, c("schema", "DEM"), boundary = c(55,
50, 17, 12))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.