From: Sarah Hoffmann Date: Sat, 5 Nov 2022 13:33:28 +0000 (+0100) Subject: ignore interpolations without parent on reverse search X-Git-Tag: v4.2.0~18^2 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/0dbc0ae6d5bde2a91e30a7f204ee5918ada875ee ignore interpolations without parent on reverse search 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. --- diff --git a/lib-php/ReverseGeocode.php b/lib-php/ReverseGeocode.php index 77c16a5b..2aea9038 100644 --- a/lib-php/ReverseGeocode.php +++ b/lib-php/ReverseGeocode.php @@ -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);