Navitia: queryNearbyLocations() with distance of 0 now means "unlimited" (50km).

This commit is contained in:
Torsten Grote 2016-01-31 19:39:42 +01:00 committed by Andreas Schildbach
parent abad1694bc
commit 4f9fb0cab2
3 changed files with 19 additions and 1 deletions

View file

@ -760,7 +760,7 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider
return false;
}
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, int maxDistance,
final int maxLocations) throws IOException
{
final ResultHeader resultHeader = new ResultHeader(network, SERVER_PRODUCT, SERVER_VERSION, 0, null);
@ -799,6 +799,9 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider
throw new IllegalArgumentException("Unhandled location type: " + location.type);
}
if (maxDistance == 0)
maxDistance = 50000;
final String queryUri = uri() + queryUriType + "places_nearby?type[]=stop_point" + "&distance=" + maxDistance + "&count=" + maxLocations
+ "&depth=0";
final CharSequence page = httpClient.get(queryUri);