mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 16:59:51 +00:00
parse special address case
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@261 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
f33f266a61
commit
5128d2f1e5
1 changed files with 11 additions and 7 deletions
|
@ -106,6 +106,12 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
||||||
final String anyType = pp.getAttributeValue(null, "anyType");
|
final String anyType = pp.getAttributeValue(null, "anyType");
|
||||||
final String idStr = pp.getAttributeValue(null, "id");
|
final String idStr = pp.getAttributeValue(null, "id");
|
||||||
final String stopIdStr = pp.getAttributeValue(null, "stopID");
|
final String stopIdStr = pp.getAttributeValue(null, "stopID");
|
||||||
|
int lat = 0, lon = 0;
|
||||||
|
if ("WGS84".equals(pp.getAttributeValue(null, "mapName")))
|
||||||
|
{
|
||||||
|
lat = Integer.parseInt(pp.getAttributeValue(null, "y"));
|
||||||
|
lon = Integer.parseInt(pp.getAttributeValue(null, "x"));
|
||||||
|
}
|
||||||
|
|
||||||
LocationType type;
|
LocationType type;
|
||||||
int id;
|
int id;
|
||||||
|
@ -134,18 +140,16 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
||||||
type = LocationType.STATION;
|
type = LocationType.STATION;
|
||||||
id = Integer.parseInt(stopIdStr);
|
id = Integer.parseInt(stopIdStr);
|
||||||
}
|
}
|
||||||
|
else if (stopIdStr == null && idStr == null && (lat != 0 || lon != 0))
|
||||||
|
{
|
||||||
|
type = LocationType.ADDRESS;
|
||||||
|
id = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("unknown type: " + anyType + " " + idStr + " " + stopIdStr);
|
throw new IllegalArgumentException("unknown type: " + anyType + " " + idStr + " " + stopIdStr);
|
||||||
}
|
}
|
||||||
|
|
||||||
int lat = 0, lon = 0;
|
|
||||||
if ("WGS84".equals(pp.getAttributeValue(null, "mapName")))
|
|
||||||
{
|
|
||||||
lat = Integer.parseInt(pp.getAttributeValue(null, "y"));
|
|
||||||
lon = Integer.parseInt(pp.getAttributeValue(null, "x"));
|
|
||||||
}
|
|
||||||
|
|
||||||
final String name = normalizeLocationName(pp.nextText());
|
final String name = normalizeLocationName(pp.nextText());
|
||||||
|
|
||||||
return new Location(type, id, lat, lon, name);
|
return new Location(type, id, lat, lon, name);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue