diff --git a/enabler/src/de/schildbach/pte/SncbProvider.java b/enabler/src/de/schildbach/pte/SncbProvider.java index c82cd563..e810f342 100644 --- a/enabler/src/de/schildbach/pte/SncbProvider.java +++ b/enabler/src/de/schildbach/pte/SncbProvider.java @@ -40,6 +40,7 @@ public class SncbProvider extends AbstractHafasProvider super(API_BASE + "stboard.exe/nn", API_BASE + "ajax-getstop.exe/nny", API_BASE + "query.exe/nn", 16, null); setJsonGetStopsEncoding(UTF_8); + setJsonNearbyStationsEncoding(UTF_8); } public NetworkId id() @@ -125,7 +126,21 @@ public class SncbProvider extends AbstractHafasProvider public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException { - if (location.type == LocationType.STATION && location.hasId()) + if (location.hasLocation()) + { + final StringBuilder uri = new StringBuilder(queryEndpoint); + uri.append('y'); + uri.append("?performLocating=2&tpl=stop2json"); + uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200); + uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000); + uri.append("&look_stopclass=").append(allProductsInt()); + uri.append("&look_nv=get_stopweight|yes"); + uri.append("&look_x=").append(location.lon); + uri.append("&look_y=").append(location.lat); + + return jsonNearbyStations(uri.toString()); + } + else if (location.type == LocationType.STATION && location.hasId()) { final StringBuilder uri = new StringBuilder(stationBoardEndpoint); uri.append("?near=Zoek");