]> git.openstreetmap.org Git - nominatim.git/commitdiff
output linked place into address details
authorSarah Hoffmann <lonvia@denofr.de>
Fri, 28 Feb 2020 21:07:06 +0000 (22:07 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Fri, 28 Feb 2020 21:07:06 +0000 (22:07 +0100)
lib/PlaceLookup.php
sql/partition-functions.src.sql

index fce4970158a9395a6c22301fcae70d6ece185398..3531413fbcab40fb3bda5665fb3f1a4d6c5f21bc 100644 (file)
@@ -215,7 +215,7 @@ class PlaceLookup
                 'ST_Collect(centroid)',
                 'min(CASE WHEN placex.rank_search < 28 THEN placex.place_id ELSE placex.parent_place_id END)'
             );
-            $sSQL .= "    (extratags->'place') AS extra_place ";
+            $sSQL .= "    COALESCE(extratags->'place', extratags->'linked_place') AS extra_place ";
             $sSQL .= ' FROM placex';
             $sSQL .= " WHERE place_id in ($sPlaceIDs) ";
             $sSQL .= '   AND (';
index 8f78032ed18d4e05e5bc5d4f3ea9dc50563db898..34b4d390750798cb506f5fe11507535c0c20278e 100644 (file)
@@ -20,7 +20,8 @@ BEGIN
     FOR r IN 
       SELECT place_id, keywords, rank_address, rank_search, min(ST_Distance(feature, centroid)) as distance, isguess, postcode, centroid
       FROM location_area_large_-partition-
-      WHERE ST_Intersects(geometry, feature) and rank_search < maxrank
+      WHERE ST_Intersects(geometry, feature)
+        AND rank_search < maxrank AND rank_address < maxrank
       GROUP BY place_id, keywords, rank_address, rank_search, isguess, postcode, centroid
       ORDER BY rank_address, isin_tokens && keywords desc, isguess asc,
         ST_Distance(feature, centroid) *