]> git.openstreetmap.org Git - nominatim.git/commitdiff
use centroid for near feature search on rank 30
authorSarah Hoffmann <lonvia@denofr.de>
Sun, 9 Apr 2017 21:12:35 +0000 (23:12 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Sun, 9 Apr 2017 21:12:35 +0000 (23:12 +0200)
Rank 30 has some very large geometries (peninsulas, time zones,
etc.) for which a near feature search for the full geometry is
too expensive, so do the search on the centroid only.

sql/functions.sql

index e6938866d7d02553ca15374294dc97357ac2bbcb..1db32d1d50973827d24ba9a194d632e45b67ffbf 100644 (file)
@@ -1681,8 +1681,10 @@ BEGIN
   -- RAISE WARNING '  getNearFeatures(%,''%'',%,''%'')',NEW.partition, place_centroid, search_maxrank, isin_tokens;
   FOR location IN
     SELECT * from getNearFeatures(NEW.partition,
-                                  CASE WHEN NEW.rank_search >= 26 THEN NEW.geometry
-                                  ELSE place_centroid END,
+                                  CASE WHEN NEW.rank_search >= 26
+                                             AND NEW.rank_search < 30
+                                       THEN NEW.geometry
+                                       ELSE place_centroid END,
                                   search_maxrank, isin_tokens)
   LOOP