mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 06:08:52 +00:00
fixed Belgium connections
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@634 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
be7a173989
commit
af6c3338e1
3 changed files with 28 additions and 9 deletions
|
@ -630,8 +630,12 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
throw new IllegalStateException("error " + code + " " + XmlPullUtil.attr(pp, "text"));
|
||||
}
|
||||
|
||||
XmlPullUtil.require(pp, "ConResCtxt");
|
||||
final String context = XmlPullUtil.text(pp);
|
||||
final String context;
|
||||
if (XmlPullUtil.test(pp, "ConResCtxt"))
|
||||
context = XmlPullUtil.text(pp);
|
||||
else
|
||||
context = null;
|
||||
|
||||
XmlPullUtil.enter(pp, "ConnectionList");
|
||||
|
||||
final List<Connection> connections = new ArrayList<Connection>();
|
||||
|
@ -1254,8 +1258,6 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
return 'T';
|
||||
// if ("T".equals(normalizedType)) // Tram
|
||||
// return "T" + normalizedName;
|
||||
// if ("Tramway".equals(normalizedType))
|
||||
// return "T" + normalizedName;
|
||||
|
||||
// Bus
|
||||
if ("BUS".equals(ucType)) // Generic Bus
|
||||
|
|
|
@ -223,6 +223,9 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
if (ucType.equals("MÉT"))
|
||||
return 'U';
|
||||
|
||||
if (ucType.equals("TRAMWAY"))
|
||||
return 'T';
|
||||
|
||||
final char t = super.normalizeType(type);
|
||||
if (t != 0)
|
||||
return t;
|
||||
|
|
|
@ -83,8 +83,13 @@ public class SncbProviderLiveTest
|
|||
{
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024), null, new Location(
|
||||
LocationType.STATION, 100066), new Date(), true, null, WalkSpeed.FAST);
|
||||
|
||||
System.out.println(result.status + " " + result.connections);
|
||||
|
||||
if (result.context != null)
|
||||
{
|
||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||
System.out.println(moreResult.status + " " + moreResult.connections);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -92,8 +97,13 @@ public class SncbProviderLiveTest
|
|||
{
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024), null, new Location(
|
||||
LocationType.STATION, 103624), new Date(), true, null, WalkSpeed.FAST);
|
||||
|
||||
System.out.println(result.status + " " + result.connections);
|
||||
|
||||
if (result.context != null)
|
||||
{
|
||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||
System.out.println(moreResult.status + " " + moreResult.connections);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -102,8 +112,12 @@ public class SncbProviderLiveTest
|
|||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, null,
|
||||
"Bruxelles - Haren, Rue Paul Janson 9"), null, new Location(LocationType.STATION, 8500010, null, "Basel"), new Date(), true,
|
||||
ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
System.out.println(result);
|
||||
System.out.println(result.status + " " + result.connections);
|
||||
|
||||
if (result.context != null)
|
||||
{
|
||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||
System.out.println(moreResult);
|
||||
System.out.println(moreResult.status + " " + moreResult.connections);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue