Description Usage Arguments Value Examples
Get raster table from a PostGIS database. The raster can be verticaly flipped if necessary, if a Y axis bug in rdgal occurs.
1 | pgisGetRaster(conn, tbl, flip = FALSE, password = "postgres")
|
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'). |
a RasterLayer object.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.