mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 02:18:47 +00:00
Introduce location type for plain coordinates.
This commit is contained in:
parent
71d88fcd18
commit
4b65f0145c
70 changed files with 186 additions and 174 deletions
|
@ -470,7 +470,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
else if ("poi".equals(ty))
|
||||
type = LocationType.POI;
|
||||
else if ("loc".equals(ty))
|
||||
type = LocationType.ADDRESS;
|
||||
type = LocationType.COORD;
|
||||
else if ("street".equals(ty))
|
||||
type = LocationType.ADDRESS;
|
||||
else if ("singlehouse".equals(ty))
|
||||
|
@ -833,6 +833,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
final String buildingName = XmlPullUtil.optAttr(pp, "buildingName", null);
|
||||
final String buildingNumber = XmlPullUtil.optAttr(pp, "buildingNumber", null);
|
||||
final String postCode = XmlPullUtil.optAttr(pp, "postCode", null);
|
||||
final String streetName = XmlPullUtil.optAttr(pp, "streetName", null);
|
||||
final Point coord = processCoordAttr(pp);
|
||||
|
||||
final String nameElem = normalizeLocationName(XmlPullUtil.valueTag(pp, "odvNameElem"));
|
||||
|
@ -844,42 +845,53 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
if ("stop".equals(type))
|
||||
{
|
||||
locationType = LocationType.STATION;
|
||||
place = locality;
|
||||
name = objectName;
|
||||
place = locality != null ? locality : defaultPlace;
|
||||
name = objectName != null ? objectName : nameElem;
|
||||
}
|
||||
else if ("poi".equals(type))
|
||||
{
|
||||
locationType = LocationType.POI;
|
||||
place = locality;
|
||||
name = objectName;
|
||||
place = locality != null ? locality : defaultPlace;
|
||||
name = objectName != null ? objectName : nameElem;
|
||||
}
|
||||
else if ("loc".equals(type))
|
||||
{
|
||||
return null;
|
||||
if (coord != null)
|
||||
{
|
||||
locationType = LocationType.COORD;
|
||||
place = null;
|
||||
name = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
locationType = LocationType.ADDRESS;
|
||||
place = null;
|
||||
name = locality;
|
||||
}
|
||||
}
|
||||
else if ("address".equals(type) || "singlehouse".equals(type))
|
||||
{
|
||||
locationType = LocationType.ADDRESS;
|
||||
place = locality;
|
||||
place = locality != null ? locality : defaultPlace;
|
||||
name = objectName + (buildingNumber != null ? " " + buildingNumber : "");
|
||||
}
|
||||
else if ("street".equals(type) || "crossing".equals(type))
|
||||
{
|
||||
locationType = LocationType.ADDRESS;
|
||||
place = locality;
|
||||
name = objectName;
|
||||
place = locality != null ? locality : defaultPlace;
|
||||
name = objectName != null ? objectName : nameElem;
|
||||
}
|
||||
else if ("postcode".equals(type))
|
||||
{
|
||||
locationType = LocationType.ADDRESS;
|
||||
place = locality;
|
||||
place = locality != null ? locality : defaultPlace;
|
||||
name = postCode;
|
||||
}
|
||||
else if ("buildingname".equals(type))
|
||||
{
|
||||
locationType = LocationType.ADDRESS;
|
||||
place = locality;
|
||||
name = buildingName;
|
||||
place = locality != null ? locality : defaultPlace;
|
||||
name = buildingName != null ? buildingName : streetName;
|
||||
}
|
||||
else if ("coord".equals(type))
|
||||
{
|
||||
|
@ -892,7 +904,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
throw new IllegalArgumentException("unknown type/anyType: " + type);
|
||||
}
|
||||
|
||||
return new Location(locationType, id, coord, place != null ? place : defaultPlace, name != null ? name : nameElem);
|
||||
return new Location(locationType, id, coord, place, name);
|
||||
}
|
||||
|
||||
private Location processItdOdvAssignedStop(final XmlPullParser pp) throws XmlPullParserException, IOException
|
||||
|
@ -3271,7 +3283,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
private void appendLocation(final StringBuilder uri, final Location location, final String paramSuffix)
|
||||
{
|
||||
if (location.type == LocationType.ADDRESS && location.hasLocation())
|
||||
if ((location.type == LocationType.ADDRESS || location.type == LocationType.COORD) && location.hasLocation())
|
||||
{
|
||||
uri.append("&type_").append(paramSuffix).append("=coord");
|
||||
uri.append("&name_").append(paramSuffix).append("=")
|
||||
|
@ -3291,6 +3303,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
return "stop";
|
||||
if (type == LocationType.ADDRESS)
|
||||
return "any"; // strange, matches with anyObjFilter
|
||||
if (type == LocationType.COORD)
|
||||
return "coord";
|
||||
if (type == LocationType.POI)
|
||||
return "poi";
|
||||
if (type == LocationType.ANY)
|
||||
|
|
|
@ -1316,6 +1316,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
else if (location.type == LocationType.ADDRESS && location.hasLocation())
|
||||
return "<Address type=\"WGS84\" x=\"" + location.lon + "\" y=\"" + location.lat + "\" name=\""
|
||||
+ (location.place != null ? location.place + ", " : "") + location.name + "\" />";
|
||||
else if (location.type == LocationType.COORD && location.hasLocation())
|
||||
return "<Coord type=\"WGS84\" x=\"" + location.lon + "\" y=\"" + location.lat + "\" />";
|
||||
else
|
||||
throw new IllegalArgumentException("cannot handle: " + location);
|
||||
}
|
||||
|
@ -1354,7 +1356,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
return 1;
|
||||
if (type == LocationType.POI)
|
||||
return 4;
|
||||
if (type == LocationType.ADDRESS && location.hasLocation())
|
||||
if (type == LocationType.COORD || (type == LocationType.ADDRESS && location.hasLocation()))
|
||||
return 16;
|
||||
if (type == LocationType.ADDRESS && location.name != null)
|
||||
return 2;
|
||||
|
|
|
@ -791,7 +791,7 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider
|
|||
|
||||
// Build query uri depending of location type.
|
||||
final String queryUriType;
|
||||
if (location.type == LocationType.ADDRESS || location.type == LocationType.ANY)
|
||||
if (location.type == LocationType.COORD || location.type == LocationType.ADDRESS || location.type == LocationType.ANY)
|
||||
{
|
||||
if (!location.hasLocation())
|
||||
{
|
||||
|
|
|
@ -53,6 +53,11 @@ public final class Location implements Serializable
|
|||
|
||||
checkArgument(id == null || id.length() > 0, "ID cannot be the empty string");
|
||||
checkArgument(place == null || name != null, "place '%s' without name cannot exist", place);
|
||||
if (type == LocationType.COORD)
|
||||
{
|
||||
checkArgument(hasLocation(), "coordinates missing");
|
||||
checkArgument(place == null && name == null, "coordinates cannot have place or name");
|
||||
}
|
||||
}
|
||||
|
||||
public Location(final LocationType type, final String id, final Point coord, final String place, final String name)
|
||||
|
@ -62,24 +67,12 @@ public final class Location implements Serializable
|
|||
|
||||
public Location(final LocationType type, final String id, final String place, final String name)
|
||||
{
|
||||
this.type = checkNotNull(type);
|
||||
this.id = id;
|
||||
this.lat = 0;
|
||||
this.lon = 0;
|
||||
this.place = place;
|
||||
this.name = name;
|
||||
|
||||
checkArgument(place == null || name != null, "place '%s' without name cannot exist", place);
|
||||
this(type, id, 0, 0, place, name);
|
||||
}
|
||||
|
||||
public Location(final LocationType type, final String id, final int lat, final int lon)
|
||||
{
|
||||
this.type = checkNotNull(type);
|
||||
this.id = id;
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
this.place = null;
|
||||
this.name = null;
|
||||
this(type, id, lat, lon, null, null);
|
||||
}
|
||||
|
||||
public Location(final LocationType type, final String id, final Point coord)
|
||||
|
@ -89,27 +82,17 @@ public final class Location implements Serializable
|
|||
|
||||
public Location(final LocationType type, final String id)
|
||||
{
|
||||
this.type = checkNotNull(type);
|
||||
this.id = id;
|
||||
this.lat = 0;
|
||||
this.lon = 0;
|
||||
this.place = null;
|
||||
this.name = null;
|
||||
this(type, id, null, null);
|
||||
}
|
||||
|
||||
public Location(final LocationType type, final int lat, final int lon)
|
||||
public static Location coord(final int lat, final int lon)
|
||||
{
|
||||
this.type = checkNotNull(type);
|
||||
this.id = null;
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
this.place = null;
|
||||
this.name = null;
|
||||
return new Location(LocationType.COORD, null, lat, lon);
|
||||
}
|
||||
|
||||
public Location(final LocationType type, final Point coord)
|
||||
public static Location coord(final Point coord)
|
||||
{
|
||||
this(type, coord != null ? coord.lat : 0, coord != null ? coord.lon : 0);
|
||||
return new Location(LocationType.COORD, null, coord.lat, coord.lon);
|
||||
}
|
||||
|
||||
public final boolean hasId()
|
||||
|
@ -135,7 +118,7 @@ public final class Location implements Serializable
|
|||
if (type == LocationType.POI)
|
||||
return true;
|
||||
|
||||
if (type == LocationType.ADDRESS)
|
||||
if (type == LocationType.ADDRESS || type == LocationType.COORD)
|
||||
return hasLocation();
|
||||
|
||||
return false;
|
||||
|
@ -196,7 +179,7 @@ public final class Location implements Serializable
|
|||
public String toString()
|
||||
{
|
||||
final ToStringHelper helper = MoreObjects.toStringHelper(this).addValue(type).addValue(id);
|
||||
if (lat != 0 || lon != 0)
|
||||
if (hasLocation())
|
||||
helper.addValue(lat + "/" + lon);
|
||||
return helper.add("place", place).add("name", name).omitNullValues().toString();
|
||||
}
|
||||
|
|
|
@ -22,5 +22,14 @@ package de.schildbach.pte.dto;
|
|||
*/
|
||||
public enum LocationType
|
||||
{
|
||||
ANY, STATION, POI, ADDRESS
|
||||
/** Location can represent any of the below. Mainly meant for user input. */
|
||||
ANY,
|
||||
/** Location represents a station or stop. */
|
||||
STATION,
|
||||
/** Location represents a point of interest. */
|
||||
POI,
|
||||
/** Location represents a postal address. */
|
||||
ADDRESS,
|
||||
/** Location represents a just a plain coordinate, e.g. acquired by GPS. */
|
||||
COORD
|
||||
}
|
||||
|
|
|
@ -52,8 +52,7 @@ public abstract class AbstractNavitiaProviderLiveTest extends AbstractProviderLi
|
|||
|
||||
protected final void nearbyStationsAddress(final int lat, final int lon) throws IOException
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), new Location(LocationType.ADDRESS, lat, lon),
|
||||
700, 10);
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), Location.coord(lat, lon), 700, 10);
|
||||
assertEquals(NearbyLocationsResult.Status.OK, result.status);
|
||||
print(result);
|
||||
}
|
||||
|
@ -75,7 +74,7 @@ public abstract class AbstractNavitiaProviderLiveTest extends AbstractProviderLi
|
|||
|
||||
protected final void nearbyStationsAny(final int lat, final int lon) throws IOException
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), new Location(LocationType.ANY, lat, lon), 700, 10);
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), Location.coord(lat, lon), 700, 10);
|
||||
assertEquals(NearbyLocationsResult.Status.OK, result.status);
|
||||
print(result);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ public class AtcProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
// TODO bad coordinate!
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 8168907, 10609969));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(8168907, 10609969));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class AvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48367233, 10894976));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(48367233, 10894976));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,15 +57,14 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52525589, 13369548));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(52525589, 13369548));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyPOIsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.POI),
|
||||
new Location(LocationType.ADDRESS, 52525589, 13369548));
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.POI), Location.coord(52525589, 13369548));
|
||||
print(result);
|
||||
assertThat(result.locations, hasItem(new Location(LocationType.POI, "990416076", "Berlin", "Museum für Naturkunde")));
|
||||
}
|
||||
|
@ -112,7 +111,6 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final SuggestLocationsResult result = suggestLocations("München, Friedenstraße 2");
|
||||
print(result);
|
||||
|
||||
assertEquals(LocationType.ADDRESS, result.getLocations().get(0).type);
|
||||
assertEquals("Friedenstraße 2", result.getLocations().get(0).name);
|
||||
}
|
||||
|
@ -179,7 +177,6 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "8010205", null, "Leipzig Hbf"), null, new Location(
|
||||
LocationType.STATION, "8010205", null, "Leipzig Hbf"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.TOO_CLOSE, result.status);
|
||||
}
|
||||
|
||||
|
@ -189,7 +186,6 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "8011160", null, "Berlin Hbf"), null, new Location(
|
||||
LocationType.STATION, "8010205", null, "Leipzig Hbf"), new Date(0), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.INVALID_DATE, result.status);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class BayernProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48135232, 11560650));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(48135232, 11560650));
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
@ -64,8 +64,8 @@ public class BayernProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyLocationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), new Location(
|
||||
LocationType.ADDRESS, 48135232, 11560650));
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI),
|
||||
Location.coord(48135232, 11560650));
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
@ -140,8 +140,8 @@ public class BayernProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void tripBetweenCoordinates() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, null, 48165238, 11577473), null, new Location(
|
||||
LocationType.ADDRESS, null, 47987199, 11326532), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(Location.coord(48165238, 11577473), null, Location.coord(47987199, 11326532), new Date(), true,
|
||||
Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
|
|
|
@ -57,7 +57,7 @@ public class BsvagProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52272065, 10524788));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(52272065, 10524788));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class BvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47551466, 7585187));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(47551466, 7585187));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class BvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52486400, 13350744));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(52486400, 13350744));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -172,8 +172,8 @@ public class BvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void tripBetweenCoordinates() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, null, 52501507, 13357026, null, null), null, new Location(
|
||||
LocationType.ADDRESS, null, 52513639, 13568648, null, null), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(Location.coord(52501507, 13357026), null, Location.coord(52513639, 13568648), new Date(), true,
|
||||
Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
|
@ -193,10 +193,8 @@ public class BvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void viaTripBetweenCoordinates() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, null, 52501507, 13357026, null, null), new Location(
|
||||
LocationType.ADDRESS, null, 52479868, 13324247, null, null),
|
||||
new Location(LocationType.ADDRESS, null, 52513639, 13568648, null, null), new Date(), true, Product.ALL, WalkSpeed.NORMAL,
|
||||
Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(Location.coord(52501507, 13357026), Location.coord(52479868, 13324247),
|
||||
Location.coord(52513639, 13568648), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
|
|
|
@ -55,7 +55,7 @@ public class DingProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48401092, 9992037));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(48401092, 9992037));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -114,4 +114,12 @@ public class DingProviderLiveTest extends AbstractProviderLiveTest
|
|||
final QueryTripsResult earlierResult = queryMoreTrips(later2Result.context, false);
|
||||
print(earlierResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tripAnyToAny() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ANY, null, null, "Hermaringen"), null, new Location(LocationType.ANY,
|
||||
null, null, "Heidenheim"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@ public class DsbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 55670305, 12554169));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(55670305, 12554169));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class DubProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 25269008, 55312672));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(25269008, 55312672));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class EireannProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 53343993, -6267371));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(53343993, -6267371));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52379497, 9735832));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(52379497, 9735832));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class InvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48744678, 11437941));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(48744678, 11437941));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class IvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47271228, 11402063));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(47271228, 11402063));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class JetProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 31769757, 35213506));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(31769757, 35213506));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class KvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49008184, 8400736));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(49008184, 8400736));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class LinzProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48305726, 14287863));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(48305726, 14287863));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class LuProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49610187, 6132746));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(49610187, 6132746));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,15 +56,15 @@ public class MerseyProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 53401112, -2958903));
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), Location.coord(53401112, -2958903));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyLocationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), new Location(
|
||||
LocationType.ADDRESS, 53401112, -2958903));
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI),
|
||||
Location.coord(53401112, -2958903));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class MetProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, -37800941, 144966545));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(-37800941, 144966545));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class MvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51219852, 7639217));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(51219852, 7639217));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public class MvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48135232, 11560650));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(48135232, 11560650));
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
@ -66,8 +66,8 @@ public class MvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyLocationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), new Location(
|
||||
LocationType.ADDRESS, 48135232, 11560650));
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI),
|
||||
Location.coord(48135232, 11560650));
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
@ -148,8 +148,8 @@ public class MvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void tripBetweenCoordinates() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, null, 48165238, 11577473), null, new Location(
|
||||
LocationType.ADDRESS, null, 47987199, 11326532), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(Location.coord(48165238, 11577473), null, Location.coord(47987199, 11326532), new Date(), true,
|
||||
Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
|
|
|
@ -55,7 +55,7 @@ public class NasaProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51346546, 12383333));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(51346546, 12383333));
|
||||
|
||||
print(result);
|
||||
assertEquals(NearbyLocationsResult.Status.OK, result.status);
|
||||
|
|
|
@ -54,7 +54,7 @@ public class NriProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 59911871, 10764999));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(59911871, 10764999));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public class NsProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52377548, 4901218));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(52377548, 4901218));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -60,10 +60,10 @@ public class NvbwProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result1 = queryNearbyStations(new Location(LocationType.ADDRESS, 48778953, 9178963));
|
||||
final NearbyLocationsResult result1 = queryNearbyStations(Location.coord(48778953, 9178963));
|
||||
print(result1);
|
||||
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(new Location(LocationType.ADDRESS, 48493550, 9205656));
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(Location.coord(48493550, 9205656));
|
||||
print(result2);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,14 +56,14 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50108625, 8669604));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(50108625, 8669604));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinateKassel() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51318447, 9496250));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(51318447, 9496250));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ public class OebbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48200239, 16370773));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(48200239, 16370773));
|
||||
|
||||
print(result);
|
||||
assertEquals(NearbyLocationsResult.Status.OK, result.status);
|
||||
|
|
|
@ -54,7 +54,7 @@ public class PlProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52227027, 20989795));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(52227027, 20989795));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ public class RsagProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 54078314, 12131715));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(54078314, 12131715));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class RtProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52525589, 13369548));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(52525589, 13369548));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class SbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52525589, 13369548));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(52525589, 13369548));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class SeProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 57709311, 11988459));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(57709311, 11988459));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class SeptaProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 39954122, -75161705));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(39954122, -75161705));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class SfProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 37777811, -122419481));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(37777811, -122419481));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50748017, 3407118));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(50748017, 3407118));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class StockholmProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 59329897, 18072281));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(59329897, 18072281));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class StvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47072612, 15431814));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(47072612, 15431814));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class SvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47809195, 13054919));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(47809195, 13054919));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class SydneyProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, -32823911, 151462824));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(-32823911, 151462824));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class TfiProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 53348656, -6262221));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(53348656, -6262221));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ public class TlemProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51507161, -0127144));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(51507161, -0127144));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -196,6 +196,16 @@ public class TlemProviderLiveTest extends AbstractProviderLiveTest
|
|||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tripFromAddress() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(
|
||||
new Location(LocationType.ADDRESS, "streetID:203417::31117006:-1", "London", "Kings Cross, London"), null, new Location(
|
||||
LocationType.STATION, "1002070", 51508530, 46706, "Royal Albert", "Royal Albert"), new Date(), true, Product.ALL,
|
||||
WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void tripPostcode() throws Exception
|
||||
{
|
||||
|
|
|
@ -57,7 +57,7 @@ public class VagfrProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48000295, 7854338));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(48000295, 7854338));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public class VbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52548505, 13388640));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(52548505, 13388640));
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
@ -172,8 +172,8 @@ public class VbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void tripBetweenCoordinates() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, null, 52501507, 13357026, null, null), null, new Location(
|
||||
LocationType.ADDRESS, null, 52513639, 13568648, null, null), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(Location.coord(52501507, 13357026), null, Location.coord(52513639, 13568648), new Date(), true,
|
||||
Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
|
@ -186,10 +186,8 @@ public class VbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void viaTripBetweenCoordinates() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, null, 52501507, 13357026, null, null), new Location(
|
||||
LocationType.ADDRESS, null, 52479868, 13324247, null, null),
|
||||
new Location(LocationType.ADDRESS, null, 52513639, 13568648, null, null), new Date(), true, Product.ALL, WalkSpeed.NORMAL,
|
||||
Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(Location.coord(52501507, 13357026), Location.coord(52479868, 13324247),
|
||||
Location.coord(52513639, 13568648), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
|
|
|
@ -55,7 +55,7 @@ public class VblProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47049107, 8312502));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(47049107, 8312502));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class VbnProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51318447, 9496250));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(51318447, 9496250));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ public class VgnProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49455472, 11079655));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(49455472, 11079655));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@ public class VgsProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49234783, 6995687));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(49234783, 6995687));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class VmobilProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47271228, 11402063));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(47271228, 11402063));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class VmsProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50832754, 12918348));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(50832754, 12918348));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class VmvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 53637555, 11392593));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(53637555, 11392593));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class VorProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48207355, 16370602));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(48207355, 16370602));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -137,8 +137,8 @@ public class VorProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void tripBetweenCoordinates() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, null, 48180281, 16333551), null, new Location(
|
||||
LocationType.ADDRESS, null, 48240452, 16444788), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(Location.coord(48180281, 16333551), null, Location.coord(48240452, 16444788), new Date(), true,
|
||||
Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
|
|
|
@ -60,10 +60,10 @@ public class VrnProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result1 = queryNearbyStations(new Location(LocationType.ADDRESS, 49486561, 8477297));
|
||||
final NearbyLocationsResult result1 = queryNearbyStations(Location.coord(49486561, 8477297));
|
||||
print(result1);
|
||||
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(new Location(LocationType.ADDRESS, 49757571, 6639147));
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(Location.coord(49757571, 6639147));
|
||||
print(result2);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,10 +57,10 @@ public class VrrProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51218693, 6777785));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(51218693, 6777785));
|
||||
print(result);
|
||||
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(new Location(LocationType.ADDRESS, 51719648, 8754330));
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(Location.coord(51719648, 8754330));
|
||||
print(result2);
|
||||
}
|
||||
|
||||
|
|
|
@ -73,29 +73,27 @@ public class VrsProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ANY, 51218693, 6777785));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(51218693, 6777785));
|
||||
print(result);
|
||||
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(new Location(LocationType.ANY, 51719648, 8754330));
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(Location.coord(51719648, 8754330));
|
||||
print(result2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyLocationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION),
|
||||
new Location(LocationType.ANY, 50732100, 7096820), 100, 1);
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), Location.coord(50732100, 7096820), 100, 1);
|
||||
print(result);
|
||||
|
||||
final NearbyLocationsResult result2 = queryNearbyLocations(EnumSet.of(LocationType.ADDRESS),
|
||||
new Location(LocationType.ANY, 50732100, 7096820));
|
||||
final NearbyLocationsResult result2 = queryNearbyLocations(EnumSet.of(LocationType.ADDRESS), Location.coord(50732100, 7096820));
|
||||
print(result2);
|
||||
|
||||
final NearbyLocationsResult result3 = queryNearbyLocations(EnumSet.of(LocationType.POI), new Location(LocationType.ANY, 50732100, 7096820));
|
||||
final NearbyLocationsResult result3 = queryNearbyLocations(EnumSet.of(LocationType.POI), Location.coord(50732100, 7096820));
|
||||
print(result3);
|
||||
|
||||
final NearbyLocationsResult result4 = queryNearbyLocations(EnumSet.of(LocationType.ADDRESS, LocationType.STATION), new Location(
|
||||
LocationType.ANY, 50732100, 7096820));
|
||||
final NearbyLocationsResult result4 = queryNearbyLocations(EnumSet.of(LocationType.ADDRESS, LocationType.STATION),
|
||||
Location.coord(50732100, 7096820));
|
||||
print(result4);
|
||||
}
|
||||
|
||||
|
@ -111,7 +109,7 @@ public class VrsProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
int lat = LAT_FROM + rand.nextInt(LAT_TO - LAT_FROM);
|
||||
int lon = LON_FROM + rand.nextInt(LON_TO - LON_FROM);
|
||||
NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.ANY), new Location(LocationType.ANY, lat, lon));
|
||||
NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.ANY), Location.coord(lat, lon));
|
||||
System.out.println(result);
|
||||
assertNotNull(result.locations);
|
||||
assertNotNull(result.locations.get(0));
|
||||
|
@ -121,23 +119,20 @@ public class VrsProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsWithLimits() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION),
|
||||
new Location(LocationType.ANY, 50732100, 7096820), 0, 0);
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), Location.coord(50732100, 7096820), 0, 0);
|
||||
print(result);
|
||||
|
||||
final NearbyLocationsResult result2 = queryNearbyLocations(EnumSet.of(LocationType.STATION),
|
||||
new Location(LocationType.ANY, 50732100, 7096820), 0, 50);
|
||||
final NearbyLocationsResult result2 = queryNearbyLocations(EnumSet.of(LocationType.STATION), Location.coord(50732100, 7096820), 0, 50);
|
||||
print(result2);
|
||||
|
||||
final NearbyLocationsResult result3 = queryNearbyLocations(EnumSet.of(LocationType.STATION),
|
||||
new Location(LocationType.ANY, 50732100, 7096820), 1000, 50);
|
||||
final NearbyLocationsResult result3 = queryNearbyLocations(EnumSet.of(LocationType.STATION), Location.coord(50732100, 7096820), 1000, 50);
|
||||
print(result3);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyLocationsEmpty() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.allOf(LocationType.class), new Location(LocationType.ANY, 1, 0), 0, 0);
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.allOf(LocationType.class), Location.coord(1, 0), 0, 0);
|
||||
print(result);
|
||||
assertEquals(0, result.locations.size());
|
||||
}
|
||||
|
@ -416,8 +411,8 @@ public class VrsProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void testTripByCoord() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ANY, 50740530, 7129200), null, new Location(LocationType.ANY, 50933930,
|
||||
6932440), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(Location.coord(50740530, 7129200), null, Location.coord(50933930, 6932440), new Date(), true,
|
||||
Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
assertTrue(result.trips.size() > 0);
|
||||
|
@ -457,8 +452,8 @@ public class VrsProviderLiveTest extends AbstractProviderLiveTest
|
|||
int fromLon = lonFrom + rand.nextInt(lonTo - lonFrom);
|
||||
int toLat = latFrom + rand.nextInt(latTo - latFrom);
|
||||
int toLon = lonFrom + rand.nextInt(lonTo - lonFrom);
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ANY, fromLat, fromLon), null, new Location(LocationType.ANY,
|
||||
toLat, toLon), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(Location.coord(fromLat, fromLon), null, Location.coord(toLat, toLon), new Date(), true,
|
||||
Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println("# " + (i + 1));
|
||||
if (result.status.equals(QueryTripsResult.Status.OK))
|
||||
{
|
||||
|
@ -527,7 +522,7 @@ public class VrsProviderLiveTest extends AbstractProviderLiveTest
|
|||
int lat = latFrom + rand.nextInt(latTo - latFrom);
|
||||
int lon = lonFrom + rand.nextInt(lonTo - lonFrom);
|
||||
System.out.println(i + " " + lat + " " + lon);
|
||||
NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), new Location(LocationType.STATION, lat, lon), 0, 3);
|
||||
NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), Location.coord(lat, lon), 0, 3);
|
||||
if (result.status == NearbyLocationsResult.Status.OK)
|
||||
{
|
||||
stations.addAll(result.locations);
|
||||
|
|
|
@ -54,7 +54,7 @@ public class VsnProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51536614, 9925673));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(51536614, 9925673));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class VvmProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49455472, 11079655));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(49455472, 11079655));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class VvoProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51052467, 13733196));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(51052467, 13733196));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ public class VvsProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48775005, 9166517));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(48775005, 9166517));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class VvtProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47271228, 11402063));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(47271228, 11402063));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ public class VvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50776518, 12056032));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(50776518, 12056032));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -58,15 +58,15 @@ public class WienProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48207355, 16370602));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(48207355, 16370602));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyLocationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), new Location(
|
||||
LocationType.ADDRESS, 48207355, 16370602));
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI),
|
||||
Location.coord(48207355, 16370602));
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
@ -136,8 +136,8 @@ public class WienProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void tripBetweenCoordinates() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, null, 48180281, 16333551), null, new Location(
|
||||
LocationType.ADDRESS, null, 48240452, 16444788), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(Location.coord(48180281, 16333551), null, Location.coord(48240452, 16444788), new Date(), true,
|
||||
Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
|
|
|
@ -54,7 +54,7 @@ public class ZvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47378968, 8540534));
|
||||
final NearbyLocationsResult result = queryNearbyStations(Location.coord(47378968, 8540534));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ public class LocationController
|
|||
@ResponseBody
|
||||
public NearbyLocationsResult nearby(@RequestParam("lat") final int lat, @RequestParam("lon") final int lon) throws IOException
|
||||
{
|
||||
final Location location = new Location(LocationType.ANY, lat, lon);
|
||||
return provider.queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), location, 5000, 100);
|
||||
final Location coord = Location.coord(lat, lon);
|
||||
return provider.queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), coord, 5000, 100);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue