ldb_load_vegcover_raster: Create a raster table record for vegetation cover derived...

ldb_load_vegcover_rasterR Documentation

Create a raster table record for vegetation cover derived from a LAS tile

Description

This function associates a single-band raster of vegetation cover, usually derived from a LAS point cloud using the CERMBlidar::get_stratum_cover function, with an existing meta-data record for the LAS tile. The database uses out-db storage for raster files, where a raster table record stores the path to the file location, which will usually be AWS S3-compatible storage although other types of storage can be used.

Usage

ldb_load_vegcover_raster(
  db,
  raster_url,
  strata_def = "specht",
  crs_fallback = NULL,
  tile_id = NULL,
  protocol = "vsicurl",
  tilew = 256,
  R2P = "C:/Program Files/PostgreSQL/12/bin/raster2pgsql.exe"
)

Arguments

db

An open database connection for a user with administrator rights to the database.

raster_url

A URL giving the file location, e.g. in an accessible S3 bucket.

strata_def

A standard strata definition abbreviation, supported by the database. Default to 'cermb' which corresponds to CERMBlidar::StrataCERMB.

crs_fallback

The coordinate reference system of the raster file in a form that can be understood by the sf::st_crs() function (e.g. a WKT string or an integer EPSG code. This is used to infer the name of the relevant meta-data and raster tables in the database. If NULL (default), the function will attempt to retrieve the CRS from the raster file.

tile_id

Integer ID for the corresponding existing record in the 'metadata' table. If NULL (default), the function will search for a meta-data record based on the file name of the input raster.

protocol

The name of a GDAL-supported virtual file system protocol to use when accessing the raster file from storage. The default is 'vsicurl'. See GDAL online documentation for other options. This will be stored as part of the raster file path in the database raster table record.

tilew

The tile size to use for the raster. See this Postgis raster example for more details.

R2P

The path to the Postgis command line program raster2pgsql. If NULL or not found, the function will attempt to locate the program on the client system.

Details

If any credentials are required to access the file (e.g. AWS Access Key) it is assumed that this have been set in the environment from which the function is being called.


mbedward/CERMBldb documentation built on May 2, 2024, 8:10 a.m.