Hafas endpoints

This commit is contained in:
Andreas Schildbach 2013-07-08 19:03:59 +02:00
parent 6f2b4515d9
commit 4a7743d094
25 changed files with 130 additions and 171 deletions

View file

@ -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);