pg_load_raster: Import a raster into the database

Description Usage Arguments Value See Also

View source: R/db_functions.R

Description

Import a raster into the database

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
pg_load_raster(
  dbsettings,
  r,
  epsg,
  tablename,
  replace = FALSE,
  tilew = NULL,
  tileh = NULL,
  flags = "-M -Y"
)

Arguments

dbsettings

A named list of database connection settings returned by db_connect_postgis or db_create_postgis.

r

The raster to import.

epsg

EPSG code for the raster projection.

tablename

Name of the raster table in the form 'schema.tablename'.

replace

If TRUE and the table exists, it will be dropped and recreated. If FALSE (default) the data will be appended to an existing table if present, otherwise a new table will be created.

tilew

Width (pixels) of raster tiles as stored in the database table. Refer to PostGIS documentation for an explanation. If NULL (default) this will be set to the width of the input raster.

tileh

height (pixels) of raster tiles as stored in the database table. Refer to PostGIS documentation for an explanation. If NULL (default) this will be set to the height of the input raster.

flags

Other options to be passed to the PostgreSQL raster2pgsql program. Default is "-M -Y" to run vacuum analyzed (-M) and use COPY instead of INSERT statements for speed (-Y). See raster2pgsql documentation for details of other options.

label

A label to use to construct a file name for writing the raster to disk prior to import. This will be stored in the 'filename' column of the raster table.

Value

The integer rid value of the record(s) for the imported raster.

See Also

db_connect_postgis db_create_postgis


mbedward/CERMBlidarpostgis documentation built on Nov. 14, 2021, 7:15 p.m.