KatsuteDev/OneMTA

Add support for station transfer data

Katsute opened this issue · 6 comments

Prerequisites

  • I have checked that no other similar feature request already exists.
  • I have checked discussions.
  • This feature request makes sense for the project.
  • I have checked that this feature does not already exist.
  • I am running the latest release version.

Feature

Add support for station transfer information. Keys are non-unique, csv parser may need to be altered.

Sample csv:

from_stop_id,to_stop_id,transfer_type,min_transfer_time
101,101,2,180
103,103,2,180
104,104,2,180
106,106,2,180
107,107,2,180

This method might need to be updated:

public final List<String> getRow(final String keyHeader, final String key){
final int index = getHeaderIndex(keyHeader);
if(index == -1) return null;
for(final List<String> row : rows)
if(row.get(index).equals(key))
return new ArrayList<>(row);
return null;
}

Reason

Developers may want transfer information.

@sinon-bot obranch reference

New branch created reference@61f6a85

This branch was created by @Katsute.

Add method to stop getTransfers() that returns an array of stops. Only generate the array when requested the first time, keep null or use existing to prevent infinite loop.

Do not include self as a valid transfer stop. Most dual platform stations do not have transfer walkways, only paid street transfers.

@sinon-bot branch transfer

New branch created transfer@44b47de

This branch was created by @Katsute.