gh_get_spt: Get the shortest path tree for a given start point

Description Usage Arguments Examples

View source: R/spt-endpoint.R

Description

Get the shortest path tree for a given start point

Usage

1
2
gh_get_spt(start_point, time_limit = 600, distance_limit = -1,
  columns = gh_spt_columns(), reverse_flow = FALSE, profile = "car")

Arguments

start_point

The start point as (lat, lon) pair.

time_limit

The travel time limit in seconds. Ignored if distance_limit > 0.

distance_limit

The distance limit in meters.

columns

The columns to be returned. See gh_spt_columns and gh_available_spt_columns for available columns.

reverse_flow

Use reverse_flow = TRUE to change the flow direction.

profile

The profile for which the spt should be calculated.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
if (FALSE) {
  start_point <- c(52.53961, 13.36487)

  columns <- gh_spt_columns(
    prev_longitude = TRUE,
    prev_latitude = TRUE,
    prev_time = TRUE
  )

  points_sf <- gh_get_spt(start_point, time_limit = 180, columns = columns) %>%
    gh_as_sf()
}

graphhopper documentation built on Feb. 6, 2021, 5:05 p.m.