From: Sarah Hoffmann Date: Fri, 12 Jun 2015 21:53:40 +0000 (+0200) Subject: fix top-bottom mixup in bounding box X-Git-Tag: deploy~451 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/c125aab8dabf6716ae1164f0489bb9b41238c97f?hp=-c fix top-bottom mixup in bounding box --- c125aab8dabf6716ae1164f0489bb9b41238c97f diff --git a/lib/Geocode.php b/lib/Geocode.php index a9fa44fe..a932949d 100644 --- a/lib/Geocode.php +++ b/lib/Geocode.php @@ -154,8 +154,8 @@ $fRight = (float)$sRight; $fTop = (float)$sTop; $fBottom = (float)$sBottom; - if ($fRight > $fLeft && $fBottom > $fTop - && ($fRight - $fLeft) < 2 && ($fBottom - $fTop) < 2) + if ($fRight > $fLeft && $fBottom < $fTop + && ($fRight - $fLeft) < 2 && ($fTop - $fBottom) < 2) $this->aViewBox = array($fLeft, $fBottom, $fRight, $fTop); } diff --git a/tests/features/api/regression.feature b/tests/features/api/regression.feature index 8a436fc3..bbff268a 100644 --- a/tests/features/api/regression.feature +++ b/tests/features/api/regression.feature @@ -187,7 +187,7 @@ Feature: API regression tests Scenario: trac #5238 Given the request parameters | bounded | viewbox - | 1 | 0,0,-1,-1 + | 1 | 0,0,1,-1 When sending json search query "sy" Then exactly 0 results are returned diff --git a/tests/features/api/search_params.feature b/tests/features/api/search_params.feature index b9d06791..92ca8c39 100644 --- a/tests/features/api/search_params.feature +++ b/tests/features/api/search_params.feature @@ -83,7 +83,7 @@ Feature: Search queries Scenario: bounded search remains within viewbox, even with no results Given the request parameters | bounded | viewbox - | 1 | 43.54285,-5.662003,43.5403125,-5.6563282 + | 1 | 43.5403125,-5.6563282,43.54285,-5.662003 When sending json search query "restaurant" Then less than 1 result is returned