mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 17:10:30 +00:00
get rid of extxml.exe usage for Belgium
This commit is contained in:
parent
56369b678d
commit
6d4c0046d8
2 changed files with 7 additions and 15 deletions
|
@ -32,12 +32,11 @@ import de.schildbach.pte.util.ParserUtils;
|
|||
public class SncbProvider extends AbstractHafasProvider
|
||||
{
|
||||
public static final NetworkId NETWORK_ID = NetworkId.SNCB;
|
||||
private static final String API_BASE = "http://hari.b-rail.be/Hafas/bin/";
|
||||
private static final String API_URI = "http://hari.b-rail.be/Hafas/bin/extxml.exe";
|
||||
private static final String API_BASE = "http://hari.b-rail.be/hafas/bin/";
|
||||
|
||||
public SncbProvider()
|
||||
{
|
||||
super(API_URI, 16, null);
|
||||
super(API_BASE + "query.exe/nn", 16, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -149,23 +148,16 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
|
||||
if (ucType.startsWith("IC "))
|
||||
return 'I';
|
||||
if ("THALYS".equals(ucType)) // Thalys
|
||||
if ("THALYS".equals(ucType))
|
||||
return 'I';
|
||||
|
||||
if (ucType.startsWith("IR "))
|
||||
return 'R';
|
||||
|
||||
if ("L".equals(ucType))
|
||||
return 'R';
|
||||
if ("CR".equals(ucType))
|
||||
return 'R';
|
||||
if ("ICT".equals(ucType)) // Brügge
|
||||
return 'R';
|
||||
if ("TRN".equals(ucType)) // Mons
|
||||
return 'R';
|
||||
|
||||
if ("MÉT".equals(ucType))
|
||||
return 'U';
|
||||
if ("MÉTRO".equals(ucType))
|
||||
return 'U';
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 100080), 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 8813003), 0, 0);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures(100080, 0, false);
|
||||
final QueryDeparturesResult result = provider.queryDepartures(8813003, 0, false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
if (result.context != null)
|
||||
{
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult.status + " " + laterResult.connections);
|
||||
System.out.println(laterResult.status + " " + laterResult.connections);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
if (result.context != null)
|
||||
{
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult.status + " " + laterResult.connections);
|
||||
System.out.println(laterResult.status + " " + laterResult.connections);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue