mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 18:58:49 +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"));
|
throw new IllegalStateException("error " + code + " " + XmlPullUtil.attr(pp, "text"));
|
||||||
}
|
}
|
||||||
|
|
||||||
XmlPullUtil.require(pp, "ConResCtxt");
|
final String context;
|
||||||
final String context = XmlPullUtil.text(pp);
|
if (XmlPullUtil.test(pp, "ConResCtxt"))
|
||||||
|
context = XmlPullUtil.text(pp);
|
||||||
|
else
|
||||||
|
context = null;
|
||||||
|
|
||||||
XmlPullUtil.enter(pp, "ConnectionList");
|
XmlPullUtil.enter(pp, "ConnectionList");
|
||||||
|
|
||||||
final List<Connection> connections = new ArrayList<Connection>();
|
final List<Connection> connections = new ArrayList<Connection>();
|
||||||
|
@ -1254,8 +1258,6 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
||||||
return 'T';
|
return 'T';
|
||||||
// if ("T".equals(normalizedType)) // Tram
|
// if ("T".equals(normalizedType)) // Tram
|
||||||
// return "T" + normalizedName;
|
// return "T" + normalizedName;
|
||||||
// if ("Tramway".equals(normalizedType))
|
|
||||||
// return "T" + normalizedName;
|
|
||||||
|
|
||||||
// Bus
|
// Bus
|
||||||
if ("BUS".equals(ucType)) // Generic Bus
|
if ("BUS".equals(ucType)) // Generic Bus
|
||||||
|
|
|
@ -223,6 +223,9 @@ public class SncbProvider extends AbstractHafasProvider
|
||||||
if (ucType.equals("MÉT"))
|
if (ucType.equals("MÉT"))
|
||||||
return 'U';
|
return 'U';
|
||||||
|
|
||||||
|
if (ucType.equals("TRAMWAY"))
|
||||||
|
return 'T';
|
||||||
|
|
||||||
final char t = super.normalizeType(type);
|
final char t = super.normalizeType(type);
|
||||||
if (t != 0)
|
if (t != 0)
|
||||||
return t;
|
return t;
|
||||||
|
|
|
@ -83,8 +83,13 @@ public class SncbProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024), null, new Location(
|
||||||
LocationType.STATION, 100066), new Date(), true, null, WalkSpeed.FAST);
|
LocationType.STATION, 100066), new Date(), true, null, WalkSpeed.FAST);
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.connections);
|
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
|
@Test
|
||||||
|
@ -92,8 +97,13 @@ public class SncbProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024), null, new Location(
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 100024), null, new Location(
|
||||||
LocationType.STATION, 103624), new Date(), true, null, WalkSpeed.FAST);
|
LocationType.STATION, 103624), new Date(), true, null, WalkSpeed.FAST);
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.connections);
|
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
|
@Test
|
||||||
|
@ -102,8 +112,12 @@ public class SncbProviderLiveTest
|
||||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, null,
|
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,
|
"Bruxelles - Haren, Rue Paul Janson 9"), null, new Location(LocationType.STATION, 8500010, null, "Basel"), new Date(), true,
|
||||||
ALL_PRODUCTS, WalkSpeed.NORMAL);
|
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);
|
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