pgGetRast: Load raster from PostGIS database.

Description Usage Arguments Details Value Author(s) Examples

View source: R/pgGetRast.R

Description

Retrieve rasters from a PostGIS table.

Usage

1
pgGetRast(conn, name, rast = "rast", bands = 1, boundary = NULL)

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"))

rast

Name of the column in name holding the raster object

bands

Index number(s) for the band(s) to retrieve (defaults to 1). The special case (bands = TRUE) returns all bands in the raster.

boundary

sp object or numeric. A Spatial* object, whose bounding box will be used to select the part of the raster to import. Alternatively, four numbers (e.g. c([top], [bottom], [right], [left])) indicating the projection-specific limits with which to clip the raster. boundary = NULL (default) will return the full raster.

Details

Default is to return a raster-class object RasterLayer for one-band, RasterBrick for multiple bands. sp-class rasters (SpatialGrid*s or SpatialPixels*) written using pgWriteRast will attempt to re-import as the same data class.

Value

RasterLayer

Author(s)

David Bucklin [email protected]

Examples

1
2
3
4
5
6
## Not run: 
pgGetRast(conn, c("schema", "tablename"))
pgGetRast(conn, c("schema", "DEM"), boundary = c(55,
    50, 17, 12))

## End(Not run)

rpostgis documentation built on July 4, 2017, 9:32 a.m.