mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-14 00:30:31 +00:00
workaround for Austria predicted stop times where trains actually don't stop
This commit is contained in:
parent
03fe13c3b0
commit
65ceab85d4
2 changed files with 15 additions and 3 deletions
|
@ -81,6 +81,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
private final String accessId;
|
||||
private final Charset jsonEncoding;
|
||||
private final Charset xmlMlcResEncoding;
|
||||
private boolean dominantPlanStopTime = false;
|
||||
|
||||
private static class Context implements QueryConnectionsContext
|
||||
{
|
||||
|
@ -149,6 +150,11 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
this.xmlMlcResEncoding = ISO_8859_1;
|
||||
}
|
||||
|
||||
protected void setDominantPlanStopTime(final boolean dominantPlanStopTime)
|
||||
{
|
||||
this.dominantPlanStopTime = dominantPlanStopTime;
|
||||
}
|
||||
|
||||
protected TimeZone timeZone()
|
||||
{
|
||||
return TimeZone.getTimeZone("CET");
|
||||
|
@ -1814,9 +1820,13 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
|
||||
final Location stopLocation = stations.read(is);
|
||||
|
||||
final Stop stop = new Stop(stopLocation, plannedStopArrivalDate, predictedStopArrivalDate,
|
||||
plannedStopArrivalPosition, predictedStopArrivalPosition, plannedStopDepartureDate,
|
||||
predictedStopDepartureDate, plannedStopDeparturePosition, predictedStopDeparturePosition);
|
||||
final boolean validPredictedDate = !dominantPlanStopTime
|
||||
|| (plannedStopArrivalDate != null && plannedStopDepartureDate != null);
|
||||
|
||||
final Stop stop = new Stop(stopLocation, plannedStopArrivalDate,
|
||||
validPredictedDate ? predictedStopArrivalDate : null, plannedStopArrivalPosition,
|
||||
predictedStopArrivalPosition, plannedStopDepartureDate, validPredictedDate ? predictedStopDepartureDate
|
||||
: null, plannedStopDeparturePosition, predictedStopDeparturePosition);
|
||||
|
||||
intermediateStops.add(stop);
|
||||
}
|
||||
|
|
|
@ -41,6 +41,8 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
public OebbProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 13, null);
|
||||
|
||||
setDominantPlanStopTime(true);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue