]> git.openstreetmap.org Git - nominatim.git/commitdiff
each address line must fill at most one geocodejson field
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 27 May 2020 09:16:27 +0000 (11:16 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 27 May 2020 09:16:27 +0000 (11:16 +0200)
This fixes an issue where a postcode with rank_address 5
would also appear in the state field.

lib/AddressDetails.php

index dd86707974765570ae9a1766eb8d29a06fb299e7..a27d3e797feefd123bbd11ab52c48a630ac14929 100644 (file)
@@ -117,8 +117,12 @@ class AddressDetails
 
             if ($aLine['type'] == 'postcode' || $aLine['type'] == 'postal_code') {
                 $aJson['postcode'] = $aLine['localname'];
-            } elseif ($aLine['type'] == 'house_number') {
+                continue;
+            }
+
+            if ($aLine['type'] == 'house_number') {
                 $aJson['housenumber'] = $aLine['localname'];
+                continue;
             }
 
             if ($this->iPlaceID == $aLine['place_id']) {