'nearby stations by coordinate' for all efa-based providers

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@568 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2011-04-16 10:24:51 +00:00
parent ff84a2f29e
commit a415ae008b
73 changed files with 376 additions and 230 deletions

View file

@ -190,6 +190,89 @@ public abstract class AbstractEfaProvider implements NetworkProvider
} }
} }
protected List<Location> xmlCoordRequest(final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException
{
final StringBuilder uri = new StringBuilder(apiBase);
uri.append("XML_COORD_REQUEST?coord=");
uri.append(String.format("%2.6f:%2.6f:WGS84", latLonToDouble(lon), latLonToDouble(lat)));
uri.append("&coordOutputFormat=WGS84&coordListOutputFormat=STRING");
uri.append("&max=").append(maxStations != 0 ? maxStations : 50);
uri.append("&inclFilter=1&radius_1=").append(maxDistance != 0 ? maxDistance : 1320);
uri.append("&type_1=STOP");
if (additionalQueryParameter != null)
uri.append('&').append(additionalQueryParameter);
InputStream is = null;
try
{
is = ParserUtils.scrapeInputStream(uri.toString());
final XmlPullParser pp = parserFactory.newPullParser();
pp.setInput(is, null);
assertItdRequest(pp);
XmlPullUtil.enter(pp, "itdRequest");
if (XmlPullUtil.test(pp, "clientHeaderLines"))
XmlPullUtil.next(pp);
if (XmlPullUtil.test(pp, "itdVersionInfo"))
XmlPullUtil.next(pp);
if (XmlPullUtil.test(pp, "itdInfoLinkList"))
XmlPullUtil.next(pp);
if (XmlPullUtil.test(pp, "serverMetaInfo"))
XmlPullUtil.next(pp);
XmlPullUtil.enter(pp, "itdCoordInfoRequest");
XmlPullUtil.enter(pp, "itdCoordInfo");
XmlPullUtil.enter(pp, "coordInfoRequest");
XmlPullUtil.exit(pp, "coordInfoRequest");
final List<Location> results = new ArrayList<Location>();
if (XmlPullUtil.test(pp, "coordInfoItemList"))
{
XmlPullUtil.enter(pp, "coordInfoItemList");
while (XmlPullUtil.test(pp, "coordInfoItem"))
{
if (!"STOP".equals(pp.getAttributeValue(null, "type")))
throw new RuntimeException("unknown type");
final int id = XmlPullUtil.intAttr(pp, "id");
final String name = normalizeLocationName(XmlPullUtil.attr(pp, "name"));
final String place = normalizeLocationName(XmlPullUtil.attr(pp, "locality"));
XmlPullUtil.enter(pp, "coordInfoItem");
// FIXME this is always only one coordinate
final Point coord = processItdPathCoordinates(pp).get(0);
XmlPullUtil.exit(pp, "coordInfoItem");
results.add(new Location(LocationType.STATION, id, coord.lat, coord.lon, place, name));
}
XmlPullUtil.exit(pp, "coordInfoItemList");
}
return results;
}
catch (final XmlPullParserException x)
{
throw new ParserException(x);
}
finally
{
if (is != null)
is.close();
}
}
private String autocompleteUri(final CharSequence constraint) private String autocompleteUri(final CharSequence constraint)
{ {
final String AUTOCOMPLETE_URI = apiBase + "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s"; final String AUTOCOMPLETE_URI = apiBase + "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s";
@ -370,18 +453,17 @@ public abstract class AbstractEfaProvider implements NetworkProvider
return new Location(LocationType.STATION, id, lat, lon, place, name); return new Location(LocationType.STATION, id, lat, lon, place, name);
} }
protected abstract String nearbyLatLonUri(int lat, int lon);
protected abstract String nearbyStationUri(String stationId); protected abstract String nearbyStationUri(String stationId);
public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
throws IOException throws IOException
{ {
if (lat != 0 || lon != 0)
return new NearbyStationsResult(xmlCoordRequest(lat, lon, maxDistance, maxStations));
String uri = null; String uri = null;
if (uri == null && stationId != null) if (uri == null && stationId != null)
uri = wrapUri(nearbyStationUri(stationId)); uri = wrapUri(nearbyStationUri(stationId));
if (uri == null && (lat != 0 || lon != 0))
uri = wrapUri(nearbyLatLonUri(lat, lon));
if (uri == null) if (uri == null)
throw new IllegalArgumentException("at least one of stationId or lat/lon must be given"); throw new IllegalArgumentException("at least one of stationId or lat/lon must be given");

View file

@ -60,12 +60,6 @@ public class AtcProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -61,12 +61,6 @@ public class AvvProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -60,12 +60,6 @@ public class BsagProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -61,12 +61,6 @@ public class BsvagProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -61,12 +61,6 @@ public class BvbProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -61,12 +61,6 @@ public class DingProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -68,12 +68,6 @@ public class DubProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -73,12 +73,6 @@ public class GvhProvider extends AbstractEfaProvider
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1")); return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
@Override @Override
protected String departuresQueryUri(String stationId, int maxDepartures) protected String departuresQueryUri(String stationId, int maxDepartures)
{ {

View file

@ -61,12 +61,6 @@ public class IvbProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -60,12 +60,6 @@ public class KvvProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -22,7 +22,6 @@ import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale;
import de.schildbach.pte.dto.Location; import de.schildbach.pte.dto.Location;
import de.schildbach.pte.dto.LocationType; import de.schildbach.pte.dto.LocationType;
@ -62,16 +61,6 @@ public class LinzProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
private static final String NEARBY_LATLON_URI = API_BASE
+ "XSLT_DM_REQUEST"
+ "?outputFormat=XML&mode=direct&coordOutputFormat=WGS84&mergeDep=1&useAllStops=1&name_dm=%2.6f:%2.6f:WGS84&type_dm=coord&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&excludedMeans=checkbox";
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return String.format(Locale.ENGLISH, NEARBY_LATLON_URI, latLonToDouble(lon), latLonToDouble(lat));
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "XSLT_DM_REQUEST"
+ "?outputFormat=XML&mode=direct&coordOutputFormat=WGS84&mergeDep=1&useAllStops=1&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&excludedMeans=checkbox"; + "?outputFormat=XML&mode=direct&coordOutputFormat=WGS84&mergeDep=1&useAllStops=1&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&excludedMeans=checkbox";

View file

@ -60,12 +60,6 @@ public class MariborProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -67,12 +67,6 @@ public class MetProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -64,12 +64,6 @@ public class MvvProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -60,12 +60,6 @@ public class NaldoProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -60,12 +60,6 @@ public class NvbwProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -82,12 +82,6 @@ public class SfProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -61,12 +61,6 @@ public class StvProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -61,12 +61,6 @@ public class SvvProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -67,12 +67,6 @@ public class SydneyProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -80,12 +80,6 @@ public class TflProvider extends AbstractEfaProvider
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1")); return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
} }
@Override
protected String nearbyLatLonUri(int lat, int lon)
{
return null;
}
@Override @Override
protected String departuresQueryUri(final String stationId, final int maxDepartures) protected String departuresQueryUri(final String stationId, final int maxDepartures)
{ {

View file

@ -68,12 +68,6 @@ public class TleaProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -68,12 +68,6 @@ public class TlemProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -68,12 +68,6 @@ public class TlseProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -67,12 +67,6 @@ public class TlswProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "XSLT_DM_REQUEST"
+ "?outputFormat=XML&coordOutputFormat=WGS84&name_dm=90000591&type_dm=stop&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct"; + "?outputFormat=XML&coordOutputFormat=WGS84&name_dm=90000591&type_dm=stop&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -60,12 +60,6 @@ public class VagfrProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -60,12 +60,6 @@ public class VblProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -61,12 +61,6 @@ public class VmsProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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&deleteAssignedStop=0"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct&deleteAssignedStop=0";

View file

@ -61,12 +61,6 @@ public class VmvProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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&deleteAssignedStop=0"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct&deleteAssignedStop=0";

View file

@ -61,12 +61,6 @@ public class VorProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -61,12 +61,6 @@ public class VrnProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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&deleteAssignedStop=0"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct&deleteAssignedStop=0";

View file

@ -23,7 +23,6 @@ import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Locale;
import java.util.Map; import java.util.Map;
import de.schildbach.pte.dto.Location; import de.schildbach.pte.dto.Location;
@ -65,16 +64,6 @@ public class VrrProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
private static final String NEARBY_LATLON_URI = API_BASE
+ "XSLT_DM_REQUEST"
+ "?outputFormat=XML&mode=direct&coordOutputFormat=WGS84&mergeDep=1&useAllStops=1&name_dm=%2.6f:%2.6f:WGS84&type_dm=coord&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1";
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return String.format(Locale.ENGLISH, NEARBY_LATLON_URI, latLonToDouble(lon), latLonToDouble(lat));
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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&deleteAssignedStop=0"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct&deleteAssignedStop=0";

View file

@ -60,12 +60,6 @@ public class VrtProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -60,12 +60,6 @@ public class VvmProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -61,12 +61,6 @@ public class VvoProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct";

View file

@ -61,12 +61,6 @@ public class VvsProvider extends AbstractEfaProvider
return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString())); return xmlStopfinderRequest(new Location(LocationType.ANY, 0, null, constraint.toString()));
} }
@Override
protected String nearbyLatLonUri(final int lat, final int lon)
{
return null;
}
private static final String NEARBY_STATION_URI = API_BASE private static final String NEARBY_STATION_URI = API_BASE
+ "XSLT_DM_REQUEST" + "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&deleteAssignedStop=0"; + "?outputFormat=XML&coordOutputFormat=WGS84&type_dm=stop&name_dm=%s&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&mergeDep=1&useAllStops=1&mode=direct&deleteAssignedStop=0";

View file

@ -57,6 +57,14 @@ public class AtcProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 8168907, 10609969, 0, 0); // bad coordinate!
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class AvvProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 48367233, 10894976, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -55,4 +55,12 @@ public class BsagProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 53076146, 8806858, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
} }

View file

@ -55,4 +55,12 @@ public class BsvagProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 52272065, 10524788, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
} }

View file

@ -57,6 +57,14 @@ public class BvbProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 47551466, 7585187, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class DingProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 48401092, 9992037, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -23,6 +23,7 @@ import org.junit.Test;
import de.schildbach.pte.DubProvider; import de.schildbach.pte.DubProvider;
import de.schildbach.pte.dto.Location; import de.schildbach.pte.dto.Location;
import de.schildbach.pte.dto.NearbyStationsResult;
/** /**
* @author Andreas Schildbach * @author Andreas Schildbach
@ -46,4 +47,12 @@ public class DubProviderLiveTest
System.out.print(autocomplete.toDebugString() + " "); System.out.print(autocomplete.toDebugString() + " ");
System.out.println(); System.out.println();
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 25269008, 55312672, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
} }

View file

@ -85,6 +85,14 @@ public class GvhProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 52379497, 9735832, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void incompleteConnection() throws Exception public void incompleteConnection() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class IvbProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 47271228, 11402063, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -62,6 +62,14 @@ public class KvvProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 49008184, 8400736, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -26,6 +26,7 @@ import de.schildbach.pte.LinzProvider;
import de.schildbach.pte.NetworkProvider.WalkSpeed; import de.schildbach.pte.NetworkProvider.WalkSpeed;
import de.schildbach.pte.dto.Location; import de.schildbach.pte.dto.Location;
import de.schildbach.pte.dto.LocationType; import de.schildbach.pte.dto.LocationType;
import de.schildbach.pte.dto.NearbyStationsResult;
import de.schildbach.pte.dto.QueryConnectionsResult; import de.schildbach.pte.dto.QueryConnectionsResult;
import de.schildbach.pte.dto.QueryDeparturesResult; import de.schildbach.pte.dto.QueryDeparturesResult;
@ -69,6 +70,14 @@ public class LinzProviderLiveTest
System.out.println(); System.out.println();
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 48305726, 14287863, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class MariborProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 46559958, 15646391, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class MetProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, -37800941, 144966545, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -62,6 +62,14 @@ public class MvvProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 48135232, 11560650, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class NaldoProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 48493550, 9205656, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class NvbwProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 48778953, 9178963, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class SfProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 37777811, -122419481, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class StvProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 47072612, 15431814, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class SvvProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 47809195, 13054919, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class SydneyProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, -32823911, 151462824, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -62,6 +62,14 @@ public class TflProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 51507161, -0127144, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class TleaProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 51507161, -0127144, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class TlemProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 51507161, -0127144, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class TlseProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 51507161, -0127144, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class TlswProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 51507161, -0127144, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class VagfrProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 48000295, 7854338, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class VblProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 47049107, 8312502, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class VmsProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 50832754, 12918348, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class VmvProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 53637555, 11392593, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class VorProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 48207355, 16370602, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -81,6 +81,14 @@ public class VrnProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 49486561, 8477297, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -73,6 +73,14 @@ public class VrrProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 51218693, 6777785, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class VrtProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 49757571, 6639147, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class VvmProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 49455472, 11079655, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class VvoProviderLiveTest
System.out.println(result.status + " " + result.stations.size() + " " + result.stations); System.out.println(result.status + " " + result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 51052467, 13733196, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {

View file

@ -57,6 +57,14 @@ public class VvsProviderLiveTest
System.out.println(result.stations.size() + " " + result.stations); System.out.println(result.stations.size() + " " + result.stations);
} }
@Test
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations(null, 48775005, 9166517, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test @Test
public void queryDepartures() throws Exception public void queryDepartures() throws Exception
{ {