mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-14 08:40:29 +00:00
use JSON stopfinder for San Francisco
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@881 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
f825c5f3f3
commit
e6078baf79
2 changed files with 5 additions and 3 deletions
|
@ -159,7 +159,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
String type = stop.getString("type");
|
||||
if ("any".equals(type))
|
||||
type = stop.getString("anyType");
|
||||
final String name = stop.getString("object");
|
||||
final String name = normalizeLocationName(stop.getString("object"));
|
||||
final JSONObject ref = stop.getJSONObject("ref");
|
||||
String place = ref.getString("place");
|
||||
if (place != null && place.length() == 0)
|
||||
|
@ -183,8 +183,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
results.add(new Location(LocationType.STATION, stop.getInt("stateless"), lat, lon, place, name));
|
||||
else if ("poi".equals(type))
|
||||
results.add(new Location(LocationType.POI, 0, lat, lon, place, name));
|
||||
else if ("crossing".equals(type))
|
||||
results.add(new Location(LocationType.ADDRESS, 0, lat, lon, place, name));
|
||||
else if ("street".equals(type) || "address".equals(type) || "singlehouse".equals(type))
|
||||
results.add(new Location(LocationType.ADDRESS, 0, lat, lon, place, stop.getString("name")));
|
||||
results.add(new Location(LocationType.ADDRESS, 0, lat, lon, place, normalizeLocationName(stop.getString("name"))));
|
||||
else
|
||||
throw new IllegalArgumentException("unknown type: " + type + " on " + uri);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ public class SfProvider extends AbstractEfaProvider
|
|||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
||||
return jsonStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue