]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib-php/SearchDescription.php
avoid near searches in very large areas
[nominatim.git] / 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';