mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-11 13:24:07 +00:00
use _st_intersects when dealing with countries, it does not use index
This commit is contained in:
@@ -1172,7 +1172,7 @@
|
|||||||
$sSQL = "select place_id from placex where calculated_country_code='".$aSearch['sCountryCode']."' and rank_search = 4";
|
$sSQL = "select place_id from placex where calculated_country_code='".$aSearch['sCountryCode']."' and rank_search = 4";
|
||||||
if ($sCountryCodesSQL) $sSQL .= " and calculated_country_code in ($sCountryCodesSQL)";
|
if ($sCountryCodesSQL) $sSQL .= " and calculated_country_code in ($sCountryCodesSQL)";
|
||||||
if ($bBoundingBoxSearch)
|
if ($bBoundingBoxSearch)
|
||||||
$sSQL .= " and st_overlaps($this->sViewboxSmallSQL, geometry)";
|
$sSQL .= " and _st_intersects($this->sViewboxSmallSQL, geometry)";
|
||||||
$sSQL .= " order by st_area(geometry) desc limit 1";
|
$sSQL .= " order by st_area(geometry) desc limit 1";
|
||||||
if (CONST_Debug) var_dump($sSQL);
|
if (CONST_Debug) var_dump($sSQL);
|
||||||
$aPlaceIDs = $this->oDB->getCol($sSQL);
|
$aPlaceIDs = $this->oDB->getCol($sSQL);
|
||||||
|
|||||||
Reference in New Issue
Block a user