Negentwee: Support house numbers in addresses.

This commit is contained in:
ajbruin 2018-08-16 19:46:38 +02:00 committed by Andreas Schildbach
parent 32142ed184
commit cc3ef24a58
2 changed files with 15 additions and 0 deletions

View file

@ -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;
}

View file

@ -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");