get_from_xy: Get DTM or DSM data from an X Y location

get_from_xyR Documentation

Get DTM or DSM data from an X Y location

Description

This function downloads Raster data from the DEFRA portal https://environment.data.gov.uk/DefraDataDownload/?Mode=survey. It retrieves all available data within the requested area defined by 'xy' and 'radius' arguments and offers some additional functionality to merge and crop the raster if desired. This function uses the get_tile function to extract all tiles that intersect the desired region.

Usage

get_from_xy(
  xy,
  radius,
  resolution,
  model_type,
  chrome_version = NULL,
  merge_tiles = TRUE,
  crop = TRUE,
  dest_folder = NULL,
  out_name = NULL,
  ras_format = "GTiff",
  headless_chrome = TRUE,
  check_selenium = TRUE
)

Arguments

xy

A vector of length 2 with XY coordinates using OSGB/British National (EPSG:27700). e.g. c(321555, 507208)

radius

The radius (in meters) of the buffer to be used to define the limits of the downloaded data

resolution

a numeric value (in meters) of either: 0.25, 0.5, 1 or 2. <1m data has generally low coverage.

model_type

A character of either 'DTM' or 'DSM' referring to Digital Terrain Model and Digital Surface Model respectively.

chrome_version

The chrome version that best matches your own chrome installation version. Choose from binman::list_versions("chromedriver")

merge_tiles

Boolean with default TRUE. If TRUE a single raster object is returned else a list of raster is produced.

crop

Boolean with default FALSE. If TRUE data outside the bounds of the requested polygon area are discarded.

dest_folder

Optional character string for output save folder. If not provided rasters will be stored in tempfile()

out_name

Character required when saving merged raster to dest.folder.

ras_format

Character for Raster format. Default is 'GTiff'. for available formats run terra::gdal(drivers=T)

headless_chrome

Boolean with default TRUE. if FALSE chrome is run with GUI activated.

check_selenium

Boolean with default TRUE. If FAlSE Rselenium will not check for updated drivers.

Value

A SpatRaster (from terra) object when merge.tiles = TRUE or a list of rasters when merge.tiles = FALSE


h-a-graham/EAlidaR documentation built on Feb. 6, 2024, 2:27 p.m.