]> git.openstreetmap.org Git - nominatim.git/commitdiff
ignore interpolations without parent on reverse search
authorSarah Hoffmann <lonvia@denofr.de>
Sat, 5 Nov 2022 13:33:28 +0000 (14:33 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Sat, 5 Nov 2022 21:16:09 +0000 (22:16 +0100)
If no parent can be found for an interpolation, there is most
likely a data error involved. So don' t show these interpolations
in reverse search results.

lib-php/ReverseGeocode.php

index 77c16a5b09fe05b5ca5e9add4d06cb1dfbaba173..2aea90387a57d07d669b16f1ae9ed1a7347da729 100644 (file)
@@ -71,7 +71,8 @@ class ReverseGeocode
         $sSQL .= '  ST_Distance(linegeo,'.$sPointSQL.') as distance';
         $sSQL .= ' FROM location_property_osmline';
         $sSQL .= ' WHERE ST_DWithin('.$sPointSQL.', linegeo, '.$fSearchDiam.')';
-        $sSQL .= ' and indexed_status = 0 and startnumber is not NULL ';
+        $sSQL .= '       and indexed_status = 0 and startnumber is not NULL ';
+        $sSQL .= '       and parent_place_id != 0';
         $sSQL .= ' ORDER BY distance ASC limit 1';
         Debug::printSQL($sSQL);