mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 18:08:49 +00:00
fixed parsing of intermediates
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@647 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
8754842cb3
commit
596e67c3d1
1 changed files with 15 additions and 17 deletions
|
@ -767,18 +767,21 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
while (XmlPullUtil.test(pp, "StAttrList"))
|
||||
XmlPullUtil.next(pp);
|
||||
final Location location = parseLocation(pp);
|
||||
if (XmlPullUtil.test(pp, "Arr"))
|
||||
XmlPullUtil.next(pp);
|
||||
if (XmlPullUtil.test(pp, "Dep"))
|
||||
if (location.id != sectionDeparture.id)
|
||||
{
|
||||
XmlPullUtil.enter(pp, "Dep");
|
||||
XmlPullUtil.require(pp, "Time");
|
||||
time.setTimeInMillis(currentDate.getTimeInMillis());
|
||||
parseTime(time, XmlPullUtil.text(pp));
|
||||
final String position = parsePlatform(pp);
|
||||
XmlPullUtil.exit(pp, "Dep");
|
||||
if (XmlPullUtil.test(pp, "Arr"))
|
||||
XmlPullUtil.next(pp);
|
||||
if (XmlPullUtil.test(pp, "Dep"))
|
||||
{
|
||||
XmlPullUtil.enter(pp, "Dep");
|
||||
XmlPullUtil.require(pp, "Time");
|
||||
time.setTimeInMillis(currentDate.getTimeInMillis());
|
||||
parseTime(time, XmlPullUtil.text(pp));
|
||||
final String position = parsePlatform(pp);
|
||||
XmlPullUtil.exit(pp, "Dep");
|
||||
|
||||
intermediateStops.add(new Stop(location, position, time.getTime()));
|
||||
intermediateStops.add(new Stop(location, position, time.getTime()));
|
||||
}
|
||||
}
|
||||
XmlPullUtil.exit(pp, "BasicStop");
|
||||
}
|
||||
|
@ -825,17 +828,12 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
XmlPullUtil.exit(pp, "BasicStop");
|
||||
XmlPullUtil.exit(pp, "Arrival");
|
||||
|
||||
// remove first and last, because they are not intermediate
|
||||
// remove last intermediate
|
||||
final int size = intermediateStops.size();
|
||||
if (size >= 2)
|
||||
{
|
||||
if (size >= 1)
|
||||
if (intermediateStops.get(size - 1).location.id == sectionArrival.id)
|
||||
intermediateStops.remove(size - 1);
|
||||
|
||||
if (intermediateStops.get(0).location.id == sectionDeparture.id)
|
||||
intermediateStops.remove(0);
|
||||
}
|
||||
|
||||
XmlPullUtil.exit(pp, "ConSection");
|
||||
|
||||
if (min == 0 || line != null)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue