From 83a83b516e6b989c2698b6073741b4152c765b04 Mon Sep 17 00:00:00 2001 From: "andreas.schildbach@gmail.com" Date: Wed, 15 Jun 2011 15:32:20 +0000 Subject: [PATCH] construct line id in cases where unavailable git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@701 0924bc21-9374-b0fa-ee44-9ff1593b38f0 --- src/de/schildbach/pte/AbstractEfaProvider.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/de/schildbach/pte/AbstractEfaProvider.java b/src/de/schildbach/pte/AbstractEfaProvider.java index f8f580d4..e1027e57 100644 --- a/src/de/schildbach/pte/AbstractEfaProvider.java +++ b/src/de/schildbach/pte/AbstractEfaProvider.java @@ -1685,17 +1685,21 @@ public abstract class AbstractEfaProvider implements NetworkProvider final String destinationName = normalizeLocationName(pp.getAttributeValue(null, "destination")); final Location destination = destinationIdStr.length() > 0 ? new Location(LocationType.STATION, Integer.parseInt(destinationIdStr), null, destinationName) : new Location(LocationType.ANY, 0, null, destinationName); - final String lineStr; + final String lineLabel; if ("AST".equals(pp.getAttributeValue(null, "symbol"))) - lineStr = "BAST"; + lineLabel = "BAST"; else - lineStr = parseLine(pp.getAttributeValue(null, "motType"), pp.getAttributeValue(null, "shortname"), + lineLabel = parseLine(pp.getAttributeValue(null, "motType"), pp.getAttributeValue(null, "shortname"), pp.getAttributeValue(null, "name"), null); - final Line line = new Line(null, lineStr, lineColors(lineStr)); - XmlPullUtil.enter(pp, "itdMeansOfTransport"); + XmlPullUtil.require(pp, "motDivaParams"); + final String lineId = XmlPullUtil.attr(pp, "network") + ':' + XmlPullUtil.attr(pp, "line") + ':' + + XmlPullUtil.attr(pp, "supplement") + ':' + XmlPullUtil.attr(pp, "direction") + ':' + + XmlPullUtil.attr(pp, "project"); XmlPullUtil.exit(pp, "itdMeansOfTransport"); + final Line line = new Line(lineId, lineLabel, lineColors(lineLabel)); + if (XmlPullUtil.test(pp, "itdRBLControlled")) XmlPullUtil.next(pp); if (XmlPullUtil.test(pp, "itdInfoTextList"))