X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/866b702e0e1807b17180af79943ce02ea0890a7c..79b30a8c0f695746b3ed79e4fb484accd5bf9bec:/lib/Geocode.php diff --git a/lib/Geocode.php b/lib/Geocode.php index 36b5b567..7de9c8e2 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -1158,6 +1158,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);