mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 16:59:51 +00:00
use ID parameters for connection queries, rather than A and G
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@321 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
f3c0a54272
commit
5711f7ea3a
4 changed files with 65 additions and 117 deletions
|
@ -122,15 +122,10 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
uri.append("&REQ0HafasSearchForw=").append(dep ? "1" : "0");
|
||||
uri.append("&REQ0JourneyDate=").append(ParserUtils.urlEncode(DATE_FORMAT.format(date)));
|
||||
uri.append("&REQ0JourneyTime=").append(ParserUtils.urlEncode(TIME_FORMAT.format(date)));
|
||||
uri.append("&REQ0JourneyStopsS0G=").append(ParserUtils.urlEncode(locationValue(from)));
|
||||
uri.append("&REQ0JourneyStopsS0A=").append(locationTypeValue(from));
|
||||
uri.append("&REQ0JourneyStopsZ0G=").append(ParserUtils.urlEncode(locationValue(to)));
|
||||
uri.append("&REQ0JourneyStopsZ0A=").append(locationTypeValue(to));
|
||||
uri.append("&REQ0JourneyStopsS0ID=").append(ParserUtils.urlEncode(locationId(from)));
|
||||
if (via != null)
|
||||
{
|
||||
uri.append("&REQ0JourneyStops1.0G=").append(ParserUtils.urlEncode(locationValue(via)));
|
||||
uri.append("&REQ0JourneyStops1.0A=").append(locationTypeValue(via));
|
||||
}
|
||||
uri.append("&REQ0JourneyStops1.0ID=").append(ParserUtils.urlEncode(locationId(via)));
|
||||
uri.append("&REQ0JourneyStopsZ0ID=").append(ParserUtils.urlEncode(locationId(to)));
|
||||
uri.append("&REQ0JourneyDep_Foot_speed=").append(WALKSPEED_MAP.get(walkSpeed));
|
||||
|
||||
for (final char p : products.toCharArray())
|
||||
|
@ -157,26 +152,6 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
return uri.toString();
|
||||
}
|
||||
|
||||
private static int locationTypeValue(final Location location)
|
||||
{
|
||||
final LocationType type = location.type;
|
||||
if (type == LocationType.STATION)
|
||||
return 1;
|
||||
if (type == LocationType.ADDRESS)
|
||||
return 2;
|
||||
if (type == LocationType.ANY)
|
||||
return 255;
|
||||
throw new IllegalArgumentException(type.toString());
|
||||
}
|
||||
|
||||
private static String locationValue(final Location location)
|
||||
{
|
||||
if (location.type == LocationType.STATION && location.id != 0)
|
||||
return Integer.toString(location.id);
|
||||
else
|
||||
return location.name;
|
||||
}
|
||||
|
||||
private static final Pattern P_PRE_ADDRESS = Pattern.compile("(?:Geben Sie einen (Startort|Zielort) an.*?)?Bitte wählen Sie aus der Liste",
|
||||
Pattern.DOTALL);
|
||||
private static final Pattern P_ADDRESSES = Pattern.compile(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue