mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 00:39:58 +00:00
split place and name for some Frankfurt stations
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@463 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
0184b5dee3
commit
b2ba8a1c79
3 changed files with 32 additions and 2 deletions
|
@ -70,6 +70,19 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String[] PLACES = { "Frankfurt (Main)", "Offenbach (Main)", "Mainz", "Wiesbaden", "Marburg", "Kassel", "Hanau", "Göttingen",
|
||||
"Darmstadt", "Aschaffenburg" };
|
||||
|
||||
@Override
|
||||
protected String[] splitNameAndPlace(final String name)
|
||||
{
|
||||
for (final String place : PLACES)
|
||||
if (name.startsWith(place + " "))
|
||||
return new String[] { place, name.substring(place.length() + 1) };
|
||||
|
||||
return super.splitNameAndPlace(name);
|
||||
}
|
||||
|
||||
private static final String NAME_URL = API_BASE + "stboard.exe/dox?input=";
|
||||
private static final Pattern P_SINGLE_NAME = Pattern.compile(".*<input type=\"hidden\" name=\"input\" value=\"(.+?)#(\\d+)\" />.*",
|
||||
Pattern.DOTALL);
|
||||
|
@ -522,7 +535,8 @@ public class RmvProvider extends AbstractHafasProvider
|
|||
}
|
||||
}
|
||||
|
||||
return new QueryDeparturesResult(new Location(LocationType.STATION, locationId, null, location), departures, null);
|
||||
final String[] nameAndPlace = splitNameAndPlace(location);
|
||||
return new QueryDeparturesResult(new Location(LocationType.STATION, locationId, nameAndPlace[0], nameAndPlace[1]), departures, null);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue