]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Thu, 9 Oct 2014 19:06:35 +0000 (21:06 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Thu, 9 Oct 2014 19:06:35 +0000 (21:06 +0200)
lib/Geocode.php
sql/functions.sql
tests/features/api/regression.feature
tests/features/api/search_params.feature
tests/features/db/import/placex.feature

index 36b5b5671bfa8f128c322f8387f6b4217680a6b4..7de9c8e2771a47b49c62b63d2bf8ca4d7ff6e283 100644 (file)
                                                                {
                                                                        $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);
index 4aef74d1d28089f63a96fcc0dcaac6bc607d4351..821d44a675d9156ced555dccc1cf02a775aab842 100644 (file)
@@ -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;
index 3e409fe867755d389109b9b62955c988c7051c53..f1887e1a045615063edf5e67b3bd6fcca376b5c1 100644 (file)
@@ -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
index 5b765f12cd69511b9cd520c68870014619c16d6a..5733af417bc97d20b8b74c92a7a9049610f5be11 100644 (file)
@@ -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
index caa0d17571d4ddc1be754b2ead49f8b5779017ec..7e9ae62026db22b0e2cf94d28b4143708b4fdff6 100644 (file)
@@ -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