mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 09:00:36 +00:00
wheelchair access in Brandenburg/Berlin
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@813 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
7db1140624
commit
afd0bc6a15
5 changed files with 21 additions and 12 deletions
|
@ -874,6 +874,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
while (pp.getName().equals("JHandle"))
|
||||
XmlPullUtil.next(pp);
|
||||
XmlPullUtil.enter(pp, "JourneyAttributeList");
|
||||
boolean wheelchairAccess = false;
|
||||
String name = null;
|
||||
String category = null;
|
||||
String shortCategory = null;
|
||||
|
@ -883,12 +884,17 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
XmlPullUtil.enter(pp, "JourneyAttribute");
|
||||
XmlPullUtil.require(pp, "Attribute");
|
||||
final String attrName = pp.getAttributeValue(null, "type");
|
||||
XmlPullUtil.enter(pp);
|
||||
final String code = pp.getAttributeValue(null, "code");
|
||||
XmlPullUtil.enter(pp, "Attribute");
|
||||
final Map<String, String> attributeVariants = parseAttributeVariants(pp);
|
||||
XmlPullUtil.exit(pp);
|
||||
XmlPullUtil.exit(pp, "Attribute");
|
||||
XmlPullUtil.exit(pp, "JourneyAttribute");
|
||||
|
||||
if ("NAME".equals(attrName))
|
||||
if ("bf".equals(code))
|
||||
{
|
||||
wheelchairAccess = true;
|
||||
}
|
||||
else if ("NAME".equals(attrName))
|
||||
{
|
||||
name = attributeVariants.get("NORMAL");
|
||||
}
|
||||
|
@ -943,7 +949,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
if (category == null)
|
||||
category = shortCategory;
|
||||
|
||||
line = parseLine(category, name);
|
||||
line = parseLine(category, name, wheelchairAccess);
|
||||
}
|
||||
else if (tag.equals("Walk") || tag.equals("Transfer") || tag.equals("GisRoute"))
|
||||
{
|
||||
|
@ -1710,7 +1716,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
|
||||
protected static final Pattern P_NORMALIZE_LINE = Pattern.compile("([A-Za-zßÄÅäáàâåéèêíìîÖöóòôÜüúùûØ/]+)[\\s-]*(.*)");
|
||||
|
||||
protected Line parseLine(final String type, final String line)
|
||||
protected Line parseLine(final String type, final String line, final boolean wheelchairAccess)
|
||||
{
|
||||
final char normalizedType = normalizeType(type);
|
||||
|
||||
|
@ -1730,7 +1736,10 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
lineStr = Character.toString(normalizedType);
|
||||
}
|
||||
|
||||
return newLine(lineStr);
|
||||
if (wheelchairAccess)
|
||||
return newLine(lineStr, Line.Attr.WHEEL_CHAIR_ACCESS);
|
||||
else
|
||||
return newLine(lineStr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -235,7 +235,7 @@ public class InvgProvider extends AbstractHafasProvider
|
|||
|
||||
final String lineType = mDepFine.group(3);
|
||||
|
||||
final Line line = parseLine(lineType, ParserUtils.resolveEntities(mDepFine.group(4)));
|
||||
final Line line = parseLine(lineType, ParserUtils.resolveEntities(mDepFine.group(4)), false);
|
||||
|
||||
final int destinationId = mDepFine.group(5) != null ? Integer.parseInt(mDepFine.group(5)) : 0;
|
||||
|
||||
|
@ -282,7 +282,7 @@ public class InvgProvider extends AbstractHafasProvider
|
|||
protected static final Pattern P_NORMALIZE_LINE_BUS_X = Pattern.compile("Bus\\s*X\\s*(\\d+)");
|
||||
|
||||
@Override
|
||||
protected Line parseLine(final String type, final String line)
|
||||
protected Line parseLine(final String type, final String line, final boolean wheelchairAccess)
|
||||
{
|
||||
if ("1".equals(type))
|
||||
{
|
||||
|
@ -315,7 +315,7 @@ public class InvgProvider extends AbstractHafasProvider
|
|||
}
|
||||
}
|
||||
|
||||
return super.parseLine(type, line);
|
||||
return super.parseLine(type, line, wheelchairAccess);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -257,7 +257,7 @@ public class SeptaProvider extends AbstractHafasProvider
|
|||
|
||||
final String lineType = mDepFine.group(3);
|
||||
|
||||
final Line line = parseLine(lineType, ParserUtils.resolveEntities(mDepFine.group(4)));
|
||||
final Line line = parseLine(lineType, ParserUtils.resolveEntities(mDepFine.group(4)), false);
|
||||
|
||||
final int destinationId = mDepFine.group(5) != null ? Integer.parseInt(mDepFine.group(5)) : 0;
|
||||
|
||||
|
|
|
@ -222,7 +222,7 @@ public class ShProvider extends AbstractHafasProvider
|
|||
|
||||
final String lineType = mDepFine.group(2);
|
||||
|
||||
final Line line = parseLine(lineType, ParserUtils.resolveEntities(mDepFine.group(3).trim()));
|
||||
final Line line = parseLine(lineType, ParserUtils.resolveEntities(mDepFine.group(3).trim()), false);
|
||||
|
||||
final int destinationId = mDepFine.group(4) != null ? Integer.parseInt(mDepFine.group(4)) : 0;
|
||||
|
||||
|
|
|
@ -264,7 +264,7 @@ public class VgsProvider extends AbstractHafasProvider
|
|||
|
||||
final String lineType = mDepFine.group(3);
|
||||
|
||||
final Line line = parseLine(lineType, ParserUtils.resolveEntities(mDepFine.group(4)));
|
||||
final Line line = parseLine(lineType, ParserUtils.resolveEntities(mDepFine.group(4)), false);
|
||||
|
||||
final int destinationId = mDepFine.group(5) != null ? Integer.parseInt(mDepFine.group(5)) : 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue