From: Sarah Hoffmann Date: Sun, 9 Apr 2017 21:12:35 +0000 (+0200) Subject: use centroid for near feature search on rank 30 X-Git-Tag: v3.0.0~43 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/8138729aea652acd1c9148df9d9318cbfb9c4da2?ds=inline;hp=-c use centroid for near feature search on rank 30 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. --- 8138729aea652acd1c9148df9d9318cbfb9c4da2 diff --git a/sql/functions.sql b/sql/functions.sql index e6938866..1db32d1d 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -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