X-Git-Url: https://git.openstreetmap.org/nominatim.git/blobdiff_plain/8989776bfda86606be036f08b2b3c6ae01e98958..e62ae5b090661f7fa56cc68981457e5b4d4bd9ca:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index bb463445..7f00de6e 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -1156,6 +1156,8 @@ { $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 ($bBoundingBoxSearch) + $sSQL .= " and st_overlaps($this->sViewboxSmallSQL, geometry)"; $sSQL .= " order by st_area(geometry) desc limit 1"; if (CONST_Debug) var_dump($sSQL); $aPlaceIDs = $this->oDB->getCol($sSQL);