pgisGetRaster: Get raster from PostGIS

Description Usage Arguments Value Examples

View source: R/rasters.R

Description

Get raster table from a PostGIS database. The raster can be verticaly flipped if necessary, if a Y axis bug in rdgal occurs.

Usage

1
pgisGetRaster(conn, tbl, flip = FALSE, password = "postgres")

Arguments

conn

a PostgreSQLConnection object.

tbl

character; name of the raster table.

flip

boolean; flip raster Y axis if necessary (default: FALSE).

password

character; password for database (default: 'postgres').

Value

a RasterLayer object.

Examples

1
2
3
4
5
6
7
8
9
library(RPostgreSQL)
library(spData)
library(raster)
data(elev)
pgisWriteRaster(elev, dbname="foodflows", crs=2154)
conn = dbConnect(drv=dbDriver("PostgreSQL"), host="localhost", port=5432,
                dbname="foodflows", user="milo", password="postgres")
rast = pgisGetRaster(conn, tbl="elev")
raster::plot(rast)

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