Navitia: Also suggest POI and administrative locations

The administrative areas are extremely useful when people search for a
suburb, but no stops have the suburbs name. They are currently mapped
to a POI location.
This commit is contained in:
Torsten Grote 2016-03-14 20:30:51 -03:00 committed by Andreas Schildbach
parent 889a85b745
commit 2adf627e51
3 changed files with 47 additions and 2 deletions

View file

@ -250,6 +250,26 @@ public abstract class AbstractNavitiaProviderLiveTest extends AbstractProviderLi
print(result);
}
protected final void queryTripFromAdminToPoi(final CharSequence from, final CharSequence to) throws IOException
{
final SuggestLocationsResult fromResult = suggestLocations(from);
assertTrue(fromResult.getLocations().size() > 0);
Location fromLocation = fromResult.getLocations().get(0);
assertEquals(fromLocation.type, LocationType.POI);
print(fromResult);
final SuggestLocationsResult toResult = suggestLocations(to);
assertTrue(toResult.getLocations().size() > 0);
Location toLocation = toResult.getLocations().get(0);
assertEquals(toLocation.type, LocationType.POI);
print(toResult);
final QueryTripsResult tripsResult = queryTrips(fromLocation, null, toLocation, new Date(), true,
Product.ALL, NetworkProvider.WalkSpeed.NORMAL, NetworkProvider.Accessibility.NEUTRAL);
assertEquals(QueryTripsResult.Status.OK, tripsResult.status);
print(tripsResult);
}
protected final void queryMoreTrips(final CharSequence from, final CharSequence to) throws IOException
{
final SuggestLocationsResult fromResult = suggestLocations(from);