mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 21:29:51 +00:00
Hafas split place and name of destinations
This commit is contained in:
parent
a9e52a5e60
commit
44f8567bc8
1 changed files with 20 additions and 8 deletions
|
@ -705,13 +705,13 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
|
|
||||||
final String position = platform != null ? "Gl. " + ParserUtils.resolveEntities(platform) : null;
|
final String position = platform != null ? "Gl. " + ParserUtils.resolveEntities(platform) : null;
|
||||||
|
|
||||||
final String destinationName;
|
final String[] destinationPlaceAndName;
|
||||||
if (dir != null)
|
if (dir != null)
|
||||||
destinationName = dir.trim();
|
destinationPlaceAndName = splitPlaceAndName(dir.trim());
|
||||||
else if (targetLoc != null)
|
else if (targetLoc != null)
|
||||||
destinationName = targetLoc.trim();
|
destinationPlaceAndName = splitPlaceAndName(targetLoc.trim());
|
||||||
else
|
else
|
||||||
destinationName = null;
|
destinationPlaceAndName = null;
|
||||||
|
|
||||||
final int destinationId;
|
final int destinationId;
|
||||||
if (dirnr != null)
|
if (dirnr != null)
|
||||||
|
@ -719,8 +719,9 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
else
|
else
|
||||||
destinationId = 0;
|
destinationId = 0;
|
||||||
|
|
||||||
final Location destination = new Location(destinationId > 0 ? LocationType.STATION : LocationType.ANY, destinationId, null,
|
final Location destination = new Location(destinationId > 0 ? LocationType.STATION : LocationType.ANY, destinationId,
|
||||||
destinationName);
|
destinationPlaceAndName != null ? destinationPlaceAndName[0] : null,
|
||||||
|
destinationPlaceAndName != null ? destinationPlaceAndName[1] : null);
|
||||||
|
|
||||||
final Line prodLine = parseLineAndType(prod);
|
final Line prodLine = parseLineAndType(prod);
|
||||||
final Line line;
|
final Line line;
|
||||||
|
@ -1187,7 +1188,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
}
|
}
|
||||||
else if ("DIRECTION".equals(attrName))
|
else if ("DIRECTION".equals(attrName))
|
||||||
{
|
{
|
||||||
destination = new Location(LocationType.ANY, 0, null, attributeVariants.get("NORMAL"));
|
final String[] destinationPlaceAndName = splitPlaceAndName(attributeVariants.get("NORMAL"));
|
||||||
|
destination = new Location(LocationType.ANY, 0, destinationPlaceAndName[0], destinationPlaceAndName[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
XmlPullUtil.exit(pp, "JourneyAttributeList");
|
XmlPullUtil.exit(pp, "JourneyAttributeList");
|
||||||
|
@ -1934,7 +1936,17 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
lineProduct = normalizeType(lineCategory);
|
lineProduct = normalizeType(lineCategory);
|
||||||
|
|
||||||
final Line line = newLine(lineProduct, normalizeLineName(lineName), lineComment, lineAttrs.toArray(new Line.Attr[0]));
|
final Line line = newLine(lineProduct, normalizeLineName(lineName), lineComment, lineAttrs.toArray(new Line.Attr[0]));
|
||||||
final Location direction = directionStr != null ? new Location(LocationType.ANY, 0, null, directionStr) : null;
|
|
||||||
|
final Location direction;
|
||||||
|
if (directionStr != null)
|
||||||
|
{
|
||||||
|
final String[] directionPlaceAndName = splitPlaceAndName(directionStr);
|
||||||
|
direction = new Location(LocationType.ANY, 0, directionPlaceAndName[0], directionPlaceAndName[1]);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
direction = null;
|
||||||
|
}
|
||||||
|
|
||||||
final Stop departure = new Stop(departureLocation, true, plannedDepartureTime != 0 ? new Date(plannedDepartureTime)
|
final Stop departure = new Stop(departureLocation, true, plannedDepartureTime != 0 ? new Date(plannedDepartureTime)
|
||||||
: null, predictedDepartureTime != 0 ? new Date(predictedDepartureTime) : null, plannedDeparturePosition,
|
: null, predictedDepartureTime != 0 ? new Date(predictedDepartureTime) : null, plannedDeparturePosition,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue