refactor pte to use int,int for coordinates

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@219 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-10-02 14:51:43 +00:00
parent 135b07f59e
commit 9af8c00ede
17 changed files with 69 additions and 106 deletions

View file

@ -38,7 +38,7 @@ public class SncbProvider implements NetworkProvider
private final static Pattern P_NEARBY_FINE = Pattern.compile(".*?&REQMapRoute0\\.Location0\\.X=(-?\\d+)&REQMapRoute0\\.Location0\\.Y=(-?\\d+)"
+ "&REQMapRoute0\\.Location0\\.Name=(.*?)\">.*?en\\?input=(\\d+).*?", Pattern.DOTALL);
public List<Station> nearbyStations(final String stationId, final double lat, final double lon, final int maxDistance, final int maxStations)
public List<Station> nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations)
throws IOException
{
if (stationId == null)
@ -55,8 +55,8 @@ public class SncbProvider implements NetworkProvider
final Matcher mFine = P_NEARBY_FINE.matcher(mCoarse.group(1));
if (mFine.matches())
{
final double parsedLon = latLonToDouble(Integer.parseInt(mFine.group(1)));
final double parsedLat = latLonToDouble(Integer.parseInt(mFine.group(2)));
final int parsedLon = Integer.parseInt(mFine.group(1));
final int parsedLat = Integer.parseInt(mFine.group(2));
final String parsedName = ParserUtils.resolveEntities(mFine.group(3));
final int parsedId = Integer.parseInt(mFine.group(4));
@ -75,11 +75,6 @@ public class SncbProvider implements NetworkProvider
return stations.subList(0, maxStations);
}
private static double latLonToDouble(int value)
{
return (double) value / 1000000;
}
public StationLocationResult stationLocation(final String stationId) throws IOException
{
throw new UnsupportedOperationException();