mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-15 09:00:36 +00:00
Fix exception when parsing type 'buildingname' in JSON stopfinder (EFA).
This commit is contained in:
parent
00b9456431
commit
c11a23ba08
1 changed files with 6 additions and 5 deletions
|
@ -294,7 +294,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
String type = stop.getString("type");
|
String type = stop.getString("type");
|
||||||
if ("any".equals(type))
|
if ("any".equals(type))
|
||||||
type = stop.getString("anyType");
|
type = stop.getString("anyType");
|
||||||
final String name = normalizeLocationName(stop.getString("object"));
|
final String name = normalizeLocationName(stop.optString("name"));
|
||||||
|
final String object = normalizeLocationName(stop.optString("object"));
|
||||||
final int quality = stop.getInt("quality");
|
final int quality = stop.getInt("quality");
|
||||||
final JSONObject ref = stop.getJSONObject("ref");
|
final JSONObject ref = stop.getJSONObject("ref");
|
||||||
String place = ref.getString("place");
|
String place = ref.getString("place");
|
||||||
|
@ -317,13 +318,13 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
||||||
|
|
||||||
final Location location;
|
final Location location;
|
||||||
if ("stop".equals(type))
|
if ("stop".equals(type))
|
||||||
location = new Location(LocationType.STATION, stop.getString("stateless"), lat, lon, place, name);
|
location = new Location(LocationType.STATION, stop.getString("stateless"), lat, lon, place, object);
|
||||||
else if ("poi".equals(type))
|
else if ("poi".equals(type))
|
||||||
location = new Location(LocationType.POI, null, lat, lon, place, name);
|
location = new Location(LocationType.POI, null, lat, lon, place, object);
|
||||||
else if ("crossing".equals(type))
|
else if ("crossing".equals(type))
|
||||||
location = new Location(LocationType.ADDRESS, null, lat, lon, place, name);
|
location = new Location(LocationType.ADDRESS, null, lat, lon, place, object);
|
||||||
else if ("street".equals(type) || "address".equals(type) || "singlehouse".equals(type) || "buildingname".equals(type))
|
else if ("street".equals(type) || "address".equals(type) || "singlehouse".equals(type) || "buildingname".equals(type))
|
||||||
location = new Location(LocationType.ADDRESS, null, lat, lon, place, normalizeLocationName(stop.getString("name")));
|
location = new Location(LocationType.ADDRESS, null, lat, lon, place, name);
|
||||||
else
|
else
|
||||||
throw new JSONException("unknown type: " + type);
|
throw new JSONException("unknown type: " + type);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue