]> git.openstreetmap.org Git - nominatim.git/commitdiff
avoid near searches in very large areas
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 23 Jun 2022 20:06:48 +0000 (22:06 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 23 Jun 2022 21:42:09 +0000 (23:42 +0200)
At some point the contains call becomes too expensive.

lib-php/SearchDescription.php

index 3f3beab1964dd2e2578c117bac663ce9baa5535c..b98c2e723ae7e4419facfed29ddb426725af314c 100644 (file)
@@ -807,6 +807,7 @@ class SearchDescription
                 $sSQL = 'SELECT geometry FROM placex';
                 $sSQL .= " WHERE place_id in ($sPlaceIDs)";
                 $sSQL .= "   AND rank_search < $iMaxRank + 5";
+                $sSQL .= '   AND ST_Area(Box2d(geometry)) < 20';
                 $sSQL .= "   AND ST_GeometryType(geometry) in ('ST_Polygon','ST_MultiPolygon')";
                 $sSQL .= ' ORDER BY rank_search ASC ';
                 $sSQL .= ' LIMIT 1';