mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-13 00:08:49 +00:00
parse US addresses
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@687 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
f87c3c4936
commit
08744d957b
1 changed files with 12 additions and 0 deletions
|
@ -71,6 +71,18 @@ public class SeptaProvider extends AbstractHafasProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final Pattern P_SPLIT_ADDRESS = Pattern.compile("(.*),\\s+([^,]+\\s+\\d{4,5})");
|
||||
|
||||
@Override
|
||||
protected String[] splitPlaceAndName(final String name)
|
||||
{
|
||||
final Matcher matcher = P_SPLIT_ADDRESS.matcher(name);
|
||||
if (matcher.matches())
|
||||
return new String[] { matcher.group(2), matcher.group(1) };
|
||||
else
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue