Creates a demand responsive transport representation of in an Area of Interest (AOI). The constructor takes a polygon (aoi), point population values (pop) and the number of virtual stations to plan as input. Then it retrieves the street network in the area of interest from OSM. Based on the OSM data a routing graph for walking and driving is created.

drt_drtm(
  model_name,
  aoi,
  pop,
  n_vir,
  m_seg = 100,
  calc_energy = e_walkDrive_pop
)

Arguments

model_name

character, name of the drtm.

aoi

sf, polygon of the Area of Interest (AOI).

pop

sf, centroids of a hectaraster population dataset covering the full extent of the 'aoi' input (column name for population must be 'n').

n_vir

numeric, number of the virtual stations to place.

m_seg

numeric, resolution of the road segmentation in meters.

calc_energy

function, energy calculation function.

Value

A demand responsive transport model of class 'drtm'.

Examples

# Example data aoi <- sf::st_read(system.file("example.gpkg", package="drtplanr"), layer = "aoi")
#> Reading layer `aoi' from data source `/home/runner/work/_temp/Library/drtplanr/example.gpkg' using driver `GPKG' #> Simple feature collection with 1 feature and 6 fields #> geometry type: POLYGON #> dimension: XY #> bbox: xmin: 7.4947 ymin: 47.0366 xmax: 7.5359 ymax: 47.0599 #> geographic CRS: WGS 84
pop <- sf::st_read(system.file("example.gpkg", package="drtplanr"), layer = "pop")
#> Reading layer `pop' from data source `/home/runner/work/_temp/Library/drtplanr/example.gpkg' using driver `GPKG' #> Simple feature collection with 150 features and 4 fields #> geometry type: POINT #> dimension: XY #> bbox: xmin: 7.496534 ymin: 47.04012 xmax: 7.524167 ymax: 47.0581 #> geographic CRS: WGS 84
# Create model m <- drt_drtm( model_name = "Jegenstorf", aoi = aoi, pop = pop, n_vir = 10, m_seg = 100 )
#> 2020-05-25 18:29:31 Get data from OSM: Streets 'roa', bus stops and rail stations 'sta'
#> 2020-05-25 18:29:49 Create routing graphs for 'foot' and 'mcar'
#> 2020-05-25 18:29:50 Mask layers 'roa', 'pop' and 'sta' by 'aoi'
#> 2020-05-25 18:29:50 Extract possible station locations 'seg' from street segments
#> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 7.0.0
#> 2020-05-25 18:29:50 Route driving times of 'seg' to the rail stations
#> 2020-05-25 18:29:51 Map stations 'sta' to segments 'seg' and set as constant
m
#> Error in diff(m$e$value): object 'm' not found