mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-08 00:08:49 +00:00
split place and name for Leipzig and Halle
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@829 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
28fc8bdd36
commit
40b46a4c14
1 changed files with 16 additions and 0 deletions
|
@ -88,6 +88,22 @@ public class NasaProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final String[] PLACES = { "Leipzig", "Halle (Saale)", "Halle" };
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String[] splitPlaceAndName(final String name)
|
||||||
|
{
|
||||||
|
for (final String place : PLACES)
|
||||||
|
{
|
||||||
|
if (name.startsWith(place + " ") || name.startsWith(place + "-"))
|
||||||
|
return new String[] { place, name.substring(place.length() + 1) };
|
||||||
|
else if (name.startsWith(place + ", "))
|
||||||
|
return new String[] { place, name.substring(place.length() + 2) };
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.splitPlaceAndName(name);
|
||||||
|
}
|
||||||
|
|
||||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||||
{
|
{
|
||||||
final StringBuilder uri = new StringBuilder(API_BASE);
|
final StringBuilder uri = new StringBuilder(API_BASE);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue