mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 01:19:49 +00:00
implement nearbyLatLonUri()
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@426 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
487f94fea9
commit
bbf1feac0a
1 changed files with 7 additions and 2 deletions
|
@ -19,6 +19,7 @@ package de.schildbach.pte;
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
import de.schildbach.pte.dto.Location;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
@ -56,10 +57,14 @@ public class VrrProvider extends AbstractEfaProvider
|
||||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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
|
@Override
|
||||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||||
{
|
{
|
||||||
return null;
|
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
|
||||||
|
@ -69,7 +74,7 @@ public class VrrProvider extends AbstractEfaProvider
|
||||||
@Override
|
@Override
|
||||||
protected String nearbyStationUri(final String stationId)
|
protected String nearbyStationUri(final String stationId)
|
||||||
{
|
{
|
||||||
return String.format(NEARBY_STATION_URI, stationId);
|
return String.format(NEARBY_STATION_URI, ParserUtils.urlEncode(stationId, "ISO-8859-1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue