mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-13 08:10:46 +00:00
Hafas: When querying for nearby stations, use urlname.
This commit is contained in:
parent
540535b7d5
commit
593e032df4
1 changed files with 6 additions and 2 deletions
|
@ -2398,6 +2398,9 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
{
|
{
|
||||||
final CharSequence page = ParserUtils.scrape(uri, null, jsonNearbyStationsEncoding);
|
final CharSequence page = ParserUtils.scrape(uri, null, jsonNearbyStationsEncoding);
|
||||||
|
|
||||||
|
// System.out.println(uri);
|
||||||
|
// System.out.println(page);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
final JSONObject head = new JSONObject(page.toString());
|
final JSONObject head = new JSONObject(page.toString());
|
||||||
|
@ -2412,14 +2415,15 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
||||||
{
|
{
|
||||||
final JSONObject stop = aStops.optJSONObject(i);
|
final JSONObject stop = aStops.optJSONObject(i);
|
||||||
final String id = stop.getString("extId");
|
final String id = stop.getString("extId");
|
||||||
final String name = ParserUtils.resolveEntities(stop.getString("name"));
|
// final String name = ParserUtils.resolveEntities(stop.getString("name"));
|
||||||
|
final String urlname = ParserUtils.urlDecode(stop.getString("urlname"), jsonNearbyStationsEncoding);
|
||||||
final int lat = stop.getInt("y");
|
final int lat = stop.getInt("y");
|
||||||
final int lon = stop.getInt("x");
|
final int lon = stop.getInt("x");
|
||||||
final int stopWeight = stop.optInt("stopweight", -1);
|
final int stopWeight = stop.optInt("stopweight", -1);
|
||||||
|
|
||||||
if (stopWeight != 0)
|
if (stopWeight != 0)
|
||||||
{
|
{
|
||||||
final String[] placeAndName = splitStationName(name);
|
final String[] placeAndName = splitStationName(urlname);
|
||||||
stations.add(new Location(LocationType.STATION, id, lat, lon, placeAndName[0], placeAndName[1]));
|
stations.add(new Location(LocationType.STATION, id, lat, lon, placeAndName[0], placeAndName[1]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue