Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse error: "transfer_type" in transfers.txt can be empty #16

Open
iblis-ms opened this issue Sep 21, 2021 · 1 comment
Open

Parse error: "transfer_type" in transfers.txt can be empty #16

iblis-ms opened this issue Sep 21, 2021 · 1 comment

Comments

@iblis-ms
Copy link

Hi,
Based on:
https://gtfs.org/reference/static/#transferstxt

Indicates the type of connection for the specified (from_stop_id, to_stop_id) pair. Valid options are:

0 or empty - Recommended transfer point between routes.
1 - Timed transfer point between two routes. The departing vehicle is expected to wait for the arriving one and leave sufficient time for a rider to transfer between routes.
2 - Transfer requires a minimum amount of time between arrival and departure to ensure a connection. The time required to transfer is specified by min_transfer_time.
3 - Transfers are not possible between routes at the location.

Therefore, the 'transfer_type' values can be empty, so:

inline Result Feed::add_transfer(const ParsedCsvRow & row)
{
  Transfer transfer;
  try
  {
    // Required fields:
    transfer.from_stop_id = row.at("from_stop_id");
    transfer.to_stop_id = row.at("to_stop_id");
    set_field(transfer.transfer_type, row, "transfer_type", false);

    // Optional:
    set_field(transfer.min_transfer_time, row, "min_transfer_time");
  }

should be changed to:
set_field(transfer.transfer_type, row, "transfer_type");

@mesozoic-drones
Copy link
Contributor

Thank you for feedback!
While choosing which type of field to set (required or not) I used Google's official GTFS reference:
https://developers.google.com/transit/gtfs/reference?csw=1

In this reference "transfer_type" is marked as required field. But it could be empty.

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

No branches or pull requests

2 participants