mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 12:39:49 +00:00
Hafas endpoints
This commit is contained in:
parent
6f2b4515d9
commit
4a7743d094
25 changed files with 130 additions and 171 deletions
|
@ -79,7 +79,9 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
|
||||
private static final String PROD = "hafas";
|
||||
|
||||
private final String apiUri;
|
||||
protected final String stationBoardEndpoint;
|
||||
protected final String getStopEndpoint;
|
||||
protected final String queryEndpoint;
|
||||
private final int numProductBits;
|
||||
private final String accessId;
|
||||
private Charset jsonGetStopsEncoding;
|
||||
|
@ -137,15 +139,18 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
}
|
||||
}
|
||||
|
||||
public AbstractHafasProvider(final String apiUri, final int numProductBits, final String accessId)
|
||||
public AbstractHafasProvider(final String stationBoardEndpoint, final String getStopEndpoint, final String queryEndpoint,
|
||||
final int numProductBits, final String accessId)
|
||||
{
|
||||
this(apiUri, numProductBits, accessId, ISO_8859_1, ISO_8859_1);
|
||||
this(stationBoardEndpoint, getStopEndpoint, queryEndpoint, numProductBits, accessId, ISO_8859_1, ISO_8859_1);
|
||||
}
|
||||
|
||||
public AbstractHafasProvider(final String apiUri, final int numProductBits, final String accessId, final Charset jsonEncoding,
|
||||
final Charset xmlMlcResEncoding)
|
||||
public AbstractHafasProvider(final String stationBoardEndpoint, final String getStopEndpoint, final String queryEndpoint,
|
||||
final int numProductBits, final String accessId, final Charset jsonEncoding, final Charset xmlMlcResEncoding)
|
||||
{
|
||||
this.apiUri = apiUri;
|
||||
this.stationBoardEndpoint = stationBoardEndpoint;
|
||||
this.getStopEndpoint = getStopEndpoint;
|
||||
this.queryEndpoint = queryEndpoint;
|
||||
this.numProductBits = numProductBits;
|
||||
this.accessId = accessId;
|
||||
this.jsonGetStopsEncoding = jsonEncoding;
|
||||
|
@ -295,7 +300,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
|
||||
try
|
||||
{
|
||||
reader = new InputStreamReader(ParserUtils.scrapeInputStream(apiUri, wrap(request, null), null, null, null, 3), ISO_8859_1);
|
||||
reader = new InputStreamReader(ParserUtils.scrapeInputStream(queryEndpoint, wrap(request, null), null, null, null, 3), ISO_8859_1);
|
||||
|
||||
final List<Location> results = new ArrayList<Location>();
|
||||
|
||||
|
@ -508,7 +513,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
|
||||
try
|
||||
{
|
||||
reader = new InputStreamReader(ParserUtils.scrapeInputStream(apiUri, wrappedRequest, xmlMlcResEncoding, null, null, 3), xmlMlcResEncoding);
|
||||
reader = new InputStreamReader(ParserUtils.scrapeInputStream(queryEndpoint, wrappedRequest, xmlMlcResEncoding, null, null, 3),
|
||||
xmlMlcResEncoding);
|
||||
|
||||
final XmlPullParserFactory factory = XmlPullParserFactory.newInstance(System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null);
|
||||
final XmlPullParser pp = factory.newPullParser();
|
||||
|
@ -1009,7 +1015,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
|
||||
try
|
||||
{
|
||||
reader = new InputStreamReader(ParserUtils.scrapeInputStream(apiUri, wrap(request, null), null, null, null, 3), ISO_8859_1);
|
||||
reader = new InputStreamReader(ParserUtils.scrapeInputStream(queryEndpoint, wrap(request, null), null, null, null, 3), ISO_8859_1);
|
||||
|
||||
final XmlPullParserFactory factory = XmlPullParserFactory.newInstance(System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null);
|
||||
final XmlPullParser pp = factory.newPullParser();
|
||||
|
@ -1546,7 +1552,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
to = autocompletes.get(0);
|
||||
}
|
||||
|
||||
final StringBuilder uri = new StringBuilder(apiUri);
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
appendTripsQueryUri(uri, from, via, to, date, dep, products, accessibility, options);
|
||||
appendCustomTripsQueryBinaryUri(uri);
|
||||
|
||||
|
@ -1557,7 +1563,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
{
|
||||
final QueryTripsBinaryContext context = (QueryTripsBinaryContext) contextObj;
|
||||
|
||||
final StringBuilder uri = new StringBuilder(apiUri);
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append("?seqnr=").append(context.seqNr);
|
||||
uri.append("&ident=").append(context.ident);
|
||||
if (context.ld != null)
|
||||
|
|
|
@ -46,7 +46,7 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
|
||||
public BahnProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 14, null);
|
||||
super(API_BASE + "bhftafel.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 14, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -142,11 +142,10 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -159,7 +158,7 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("bhftafel.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -191,8 +190,7 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -65,7 +65,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
|
||||
public BvgProvider(final String additionalQueryParameter)
|
||||
{
|
||||
super(API_BASE + "query.bin/dn", 8, null);
|
||||
super(API_BASE + "stboard.bin/dn", API_BASE + "ajax-getstop.bin/dny", API_BASE + "query.bin/dn", 8, null);
|
||||
|
||||
this.additionalQueryParameter = additionalQueryParameter;
|
||||
}
|
||||
|
@ -180,11 +180,10 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.bin/dn?near=Anzeigen");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ public class DsbProvider extends AbstractHafasProvider
|
|||
|
||||
public DsbProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 11, null);
|
||||
super(API_BASE + "stboard.exe/mn", null, API_BASE + "query.exe/dn", 11, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -124,9 +124,7 @@ public class DsbProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
uri.append("stboard.exe/mn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -143,8 +141,7 @@ public class DsbProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/mn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -43,7 +43,7 @@ public class EireannProvider extends AbstractHafasProvider
|
|||
|
||||
public EireannProvider()
|
||||
{
|
||||
super(API_BASE + "query.bin/en", 4, null);
|
||||
super(API_BASE + "stboard.bin/en", API_BASE + "ajax-getstop.bin/en", API_BASE + "query.bin/en", 4, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -99,11 +99,10 @@ public class EireannProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.bin/eny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -115,7 +114,7 @@ public class EireannProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.bin/en");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -132,8 +131,7 @@ public class EireannProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.bin/en");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -48,13 +48,12 @@ public class InvgProvider extends AbstractHafasProvider
|
|||
{
|
||||
public static final NetworkId NETWORK_ID = NetworkId.INVG;
|
||||
private static final String API_BASE = "http://fpa.invg.de/bin/";
|
||||
private static final String API_URI = "http://fpa.invg.de/bin/extxml.exe";
|
||||
|
||||
private static final long PARSER_DAY_ROLLOVER_THRESHOLD_MS = 12 * 60 * 60 * 1000;
|
||||
|
||||
public InvgProvider()
|
||||
{
|
||||
super(API_URI, 10, null);
|
||||
super(API_BASE + "stboard.exe/dn", null, API_BASE + "extxml.exe", 10, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -95,11 +94,10 @@ public class InvgProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn?near=Anzeigen");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
|
@ -113,9 +111,7 @@ public class InvgProvider extends AbstractHafasProvider
|
|||
|
||||
private String departuresQueryUri(final int stationId, final int maxDepartures)
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?input=").append(stationId);
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&productsFilter=").append(allProductsString());
|
||||
|
|
|
@ -36,7 +36,7 @@ public class LuProvider extends AbstractHafasProvider
|
|||
|
||||
public LuProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/fn", 10, null, UTF_8, UTF_8);
|
||||
super(API_BASE + "stboard.exe/fn", null, API_BASE + "query.exe/fn", 10, null, UTF_8, UTF_8);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -117,11 +117,10 @@ public class LuProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/fny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -133,7 +132,7 @@ public class LuProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/fn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -149,8 +148,7 @@ public class LuProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/fn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -41,7 +41,7 @@ public class NasaProvider extends AbstractHafasProvider
|
|||
|
||||
public NasaProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 8, null);
|
||||
super(API_BASE + "stboard.exe/dn", null, API_BASE + "query.exe/dn", 8, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -134,11 +134,10 @@ public class NasaProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn?near=Anzeigen");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
|
@ -152,8 +151,7 @@ public class NasaProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -39,7 +39,7 @@ public class NriProvider extends AbstractHafasProvider
|
|||
|
||||
public NriProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/on", 8, null);
|
||||
super(API_BASE + "stboard.exe/on", API_BASE + "ajax-getstop.exe/ony", API_BASE + "query.exe/on", 8, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -133,11 +133,10 @@ public class NriProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/ony");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 150);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -149,7 +148,7 @@ public class NriProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/on");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -166,8 +165,7 @@ public class NriProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/on");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -43,7 +43,7 @@ public class NsProvider extends AbstractHafasProvider
|
|||
|
||||
public NsProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/nn", 10, null);
|
||||
super(API_BASE + "stboard.exe/nn", API_BASE + "ajax-getstop.exe/nny", API_BASE + "query.exe/nn", 10, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -115,8 +115,7 @@ public class NsProvider extends AbstractHafasProvider
|
|||
{
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
uri.append("stboard.exe/nn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
|
|
@ -36,7 +36,7 @@ public class NvvProvider extends AbstractHafasProvider
|
|||
|
||||
public NvvProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 17, null, UTF_8, UTF_8);
|
||||
super(API_BASE + "stboard.exe/dn", null, API_BASE + "query.exe/dn", 17, null, UTF_8, UTF_8);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -114,11 +114,10 @@ public class NvvProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -130,7 +129,8 @@ public class NvvProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/en?near=Anzeigen");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
|
@ -144,8 +144,7 @@ public class NvvProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -43,7 +43,7 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
|
||||
public OebbProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 13, null);
|
||||
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dny", API_BASE + "query.exe/dn", 13, null);
|
||||
|
||||
setDominantPlanStopTime(true);
|
||||
setJsonGetStopsEncoding(UTF_8);
|
||||
|
@ -148,11 +148,10 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -164,7 +163,8 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn?near=Suchen");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?near=Suchen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
|
@ -178,8 +178,7 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -37,11 +37,11 @@ public class PlProvider extends AbstractHafasProvider
|
|||
private static final String API_BASE = "http://rozklad-pkp.pl/bin/";
|
||||
|
||||
// http://rozklad.sitkol.pl/bin/
|
||||
// http://h2g.sitkol.pl/bin/query.exe/en
|
||||
// http://h2g.sitkol.pl/bin/
|
||||
|
||||
public PlProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/pn", 7, null, UTF_8, UTF_8);
|
||||
super(API_BASE + "stboard.exe/pn", null, API_BASE + "query.exe/pn", 7, null, UTF_8, UTF_8);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -134,11 +134,10 @@ public class PlProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/pny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -150,7 +149,7 @@ public class PlProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/pn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -167,8 +166,7 @@ public class PlProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/pn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -43,7 +43,7 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
|
||||
public RmvProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 16, null, UTF_8, null);
|
||||
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 16, null, UTF_8, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -155,11 +155,10 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -172,7 +171,8 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn?L=vs_rmv&near=Anzeigen");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?L=vs_rmv&near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
|
@ -186,8 +186,7 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -39,7 +39,7 @@ public class RtProvider extends AbstractHafasProvider
|
|||
|
||||
public RtProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 10, null, UTF_8, null);
|
||||
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 10, null, UTF_8, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -104,11 +104,10 @@ public class RtProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -120,7 +119,7 @@ public class RtProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -137,8 +136,7 @@ public class RtProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -36,11 +36,10 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
{
|
||||
public static final NetworkId NETWORK_ID = NetworkId.SBB;
|
||||
private static final String API_BASE = "http://fahrplan.sbb.ch/bin/";
|
||||
private static final String API_URI = "http://fahrplan.sbb.ch/bin/extxml.exe"; // xmlfahrplan.sbb.ch
|
||||
|
||||
public SbbProvider(final String accessId)
|
||||
{
|
||||
super(API_URI, 10, accessId);
|
||||
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "extxml.exe", 10, accessId);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -99,11 +98,10 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -115,7 +113,7 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -132,8 +130,7 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -42,7 +42,7 @@ public class SeProvider extends AbstractHafasProvider
|
|||
|
||||
public SeProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/sn", 14, null, UTF_8, null);
|
||||
super(API_BASE + "stboard.exe/sn", API_BASE + "ajax-getstop.exe/sny", API_BASE + "query.exe/sn", 14, null, UTF_8, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -147,11 +147,10 @@ public class SeProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/sny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 150);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -163,7 +162,7 @@ public class SeProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/sn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -179,8 +178,7 @@ public class SeProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/sn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -52,7 +52,7 @@ public class SeptaProvider extends AbstractHafasProvider
|
|||
|
||||
public SeptaProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/en", 4, null);
|
||||
super(API_BASE + "stboard.exe/en", API_BASE + "ajax-getstop.exe/dny", API_BASE + "query.exe/en", 4, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -120,11 +120,10 @@ public class SeptaProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/en?near=Anzeigen");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
|
@ -140,8 +139,7 @@ public class SeptaProvider extends AbstractHafasProvider
|
|||
{
|
||||
final Calendar now = new GregorianCalendar(timeZone());
|
||||
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/en");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?input=").append(stationId);
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&time=");
|
||||
|
|
|
@ -50,7 +50,7 @@ public class ShProvider extends AbstractHafasProvider
|
|||
|
||||
public ShProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 10, null, null, UTF_8);
|
||||
super(API_BASE + "stboard.exe/dn", null, API_BASE + "query.exe/dn", 10, null, null, UTF_8);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -115,11 +115,10 @@ public class ShProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn?near=Anzeigen");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
|
@ -133,9 +132,7 @@ public class ShProvider extends AbstractHafasProvider
|
|||
|
||||
private String departuresQueryUri(final int stationId, final int maxDepartures)
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?input=").append(stationId);
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&productsFilter=").append(allProductsString());
|
||||
|
|
|
@ -39,7 +39,7 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
|
||||
public SncbProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/nn", 16, null);
|
||||
super(API_BASE + "stboard.exe/nn", API_BASE + "ajax-getstop.exe/nny", API_BASE + "query.exe/nn", 16, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -103,11 +103,10 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/nn?near=Zoek");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?near=Zoek");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
|
@ -121,8 +120,7 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/nn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -50,7 +50,7 @@ public class StockholmProvider extends AbstractHafasProvider
|
|||
|
||||
public StockholmProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/sn", 7, null, null, null);
|
||||
super(API_BASE + "stboard.exe/sn", API_BASE + "ajax-getstop.exe/sny", API_BASE + "query.exe/sn", 7, null, null, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -142,11 +142,10 @@ public class StockholmProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/sny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -158,7 +157,7 @@ public class StockholmProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/sn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -174,8 +173,7 @@ public class StockholmProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/sn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -40,7 +40,7 @@ public class VbbProvider extends AbstractHafasProvider
|
|||
|
||||
public VbbProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 7, null, UTF_8, UTF_8);
|
||||
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 7, null, UTF_8, UTF_8);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -140,11 +140,10 @@ public class VbbProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -156,7 +155,7 @@ public class VbbProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -173,8 +172,7 @@ public class VbbProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -38,7 +38,7 @@ public class VbnProvider extends AbstractHafasProvider
|
|||
|
||||
public VbnProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 10, null);
|
||||
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dny", API_BASE + "query.exe/dn", 10, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -103,11 +103,10 @@ public class VbnProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -119,7 +118,7 @@ public class VbnProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -136,8 +135,7 @@ public class VbnProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -42,7 +42,7 @@ public class VgsProvider extends AbstractHafasProvider
|
|||
|
||||
public VgsProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 11, null);
|
||||
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 11, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -124,11 +124,10 @@ public class VgsProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -140,7 +139,8 @@ public class VgsProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn?near=Anzeigen");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
|
@ -154,8 +154,7 @@ public class VgsProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
|
@ -42,7 +42,7 @@ public class ZvvProvider extends AbstractHafasProvider
|
|||
|
||||
public ZvvProvider()
|
||||
{
|
||||
super(API_BASE + "query.exe/dn", 10, null, UTF_8, UTF_8);
|
||||
super(API_BASE + "stboard.exe/dn", null, API_BASE + "query.exe/dn", 10, null, UTF_8, UTF_8);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -162,11 +162,10 @@ public class ZvvProvider extends AbstractHafasProvider
|
|||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 150);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
|
@ -178,7 +177,7 @@ public class ZvvProvider extends AbstractHafasProvider
|
|||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
|
@ -195,8 +194,7 @@ public class ZvvProvider extends AbstractHafasProvider
|
|||
|
||||
public QueryDeparturesResult queryDepartures(final int stationId, final int maxDepartures, final boolean equivs) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder();
|
||||
uri.append(API_BASE).append("stboard.exe/dn");
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
uri.append(xmlQueryDeparturesParameters(stationId));
|
||||
|
||||
return xmlQueryDepartures(uri.toString(), stationId);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue