mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 17:39:49 +00:00
Hafas endpoints
This commit is contained in:
parent
6f2b4515d9
commit
4a7743d094
25 changed files with 130 additions and 171 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue