mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 17:39:49 +00:00
Lines.
This commit is contained in:
parent
05391cab75
commit
966b248d50
13 changed files with 46 additions and 21 deletions
|
@ -1351,6 +1351,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
return new Line(id, network, Product.REGIONAL_TRAIN, "OPB" + trainNum);
|
||||
if (("OPX".equals(trainType) || "oberpfalz-express".equals(trainName)) && trainNum != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "OPX" + trainNum);
|
||||
if (("LEO".equals(trainType) || "Chiemgauer Lokalbahn".equals(trainName)) && trainNum != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "LEO" + trainNum);
|
||||
if (("V6".equals(trainType) || "vlexx".equals(trainName)) && trainNum != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "vlexx" + trainNum);
|
||||
if (("ARZ".equals(trainType) || "Autoreisezug".equals(trainName)) && trainNum != null)
|
||||
|
|
|
@ -3002,6 +3002,10 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
if ("SL".equals(ucType)) // Sessel-Lift
|
||||
return Product.CABLECAR;
|
||||
|
||||
// Unknown product
|
||||
if ("E".equals(ucType))
|
||||
return null;
|
||||
|
||||
throw new IllegalStateException("cannot normalize type '" + type + "'");
|
||||
}
|
||||
|
||||
|
|
|
@ -167,8 +167,6 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
{
|
||||
final String ucType = type.toUpperCase();
|
||||
|
||||
if ("E".equals(ucType))
|
||||
return null;
|
||||
if ("N".equals(ucType))
|
||||
return null;
|
||||
|
||||
|
|
|
@ -79,6 +79,13 @@ public class BayernProvider extends AbstractEfaProvider
|
|||
if ("ABR".equals(trainType) || "ABELLIO Rail NRW GmbH".equals(trainName))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "ABR" + trainNum);
|
||||
}
|
||||
else if ("5".equals(mot))
|
||||
{
|
||||
if (name != null && name.startsWith("Stadtbus Linie ")) // Lindau
|
||||
return super.parseLine(id, network, mot, symbol, name.substring(15), longName, trainType, trainNum, trainName);
|
||||
else
|
||||
return super.parseLine(id, network, mot, symbol, name, longName, trainType, trainNum, trainName);
|
||||
}
|
||||
else if ("16".equals(mot))
|
||||
{
|
||||
if ("EC".equals(trainType) && trainNum != null)
|
||||
|
|
|
@ -20,6 +20,10 @@ package de.schildbach.pte;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.Style;
|
||||
|
||||
/**
|
||||
|
@ -42,6 +46,20 @@ public class GvhProvider extends AbstractEfaProvider
|
|||
setSessionCookieName("HASESSIONID");
|
||||
}
|
||||
|
||||
@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 ("S4".equals(trainNum))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "S4");
|
||||
}
|
||||
|
||||
return super.parseLine(id, network, mot, symbol, name, longName, trainType, trainNum, trainName);
|
||||
}
|
||||
|
||||
private static final Map<String, Style> STYLES = new HashMap<String, Style>();
|
||||
|
||||
static
|
||||
|
|
|
@ -187,9 +187,6 @@ public class NasaProvider extends AbstractHafasProvider
|
|||
if ("DAMPFZUG".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
|
||||
if ("E".equals(ucType)) // Stadtbahn Karlsruhe: S4/S31/xxxxx
|
||||
return Product.SUBURBAN_TRAIN;
|
||||
|
||||
if ("RUFBUS".equals(ucType)) // Rufbus
|
||||
return Product.BUS;
|
||||
if ("RBS".equals(ucType)) // Rufbus
|
||||
|
|
|
@ -150,8 +150,6 @@ public class NsProvider extends AbstractHafasProvider
|
|||
|
||||
if (ucType.equals("SPR"))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if (ucType.equals("E")) // Budapest, Ungarn
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if (ucType.equals("N")) // Avignon
|
||||
return Product.REGIONAL_TRAIN;
|
||||
|
||||
|
|
|
@ -207,8 +207,6 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
return Product.REGIONAL_TRAIN;
|
||||
if (ucType.equals("DPN")) // Connections only? TODO nicht evtl. doch eher ne S-Bahn?
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if (ucType.equals("E")) // Budapest, Ungarn
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if (ucType.equals("IP")) // Ozd, Ungarn
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if (ucType.equals("N")) // Frankreich, Tours
|
||||
|
|
|
@ -140,8 +140,6 @@ public class PlProvider extends AbstractHafasProvider
|
|||
return Product.REGIONAL_TRAIN;
|
||||
if ("KS".equals(ucType)) // Koleje Śląskie
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("E".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("DB".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("REG".equals(ucType))
|
||||
|
|
|
@ -98,8 +98,6 @@ public class RtProvider extends AbstractHafasProvider
|
|||
{
|
||||
final String ucType = type.toUpperCase();
|
||||
|
||||
if ("E".equals(ucType)) // Romania, Croatia
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("N".equals(ucType)) // Frankreich, Tours
|
||||
return Product.REGIONAL_TRAIN;
|
||||
|
||||
|
|
|
@ -146,9 +146,9 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
|
||||
if ("IN".equals(ucType)) // Italien Roma-Lecce
|
||||
return Product.HIGH_SPEED_TRAIN;
|
||||
if ("IT".equals(ucType)) // Italien Roma-Venezia
|
||||
return Product.HIGH_SPEED_TRAIN;
|
||||
|
||||
if ("E".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("T".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("TE2".equals(ucType)) // Basel - Strasbourg
|
||||
|
|
|
@ -102,11 +102,19 @@ 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
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "NRC");
|
||||
if ("WST".equals(symbol)) // Western NSW Line
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "WST");
|
||||
if ("STH".equals(symbol)) // Southern NSW Line
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "STH");
|
||||
|
||||
if ("T1".equals(symbol) || "T1 North Shore & Northern Line".equals(symbol) || "T1 Northern Line".equals(symbol)
|
||||
|| "T1 Western Line".equals(symbol))
|
||||
if ("T1".equals(symbol) || "T1 North Shore & Northern Line".equals(symbol) || "T1 North Shore and Northern Line".equals(symbol)
|
||||
|| "T1 Northern Line".equals(symbol) || "T1 Western Line".equals(symbol)
|
||||
|| "T1 North Shore, Northern & Western Line".equals(symbol))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "T1");
|
||||
if ("T2".equals(symbol) || "T2 Inner West & South Line".equals(symbol) || "T2 Airport Line".equals(symbol))
|
||||
if ("T2".equals(symbol) || "T2 Inner West & South Line".equals(symbol) || "T2 Airport Line".equals(symbol)
|
||||
|| "T2 Airport, Inner West & South Line".equals(symbol))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "T2");
|
||||
if ("T3".equals(symbol) || "T3 Bankstown Line".equals(symbol))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "T3");
|
||||
|
@ -150,6 +158,8 @@ public class SydneyProvider extends AbstractEfaProvider
|
|||
return new Line(id, network, Product.FERRY, symbol);
|
||||
if ("MFF".equals(symbol) || "Manly Fast Ferry".equals(name))
|
||||
return new Line(id, network, Product.FERRY, "MFF");
|
||||
if ("LneCv".equals(symbol) || "Lane Cove Ferry".equals(name))
|
||||
return new Line(id, network, Product.FERRY, "LneCv");
|
||||
|
||||
throw new IllegalStateException("cannot normalize mot='" + mot + "' symbol='" + symbol + "' name='" + name + "' long='" + longName
|
||||
+ "' trainType='" + trainType + "' trainNum='" + trainNum + "' trainName='" + trainName + "'");
|
||||
|
|
|
@ -156,9 +156,6 @@ public class VsnProvider extends AbstractHafasProvider
|
|||
{
|
||||
final String ucType = type.toUpperCase();
|
||||
|
||||
if ("E".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
|
||||
if ("T84".equals(ucType))
|
||||
return null;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue