mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-21 01:39:51 +00:00
helper for reverse migration of Berlin station ids
This commit is contained in:
parent
ee6199ce1c
commit
384dc47240
2 changed files with 28 additions and 0 deletions
|
@ -742,4 +742,20 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
{
|
||||
return Berlin.BOUNDARY;
|
||||
}
|
||||
|
||||
public static int migrateStationIdReverse(final int stationId)
|
||||
{
|
||||
if (stationId < 100000000 || stationId >= 1000000000)
|
||||
return stationId;
|
||||
|
||||
final int low = stationId % 100000;
|
||||
final int middle = (stationId % 100000000) - low;
|
||||
|
||||
if (middle != 1000000)
|
||||
return stationId;
|
||||
|
||||
final int high = stationId - (stationId % 100000000);
|
||||
|
||||
return high / 1000 + low;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue