Can I take a cycle on this train?: Difference between revisions

From Open Rail Data Wiki
Cycles on trains - proposal
 
No edit summary
Line 12: Line 12:
* https://docs.google.com/spreadsheet/ccc?key=0AmGNdVG13yM4dFl5aV9nZXdRdEtrZEhibWhDR3B0QlE
* https://docs.google.com/spreadsheet/ccc?key=0AmGNdVG13yM4dFl5aV9nZXdRdEtrZEhibWhDR3B0QlE


== Use-cases ==
== Pseudo-code ==
 
<nowiki>function CanCarryBike()
{
  SELECT * FROM BikeRules WHERE Operating_Co IS atoc_code
 
  foreach rule in rules {
    if (joining station or leaving station in rule.Stations
      AND eval(rule.Logic)) {
      return rule.Bike;
    }
  }
  return 'Yes';
}</nowiki>
 
== Use-case ==


Our goal is to enable a route-finder like http://www.opentraintimes.com/ to have a
Our goal is to enable a route-finder like http://www.opentraintimes.com/ to have a
Line 19: Line 34:


checkbox that would avoid routes and times where bikes are not allowed.
checkbox that would avoid routes and times where bikes are not allowed.
== Folding bikes ==
Please note that you can '''always''' carry a folded-up folding bike inside a bag on any train in the UK.

Revision as of 17:57, 13 October 2012

Can I take a cycle on this train?

We'd like to be able to determine if

  1. Yes, I can take a bicycle on board
  2. No, I can't or
  3. I need to book my bike in advance

This information has recently been collated for the UK at http://www.nationalrail.co.uk/passenger_services/cyclists/2012CyclingbyTrain.pdf.

As part of LOCO2's Off the Rails hackday we began to codify the information in this PDF into a format that can be used to programatically determine which restrictions apply to carrying my bike. The idea is that you only use the information in a train's SCHEDULE record and the information in this Google Fusion Table:

Pseudo-code

function CanCarryBike()
{
  SELECT * FROM BikeRules WHERE Operating_Co IS atoc_code

  foreach rule in rules {
    if (joining station or leaving station in rule.Stations
       AND eval(rule.Logic)) {
      return rule.Bike;
    }
  }
  return 'Yes';
}

Use-case

Our goal is to enable a route-finder like http://www.opentraintimes.com/ to have a

 [x] with a bike

checkbox that would avoid routes and times where bikes are not allowed.

Folding bikes

Please note that you can always carry a folded-up folding bike inside a bag on any train in the UK.