mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 17:38:49 +00:00
queryNearbyStations now takes Location object
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@619 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
c0f0be81bf
commit
653d590e1b
112 changed files with 605 additions and 501 deletions
|
@ -431,20 +431,21 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
|||
return new Location(LocationType.STATION, id, lat, lon, place, name);
|
||||
}
|
||||
|
||||
protected abstract String nearbyStationUri(String stationId);
|
||||
protected abstract String nearbyStationUri(int stationId);
|
||||
|
||||
public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
if (lat != 0 || lon != 0)
|
||||
return new NearbyStationsResult(xmlCoordRequest(lat, lon, maxDistance, maxStations));
|
||||
if (location.hasLocation())
|
||||
return new NearbyStationsResult(xmlCoordRequest(location.lat, location.lon, maxDistance, maxStations));
|
||||
|
||||
String uri = null;
|
||||
if (uri == null && stationId != null)
|
||||
uri = nearbyStationUri(stationId);
|
||||
if (uri == null)
|
||||
if (location.type != LocationType.STATION)
|
||||
throw new IllegalArgumentException("cannot handle: " + location.type);
|
||||
|
||||
if (!location.hasId())
|
||||
throw new IllegalArgumentException("at least one of stationId or lat/lon must be given");
|
||||
|
||||
final String uri = nearbyStationUri(location.id);
|
||||
|
||||
InputStream is = null;
|
||||
try
|
||||
{
|
||||
|
@ -644,6 +645,8 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
|||
return 'I' + str;
|
||||
if (type.equals("HKX")) // Hamburg-Koeln-Express
|
||||
return 'I' + str;
|
||||
if (type.equals("DNZ")) // Nachtzug Basel-Moskau
|
||||
return 'I' + str;
|
||||
|
||||
if (type.equals("IR")) // Interregio
|
||||
return 'R' + str;
|
||||
|
|
|
@ -278,6 +278,14 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
{
|
||||
// TODO don't know what to do
|
||||
}
|
||||
else if (type == 87) // strange (ZTM)
|
||||
{
|
||||
// TODO don't know what to do
|
||||
}
|
||||
else if (type == 128) // strange (SEPTA)
|
||||
{
|
||||
// TODO don't know what to do
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalStateException("unknown type " + type + " on " + uri);
|
||||
|
@ -1008,7 +1016,7 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
return new NearbyStationsResult(stations);
|
||||
}
|
||||
|
||||
protected NearbyStationsResult jsonNearbyStations(final String uri) throws IOException
|
||||
protected final NearbyStationsResult jsonNearbyStations(final String uri) throws IOException
|
||||
{
|
||||
final CharSequence page = ParserUtils.scrape(uri);
|
||||
|
||||
|
@ -1045,17 +1053,10 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
.compile("REQMapRoute0\\.Location0\\.X=(-?\\d+)&(?:amp;)?REQMapRoute0\\.Location0\\.Y=(-?\\d+)&");
|
||||
private final static Pattern P_NEARBY_FINE_LOCATION = Pattern.compile("[\\?&]input=(\\d+)&[^\"]*\">([^<]*)<");
|
||||
|
||||
protected abstract String nearbyStationUri(String stationId);
|
||||
|
||||
public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
protected final NearbyStationsResult htmlNearbyStations(final String uri) throws IOException
|
||||
{
|
||||
if (stationId == null)
|
||||
throw new IllegalArgumentException("stationId must be given");
|
||||
|
||||
final List<Location> stations = new ArrayList<Location>();
|
||||
|
||||
final String uri = nearbyStationUri(stationId);
|
||||
final CharSequence page = ParserUtils.scrape(uri);
|
||||
String oldZebra = null;
|
||||
|
||||
|
@ -1095,10 +1096,7 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
}
|
||||
}
|
||||
|
||||
if (maxStations == 0 || maxStations >= stations.size())
|
||||
return new NearbyStationsResult(stations);
|
||||
else
|
||||
return new NearbyStationsResult(stations.subList(0, maxStations));
|
||||
return new NearbyStationsResult(stations);
|
||||
}
|
||||
|
||||
protected static final Pattern P_NORMALIZE_LINE = Pattern.compile("([A-Za-zßÄÅäáàâåéèêíìîÖöóòôÜüúùûØ/-]+)[\\s-]*(.*)");
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -62,8 +61,8 @@ public class AtcProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class AvvProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -81,33 +81,28 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
private final static Pattern P_NEARBY_STATIONS_BY_STATION = Pattern
|
||||
.compile("<a href=\"http://mobile\\.bahn\\.de/bin/mobil/bhftafel.exe/dn[^\"]*?evaId=(\\d*)&[^\"]*?\">([^<]*)</a>");
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (lat != 0 || lon != 0)
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
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_x=").append(lon);
|
||||
uri.append("&look_y=").append(lat);
|
||||
uri.append("&look_x=").append(location.lon);
|
||||
uri.append("&look_y=").append(location.lat);
|
||||
|
||||
return jsonNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("bhftafel.exe/dn?near=Anzeigen&distance=50&input=").append(ParserUtils.urlEncode(stationId));
|
||||
uri.append("bhftafel.exe/dn");
|
||||
uri.append("?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
final CharSequence page = ParserUtils.scrape(uri.toString());
|
||||
|
||||
|
@ -128,6 +123,10 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
else
|
||||
return new NearbyStationsResult(stations.subList(0, maxStations));
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private String connectionsQueryUri(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -62,8 +61,8 @@ public class BsagProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class BsvagProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class BvbProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,14 +88,6 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
return xmlMLcReq(constraint);
|
||||
}
|
||||
|
||||
private final String NEARBY_URI = API_BASE + "stboard.bin/dn?distance=50&near&input=%s";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
{
|
||||
return String.format(NEARBY_URI, ParserUtils.urlEncode(stationId));
|
||||
}
|
||||
|
||||
private final static Pattern P_NEARBY_OWN = Pattern
|
||||
.compile("/Stadtplan/index.*?location=(\\d+),HST,WGS84,(-?\\d+\\.\\d+),(-?\\d+\\.\\d+)&label=([^\"]*)\"");
|
||||
private final static Pattern P_NEARBY_PAGE = Pattern.compile("<table class=\"ivuTableOverview\".*?<tbody>(.*?)</tbody>", Pattern.DOTALL);
|
||||
|
@ -103,66 +95,73 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
private final static Pattern P_NEARBY_FINE_LOCATION = Pattern.compile("input=(\\d+)&[^\"]*\">([^<]*)<");
|
||||
private static final Pattern P_NEARBY_ERRORS = Pattern.compile("(derzeit leider nicht bearbeitet werden)");
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
if (stationId == null)
|
||||
throw new IllegalArgumentException("stationId must be given");
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
final List<Location> stations = new ArrayList<Location>();
|
||||
|
||||
final String uri = nearbyStationUri(stationId);
|
||||
final CharSequence page = ParserUtils.scrape(uri);
|
||||
|
||||
final Matcher mError = P_NEARBY_ERRORS.matcher(page);
|
||||
if (mError.find())
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
if (mError.group(1) != null)
|
||||
return new NearbyStationsResult(NearbyStationsResult.Status.INVALID_STATION);
|
||||
}
|
||||
uri.append("stboard.bin/dn?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
final Matcher mOwn = P_NEARBY_OWN.matcher(page);
|
||||
if (mOwn.find())
|
||||
{
|
||||
final int parsedId = Integer.parseInt(mOwn.group(1));
|
||||
final int parsedLon = (int) (Float.parseFloat(mOwn.group(2)) * 1E6);
|
||||
final int parsedLat = (int) (Float.parseFloat(mOwn.group(3)) * 1E6);
|
||||
final String[] parsedPlaceAndName = splitNameAndPlace(ParserUtils.urlDecode(mOwn.group(4), "ISO-8859-1"));
|
||||
stations.add(new Location(LocationType.STATION, parsedId, parsedLat, parsedLon, parsedPlaceAndName[0], parsedPlaceAndName[1]));
|
||||
}
|
||||
final CharSequence page = ParserUtils.scrape(uri.toString());
|
||||
|
||||
final Matcher mPage = P_NEARBY_PAGE.matcher(page);
|
||||
if (mPage.find())
|
||||
{
|
||||
final Matcher mCoarse = P_NEARBY_COARSE.matcher(mPage.group(1));
|
||||
|
||||
while (mCoarse.find())
|
||||
final Matcher mError = P_NEARBY_ERRORS.matcher(page);
|
||||
if (mError.find())
|
||||
{
|
||||
final Matcher mFineLocation = P_NEARBY_FINE_LOCATION.matcher(mCoarse.group(1));
|
||||
|
||||
if (mFineLocation.find())
|
||||
{
|
||||
final int parsedId = Integer.parseInt(mFineLocation.group(1));
|
||||
final String[] parsedPlaceAndName = splitNameAndPlace(ParserUtils.resolveEntities(mFineLocation.group(2)));
|
||||
final Location station = new Location(LocationType.STATION, parsedId, parsedPlaceAndName[0], parsedPlaceAndName[1]);
|
||||
if (!stations.contains(station))
|
||||
stations.add(station);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot parse '" + mCoarse.group(1) + "' on " + uri);
|
||||
}
|
||||
if (mError.group(1) != null)
|
||||
return new NearbyStationsResult(NearbyStationsResult.Status.INVALID_STATION);
|
||||
}
|
||||
|
||||
if (maxStations == 0 || maxStations >= stations.size())
|
||||
return new NearbyStationsResult(stations);
|
||||
final List<Location> stations = new ArrayList<Location>();
|
||||
|
||||
final Matcher mOwn = P_NEARBY_OWN.matcher(page);
|
||||
if (mOwn.find())
|
||||
{
|
||||
final int parsedId = Integer.parseInt(mOwn.group(1));
|
||||
final int parsedLon = (int) (Float.parseFloat(mOwn.group(2)) * 1E6);
|
||||
final int parsedLat = (int) (Float.parseFloat(mOwn.group(3)) * 1E6);
|
||||
final String[] parsedPlaceAndName = splitNameAndPlace(ParserUtils.urlDecode(mOwn.group(4), "ISO-8859-1"));
|
||||
stations.add(new Location(LocationType.STATION, parsedId, parsedLat, parsedLon, parsedPlaceAndName[0], parsedPlaceAndName[1]));
|
||||
}
|
||||
|
||||
final Matcher mPage = P_NEARBY_PAGE.matcher(page);
|
||||
if (mPage.find())
|
||||
{
|
||||
final Matcher mCoarse = P_NEARBY_COARSE.matcher(mPage.group(1));
|
||||
|
||||
while (mCoarse.find())
|
||||
{
|
||||
final Matcher mFineLocation = P_NEARBY_FINE_LOCATION.matcher(mCoarse.group(1));
|
||||
|
||||
if (mFineLocation.find())
|
||||
{
|
||||
final int parsedId = Integer.parseInt(mFineLocation.group(1));
|
||||
final String[] parsedPlaceAndName = splitNameAndPlace(ParserUtils.resolveEntities(mFineLocation.group(2)));
|
||||
final Location station = new Location(LocationType.STATION, parsedId, parsedPlaceAndName[0], parsedPlaceAndName[1]);
|
||||
if (!stations.contains(station))
|
||||
stations.add(station);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot parse '" + mCoarse.group(1) + "' on " + uri);
|
||||
}
|
||||
}
|
||||
|
||||
if (maxStations == 0 || maxStations >= stations.size())
|
||||
return new NearbyStationsResult(stations);
|
||||
else
|
||||
return new NearbyStationsResult(stations.subList(0, maxStations));
|
||||
}
|
||||
else
|
||||
return new NearbyStationsResult(stations.subList(0, maxStations));
|
||||
{
|
||||
throw new IllegalArgumentException("cannot parse '" + page + "' on " + uri);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot parse '" + page + "' on " + uri);
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class DingProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -64,41 +65,38 @@ public class DsbProvider extends AbstractHafasProvider
|
|||
return jsonGetStops(uri);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(String stationId)
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (lat != 0 || lon != 0)
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/mny");
|
||||
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_x=").append(lon);
|
||||
uri.append("&look_y=").append(lat);
|
||||
uri.append("&look_x=").append(location.lon);
|
||||
uri.append("&look_y=").append(location.lat);
|
||||
|
||||
return jsonNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/mn");
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(ParserUtils.urlEncode(stationId));
|
||||
uri.append("&input=").append(location.id);
|
||||
uri.append("&sTI=1&start=yes&hcount=0");
|
||||
uri.append("&L=vs_java3");
|
||||
|
||||
return xmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: '" + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private static final Pattern P_NORMALIZE_LINE_AND_TYPE = Pattern.compile("([^#]*)#(.*)");
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.TimeZone;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,8 +69,8 @@ public class DubProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import java.util.Map;
|
|||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.Color;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -65,9 +64,9 @@ public class GvhProvider extends AbstractEfaProvider
|
|||
+ "XSLT_DM_REQUEST?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
|
||||
private static final Map<String, int[]> LINES = new HashMap<String, int[]>();
|
||||
|
|
|
@ -31,6 +31,7 @@ import java.util.regex.Pattern;
|
|||
import de.schildbach.pte.dto.Departure;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||
import de.schildbach.pte.dto.StationDepartures;
|
||||
|
@ -89,12 +90,22 @@ public class InvgProvider extends AbstractHafasProvider
|
|||
return super.splitNameAndPlace(name);
|
||||
}
|
||||
|
||||
private final String NEARBY_URI = API_BASE + "stboard.exe/dn?input=%s&distance=50&near=Anzeigen";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
return String.format(NEARBY_URI, ParserUtils.urlEncode(stationId));
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
return htmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
protected static final Pattern P_NORMALIZE_LINE_BUS = Pattern.compile("Bus\\s*(\\d+)");
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class IvbProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class KvvProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class LinzProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&mode=direct&coordOutputFormat=WGS84&mergeDep=1&useAllStops=1&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&excludedMeans=checkbox";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,9 +23,9 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -59,24 +59,23 @@ public class LuProvider extends AbstractHafasProvider
|
|||
return xmlMLcReq(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(String stationId)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
uri.append("stboard.exe/dn");
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
uri.append("&sTI=1&start=yes&hcount=0&L=vs_java3");
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
uri.append("stboard.exe/dn");
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(ParserUtils.urlEncode(stationId));
|
||||
uri.append("&sTI=1&start=yes&hcount=0&L=vs_java3");
|
||||
|
||||
return xmlNearbyStations(uri.toString());
|
||||
return xmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private static final Pattern P_NORMALIZE_LINE_AND_TYPE = Pattern.compile("([^#]*)#(.*)");
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class MariborProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.TimeZone;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -69,8 +68,8 @@ public class MetProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -62,8 +61,8 @@ public class MvgProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct&deleteAssignedStop=0";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import java.util.Map;
|
|||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.Color;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -66,9 +65,9 @@ public class MvvProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
|
||||
private static final Map<String, int[]> LINES = new HashMap<String, int[]>();
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class NaldoProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import java.util.regex.Pattern;
|
|||
import de.schildbach.pte.dto.Departure;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||
import de.schildbach.pte.dto.StationDepartures;
|
||||
|
@ -69,13 +70,22 @@ public class NasaProvider extends AbstractHafasProvider
|
|||
return xmlMLcReq(constraint);
|
||||
}
|
||||
|
||||
private final String NEARBY_URI = API_BASE + "stboard.exe/dn?input=%s&selectDate=today&boardType=dep&productsFilter=" + allProductsString()
|
||||
+ "&distance=50&near=Anzeigen";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
return String.format(NEARBY_URI, ParserUtils.urlEncode(stationId));
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
return htmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private String departuresQueryUri(final String stationId, final int maxDepartures)
|
||||
|
|
|
@ -59,14 +59,10 @@ public interface NetworkProvider
|
|||
List<Location> autocompleteStations(CharSequence constraint) throws IOException;
|
||||
|
||||
/**
|
||||
* Determine stations near to given location. At least one of stationId or lat/lon pair must be given.
|
||||
* Determine stations near to given location. At least one of stationId or lat/lon pair must be present.
|
||||
*
|
||||
* @param stationId
|
||||
* id of station to look up nearby stations (optional)
|
||||
* @param lat
|
||||
* latitude (optional)
|
||||
* @param lon
|
||||
* longitude (optional)
|
||||
* @param location
|
||||
* location to determine nearby stations (optional)
|
||||
* @param maxDistance
|
||||
* maximum distance in meters, or {@code 0}
|
||||
* @param maxStations
|
||||
|
@ -74,7 +70,7 @@ public interface NetworkProvider
|
|||
* @return nearby stations
|
||||
* @throws IOException
|
||||
*/
|
||||
NearbyStationsResult nearbyStations(String stationId, int lat, int lon, int maxDistance, int maxStations) throws IOException;
|
||||
NearbyStationsResult queryNearbyStations(Location location, int maxDistance, int maxStations) throws IOException;
|
||||
|
||||
/**
|
||||
* Query connections, asking for any ambiguousnesses
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.util.regex.Pattern;
|
|||
import de.schildbach.pte.dto.Departure;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||
import de.schildbach.pte.dto.StationDepartures;
|
||||
|
@ -41,6 +42,7 @@ public class NsProvider extends AbstractHafasProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.NS;
|
||||
public static final String OLD_NETWORK_ID = "hafas.bene-system.com";
|
||||
private static final String API_URI = "http://hafas.bene-system.com/bin/extxml.exe"; // http://plannerint.b-rail.be/bin/extxml.exe
|
||||
private static final String API_BASE = "http://hari.b-rail.be/HAFAS/bin/"; // FIXME!
|
||||
|
||||
private static final long PARSER_DAY_ROLLOVER_THRESHOLD_MS = 12 * 60 * 60 * 1000;
|
||||
|
||||
|
@ -63,17 +65,26 @@ public class NsProvider extends AbstractHafasProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
public List<Location> autocompleteStations(CharSequence constraint) throws IOException
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
private final String NEARBY_URI = "http://hari.b-rail.be/HAFAS/bin/stboard.exe/en?input=%s&distance=50&near=Anzeigen";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
return String.format(NEARBY_URI, ParserUtils.urlEncode(stationId));
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
uri.append("stboard.exe/en");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
return htmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private String departuresQueryUri(final String stationId, final int maxDepartures)
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -62,8 +61,8 @@ public class NvbwProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,35 +86,33 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
return jsonGetStops(uri);
|
||||
}
|
||||
|
||||
private final String NEARBY_URI = API_BASE + "stboard.exe/dn?distance=50&near=Suchen&input=%s";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
{
|
||||
return String.format(NEARBY_URI, ParserUtils.urlEncode(stationId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (lat != 0 || lon != 0)
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
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_x=").append(lon);
|
||||
uri.append("&look_y=").append(lat);
|
||||
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())
|
||||
{
|
||||
uri.append("stboard.exe/dn?near=Suchen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
return htmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
return super.nearbyStations(stationId, lat, lon, maxDistance, maxStations);
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -23,9 +23,9 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -75,27 +75,26 @@ public class PlProvider extends AbstractHafasProvider
|
|||
return xmlMLcReq(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(String stationId)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
uri.append("stboard.exe/pn");
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(location.id);
|
||||
uri.append("&sTI=1&start=yes&hcount=0");
|
||||
uri.append("&L=vs_java3");
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
uri.append("stboard.exe/pn");
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(ParserUtils.urlEncode(stationId));
|
||||
uri.append("&sTI=1&start=yes&hcount=0");
|
||||
uri.append("&L=vs_java3");
|
||||
// &inputTripelId=A%3d1%40O%3dCopenhagen%20Airport%40X%3d12646941%40Y%3d55629753%40U%3d86%40L%3d900000011%40B%3d1
|
||||
|
||||
// &inputTripelId=A%3d1%40O%3dCopenhagen%20Airport%40X%3d12646941%40Y%3d55629753%40U%3d86%40L%3d900000011%40B%3d1
|
||||
|
||||
return xmlNearbyStations(uri.toString());
|
||||
return xmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private static final Pattern P_NORMALIZE_LINE_RUSSIA = Pattern.compile("(?:D\\s*)?(\\d{1,3}(?:[A-Z]{2}|Y))");
|
||||
|
|
|
@ -34,6 +34,7 @@ import de.schildbach.pte.dto.GetConnectionDetailsResult;
|
|||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||
|
@ -110,12 +111,22 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
return results;
|
||||
}
|
||||
|
||||
private final String NEARBY_URI = API_BASE + "stboard.exe/dn?L=vs_rmv&distance=50&near&input=%s";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
return String.format(NEARBY_URI, ParserUtils.urlEncode(stationId));
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn?L=vs_rmv&near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
return htmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private static final Map<WalkSpeed, String> WALKSPEED_MAP = new HashMap<WalkSpeed, String>();
|
||||
|
|
|
@ -29,6 +29,7 @@ import java.util.regex.Pattern;
|
|||
import de.schildbach.pte.dto.Departure;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||
import de.schildbach.pte.dto.StationDepartures;
|
||||
|
@ -70,12 +71,22 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
return xmlMLcReq(constraint);
|
||||
}
|
||||
|
||||
private final static String NEARBY_URI = API_BASE + "bhftafel.exe/dn?input=%s&distance=50&near=Anzeigen";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
return String.format(NEARBY_URI, ParserUtils.urlEncode(stationId));
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("bhftafel.exe/dn?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
return htmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private String departuresQueryUri(final String stationId, final int maxDepartures)
|
||||
|
|
|
@ -30,6 +30,7 @@ import java.util.regex.Pattern;
|
|||
import de.schildbach.pte.dto.Departure;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||
import de.schildbach.pte.dto.StationDepartures;
|
||||
|
@ -126,13 +127,22 @@ public class SeptaProvider extends AbstractHafasProvider
|
|||
return 0;
|
||||
}
|
||||
|
||||
private final String NEARBY_URI = API_BASE + "stboard.exe/en?input=%s&selectDate=today&boardType=dep&productsFilter=" + allProductsString()
|
||||
+ "&distance=50&near=Anzeigen";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
return String.format(NEARBY_URI, ParserUtils.urlEncode(stationId));
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/en?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
return htmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private String departuresQueryUri(final String stationId, final int maxDepartures)
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.TimeZone;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -93,8 +92,8 @@ public class SfProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ import java.util.regex.Pattern;
|
|||
import de.schildbach.pte.dto.Departure;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||
import de.schildbach.pte.dto.StationDepartures;
|
||||
|
@ -68,13 +69,22 @@ public class ShProvider extends AbstractHafasProvider
|
|||
return xmlMLcReq(constraint);
|
||||
}
|
||||
|
||||
private final String NEARBY_URI = API_BASE + "stboard.exe/dn?input=%s&selectDate=today&boardType=dep&productsFilter=" + allProductsString()
|
||||
+ "&distance=50&near=Anzeigen";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
return String.format(NEARBY_URI, ParserUtils.urlEncode(stationId));
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
return htmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,6 +28,7 @@ import java.util.regex.Pattern;
|
|||
import de.schildbach.pte.dto.Departure;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||
import de.schildbach.pte.dto.StationDepartures;
|
||||
|
@ -75,12 +76,22 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
return jsonGetStops(uri);
|
||||
}
|
||||
|
||||
private final String NEARBY_URI = "http://hari.b-rail.be/HAFAS/bin/stboard.exe/en?input=%s&distance=50&near=Anzeigen";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
return String.format(NEARBY_URI, ParserUtils.urlEncode(stationId));
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/en?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
return htmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private String departuresQueryUri(final String stationId, final int maxDepartures)
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class StvProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class SvvProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.TimeZone;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -69,8 +68,8 @@ public class SydneyProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,7 +26,6 @@ import java.util.TimeZone;
|
|||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.Color;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -72,9 +71,9 @@ public class TflProvider extends AbstractEfaProvider
|
|||
+ "XSLT_DM_REQUEST?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
|
||||
private static final Map<String, int[]> LINES = new HashMap<String, int[]>();
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.TimeZone;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,8 +69,8 @@ public class TleaProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.TimeZone;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,8 +69,8 @@ public class TlemProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.TimeZone;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,8 +69,8 @@ public class TlseProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,6 @@ import java.util.TimeZone;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -69,8 +68,8 @@ public class TlswProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&name_dm=90000591&type_dm=stop&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -62,8 +61,8 @@ public class VagfrProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "UTF-8"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -62,8 +61,8 @@ public class VblProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,6 +31,7 @@ import de.schildbach.pte.dto.Departure;
|
|||
import de.schildbach.pte.dto.GetConnectionDetailsResult;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||
|
@ -77,13 +78,22 @@ public class VgsProvider extends AbstractHafasProvider
|
|||
return jsonGetStops(uri);
|
||||
}
|
||||
|
||||
private final String NEARBY_URI = API_BASE + "stboard.exe/dn?input=%s&selectDate=today&boardType=dep&productsFilter=" + allProductsString()
|
||||
+ "&distance=50&near=Anzeigen";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
return String.format(NEARBY_URI, ParserUtils.urlEncode(stationId));
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn?near=Anzeigen");
|
||||
uri.append("&distance=").append(maxDistance != 0 ? maxDistance / 1000 : 50);
|
||||
uri.append("&input=").append(location.id);
|
||||
|
||||
return htmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private String departuresQueryUri(final String stationId, final int maxDepartures)
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class VmsProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct&deleteAssignedStop=0";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class VmvProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct&deleteAssignedStop=0";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class VorProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class VrnProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct&deleteAssignedStop=0";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -25,7 +25,6 @@ import java.util.Map;
|
|||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.Color;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -66,9 +65,9 @@ public class VrrProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct&deleteAssignedStop=0";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
|
||||
private static final Map<String, int[]> LINES = new HashMap<String, int[]>();
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -62,8 +61,8 @@ public class VrtProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "UTF-8"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -62,8 +61,8 @@ public class VvmProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "UTF-8"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class VvoProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -63,8 +62,8 @@ public class VvsProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct&deleteAssignedStop=0";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,6 @@ import java.util.List;
|
|||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -62,8 +61,8 @@ public class VvvProvider extends AbstractEfaProvider
|
|||
+ "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(final String stationId)
|
||||
protected String nearbyStationUri(final int stationId)
|
||||
{
|
||||
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,9 +23,9 @@ import java.util.regex.Matcher;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -73,41 +73,37 @@ public class ZvvProvider extends AbstractHafasProvider
|
|||
return xmlMLcReq(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyStationUri(String stationId)
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||
|
||||
if (lat != 0 || lon != 0)
|
||||
if (location.hasLocation())
|
||||
{
|
||||
uri.append("query.exe/dny");
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 150);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
uri.append("&look_stopclass=").append(allProductsInt());
|
||||
uri.append("&look_x=").append(lon);
|
||||
uri.append("&look_y=").append(lat);
|
||||
uri.append("&look_x=").append(location.lon);
|
||||
uri.append("&look_y=").append(location.lat);
|
||||
|
||||
return jsonNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
uri.append("stboard.exe/dn");
|
||||
uri.append("?productsFilter=").append(allProductsString());
|
||||
uri.append("&boardType=dep");
|
||||
uri.append("&input=").append(ParserUtils.urlEncode(stationId));
|
||||
uri.append("&input=").append(location.id);
|
||||
uri.append("&sTI=1&start=yes&hcount=0");
|
||||
uri.append("&L=vs_java3");
|
||||
|
||||
return xmlNearbyStations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalArgumentException("cannot handle: " + location.toDebugString());
|
||||
}
|
||||
}
|
||||
|
||||
private static final Pattern P_NORMALIZE_LINE_AND_TYPE = Pattern.compile("([^#]*)#(.*)");
|
||||
|
|
|
@ -70,6 +70,16 @@ public final class Location implements Serializable
|
|||
this.name = null;
|
||||
}
|
||||
|
||||
public Location(final LocationType type, final int lat, final int lon)
|
||||
{
|
||||
this.type = type;
|
||||
this.id = 0;
|
||||
this.lat = lat;
|
||||
this.lon = lon;
|
||||
this.place = null;
|
||||
this.name = null;
|
||||
}
|
||||
|
||||
public final boolean hasId()
|
||||
{
|
||||
return id != 0;
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.AtcProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class AtcProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Bologna, ISTITUTO ALDINI", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 740), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,8 @@ public class AtcProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 8168907, 10609969, 0, 0); // bad coordinate!
|
||||
// TODO bad coordinate!
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 8168907, 10609969), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -68,7 +70,7 @@ public class AtcProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("Bologna", 0, false);
|
||||
final QueryDeparturesResult result = provider.queryDepartures("740", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.AvvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class AvvProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("100", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 100), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class AvvProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 48367233, 10894976, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 48367233, 10894976), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ public class BahnProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("692991", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 692991), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ public class BahnProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 52525589, 13369548, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 52525589, 13369548), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.BsagProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
||||
/**
|
||||
|
@ -49,9 +50,9 @@ public class BsagProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Bremen", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 28000257), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -59,7 +60,7 @@ public class BsagProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 53076146, 8806858, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 53076146, 8806858), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.BsvagProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
||||
/**
|
||||
|
@ -49,9 +50,9 @@ public class BsvagProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Braunschweig", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 26000178), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -59,7 +60,7 @@ public class BsvagProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 52272065, 10524788, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 52272065, 10524788), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.BvbProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class BvbProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("10000", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 10000), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class BvbProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 47551466, 7585187, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 47551466, 7585187), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ public class BvgProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("9220302", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 9220302), 0, 0);
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.DingProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class DingProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Ulm Hauptbahnhof", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 90001611), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class DingProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 48401092, 9992037, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 48401092, 9992037), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -68,7 +69,7 @@ public class DingProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("Ulm", 0, false);
|
||||
final QueryDeparturesResult result = provider.queryDepartures("90001611", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.DsbProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -52,7 +53,7 @@ public class DsbProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("8600858", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 8600858), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class DsbProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 55670305, 12554169, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 55670305, 12554169), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.DubProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
||||
/**
|
||||
|
@ -51,7 +52,7 @@ public class DubProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 25269008, 55312672, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 25269008, 55312672), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -78,9 +78,9 @@ public class GvhProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("25000031", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 25000031), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ public class GvhProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 52379497, 9735832, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 52379497, 9735832), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -17,13 +17,17 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.InvgProvider;
|
||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
/**
|
||||
|
@ -32,6 +36,7 @@ import de.schildbach.pte.dto.QueryDeparturesResult;
|
|||
public class InvgProviderLiveTest
|
||||
{
|
||||
private final InvgProvider provider = new InvgProvider();
|
||||
private static final String ALL_PRODUCTS = "IRSUTBFC";
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
|
@ -50,9 +55,9 @@ public class InvgProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("80301", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 80301), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -64,4 +69,15 @@ public class InvgProviderLiveTest
|
|||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 80302, null,
|
||||
"Ingolstadt, Hauptbahnhof Stadteinwärts"), null, new Location(LocationType.STATION, 181102, null, "Elisabethstraße"), new Date(),
|
||||
true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||
System.out.println(moreResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.IvbProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class IvbProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Innsbruck", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 60401187), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class IvbProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 47271228, 11402063, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 47271228, 11402063), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -68,7 +69,7 @@ public class IvbProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("60464209", 0, false);
|
||||
final QueryDeparturesResult result = provider.queryDepartures("60401187", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ public class KvvProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Karlsruhe", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 7000090), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class KvvProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 49008184, 8400736, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 49008184, 8400736), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public class KvvProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("119", 0, false);
|
||||
final QueryDeparturesResult result = provider.queryDepartures("7000090", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,7 @@ public class LinzProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 48305726, 14287863, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 48305726, 14287863), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ public class LuProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("9865836", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 9865836), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.MariborProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class MariborProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("63203067", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 63203067), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class MariborProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 46559958, 15646391, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 46559958, 15646391), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.MetProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class MetProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Melbourne", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 10001167), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class MetProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, -37800941, 144966545, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, -37800941, 144966545), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.MvgProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class MvgProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Ahaus", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 3), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class MvgProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 51219852, 7639217, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 51219852, 7639217), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ public class MvvProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("350", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 350), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class MvvProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 48135232, 11560650, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 48135232, 11560650), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.NaldoProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class NaldoProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("53019174", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 53019174), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class NaldoProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 48493550, 9205656, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 48493550, 9205656), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ public class NasaProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("13000", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 13000), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@ import java.util.List;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.NsProvider;
|
||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||
import de.schildbach.pte.NsProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -80,9 +80,9 @@ public class NsProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("100080", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 100080), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.NvbwProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class NvbwProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Neufels", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 6900001), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class NvbwProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 48778953, 9178963, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 48778953, 9178963), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -68,7 +69,7 @@ public class NvbwProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("Neuzell", 0, false);
|
||||
final QueryDeparturesResult result = provider.queryDepartures("6900001", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ public class OebbProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("902006", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 902006), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ public class OebbProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 48200239, 16370773, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 48200239, 16370773), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ public class PlProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("5100065", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 5100065), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -22,8 +22,8 @@ import java.util.List;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.RmvProvider;
|
||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||
import de.schildbach.pte.RmvProvider;
|
||||
import de.schildbach.pte.dto.Connection;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
|
@ -56,9 +56,9 @@ public class RmvProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("3000001", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 3000001), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -63,9 +63,9 @@ public class SbbProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("8500010", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 8500010), 0, 0);
|
||||
|
||||
System.out.println(result.status + " " + result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ public class SeptaProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("2090227", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 2090227), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.SfProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class SfProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("San Franzisco", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 10001017), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class SfProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 37777811, -122419481, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 37777811, -122419481), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -68,7 +69,7 @@ public class SfProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("10010813", 0, false);
|
||||
final QueryDeparturesResult result = provider.queryDepartures("10001017", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ public class ShProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("715210", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 715210), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -39,9 +39,9 @@ public class SncbProviderLiveTest
|
|||
private static final String ALL_PRODUCTS = "IRSUTBFC";
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("100080", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 100080), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.StvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class StvProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Graz", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 63203040), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class StvProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 47072612, 15431814, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 47072612, 15431814), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -68,7 +69,7 @@ public class StvProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("Graz", 0, false);
|
||||
final QueryDeparturesResult result = provider.queryDepartures("63203040", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.SvvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class SvvProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("60650002", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 60650002), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class SvvProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 47809195, 13054919, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 47809195, 13054919), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.SydneyProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class SydneyProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Sydney", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 10101452), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class SydneyProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, -32823911, 151462824, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, -32823911, 151462824), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -55,9 +55,9 @@ public class TflProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("1000086", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 1000086), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -65,7 +65,7 @@ public class TflProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 51507161, -0127144, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 51507161, -0127144), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.TleaProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class TleaProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("London", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 1001003), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class TleaProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 51507161, -0127144, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 51507161, -0127144), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -68,7 +69,7 @@ public class TleaProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("London", 0, false);
|
||||
final QueryDeparturesResult result = provider.queryDepartures("1001003", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.TlemProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class TlemProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("London", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 1001003), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class TlemProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 51507161, -0127144, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 51507161, -0127144), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -68,7 +69,7 @@ public class TlemProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("London", 0, false);
|
||||
final QueryDeparturesResult result = provider.queryDepartures("1001003", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.TlseProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class TlseProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("London", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 1001003), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class TlseProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 51507161, -0127144, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 51507161, -0127144), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -68,7 +69,7 @@ public class TlseProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("London", 0, false);
|
||||
final QueryDeparturesResult result = provider.queryDepartures("1001003", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.TlswProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class TlswProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("247616", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 247616), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class TlswProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 51507161, -0127144, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 51507161, -0127144), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.VagfrProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class VagfrProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("6930112", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 6930112), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class VagfrProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 48000295, 7854338, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 48000295, 7854338), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.VblProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -50,9 +51,9 @@ public class VblProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("119", 0, 0, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 119), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
@ -60,7 +61,7 @@ public class VblProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations(null, 47049107, 8312502, 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 47049107, 8312502), 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue