]> git.openstreetmap.org Git - nominatim.git/commitdiff
re-add district to geocodejson
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 1 Apr 2020 19:24:42 +0000 (21:24 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 1 Apr 2020 19:24:42 +0000 (21:24 +0200)
docs/api/Output.md
lib/AddressDetails.php
test/bdd/api/reverse/geocodejson.feature
test/bdd/api/search/geocodejson.feature

index 9871b22525fb35f978742770175d0978c6910f72..2f9bdaebe98fa7b4958587f2f7f2871ac4db745c 100644 (file)
@@ -100,7 +100,7 @@ The following feature attributes are implemented:
  * `type` - value of the main tag of the object (e.g. residential, restaurant, ...)
  * `label` - full comma-separated address
  * `name` - localised name of the place
- * `housenumber`, `street`, `locality`, `postcode`, `city`,
+ * `housenumber`, `street`, `locality`, `district`, `postcode`, `city`,
    `county`, `state`, `country` -
    provided when it can be determined from the address
  * `admin` - list of localised names of administrative boundaries (only with `addressdetails=1`)
index 4606bbe2a1ad7a5e86e68b3fc0046ecd0f246a26..2aae0742e131cb6c314e691cb84273d31a2f7180 100644 (file)
@@ -132,8 +132,10 @@ class AddressDetails
                 $aJson['housenumber'] = $aLine['localname'];
             } else if ($iRank > 25 && $iRank < 28) {
                 $aJson['street'] = $aLine['localname'];
-            } else if ($iRank >= 17 && $iRank <= 25) {
+            } else if ($iRank >= 22 && $iRank <= 25) {
                 $aJson['locality'] = $aLine['localname'];
+            } else if ($iRank >= 17 && $iRank <= 21) {
+                $aJson['district'] = $aLine['localname'];
             } else if ($iRank >= 13 && $iRank <= 16) {
                 $aJson['city'] = $aLine['localname'];
             } else if ($iRank >= 10 && $iRank <= 12) {
index ef2053ae1f29f2ad658f0722cdb10322016c3d01..b32bf1ca453482f859eac8bb5f65501717f1bed8 100644 (file)
@@ -23,5 +23,5 @@ Feature: Parameters for Reverse API
     Scenario: City address with suburb
         When sending geocodejson reverse coordinates 53.5822,10.0805
         Then results contain
-          | housenumber | street                | locality  | city    | postcode | country |
-          | 64          | Hinschenfelder Straße | Wandsbek  | Hamburg | 22047    | Deutschland |
+          | housenumber | street                | district | city    | postcode | country |
+          | 64          | Hinschenfelder Straße | Wandsbek | Hamburg | 22047    | Deutschland |
index f9132f709d080509dd835e47c16cebf61947d7d0..97cb220b0b84c6250750a4bcb7288dcd2794e4d8 100644 (file)
@@ -23,5 +23,5 @@ Feature: Parameters for Search API
     Scenario: City address with suburb
         When sending geocodejson search query "hinschenfelder str 64, wandsbek" with address
         Then results contain
-          | housenumber | street                | locality  | city    | postcode | country |
-          | 64          | Hinschenfelder Straße | Wandsbek  | Hamburg | 22047    | Deutschland |
+          | housenumber | street                | district | city    | postcode | country |
+          | 64          | Hinschenfelder Straße | Wandsbek | Hamburg | 22047    | Deutschland |