A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/ipeaGIT/r5r/issues/265 below:

New `detailed_itineraries()` · Issue #265 · ipeaGIT/r5r · GitHub

I have rebuilt the detailed_itineraries() function to make it faster, more reliable, and add some cool new features. It's on the dev branch now, and I think we can move it to the master branch after we update the tests and documentation.

Some of the new features:

Reproducible example:

# load libraries
library("r5r")
library("data.table")
library("mapview")


# build transport network
data_path <- system.file("extdata/poa", package = "r5r")
r5r_core <- setup_r5(data_path)

# load origin/destination points
points <- read.csv(file.path(data_path, "poa_points_of_interest.csv"))

# load fare structure object
fare_structure_path <- system.file(
  "extdata/poa/fares/fares_poa.zip",
  package = "r5r"
)
fare_structure <- read_fare_structure(fare_structure_path)

# inputs
departure_datetime <- as.POSIXct("13-05-2019 14:00:00",
                                 format = "%d-%m-%Y %H:%M:%S")

# compute paths
dit <- detailed_itineraries(r5r_core,
                            origins = points[10,],
                            destinations = points[12,],
                            mode = c("WALK", "TRANSIT"),
                            departure_datetime = departure_datetime,
                            max_walk_dist = 1000,
                            max_trip_duration = 60,
                            fare_structure = fare_structure,
                            max_fare = 9,
                            shortest_path = F)

# visualise results
mapview(dit, zcol = "mode")

Map:

Data:

from_id from_lat from_lon to_id to_lat to_lon option departure_time total_duration total_distance total_fare segment mode cumulative_fare segment_duration wait distance route 1 farrapos_station -29.997721 -51.197618 praia_de_belas_shopping_center -30.049951 -51.228752 1 14:00:59 44.3333333333333 9460 8.37 1 WALK 0 4.56666666666667 0 174 2 farrapos_station -29.997721 -51.197618 praia_de_belas_shopping_center -30.049951 -51.228752 1 14:00:59 44.3333333333333 9460 8.37 2 RAIL 4.5 6.58333333333333 9.45 4796 LINHA1 3 farrapos_station -29.997721 -51.197618 praia_de_belas_shopping_center -30.049951 -51.228752 1 14:00:59 44.3333333333333 9460 8.37 3 WALK 4.5 5.73333333333333 0 256 4 farrapos_station -29.997721 -51.197618 praia_de_belas_shopping_center -30.049951 -51.228752 1 14:00:59 44.3333333333333 9460 8.37 4 BUS 8.37 10.4166666666667 4.41666666666667 4083 188 5 farrapos_station -29.997721 -51.197618 praia_de_belas_shopping_center -30.049951 -51.228752 1 14:00:59 44.3333333333333 9460 8.37 5 WALK 8.37 3.16666666666667 0 151 6 farrapos_station -29.997721 -51.197618 praia_de_belas_shopping_center -30.049951 -51.228752 2 14:00:59 52.1166666666667 8310 7.2 1 WALK 0 7.96666666666667 0 347 7 farrapos_station -29.997721 -51.197618 praia_de_belas_shopping_center -30.049951 -51.228752 2 14:00:59 52.1166666666667 8310 7.2 2 BUS 4.8 15.8666666666667 2.18333333333333 4310 703 8 farrapos_station -29.997721 -51.197618 praia_de_belas_shopping_center -30.049951 -51.228752 2 14:00:59 52.1166666666667 8310 7.2 3 WALK 4.8 12.5666666666667 0 653 9 farrapos_station -29.997721 -51.197618 praia_de_belas_shopping_center -30.049951 -51.228752 2 14:00:59 52.1166666666667 8310 7.2 4 BUS 7.2 7.5 2.86666666666667 2849 179 10 farrapos_station -29.997721 -51.197618 praia_de_belas_shopping_center -30.049951 -51.228752 2 14:00:59 52.1166666666667 8310 7.2 5 WALK 7.2 3.16666666666667 0 151

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4