calculateRoute: Calculate route between two points

View source: R/calculateRoute.R

calculateRouteR Documentation

Calculate route between two points

Description

The route between two points is calculated for the given coordinates. The default values for rolling resistance and drag coefficient correspond to values found by Tengatti and Bigazzi (2018): Physical characteristics and resistance parameters of typical urban cyclists. brouterR ignores the bikerPower, totalMass, dragCoefficient, rollingResistance and maxSpeed available in the brouter routing profiles and uses the values provided via R instead. This functions needs the server to be set manually before running it with the setServers and then the startServers functions.

Usage

calculateRoute(
  startLat,
  startLon,
  endLat,
  endLon,
  bikerPower = 100,
  totalMass = 90,
  dragCoefficient = 0.559,
  rollingResistance = 0.0077,
  maxSpeed = 45,
  profile = "trekking",
  outputFormat = "df",
  serverNodeId = 1
)

Arguments

startLat

Latitude of start location

startLon

Longitude of start location

endLat

Latitude of end location

endLon

Longitude of end location

bikerPower

The total average power put on the pedals in Watts. Defaults to 100W

totalMass

The total weight of biker, bike and cargo in kg. Defaults to 90kg

dragCoefficient

The wind drag coefficient in m2. Defaults to 0.559

rollingResistance

The rolling resistance of the underground. Default value assumes dry asphalt, 0.0077

maxSpeed

The maximum speed achieved by the bike in km/h. Defaults to 45 km/h.

profile

Routing profile. Defaults to "trekking"

outputFormat

one of "df" or "linestring" (as an st_linestring object with XYZ dimensions). Defaults to "df"

serverNodeId

The node where the server is running on. Defaults to 1. Do not change for single core usage.

Value

Either a dataframe of the track (outputFormat="df"), or a st_linestring (outputFormat="linestring") containing elevation information


ivt-baug-ethz/brouterR documentation built on Dec. 9, 2024, 8:59 p.m.