X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/5f4115f2f3c5727428b193a857d6663373c3044b..f1c4615c32532cdb03845c017f660fa5c5a06331:/lib/Geocode.php?ds=sidebyside 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);