mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 00:50:31 +00:00
Improved type determination in processing of odvNameElems
This commit is contained in:
parent
d2cd0b6603
commit
b63b261f34
1 changed files with 28 additions and 21 deletions
|
@ -789,8 +789,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
throw new IllegalStateException("unknown mapName=" + mapName + " x=" + x + " y=" + y);
|
throw new IllegalStateException("unknown mapName=" + mapName + " x=" + x + " y=" + y);
|
||||||
}
|
}
|
||||||
|
|
||||||
LocationType type;
|
final LocationType type;
|
||||||
int id;
|
final int id;
|
||||||
if ("stop".equals(anyType))
|
if ("stop".equals(anyType))
|
||||||
{
|
{
|
||||||
type = LocationType.STATION;
|
type = LocationType.STATION;
|
||||||
|
@ -812,7 +812,9 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
type = LocationType.ADDRESS;
|
type = LocationType.ADDRESS;
|
||||||
id = 0;
|
id = 0;
|
||||||
}
|
}
|
||||||
else if (stopIdStr != null)
|
else if (anyType == null || "unknown".equals(anyType))
|
||||||
|
{
|
||||||
|
if (stopIdStr != null)
|
||||||
{
|
{
|
||||||
type = LocationType.STATION;
|
type = LocationType.STATION;
|
||||||
id = Integer.parseInt(stopIdStr);
|
id = Integer.parseInt(stopIdStr);
|
||||||
|
@ -822,19 +824,24 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
type = LocationType.POI;
|
type = LocationType.POI;
|
||||||
id = Integer.parseInt(poiIdStr);
|
id = Integer.parseInt(poiIdStr);
|
||||||
}
|
}
|
||||||
else if (stopIdStr == null && idStr == null && (lat != 0 || lon != 0))
|
|
||||||
{
|
|
||||||
type = LocationType.ADDRESS;
|
|
||||||
id = 0;
|
|
||||||
}
|
|
||||||
else if (streetIdStr != null)
|
else if (streetIdStr != null)
|
||||||
{
|
{
|
||||||
type = LocationType.ADDRESS;
|
type = LocationType.ADDRESS;
|
||||||
id = Integer.parseInt(streetIdStr);
|
id = Integer.parseInt(streetIdStr);
|
||||||
}
|
}
|
||||||
|
else if (lat != 0 || lon != 0)
|
||||||
|
{
|
||||||
|
type = LocationType.ADDRESS;
|
||||||
|
id = 0;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new IllegalArgumentException("unknown type: " + anyType + " " + idStr + " " + stopIdStr);
|
throw new IllegalArgumentException("cannot substitute type");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new IllegalArgumentException("unknown type: " + anyType);
|
||||||
}
|
}
|
||||||
|
|
||||||
XmlPullUtil.enter(pp, "odvNameElem");
|
XmlPullUtil.enter(pp, "odvNameElem");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue