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:
andreas.schildbach@gmail.com 2011-10-15 22:14:41 +00:00
parent 28fc8bdd36
commit 40b46a4c14

View file

@ -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
{
final StringBuilder uri = new StringBuilder(API_BASE);