parse poiID and streetID, just in case

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@284 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-10-11 21:45:45 +00:00
parent 1872466fe4
commit cbbcc42c94

View file

@ -120,6 +120,8 @@ 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");
final String poiIdStr = pp.getAttributeValue(null, "poiID");
final String streetIdStr = pp.getAttributeValue(null, "streetID");
int lat = 0, lon = 0; int lat = 0, lon = 0;
if ("WGS84".equals(pp.getAttributeValue(null, "mapName"))) if ("WGS84".equals(pp.getAttributeValue(null, "mapName")))
{ {
@ -159,6 +161,16 @@ public abstract class AbstractEfaProvider implements NetworkProvider
type = LocationType.ADDRESS; type = LocationType.ADDRESS;
id = 0; id = 0;
} }
else if (poiIdStr != null)
{
type = LocationType.POI;
id = Integer.parseInt(poiIdStr);
}
else if (streetIdStr != null)
{
type = LocationType.ADDRESS;
id = Integer.parseInt(streetIdStr);
}
else else
{ {
throw new IllegalArgumentException("unknown type: " + anyType + " " + idStr + " " + stopIdStr); throw new IllegalArgumentException("unknown type: " + anyType + " " + idStr + " " + stopIdStr);