From: Sarah Hoffmann Date: Thu, 9 Oct 2014 19:06:35 +0000 (+0200) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Tag: deploy~509 X-Git-Url: https://git.openstreetmap.org/nominatim.git/commitdiff_plain/27984ef340c389886a6b80d2a867d234f9ee0c1c?hp=8564b76add152949d0493f8d15c5049f154118eb Merge remote-tracking branch 'upstream/master' --- 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); diff --git a/sql/functions.sql b/sql/functions.sql index 4aef74d1..821d44a6 100644 --- a/sql/functions.sql +++ b/sql/functions.sql @@ -1128,7 +1128,7 @@ BEGIN -- any feature more than 5 square miles is probably worth indexing ELSEIF ST_GeometryType(NEW.geometry) in ('ST_Polygon','ST_MultiPolygon') AND ST_Area(NEW.geometry) > 0.1 THEN NEW.rank_search := 22; - NEW.rank_address := NEW.rank_search; + NEW.rank_address := 0; ELSEIF NEW.class = 'highway' AND NEW.name is NULL AND NEW.type in ('service','cycleway','path','footway','steps','bridleway','track','byway','motorway_link','primary_link','trunk_link','secondary_link','tertiary_link') THEN -- RAISE WARNING 'unnamed minor feature %',NEW.osm_id; diff --git a/tests/features/api/regression.feature b/tests/features/api/regression.feature index 3e409fe8..f1887e1a 100644 --- a/tests/features/api/regression.feature +++ b/tests/features/api/regression.feature @@ -177,3 +177,10 @@ Feature: API regression tests Then results contain | ID | class | latlon | 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 diff --git a/tests/features/api/search_params.feature b/tests/features/api/search_params.feature index 5b765f12..5733af41 100644 --- a/tests/features/api/search_params.feature +++ b/tests/features/api/search_params.feature @@ -29,7 +29,7 @@ Feature: Search queries When sending xml search query "Inuvik" with address Then address of result 0 is | type | value - | town | Inuvik + | city | Inuvik | state | Northwest Territories | country | Canada | country_code | ca @@ -41,7 +41,7 @@ Feature: Search queries | 0 | leisure | hackerspace And result addresses contain | ID | address29 - | 0 | foobar + | 0 | Chaospott And address of result 0 does not contain leisure,hackerspace Scenario: Disabling deduplication diff --git a/tests/features/db/import/placex.feature b/tests/features/db/import/placex.feature index caa0d175..7e9ae620 100644 --- a/tests/features/db/import/placex.feature +++ b/tests/features/db/import/placex.feature @@ -378,7 +378,7 @@ Feature: Import into placex | N5 | 30 | 30 | W2 | 18 | 0 | R3 | 18 | 0 - | R4 | 22 | 22 + | R4 | 22 | 0 | R5 | 4 | 4 | R6 | 4 | 4 | W3 | 30 | 30