]> git.openstreetmap.org Git - nominatim.git/commitdiff
rather use new place_type in getAddressNames()
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 29 Mar 2020 18:49:35 +0000 (20:49 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 29 Mar 2020 18:49:35 +0000 (20:49 +0200)
If for a boundary the place_type is defined, handle the address
part like a place node. This is the same behaviour as before
when class/type where patched earlier.

lib/ClassTypes.php

index d46847f1c7a65d6ec7565070361ac32da0bb5383..91066a1ffb1d3b2dacba3834aa78e9a2221952ea 100644 (file)
@@ -6,6 +6,13 @@ function getInfo($aPlace)
 {
     $aClassType = getList();
 
+    if ($aPlace['type'] == 'administrative' && isset($aPlace['place_type'])) {
+        $sName = 'place:'.$aPlace['place_type'];
+        if (isset($aClassType[$sName])) {
+            return $aClassType[$sName];
+        }
+    }
+
     if (isset($aPlace['admin_level'])) {
         $sName = $aPlace['class'].':'.$aPlace['type'].':'.$aPlace['admin_level'];
         if (isset($aClassType[$sName])) {