Skip to content

Add Dutch fare service#2571

Merged
abyrd merged 13 commits into
opentripplanner:masterfrom
plannerstack:20170220_master_dutch_fares
May 23, 2018
Merged

Add Dutch fare service#2571
abyrd merged 13 commits into
opentripplanner:masterfrom
plannerstack:20170220_master_dutch_fares

Conversation

@abyrd

@abyrd abyrd commented May 19, 2018

Copy link
Copy Markdown
Member

Plannerstack has developed a Dutch fare service. The developer states the code could stand to be revised / improved, so they were hesitating to integrate it into mainline OTP, but it's already used in production and should not interfere with any other part of OTP.

skinkie and others added 12 commits May 2, 2016 03:51
This service requires proprietary fare_attributes.txt and fare_rules.txt brought to you by Bliksem Labs B.V.
{
    fares: {
        type: "dutch",
        currency: "EUR"
    }
}
OpenTripPlanner now fetches a random fare_attribute and assumes the entire feed is in this currency. It also ignores the build.config. Since the DutchFare table contains Distance Units in XXX currency it might (and thus: will) happen that XXX as currency ends up in the client.
@abyrd

abyrd commented May 19, 2018

Copy link
Copy Markdown
Member Author

Everything here is isolated from existing code except that currency is hard-coded to EUR in 607fe0a:

"OpenTripPlanner now fetches a random fare_attribute and assumes the entire feed is in this currency. It also ignores the build.config. Since the DutchFare table contains Distance Units in XXX currency it might (and thus: will) happen that XXX as currency ends up in the client." @skinkie we will have to find a way to fix this.

@abyrd

abyrd commented May 19, 2018

Copy link
Copy Markdown
Member Author

We just discussed this. Some clarification: each train ride in NL has a certain cost in Euros if ridden in isolation. However costs are distance-based and digressive when multiple trips are chained together, and different operators may have different Euro-km conversion rates. In order to communicate this information in GTFS, there are separate fares with units of distance and units of Euros (these are expressed as two different currencies because it's the cleanest way to get the data through the GTFS loader with standard fields). OTP does not properly handle multiple currencies in the fare input - it assumes everything is in the same currency.

in the original form, the PR forced all fare services to use Euros.
@abyrd

abyrd commented May 19, 2018

Copy link
Copy Markdown
Member Author

All fares are forced to EUR by above commit 0cce407

@abyrd

abyrd commented May 23, 2018

Copy link
Copy Markdown
Member Author

The changes introduced by this PR are now self-contained and do not affect the rest of OTP code. The above test failure is due to a test on memory-hungry deprecated code, which has been fixed in Master (as seen by the second build success). Merging.

@abyrd
abyrd merged commit c9ecfc3 into opentripplanner:master May 23, 2018
@abyrd
abyrd deleted the 20170220_master_dutch_fares branch May 23, 2018 11:58
@skinkie skinkie mentioned this pull request Nov 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants