re-add district to geocodejson

This commit is contained in:
Sarah Hoffmann
2020-04-01 21:24:42 +02:00
parent e59146a733
commit 975ef0b305
4 changed files with 8 additions and 6 deletions

View File

@@ -100,7 +100,7 @@ The following feature attributes are implemented:
* `type` - value of the main tag of the object (e.g. residential, restaurant, ...) * `type` - value of the main tag of the object (e.g. residential, restaurant, ...)
* `label` - full comma-separated address * `label` - full comma-separated address
* `name` - localised name of the place * `name` - localised name of the place
* `housenumber`, `street`, `locality`, `postcode`, `city`, * `housenumber`, `street`, `locality`, `district`, `postcode`, `city`,
`county`, `state`, `country` - `county`, `state`, `country` -
provided when it can be determined from the address provided when it can be determined from the address
* `admin` - list of localised names of administrative boundaries (only with `addressdetails=1`) * `admin` - list of localised names of administrative boundaries (only with `addressdetails=1`)

View File

@@ -132,8 +132,10 @@ class AddressDetails
$aJson['housenumber'] = $aLine['localname']; $aJson['housenumber'] = $aLine['localname'];
} else if ($iRank > 25 && $iRank < 28) { } else if ($iRank > 25 && $iRank < 28) {
$aJson['street'] = $aLine['localname']; $aJson['street'] = $aLine['localname'];
} else if ($iRank >= 17 && $iRank <= 25) { } else if ($iRank >= 22 && $iRank <= 25) {
$aJson['locality'] = $aLine['localname']; $aJson['locality'] = $aLine['localname'];
} else if ($iRank >= 17 && $iRank <= 21) {
$aJson['district'] = $aLine['localname'];
} else if ($iRank >= 13 && $iRank <= 16) { } else if ($iRank >= 13 && $iRank <= 16) {
$aJson['city'] = $aLine['localname']; $aJson['city'] = $aLine['localname'];
} else if ($iRank >= 10 && $iRank <= 12) { } else if ($iRank >= 10 && $iRank <= 12) {

View File

@@ -23,5 +23,5 @@ Feature: Parameters for Reverse API
Scenario: City address with suburb Scenario: City address with suburb
When sending geocodejson reverse coordinates 53.5822,10.0805 When sending geocodejson reverse coordinates 53.5822,10.0805
Then results contain Then results contain
| housenumber | street | locality | city | postcode | country | | housenumber | street | district | city | postcode | country |
| 64 | Hinschenfelder Straße | Wandsbek | Hamburg | 22047 | Deutschland | | 64 | Hinschenfelder Straße | Wandsbek | Hamburg | 22047 | Deutschland |

View File

@@ -23,5 +23,5 @@ Feature: Parameters for Search API
Scenario: City address with suburb Scenario: City address with suburb
When sending geocodejson search query "hinschenfelder str 64, wandsbek" with address When sending geocodejson search query "hinschenfelder str 64, wandsbek" with address
Then results contain Then results contain
| housenumber | street | locality | city | postcode | country | | housenumber | street | district | city | postcode | country |
| 64 | Hinschenfelder Straße | Wandsbek | Hamburg | 22047 | Deutschland | | 64 | Hinschenfelder Straße | Wandsbek | Hamburg | 22047 | Deutschland |