Skip to contents

Calculate specific metrics from OpenStreetMap (OSM) vector data at point locations. The character vector of predictor names include the specified buffer radii within which to summarise each metric. Currently supports vector data of buildings (polygons) and roads (lines).

Usage

calc_specific_osm(
  vector,
  building_ndsm = NULL,
  building_height = "height",
  building_levels = "levels",
  road_lanes = "lanes",
  predictors_osm,
  points,
  point_id = "point_id"
)

Arguments

vector

sf dataframe of either buildings (polygons) or roads (lines).

building_ndsm

SpatRaster object (terra::rast()) (optional). A continuous raster of the normalised Digital Surface Model, used to calculate building heights. If absent (NULL) and the variable is named in predictors_osm, the column building_height is used instead. Defaults to NULL.

building_height

Column name in vector for building height. Defaults to "height".

building_levels

Column name in vector for the number of building levels. Defaults to "levels".

road_lanes

Column name in vector for the number of lanes per road line.

predictors_osm

Vector (character) of predictor variables to be calculated from the vector file(s). The naming format is <radius in metres>_osm_<metric> (e.g. r50m_osm_buildingFA_ratio).

points

Points locations (sf object) to calculate the metrics.

point_id

Column name of the sampling point id within the points sf. Defaults to "point_id".

Value

The points object including new columns for the variables specified in predictors_osm.