mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-13 16:20:34 +00:00
Negentwee: Support house numbers in addresses.
This commit is contained in:
parent
32142ed184
commit
cc3ef24a58
2 changed files with 15 additions and 0 deletions
|
@ -518,6 +518,14 @@ public class NegentweeProvider extends AbstractNetworkProvider {
|
|||
|
||||
String locationType = location.getString("type");
|
||||
String locationName = location.getString("name");
|
||||
|
||||
if (locationType.equals("address")) {
|
||||
String houseNumber = location.optString("houseNr");
|
||||
if (!houseNumber.isEmpty()) {
|
||||
locationName = locationName + " " + houseNumber;
|
||||
}
|
||||
}
|
||||
|
||||
if (addTypePrefix && !location.isNull(locationType + "Type") && !locationType.equals("poi")) {
|
||||
locationName = location.getString(locationType + "Type") + " " + locationName;
|
||||
}
|
||||
|
|
|
@ -99,6 +99,13 @@ public class NegentweeProviderLiveTest extends AbstractProviderLiveTest {
|
|||
assertEquals(SuggestLocationsResult.Status.OK, result.status);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void suggestLocationsAddress() throws Exception {
|
||||
final SuggestLocationsResult result = suggestLocations("Isolatorweg 32");
|
||||
print(result);
|
||||
assertEquals(SuggestLocationsResult.Status.OK, result.status);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void suggestLocationsIncomplete() throws Exception {
|
||||
final SuggestLocationsResult result = suggestLocations("Amsterdam");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue