Skip to contents

Calculate metrics from OpenStreetMap (OSM) vector data, at specific point locations and buffer radii. Currently supports vector data of buildings (polygons) and roads (lines).

Usage

calc_osm(
  vector,
  name = NULL,
  points,
  buffer_sizes,
  building_ndsm = NULL,
  building_height = "height",
  building_levels = "levels",
  road_lanes = "lanes"
)

Arguments

vector

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

name

Specify either "buildings" or "roads".

points

Point locations (sf object) to calculate the metrics.

buffer_sizes

Radius of circle (in mapunits) for each point location; metrics will be calculated within the buffer area.

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". Column data should be numeric.

road_lanes

Column name in vector for the number of lanes per road line. Defaults to "lanes". Column data should be numeric.

Value

A list containing the features/metrics calculated for points, appended as new columns. Each element in the list corresponds to a particular buffer size.