]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge branch 'place-in-addressdetails' of https://github.com/lonvia/Nominatim
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 16 May 2014 09:23:05 +0000 (11:23 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 16 May 2014 09:23:05 +0000 (11:23 +0200)
lib/PlaceLookup.php
lib/lib.php
sql/functions.sql

index ed2f494d45c41bbc66b3c2dc66a5012f158360c1..e00163378a3d48a8555864f4a8f1d75f1fec3b22 100644 (file)
                                {
                                        $sTypeLabel = strtolower(isset($aTypeLabel['simplelabel'])?$aTypeLabel['simplelabel']:$aTypeLabel['label']);
                                        $sTypeLabel = str_replace(' ','_',$sTypeLabel);
-                                       if (!isset($aAddress[$sTypeLabel]) || (isset($aFallback[$sTypeLabel]) && $aFallback[$sTypeLabel]))
+                                       if (!isset($aAddress[$sTypeLabel]) || (isset($aFallback[$sTypeLabel]) && $aFallback[$sTypeLabel]) || $aLine['class'] == 'place')
                                        {
                                                $aAddress[$sTypeLabel] = $aLine['localname']?$aLine['localname']:$aLine['housenumber'];
                                        }
index 268c75581f4292940fcc914ea0855d7849d0e68d..afcc02eff186f78d5579a4b5136e935edf8b37df 100644 (file)
                        {
                                $sTypeLabel = strtolower(isset($aTypeLabel['simplelabel'])?$aTypeLabel['simplelabel']:$aTypeLabel['label']);
                                $sTypeLabel = str_replace(' ','_',$sTypeLabel);
-                               if (!isset($aAddress[$sTypeLabel]) || (isset($aFallback[$sTypeLabel]) && $aFallback[$sTypeLabel]))
+                               if (!isset($aAddress[$sTypeLabel]) || (isset($aFallback[$sTypeLabel]) && $aFallback[$sTypeLabel]) || $aLine['class'] == 'place')
                                {
                                        $aAddress[$sTypeLabel] = $aLine['localname']?$aLine['localname']:$aLine['housenumber'];
                                }
index 820236718cf480ed7a5f38de014b441f19b8edc0..1da469208d29910001ca04f9351c771232590519 100644 (file)
@@ -2518,7 +2518,9 @@ BEGIN
   FOR location IN 
     select placex.place_id, osm_type, osm_id,
       CASE WHEN class = 'place' and type = 'postcode' THEN hstore('name', postcode) ELSE name END as name,
-      class, type, admin_level, fromarea, isaddress,
+      CASE WHEN extratags ? 'place' THEN 'place' ELSE class END as class,
+      CASE WHEN extratags ? 'place' THEN extratags->'place' ELSE type END as type,
+      admin_level, fromarea, isaddress,
       CASE WHEN address_place_id = for_place_id AND rank_address = 0 THEN 100 WHEN rank_address = 11 THEN 5 ELSE rank_address END as rank_address,
       distance,calculated_country_code,postcode
       from place_addressline join placex on (address_place_id = placex.place_id)