mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +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 class SncbProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
public static final NetworkId NETWORK_ID = NetworkId.SNCB;
|
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_BASE = "http://hari.b-rail.be/hafas/bin/";
|
||||||
private static final String API_URI = "http://hari.b-rail.be/Hafas/bin/extxml.exe";
|
|
||||||
|
|
||||||
public SncbProvider()
|
public SncbProvider()
|
||||||
{
|
{
|
||||||
super(API_URI, 16, null);
|
super(API_BASE + "query.exe/nn", 16, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public NetworkId id()
|
public NetworkId id()
|
||||||
|
@ -149,23 +148,16 @@ public class SncbProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
if (ucType.startsWith("IC "))
|
if (ucType.startsWith("IC "))
|
||||||
return 'I';
|
return 'I';
|
||||||
if ("THALYS".equals(ucType)) // Thalys
|
if ("THALYS".equals(ucType))
|
||||||
return 'I';
|
return 'I';
|
||||||
|
|
||||||
if (ucType.startsWith("IR "))
|
if (ucType.startsWith("IR "))
|
||||||
return 'R';
|
return 'R';
|
||||||
|
|
||||||
if ("L".equals(ucType))
|
if ("L".equals(ucType))
|
||||||
return 'R';
|
return 'R';
|
||||||
if ("CR".equals(ucType))
|
if ("CR".equals(ucType))
|
||||||
return 'R';
|
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))
|
if ("MÉTRO".equals(ucType))
|
||||||
return 'U';
|
return 'U';
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void nearbyStations() throws Exception
|
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);
|
print(result);
|
||||||
}
|
}
|
||||||
|
@ -60,7 +60,7 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
||||||
@Test
|
@Test
|
||||||
public void queryDepartures() throws Exception
|
public void queryDepartures() throws Exception
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures(100080, 0, false);
|
final QueryDeparturesResult result = provider.queryDepartures(8813003, 0, false);
|
||||||
|
|
||||||
print(result);
|
print(result);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue