mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 00:39:58 +00:00
more lines
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@698 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
3f61979eb1
commit
b215c793ac
4 changed files with 40 additions and 9 deletions
|
@ -1463,6 +1463,12 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
||||||
return 'R';
|
return 'R';
|
||||||
if ("VEB".equals(ucType)) // Vulkan-Eifel-Bahn Betriebsgesellschaft
|
if ("VEB".equals(ucType)) // Vulkan-Eifel-Bahn Betriebsgesellschaft
|
||||||
return 'R';
|
return 'R';
|
||||||
|
if ("LEO".equals(ucType)) // Chiemgauer Lokalbahn
|
||||||
|
return 'R';
|
||||||
|
if ("VX".equals(ucType)) // Vogtland Express
|
||||||
|
return 'R';
|
||||||
|
if ("MSB".equals(ucType)) // Mainschleifenbahn
|
||||||
|
return 'R';
|
||||||
if ("P".equals(ucType)) // Kasbachtalbahn
|
if ("P".equals(ucType)) // Kasbachtalbahn
|
||||||
return 'R';
|
return 'R';
|
||||||
if ("ATZ".equals(ucType)) // Autotunnelzug
|
if ("ATZ".equals(ucType)) // Autotunnelzug
|
||||||
|
|
|
@ -556,8 +556,6 @@ public class OebbProvider extends AbstractHafasProvider
|
||||||
return 'R';
|
return 'R';
|
||||||
// if (ucType.equals("SBE")) // Zittau-Seifhennersdorf, via JSON API
|
// if (ucType.equals("SBE")) // Zittau-Seifhennersdorf, via JSON API
|
||||||
// return 'R';
|
// return 'R';
|
||||||
// if (ucType.equals("VX")) // Vogtland Express, via JSON API
|
|
||||||
// return 'R';
|
|
||||||
// if (ucType.equals("RNV")) // Rhein-Neckar-Verkehr GmbH, via JSON API
|
// if (ucType.equals("RNV")) // Rhein-Neckar-Verkehr GmbH, via JSON API
|
||||||
// return 'R';
|
// return 'R';
|
||||||
if ("UAU".equals(ucType)) // Rußland
|
if ("UAU".equals(ucType)) // Rußland
|
||||||
|
|
|
@ -147,10 +147,6 @@ public class PlProvider extends AbstractHafasProvider
|
||||||
return 'R';
|
return 'R';
|
||||||
if ("KTB".equals(ucType)) // Kandertalbahn
|
if ("KTB".equals(ucType)) // Kandertalbahn
|
||||||
return 'R';
|
return 'R';
|
||||||
if ("LEO".equals(ucType)) // Chiemgauer Lokalbahn
|
|
||||||
return 'R';
|
|
||||||
if ("MSB".equals(ucType)) // Mainschleifenbahn
|
|
||||||
return 'R';
|
|
||||||
if ("N".equals(ucType)) // St. Pierre des Corps - Tours
|
if ("N".equals(ucType)) // St. Pierre des Corps - Tours
|
||||||
return 'R';
|
return 'R';
|
||||||
// if ("INT".equals(ucType)) // Rußland
|
// if ("INT".equals(ucType)) // Rußland
|
||||||
|
|
|
@ -113,14 +113,13 @@ public class RtProvider extends AbstractHafasProvider
|
||||||
return jsonGetStops(uri);
|
return jsonGetStops(uri);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Pattern P_NORMALIZE_LINE_RUSSIA = Pattern.compile("(\\d{3}(BJ|FJ|IJ|MJ|NJ|OJ|TJ|SZ))");
|
||||||
|
private static final Pattern P_NORMALIZE_LINE_NUMBER = Pattern.compile("\\d{2,5}");
|
||||||
private static final Pattern P_NORMALIZE_LINE_AND_TYPE = Pattern.compile("([^#]*)#(.*)");
|
private static final Pattern P_NORMALIZE_LINE_AND_TYPE = Pattern.compile("([^#]*)#(.*)");
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String normalizeLine(final String line)
|
protected String normalizeLine(final String line)
|
||||||
{
|
{
|
||||||
if (line.equals("#"))
|
|
||||||
return "?";
|
|
||||||
|
|
||||||
final Matcher m = P_NORMALIZE_LINE_AND_TYPE.matcher(line);
|
final Matcher m = P_NORMALIZE_LINE_AND_TYPE.matcher(line);
|
||||||
if (m.matches())
|
if (m.matches())
|
||||||
{
|
{
|
||||||
|
@ -131,9 +130,41 @@ public class RtProvider extends AbstractHafasProvider
|
||||||
if (normalizedType != 0)
|
if (normalizedType != 0)
|
||||||
return normalizedType + number;
|
return normalizedType + number;
|
||||||
|
|
||||||
|
if (type.length() == 0)
|
||||||
|
{
|
||||||
|
if (P_NORMALIZE_LINE_RUSSIA.matcher(number).matches())
|
||||||
|
return 'R' + number;
|
||||||
|
|
||||||
|
if (P_NORMALIZE_LINE_NUMBER.matcher(number).matches())
|
||||||
|
return '?' + number;
|
||||||
|
|
||||||
|
if (number.length() == 0)
|
||||||
|
return "?";
|
||||||
|
}
|
||||||
|
|
||||||
throw new IllegalStateException("cannot normalize type " + type + " number " + number + " line " + line);
|
throw new IllegalStateException("cannot normalize type " + type + " number " + number + " line " + line);
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new IllegalStateException("cannot normalize line " + line);
|
throw new IllegalStateException("cannot normalize line " + line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected char normalizeType(final String type)
|
||||||
|
{
|
||||||
|
final String ucType = type.toUpperCase();
|
||||||
|
|
||||||
|
if ("A".equals(ucType)) // Spain, Highspeed
|
||||||
|
return 'I';
|
||||||
|
|
||||||
|
if ("E".equals(ucType)) // Romania, Croatia
|
||||||
|
return 'R';
|
||||||
|
if ("N".equals(ucType)) // Frankreich, Tours
|
||||||
|
return 'R';
|
||||||
|
|
||||||
|
final char t = super.normalizeType(type);
|
||||||
|
if (t != 0)
|
||||||
|
return t;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue