pgis2rast: Load a raster stored in a PostgreSQL database into R.

Description Usage Arguments Value Examples

Description

Load a raster stored in a PostgreSQL database into R.

Usage

1
2
pgis2rast(conn, table, rast = "rast", proj = NULL, digits = 9,
  NSEW = c(NULL, NULL, NULL, NULL))

Arguments

conn

A connection object created in RPostgreSQL package.

table

Name of the schema-qualified table in Postgresql holding the raster.

rast

Name of the column in 'table' holding the raster object

proj

Can be set to TRUE to automatically take the SRID for the table in the database. Alternatively, the number of EPSG-specified projection of the geometry (Default is NULL, resulting in no projection.)

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)

NSEW

numeric, clipping box for raster with four arguments (north, south, east, west) indicating the projection-specific limits with which to clip the raster.

Value

RasterLayer

Examples

1
2
3
4
5
6
#library(RPostgreSQL)
#drv<-dbDriver("PostgreSQL")
#conn<-dbConnect(drv,dbname='dbname',host='host',port='5432',user='user',password='password')

#pgis2rast(conn,'schema.tablename')
#pgis2rast(conn,'schema.tablename',proj=4326,digits=9,NSEW=c(55,50,17,12))

dnbucklin/pgis2r documentation built on May 15, 2019, 9:38 a.m.