X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/4d6da459da6237a1fe383c6edc7e1166e56fc8e5..6704f7bbb08127cdf2cb7e1e1fc28605b2273bfa:/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);