filter unassociated serving lines

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@472 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2011-01-30 12:15:43 +00:00
parent ba7bf25f83
commit 2a1df9b041

View file

@ -867,6 +867,9 @@ public abstract class AbstractEfaProvider implements NetworkProvider
{ {
XmlPullUtil.enter(pp, "itdServingLines"); XmlPullUtil.enter(pp, "itdServingLines");
while (XmlPullUtil.test(pp, "itdServingLine")) while (XmlPullUtil.test(pp, "itdServingLine"))
{
final String assignedStopId = pp.getAttributeValue(null, "assignedStopID");
if (assignedStopId == null || Integer.parseInt(assignedStopId) == location.id)
{ {
final String destination = normalizeLocationName(pp.getAttributeValue(null, "direction")); final String destination = normalizeLocationName(pp.getAttributeValue(null, "direction"));
final String destinationIdStr = pp.getAttributeValue(null, "destID"); final String destinationIdStr = pp.getAttributeValue(null, "destID");
@ -877,6 +880,12 @@ public abstract class AbstractEfaProvider implements NetworkProvider
if (!lines.contains(line)) if (!lines.contains(line))
lines.add(line); lines.add(line);
} }
else
{
XmlPullUtil.enter(pp, "itdServingLine");
XmlPullUtil.exit(pp, "itdServingLine");
}
}
XmlPullUtil.exit(pp, "itdServingLines"); XmlPullUtil.exit(pp, "itdServingLines");
} }
else else
@ -892,7 +901,7 @@ public abstract class AbstractEfaProvider implements NetworkProvider
XmlPullUtil.enter(pp, "itdDepartureList"); XmlPullUtil.enter(pp, "itdDepartureList");
while (XmlPullUtil.test(pp, "itdDeparture")) while (XmlPullUtil.test(pp, "itdDeparture"))
{ {
if (Integer.parseInt(pp.getAttributeValue(null, "stopID")) == location.id) if (XmlPullUtil.intAttr(pp, "stopID") == location.id)
{ {
final String position = normalizePlatform(pp.getAttributeValue(null, "platform"), final String position = normalizePlatform(pp.getAttributeValue(null, "platform"),
pp.getAttributeValue(null, "platformName")); pp.getAttributeValue(null, "platformName"));