avoid near searches in very large areas

At some point the contains call becomes too expensive.
This commit is contained in:
Sarah Hoffmann
2022-06-23 22:06:48 +02:00
parent 8de483a45b
commit 0cd3a1b9bd

View 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';