mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +00:00
use common line parser for efa based apis
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@213 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
e8d2d60919
commit
8419822b30
4 changed files with 242 additions and 331 deletions
|
@ -59,7 +59,7 @@ public class LinzProvider extends AbstractEfaProvider
|
|||
{
|
||||
return String.format(NEARBY_LATLON_URI, lon, lat);
|
||||
}
|
||||
|
||||
|
||||
private static final String NEARBY_STATION_URI = API_BASE
|
||||
+ "XSLT_DM_REQUEST"
|
||||
+ "?outputFormat=XML&mode=direct&coordOutputFormat=WGS84&mergeDep=1&useAllStops=1&name_dm=%s&type_dm=stop&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&excludedMeans=checkbox";
|
||||
|
@ -69,7 +69,7 @@ public class LinzProvider extends AbstractEfaProvider
|
|||
{
|
||||
return String.format(NEARBY_STATION_URI, stationId);
|
||||
}
|
||||
|
||||
|
||||
public StationLocationResult stationLocation(final String stationId) throws IOException
|
||||
{
|
||||
throw new UnsupportedOperationException();
|
||||
|
@ -103,24 +103,6 @@ public class LinzProvider extends AbstractEfaProvider
|
|||
return uri.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String parseLine(final String number, final String symbol, final String mot)
|
||||
{
|
||||
if (!number.equals(symbol))
|
||||
throw new IllegalStateException("number " + number + ", symbol " + symbol);
|
||||
|
||||
int t = Integer.parseInt(mot);
|
||||
|
||||
if (t == 4)
|
||||
return 'T' + number;
|
||||
if (t == 5 || t == 6 || t == 7 || t == 10)
|
||||
return 'B' + number;
|
||||
if (t == 8)
|
||||
return 'C' + number;
|
||||
|
||||
throw new IllegalStateException("cannot normalize mot '" + mot + "' number '" + number + "'");
|
||||
}
|
||||
|
||||
private static final Map<Character, int[]> LINES = new HashMap<Character, int[]>();
|
||||
|
||||
static
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue