Learn R Programming

rpostgis (version 1.0.0)

pgGetRast: Load raster from PostGIS database.

Description

Retrieve rasters from a PostGIS table.

Usage

pgGetRast(conn, name, rast = "rast", digits = 9, boundary = NULL)

Arguments

conn
A connection object to a PostgreSQL database
name
A character string specifying a PostgreSQL schema (if necessary), and table or view name for the table holding the raster (e.g., name = c("schema","table"))
rast
Name of the column in 'name' holding the raster object
digits
numeric, precision for detecting whether points are on a regular grid (a low number of digits is a low precision) - From rasterFromXYZ function (raster package)
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(north, south, east, west)) indicating the projection-specific limits with which to clip the raster. NULL (default) will return the full raster.

Value

RasterLayer

Examples

Run this code
## Not run: 
# pgGetRast(conn, c("schema", "tablename"))
# pgGetRast(conn, c("schema", "DEM"), digits = 9, boundary = c(55,
#     50, 17, 12))
# ## End(Not run)

Run the code above in your browser using DataLab