]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge remote-tracking branch 'upstream/master'
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 4 Jul 2018 19:11:32 +0000 (21:11 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 4 Jul 2018 19:11:32 +0000 (21:11 +0200)
lib/ReverseGeocode.php
test/bdd/api/reverse/queries.feature

index 41da26676f771cbd1750b66a3a790400be469e0d..69fef37e592df47dfec07b779ee945c697f51f9f 100644 (file)
@@ -111,10 +111,11 @@ class ReverseGeocode
             $sSQL .= ' WHERE osm_type = \'N\'';
             $sSQL .= ' AND country_code = \''.$sCountryCode.'\'';
             $sSQL .= ' AND rank_address > 0';
-            $sSQL .= ' AND rank_address <= ' .$iMaxRank;
+            $sSQL .= ' AND rank_address <= ' .min(25, $iMaxRank);
             $sSQL .= ' AND type != \'postcode\'';
             $sSQL .= ' AND name IS NOT NULL ';
             $sSQL .= ' and indexed_status = 0 and linked_place_id is null';
+            $sSQL .= ' AND ST_DWithin('.$sPointSQL.', geometry, 1.0)';
             $sSQL .= ' ORDER BY distance ASC, rank_address DESC';
             $sSQL .= ' LIMIT 1';
             
index a9ee2b17dc5adfa9ef89f67496013e877137ade4..a6c1dd34671608edebdd49aadc335c65c52d8cbf 100644 (file)
@@ -48,8 +48,8 @@ Feature: Reverse geocoding
 
     Scenario: Location off the coast
         When sending jsonv2 reverse coordinates 54.046489113,8.5546870529
-        | zoom |
+         | zoom |
          | 5 |
         Then results contain
-         | display_name |
-         | ^.*Hamburg, Deutschland |
+         | error |
+         | Unable to geocode |