X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/c755733b03a1a5c4a1243af09bee5af7f3a226d3..f1c4615c32532cdb03845c017f660fa5c5a06331:/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);