mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
respect bounded in country searches
fixes trac 5238
This commit is contained in:
@@ -1156,6 +1156,8 @@
|
|||||||
{
|
{
|
||||||
$sSQL = "select place_id from placex where calculated_country_code='".$aSearch['sCountryCode']."' and rank_search = 4";
|
$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 ($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";
|
$sSQL .= " order by st_area(geometry) desc limit 1";
|
||||||
if (CONST_Debug) var_dump($sSQL);
|
if (CONST_Debug) var_dump($sSQL);
|
||||||
$aPlaceIDs = $this->oDB->getCol($sSQL);
|
$aPlaceIDs = $this->oDB->getCol($sSQL);
|
||||||
|
|||||||
@@ -177,3 +177,10 @@ Feature: API regression tests
|
|||||||
Then results contain
|
Then results contain
|
||||||
| ID | class | latlon
|
| ID | class | latlon
|
||||||
| 0 | highway | 51.8324206,1.2447352 +-100m
|
| 0 | highway | 51.8324206,1.2447352 +-100m
|
||||||
|
|
||||||
|
Scenario: trac #5238
|
||||||
|
Given the request parameters
|
||||||
|
| bounded | viewbox
|
||||||
|
| 1 | 0,0,-1,-1
|
||||||
|
When sending json search query "sy"
|
||||||
|
Then exactly 0 results are returned
|
||||||
|
|||||||
Reference in New Issue
Block a user