mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 00:39:58 +00:00
Lines.
This commit is contained in:
parent
eb533aafe0
commit
62d84eaf33
14 changed files with 96 additions and 12 deletions
|
@ -1111,6 +1111,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("RB-Bahn".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if (trainType == null && "RB67/71".equals(trainNum))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, trainNum);
|
||||
if ("RE-Bahn".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("REX".equals(trainType)) // RegionalExpress, Österreich
|
||||
|
@ -1151,7 +1153,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
return new Line(id, network, Product.REGIONAL_TRAIN, "EB");
|
||||
if ("EBx".equals(trainType) || "Erfurter Bahn Express".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "EBx" + trainNum);
|
||||
if ("Erfurter Bahn Express".equals(longName))
|
||||
if ("Erfurter Bahn Express".equals(longName) && symbol == null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "EBx");
|
||||
if ("MRB".equals(trainType) || "Mitteldeutsche Regiobahn".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "MRB" + trainNum);
|
||||
|
@ -1161,7 +1163,9 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
return new Line(id, network, Product.REGIONAL_TRAIN, "NEB" + trainNum);
|
||||
if ("OE".equals(trainType) || "Ostdeutsche Eisenbahn GmbH".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "OE" + trainNum);
|
||||
if ("ODE".equals(trainType))
|
||||
if ("Ostdeutsche Eisenbahn GmbH".equals(longName) && symbol == null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "OE");
|
||||
if ("ODE".equals(trainType) && symbol != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("OLA".equals(trainType) || "Ostseeland Verkehr GmbH".equals(trainName))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "OLA" + trainNum);
|
||||
|
|
|
@ -50,6 +50,18 @@ public class AvvProvider extends AbstractEfaProvider
|
|||
{
|
||||
if ("Regionalbahn".equals(trainName) && symbol != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
|
||||
// Streikfahrplan
|
||||
if ("R1S".equals(symbol))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("R4S".equals(symbol))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("R6S".equals(symbol))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("R7S".equals(symbol))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("R8S".equals(symbol))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
}
|
||||
|
||||
return super.parseLine(id, network, mot, symbol, name, longName, trainType, trainNum, trainName);
|
||||
|
|
|
@ -74,6 +74,11 @@ public class BayernProvider extends AbstractEfaProvider
|
|||
if ("ZUG".equals(trainType) && trainNum != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, trainNum);
|
||||
}
|
||||
else if ("1".equals(mot))
|
||||
{
|
||||
if ("ABR".equals(trainType) || "ABELLIO Rail NRW GmbH".equals(trainName))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "ABR" + trainNum);
|
||||
}
|
||||
else if ("16".equals(mot))
|
||||
{
|
||||
if ("EC".equals(trainType) && trainNum != null)
|
||||
|
|
|
@ -71,6 +71,11 @@ public class MvvProvider extends AbstractEfaProvider
|
|||
if ("DB AG".equals(trainName))
|
||||
return new Line(id, network, null, symbol);
|
||||
}
|
||||
else if ("1".equals(mot))
|
||||
{
|
||||
if ("S".equals(symbol) && "Pendelverkehr".equals(name))
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "S⇆");
|
||||
}
|
||||
|
||||
return super.parseLine(id, network, mot, symbol, name, longName, trainType, trainNum, trainName);
|
||||
}
|
||||
|
|
|
@ -198,6 +198,8 @@ public class NvvProvider extends AbstractHafasProvider
|
|||
|
||||
if ("AT".equals(ucType)) // Anschluß Sammel Taxi, Anmeldung nicht erforderlich
|
||||
return Product.BUS;
|
||||
if ("LTAXI".equals(ucType))
|
||||
return Product.BUS;
|
||||
|
||||
if ("MOFA".equals(ucType)) // Mobilfalt-Fahrt
|
||||
return Product.ON_DEMAND;
|
||||
|
|
|
@ -147,6 +147,9 @@ public class PlProvider extends AbstractHafasProvider
|
|||
if ("REG".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
|
||||
if ("LKA".equals(ucType)) // Łódzka Kolej Aglomeracyjna
|
||||
return Product.SUBURBAN_TRAIN;
|
||||
|
||||
if ("IRB".equals(ucType)) // interREGIO Bus
|
||||
return Product.BUS;
|
||||
if ("ZKA".equals(ucType)) // Zastępcza Komunikacja Autobusowa (Schienenersatzverkehr)
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
|
@ -90,6 +91,8 @@ public class RtProvider extends AbstractHafasProvider
|
|||
return Product.ALL;
|
||||
}
|
||||
|
||||
private static final Pattern P_NUMBER = Pattern.compile("\\d{4,5}");
|
||||
|
||||
@Override
|
||||
protected Product normalizeType(final String type)
|
||||
{
|
||||
|
@ -107,6 +110,9 @@ public class RtProvider extends AbstractHafasProvider
|
|||
if (ucType.equals("T84"))
|
||||
return null;
|
||||
|
||||
if (P_NUMBER.matcher(type).matches())
|
||||
return null;
|
||||
|
||||
return super.normalizeType(type);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,6 +151,8 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
return Product.REGIONAL_TRAIN;
|
||||
if ("T".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("TE2".equals(ucType)) // Basel - Strasbourg
|
||||
return Product.REGIONAL_TRAIN;
|
||||
|
||||
if ("TX".equals(ucType))
|
||||
return Product.BUS;
|
||||
|
|
|
@ -158,19 +158,11 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
{
|
||||
final String ucType = type.toUpperCase();
|
||||
|
||||
if (ucType.startsWith("IC "))
|
||||
return Product.HIGH_SPEED_TRAIN;
|
||||
if ("THALYS".equals(ucType))
|
||||
return Product.HIGH_SPEED_TRAIN;
|
||||
|
||||
if (ucType.startsWith("IR "))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("L".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("CR".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
if ("TRN".equals(ucType))
|
||||
return Product.REGIONAL_TRAIN;
|
||||
|
||||
if ("MÉTRO".equals(ucType))
|
||||
return Product.SUBWAY;
|
||||
|
|
|
@ -20,8 +20,12 @@ package de.schildbach.pte;
|
|||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.Style;
|
||||
|
||||
/**
|
||||
|
@ -39,6 +43,20 @@ public class SvvProvider extends AbstractEfaProvider
|
|||
setStyles(STYLES);
|
||||
}
|
||||
|
||||
@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 ("1".equals(mot))
|
||||
{
|
||||
if ("S1/11".equals(symbol)) // Salzburger Lokalbahn
|
||||
return new Line(id, network, Product.SUBURBAN_TRAIN, "S1/11");
|
||||
}
|
||||
|
||||
return super.parseLine(id, network, mot, symbol, name, longName, trainType, trainNum, trainName);
|
||||
}
|
||||
|
||||
private static final Map<String, Style> STYLES = new HashMap<String, Style>();
|
||||
|
||||
static
|
||||
|
|
|
@ -100,6 +100,8 @@ public class SydneyProvider extends AbstractEfaProvider
|
|||
return new Line(id, network, Product.SUBURBAN_TRAIN, "SCO");
|
||||
if ("HUN".equals(symbol) || "Hunter Line".equals(symbol))
|
||||
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 ("T1".equals(symbol) || "T1 North Shore & Northern Line".equals(symbol) || "T1 Northern Line".equals(symbol)
|
||||
|| "T1 Western Line".equals(symbol))
|
||||
|
|
|
@ -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;
|
||||
import de.schildbach.pte.dto.Style.Shape;
|
||||
|
||||
|
@ -39,6 +43,22 @@ public class VagfrProvider extends AbstractEfaProvider
|
|||
setSessionCookieName("EFABWLB");
|
||||
}
|
||||
|
||||
@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 (("N".equals(trainType) || "Nahverkehrszug".equals(trainName)) && trainNum != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "N" + trainNum);
|
||||
if (("VAE".equals(trainType) || "Voralpen-Express".equals(trainName)) && trainNum != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, "VAE" + trainNum);
|
||||
}
|
||||
|
||||
return super.parseLine(id, network, mot, symbol, name, longName, trainType, trainNum, trainName);
|
||||
}
|
||||
|
||||
private static final Map<String, Style> STYLES = new HashMap<String, Style>();
|
||||
|
||||
static
|
||||
|
|
|
@ -27,6 +27,7 @@ import javax.annotation.Nullable;
|
|||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.Style;
|
||||
|
@ -69,6 +70,20 @@ public class VorProvider extends AbstractEfaProvider
|
|||
return uri.toString();
|
||||
}
|
||||
|
||||
@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 ("WLB".equals(trainNum) && trainType == null)
|
||||
return new Line(id, network, Product.TRAM, "WLB");
|
||||
}
|
||||
|
||||
return super.parseLine(id, network, mot, symbol, name, longName, trainType, trainNum, trainName);
|
||||
}
|
||||
|
||||
private static final Map<String, Style> STYLES = new HashMap<String, Style>();
|
||||
|
||||
static
|
||||
|
|
|
@ -80,8 +80,6 @@ public class VrrProvider extends AbstractEfaProvider
|
|||
{
|
||||
if ("0".equals(mot))
|
||||
{
|
||||
if (trainType == null && "RB67/71".equals(trainNum))
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, trainNum);
|
||||
if ("Regionalbahn".equals(trainName) && symbol != null)
|
||||
return new Line(id, network, Product.REGIONAL_TRAIN, symbol);
|
||||
if ("NordWestBahn".equals(trainName) && symbol != null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue