]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 4 Oct 2017 18:16:27 +0000 (20:16 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 4 Oct 2017 18:16:27 +0000 (20:16 +0200)
lib/Geocode.php
lib/PlaceLookup.php
lib/lib.php
test/bdd/api/details/simple.feature
test/bdd/api/reverse/queries.feature
test/bdd/api/search/queries.feature

index f142731dac0f3233d96d59c12b86b967081a898c..1297b36388b0d66112f308d43870dd29b09ff494 100644 (file)
@@ -785,7 +785,7 @@ class Geocode
                                     // require a normalized exact match of the term
                                     // if we have the normalizer version of the query
                                     // available
-                                    if ($aSearch['sClass'] === ''
+                                    if ($aSearch['sOperator'] === ''
                                         && ($sNormQuery === null || !($aSearchTerm['word'] && strpos($sNormQuery, $aSearchTerm['word']) === false))) {
                                         $aSearch['sClass'] = $aSearchTerm['class'];
                                         $aSearch['sType'] = $aSearchTerm['type'];
index 40d003fa7c593fc81e3aee0c62c258f8613850c4..4920a1318d6edd24bbb84c5ae1dab83ef4c3bbcf 100644 (file)
@@ -45,27 +45,16 @@ class PlaceLookup
         $this->bNameDetails = $bNameDetails;
     }
 
-
     public function setIncludePolygonAsPoints($b = true)
     {
         $this->bIncludePolygonAsPoints = $b;
     }
 
-    public function getIncludePolygonAsPoints()
-    {
-        return $this->bIncludePolygonAsPoints;
-    }
-
     public function setIncludePolygonAsText($b = true)
     {
         $this->bIncludePolygonAsText = $b;
     }
 
-    public function getIncludePolygonAsText()
-    {
-        return $this->bIncludePolygonAsText;
-    }
-
     public function setIncludePolygonAsGeoJSON($b = true)
     {
         $this->bIncludePolygonAsGeoJSON = $b;
index 8a49761b638636b6f8919c2bb4fb7d3d3c1d9c30..cdd6b5cb773e9ce500959876a0dfd026983d5917 100644 (file)
@@ -548,10 +548,10 @@ function _debugDumpGroupedSearches($aData, $aTokens)
             if ($aRow['oNear']) {
                 echo "<td>".$aRow['oNear']->lat()."</td>";
                 echo "<td>".$aRow['oNear']->lon()."</td>";
+                echo "<td>".$aRow['oNear']->radius()."</td>";
             } else {
-                echo "<td></td><td></td>";
+                echo "<td></td><td></td><td></td>";
             }
-            echo "<td>".$aRow['fRadius']."</td>";
 
             echo "</tr>";
         }
index 638e89ca9bfe8e1fafc3e2d616598533df3a8204..8971c5c2d0f36a21db13b6cdf776f2ba64ae47a1 100644 (file)
@@ -12,3 +12,9 @@ Feature: Object details
      | N4267356889 |
      | W230804120 |
      | R123924 |
+
+    Scenario: Details with keywords
+        When sending details query for W78099902
+            | keywords |
+            | 1 |
+        Then the result is valid html
index e1d089b92c13279f6f9736f7038e1afb566e64d6..b860823e596d3dea7bd7795a7186c5f056606cdc 100644 (file)
@@ -23,3 +23,12 @@ Feature: Reverse geocoding
         And result addresses contain
           | road            | postcode | country_code |
           | West 1st Street | 57274    | us |
+
+    Scenario: Interpolated house number
+        When sending jsonv2 reverse coordinates -33.231795578514635,-54.38682173844428
+        Then results contain
+          | osm_type | category | type |
+          | way      | place    | house |
+        And result addresses contain
+          | house_number | road |
+          | 1410         | Juan Antonio Lavalleja |
index 2767f87cfd40fc84bb74005983be0fbd066b6d2a..5ef8f7ed8bbf9139f4edfef88238089734fb5f87 100644 (file)
@@ -44,6 +44,17 @@ Feature: Search queries
           | country      | Deutschland |
           | country_code | de |
 
+    Scenario: With missing housenumber search falls back to road
+        When sending json search query "342 rocha, santa lucia" with address
+        Then address of result 0 is
+          | type         | value |
+          | road         | Rocha |
+          | city         | Santa Lucía |
+          | state        | Canelones |
+          | postcode     | 90700 |
+          | country      | Uruguay |
+          | country_code | uy |
+
     @Tiger
     Scenario: TIGER house number
         When sending json search query "323 22nd Street Southwest, Huron"
@@ -91,11 +102,25 @@ Feature: Search queries
           | amenity | restaurant |
 
     Scenario: Arbitrary key/value search near given coordinate
-        When sending json search query "[man_made=mast]  47.15739,9.61264"
+        When sending json search query "[man_made=mast]  47.15739° N 9.61264° E"
+        Then results contain
+          | class    | type |
+          | man_made | mast |
+
+    Scenario: Arbitrary key/value search near given coordinate and named place
+        When sending json search query "[man_made=mast] amerlugalpe  47° 9′ 26″ N 9° 36′ 45″ E"
         Then results contain
           | class    | type |
           | man_made | mast |
 
+    Scenario: Name search near given coordinate
+        When sending json search query "amerlugalpe, N 47.15739° E 9.61264°"
+        Then exactly 1 result is returned
+
+    Scenario: Name search near given coordinate without result
+        When sending json search query "amerlugalpe, N 47 15 7 W 9 61 26"
+        Then exactly 0 results are returned
+
     Scenario: Arbitrary key/value search near a road
         When sending json search query "[leisure=table_soccer_table] immenbusch"
         Then results contain