| Age | Commit message (Collapse) | Author |
|
af83/6095-route--calculate-distance-and-time-cost-between-stops
Calculate distance and time cost between Route stops. Refs #6095
|
|
We say `TomTom` is disabled when no API key is present. If this is the
case, the `after_save` callback that uses it shouldn't be executed.
I had to change my `API_KEY` constant to an instance variable to be able
to change it for testing.
Refs #6095
|
|
|
|
Refs #6028 small changes in model attribute for CC
|
|
A JSON serialiser for a collection of `WayCost`s. This will be used to
store `WayCost`s for a `Chouette::Route` in the `Route#costs` JSON
field.
Refs #6095
|
|
A new class that converts a list of `StopArea`s to `WayCost`s. This will
be called from `Chouette::Route` to get `WayCost`s from its stops, which
will then be JSON serialised and stored in `Route#costs`.
Update `WayCost`:
* Remove comment about calculating the ID automatically. It actually
needs to be the same as the `JourneyPattern#cost` ID (`key`), which is
a string with the IDs of the departure and arrival stops.
* Make `#==` check that `id`s are the same, which necessitates making
`id` a reader.
Refs #6095
|
|
Extract some code from `#batch` to allow us to test the part that takes
distance and time values from the response JSON and put fill them into
`WayCost`s.
In order for the test to work, had to add an `#==` method to `WayCost`
and make `distance` and `time` accessors.
The JSON file fixture is a copy of a response from the TomTom `/batch`
API. The file is pretty big. I'm not sure if maybe I should condense it
for the sake of test performance.
Refs #6095
|
|
Rename to `#convert_way_costs` since this method now lives inside the
`TomTom::Batch` class, so that part of the name became redundant.
Refs #6095
|
|
This change enables us to call `TomTom.batch(...)` instead of
`TomTom.new.batch(...)` a couple commits ago. This is nice because the
initialisation was kind of unnecessary for users of the class.
Refs #6095
|
|
Change the `TomTom::Batch` to `module ... class ...` syntax instead. I
like this better in this case.
Refs #6095
|
|
Separate the functionality a little better by moving the `/batch`
endpoint code into a new class. The goal here is also to lay the
foundation for being able to call `TomTom.batch()` instead of
`TomTom.new.batch()`.
Refs #6095
|
|
Look through the API response from `/batch` and extract the distance &
time values given to us by TomTom. These are inserted in the `WayCost`s
given to use in the argument to `#batch`.
At the end, we get a list of `WayCost`s that are completely filled with
distance & time values.
We need to split up this code a bit to make it more testable, but
already this seems to function correctly.
Refs #6095
|
|
Make the TomTom API key accessible to the application. It gets set in
Docker via an environment variable. Still need to work out how we're
setting it in development. For now I'm just saving it in `secrets.yml`
without committing it.
Refs #6095
|
|
This reverts commit f28a4b2c5b348bc12b455aa0cd76a9513103aea7.
As stated in that commit, I'm going to use the `/batch` endpoint instead
of `/calculateRoute` because I know that's already working.
|
|
A new method to provide access to the `/calculateRoute` endpoint, which
calculates costs for a single route through a bunch of waypoints.
This doesn't work currently because the API requires that I send
`supportingPoints` in the body of the request. Since I'm not too clear
on what those are, I'm going to cut off development of this method here
and just use `#batch` instead for my purposes.
My idea was to use this endpoint instead of `/batch` to allow us to
calculate a single route instead of having the API do `/calculateRoute`
for each of our point pairs. This seemed like it would be more
efficient, and give us our distance and time costs between each waypoint
all in one go, but since I'm not clear on how to use this API and
whether it will give us the correct data, I'm going to stick with
`/batch`. I'll probably be reverting this code. Just committing it now
in case it becomes useful in the future.
Refs #6095
|
|
I had copy-pasted these from the example in the docs
(https://developer.tomtom.com/online-routing/online-routing-documentation/batch-routing),
but I don't think we want some of these. For `maxAlternatives`, it's
already 0 by default according to their docs, and the others don't
really make sense for us because we want a general routing instead of
one based on traffic or time of day.
Refs #6095
|
|
For now, hard-code 'bus' as the travel mode. This feature is currently
only going to be used for Ouibus, so we want to be able to request in
'bus' mode, but for now don't have time to think about how to make it
more extensible to other travel modes and operators.
Refs #6095
|
|
These served during development but are no longer needed.
Refs #6095
|
|
Provides an interface to communicate with the TomTom API. Currently
includes a method `#batch` to make a batch routing request
(https://developer.tomtom.com/online-routing/online-routing-documentation/batch-routing).
Left a bunch of development-related code in just to preserve my
in-progress stages. Originally I was told to use the matrix routing API,
but that turned out to not match what we wanted. Namely, matrix routing
would produce a table with every point routed with every other point. We
instead want routes of each segment in a line, in order (or, just the
diagonal of the matrix). Using the batch API allows us to get the routes
we need without doing unnecessary work.
Update the `WayCost` class to provide `departure` and `arrival` methods
as readers, and make `id` an optional parameter for now. (We still need
to figure out how we're dealing with ID.)
Refs #6095
|
|
We don't have these values until after the TomTom API calculation, but
we need to create `WayCost` objects before then. Give these values
defaults so we don't have to set them.
Refs #6095
|
|
A data class to hold the distance and time cost required to go between
departure and arrival points.
Refs #6095
|
|
6068 simple exporter
|
|
|
|
config/database/jenkins.yml in ci.yml. Refs #6047
|
|
|
|
|
|
SimpleImporter#dump_csv_from_context. Refs #5924
|
|
Simple exporter. Refs #6068
|
|
|
|
|
|
|
|
|
|
Add a mechanism to allow for several rows in the csv per single object
in the collection.
|
|
|
|
|
|
5878 Add ComplianceCheck#show
|
|
ComplianceControl
|
|
|
|
|
|
|
|
|
|
- The checksum computing for VehicleJourneyAtStops
- Offsets calculation in VehicleJourneys
|
|
Mostly add a way to override the default behaviour and process each row
its own way
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4963 import cron should abort old imports
|