From 0cd3a1b9bd8af6541c65f58608d8be7ad3674607 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 23 Jun 2022 22:06:48 +0200 Subject: [PATCH] avoid near searches in very large areas At some point the contains call becomes too expensive. --- lib-php/SearchDescription.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib-php/SearchDescription.php b/lib-php/SearchDescription.php index 3f3beab1..b98c2e72 100644 --- a/lib-php/SearchDescription.php +++ b/lib-php/SearchDescription.php @@ -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'; -- 2.39.5