mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 09:00:36 +00:00
Lines.
This commit is contained in:
parent
0c0e1ad8a7
commit
7c79f55682
11 changed files with 61 additions and 20 deletions
|
@ -1114,10 +1114,6 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
if ("AVE".equals(trainType) && trainNum != null) // klimatisierter Hochgeschwindigkeitszug
|
||||
return new Line(id, network, Product.HIGH_SPEED_TRAIN, "DNZ" + trainNum);
|
||||
|
||||
if ("Zug".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("Zuglinie".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("IR".equals(trainType) || "Interregio".equals(trainName) || "InterRegio".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "IR" + trainNum);
|
||||
if ("IRE".equals(trainType) || "Interregio-Express".equals(trainName))
|
||||
|
@ -1128,6 +1124,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
return new Line(id, network, Product.REGIONAL_TRAIN, "RE" + trainNum);
|
||||
if (trainType == null && trainNum != null && P_LINE_RE.matcher(trainNum).matches())
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, trainNum);
|
||||
if ("RE6a".equals(trainNum) && trainType == null && trainName == null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, trainNum);
|
||||
if ("RE3 / RB30".equals(trainNum) && trainType == null && trainName == null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "RE3/RB30");
|
||||
if ("Regionalexpress".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("R-Bahn".equals(trainName))
|
||||
|
@ -1210,6 +1210,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
return new Line(id, network, Product.REGIONAL_TRAIN, "VBG" + trainNum);
|
||||
if ("CB".equals(trainType) || "City-Bahn Chemnitz".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "CB" + trainNum);
|
||||
if (trainType == null && ("C11".equals(trainNum) || "C13".equals(trainNum) || "C14".equals(trainNum) || "C15".equals(trainNum)))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, trainNum);
|
||||
if ("VEC".equals(trainType) || "vectus Verkehrsgesellschaft".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "VEC" + trainNum);
|
||||
if ("HzL".equals(trainType) || "Hohenzollerische Landesbahn AG".equals(trainName))
|
||||
|
@ -1301,6 +1303,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
return new Line(id, network, Product.REGIONAL_TRAIN, "erx" + trainNum);
|
||||
if (("ERX".equals(trainType) || "Erixx".equals(trainName)) && trainNum != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "ERX" + trainNum);
|
||||
if (("SWE".equals(trainType) || "Südwestdeutsche Verkehrs-AG".equals(trainName)) && trainNum != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "SWE" + trainNum);
|
||||
if ("SWEG-Zug".equals(trainName)) // Südwestdeutschen Verkehrs-Aktiengesellschaft
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "SWEG" + trainNum);
|
||||
if ("SWEG-Zug".equals(longName))
|
||||
|
@ -1398,6 +1402,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
if (("SE".equals(trainType) || "ABELLIO Rail Mitteldeutschland GmbH".equals(trainName)) && trainNum != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "SE" + trainNum);
|
||||
|
||||
if (("BSB".equals(trainType) || "Breisgau-S-Bahn Gmbh".equals(trainName)) && trainNum != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "BSB" + trainNum);
|
||||
if ("BSB-Zug".equals(trainName) && trainNum != null) // Breisgau-S-Bahn
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, trainNum);
|
||||
if ("BSB-Zug".equals(trainName) && trainNum == null)
|
||||
|
@ -1417,8 +1423,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
if ("RT".equals(trainType) || "RegioTram".equals(trainName))
|
||||
return new Line(id, network, Product.TRAM, "RT" + trainNum);
|
||||
|
||||
if ("Bus".equals(trainType))
|
||||
return new Line(id, network, Product.BUS, "" + trainNum);
|
||||
if ("Bus".equals(trainType) && trainNum != null)
|
||||
return new Line(id, network, Product.BUS, trainNum);
|
||||
if ("Bus".equals(longName) && symbol == null)
|
||||
return new Line(id, network, Product.BUS, longName);
|
||||
if ("SEV".equals(trainType) || "SEV".equals(trainNum) || "SEV".equals(trainName) || "SEV".equals(symbol) || "BSV".equals(trainType)
|
||||
|| "Ersatzverkehr".equals(trainName) || "Schienenersatzverkehr".equals(trainName))
|
||||
return new Line(id, network, Product.BUS, "SEV" + trainNumStr);
|
||||
|
@ -1434,6 +1442,12 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
if ("SB".equals(trainType)) // Seilbahn
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "SB" + trainNum);
|
||||
|
||||
if ("Zug".equals(trainName) && symbol != null)
|
||||
return new Line(id, network, null, symbol);
|
||||
if ("Zug".equals(longName) && symbol == null)
|
||||
return new Line(id, network, null, "Zug");
|
||||
if ("Zuglinie".equals(trainName) && symbol != null)
|
||||
return new Line(id, network, null, symbol);
|
||||
if ("ZUG".equals(trainType) && trainNum != null)
|
||||
return new Line(id, network, null, trainNum);
|
||||
if (symbol != null && P_LINE_NUMBER.matcher(symbol).matches() && trainType == null && trainName == null)
|
||||
|
|
|
@ -3422,6 +3422,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
return Product.HIGH_SPEED_TRAIN;
|
||||
if ("TLK".equals(ucType)) // Tanie Linie Kolejowe, Polen
|
||||
return Product.HIGH_SPEED_TRAIN;
|
||||
if ("PKP".equals(ucType)) // Polskie Koleje Państwowe (Polnische Staatsbahnen)
|
||||
return Product.HIGH_SPEED_TRAIN;
|
||||
if ("EIP".equals(ucType)) // Express Intercity Premium
|
||||
return Product.HIGH_SPEED_TRAIN;
|
||||
if ("INT".equals(ucType)) // Zürich-Brüssel - Budapest-Istanbul
|
||||
|
@ -3440,6 +3442,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
return Product.REGIONAL_TRAIN;
|
||||
if ("RE".equals(ucType)) // RegionalExpress
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("ER".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("DB".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("IR".equals(ucType)) // Interregio
|
||||
|
@ -3720,6 +3724,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
return Product.BUS;
|
||||
|
||||
// Phone
|
||||
if ("RUFBUS".equals(ucType))
|
||||
return Product.ON_DEMAND;
|
||||
if (ucType.startsWith("AST")) // Anruf-Sammel-Taxi
|
||||
return Product.ON_DEMAND;
|
||||
if (ucType.startsWith("ALT")) // Anruf-Linien-Taxi
|
||||
|
|
|
@ -72,6 +72,8 @@ public class AvvProvider extends AbstractEfaProvider
|
|||
{
|
||||
if ("Regionalbahn".equals(trainName) && symbol != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("Staudenbahn SVG".equals(trainNum) && trainType == null && trainName == null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "SVG");
|
||||
|
||||
// Streikfahrplan
|
||||
if ("R1S".equals(symbol))
|
||||
|
|
|
@ -59,8 +59,6 @@ public class GvhProvider extends AbstractEfaProvider
|
|||
{
|
||||
if ("S4".equals(trainNum))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "S4");
|
||||
if ("Bus".equals(longName) && symbol == null)
|
||||
return new Line(id, network, Product.BUS, longName);
|
||||
if (longName != null && longName.startsWith("Bus ") && name != null)
|
||||
return new Line(id, network, Product.BUS, name);
|
||||
}
|
||||
|
|
|
@ -133,6 +133,9 @@ public class NasaProvider extends AbstractHafasProvider
|
|||
if ("DAMPFZUG".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
|
||||
if ("DPS".equals(ucType))
|
||||
return Product.SUBURBAN_TRAIN;
|
||||
|
||||
if ("RUFBUS".equals(ucType)) // Rufbus
|
||||
return Product.BUS;
|
||||
if ("RBS".equals(ucType)) // Rufbus
|
||||
|
|
|
@ -103,6 +103,9 @@ public class SfProvider extends AbstractEfaProvider
|
|||
&& ("DUBLIN/DALY".equals(name) || "Dublin Pleasanton / Daly City".equals(name)))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "DUBL/DALY");
|
||||
|
||||
if ("BAB".equals(symbol) && "BABY BULLET".equals(trainNum)) // Caltrain Baby Bullet
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "BAB");
|
||||
|
||||
if ("LOC".equals(symbol) && "LOCAL".equals(name))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "Local");
|
||||
if ("CAP".equals(symbol) && "CAPITOL".equals(name))
|
||||
|
|
|
@ -102,13 +102,13 @@ public class SydneyProvider extends AbstractEfaProvider
|
|||
return new Line(id, network, Product.SUBURBAN_TRAIN, "HUN");
|
||||
if ("SWR".equals(symbol)) // South West Rail Link
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "SWR");
|
||||
if ("NRC".equals(symbol)) // North Coast NSW Line
|
||||
if ("NRC".equals(symbol) || (symbol != null && symbol.startsWith("North Coast NSW Line")))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "NRC");
|
||||
if ("WST".equals(symbol)) // Western NSW Line
|
||||
if ("WST".equals(symbol) || (symbol != null && symbol.startsWith("Western NSW Line")))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "WST");
|
||||
if ("STH".equals(symbol)) // Southern NSW Line
|
||||
if ("STH".equals(symbol) || (symbol != null && symbol.startsWith("Southern NSW Line")))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "STH");
|
||||
if ("NRW".equals(symbol)) // North Western NSW Line
|
||||
if ("NRW".equals(symbol) || (symbol != null && symbol.startsWith("North Western NSW Line")))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "NRW");
|
||||
|
||||
if ("T1".equals(symbol) || "T1 North Shore & Northern Line".equals(symbol) || "T1 North Shore and Northern Line".equals(symbol)
|
||||
|
@ -164,6 +164,8 @@ public class SydneyProvider extends AbstractEfaProvider
|
|||
return new Line(id, network, Product.FERRY, "LneCv");
|
||||
if ("EmpBa".equals(symbol) || "Woy Woy to Empire Bay Ferry".equals(name))
|
||||
return new Line(id, network, Product.FERRY, "EmpBa");
|
||||
if ("Stkn".equals(symbol) || "Stockton Ferry".equals(name))
|
||||
return new Line(id, network, Product.FERRY, "Stkn");
|
||||
|
||||
throw new IllegalStateException("cannot normalize mot='" + mot + "' symbol='" + symbol + "' name='" + name + "' long='" + longName
|
||||
+ "' trainType='" + trainType + "' trainNum='" + trainNum + "' trainName='" + trainName + "'");
|
||||
|
|
|
@ -74,8 +74,6 @@ public class VmsProvider extends AbstractEfaProvider
|
|||
return new Line(id, network, Product.REGIONAL_TRAIN, "CB");
|
||||
if ("CityBahn".equals(longName) && "C11".equals(symbol))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if (trainType == null && ("C11".equals(trainNum) || "C13".equals(trainNum) || "C14".equals(trainNum) || "C15".equals(trainNum)))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, trainNum);
|
||||
if ("Zug".equals(longName) && ("C11".equals(symbol) || "C13".equals(symbol) || "C14".equals(symbol) || "C15".equals(symbol)))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
|
||||
|
|
|
@ -91,14 +91,9 @@ public class VrrProvider extends AbstractEfaProvider
|
|||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("NordWestBahn".equals(trainName) && symbol != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("RE6a".equals(trainNum) && trainType == null && trainName == null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, trainNum);
|
||||
|
||||
if (trainType == null && "SEV7".equals(trainNum))
|
||||
return new Line(id, network, Product.BUS, trainNum);
|
||||
|
||||
if ("Zug".equals(longName))
|
||||
return new Line(id, network, null, "Zug");
|
||||
}
|
||||
else if ("11".equals(mot))
|
||||
{
|
||||
|
|
|
@ -63,8 +63,10 @@ public class VvoProvider extends AbstractEfaProvider
|
|||
return new Line(id, network, Product.REGIONAL_TRAIN, "TLX");
|
||||
if ("Trilex".equals(trainName) && trainNum == null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "TLX");
|
||||
if ("U28".equals(symbol)) // Nationalparkbahn
|
||||
if ("U 28".equals(symbol)) // Nationalparkbahn
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "U28");
|
||||
if ("SB 71".equals(symbol)) // Städtebahn Sachsen
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "SB71");
|
||||
|
||||
if ("Fernbus".equals(trainName) && trainNum == null)
|
||||
return new Line(id, network, Product.BUS, trainName);
|
||||
|
|
|
@ -17,7 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Point;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -44,4 +48,18 @@ public class VvsProvider extends AbstractEfaProvider
|
|||
{
|
||||
return new Point[] { Point.fromDouble(48.784068, 9.181713) };
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Line parseLine(final @Nullable String id, final @Nullable String network, final @Nullable String mot, final @Nullable String symbol,
|
||||
final @Nullable String name, final @Nullable String longName, final @Nullable String trainType, final @Nullable String trainNum,
|
||||
final @Nullable String trainName)
|
||||
{
|
||||
if ("0".equals(mot))
|
||||
{
|
||||
if ("IC".equals(trainNum))
|
||||
return new Line(id, network, Product.HIGH_SPEED_TRAIN, trainNum);
|
||||
}
|
||||
|
||||
return super.parseLine(id, network, mot, symbol, name, longName, trainType, trainNum, trainName);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue