aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tasks
diff options
context:
space:
mode:
authorTeddy Wing2018-03-23 12:26:04 +0100
committerTeddy Wing2018-03-27 16:46:18 +0200
commit4bc33f14a148feb4056db1a2839303b07c67a6b3 (patch)
tree7e0c057da62ed5efb6d2376bd1e45726b2a79e25 /lib/tasks
parentd3ab2606ffd3dcb94a27d7b4e7c899f1238d3a53 (diff)
downloadchouette-core-4bc33f14a148feb4056db1a2839303b07c67a6b3.tar.bz2
Add `TomTom::Matrix`
A new component to the `TomTom` module that asks TomTom's Matrix API endpoint (https://developer.tomtom.com/online-routing/online-routing-documentation/matrix-routing) to compute `WayCost`s. The matrix API will give us all costs between each pair of coordinates. This will enable us to provide costs for any combination of points in a journey pattern. Given a list of `WayCost`s, it will send all points from those costs to the matrix API and return a list of all non-zero `WayCost`s between all pairs of coordinates. `points_from_way_costs()` extracts unique coordinates from the `WayCost`s. `points_as_params()` builds a list of points in the format expected by the matrix API. The response from the matrix API is formatted as a two-dimensional array consisting of rows and columns that pair each "origin" point with each "destination" point. We loop through this matrix and construct new `WayCost` objects for each pair of coordinates. At the moment, I haven't figured out how I want to save `WayCost` IDs when creating the new pairs. Leaving that for later. Refs #6222
Diffstat (limited to 'lib/tasks')
0 files changed, 0 insertions, 0 deletions