helper for reverse migration of Berlin station ids

This commit is contained in:
Andreas Schildbach 2013-01-16 15:18:43 +01:00
parent ee6199ce1c
commit 384dc47240
2 changed files with 28 additions and 0 deletions

View file

@ -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;
}
}