From: Sarah Hoffmann Date: Sun, 24 Feb 2019 10:00:33 +0000 (+0100) Subject: Change accepted features for reverse geocoding at rank 30 X-Git-Tag: v3.3.0~27 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/16794a84defe0839c17f97b14c57b1bac23be4b2?ds=inline;hp=189da9afb3659e194b545dd5a6d9de1b1033c72d Change accepted features for reverse geocoding at rank 30 Always exclude line features (removes railways, tunnels, piers, historical streets etc.) and boundaries (removes electoral, historical boundaries etc.) Fixes #1313. --- diff --git a/lib/ReverseGeocode.php b/lib/ReverseGeocode.php index 820ca385..9601ecf5 100644 --- a/lib/ReverseGeocode.php +++ b/lib/ReverseGeocode.php @@ -263,7 +263,9 @@ class ReverseGeocode } $sSQL .= ' and (name is not null or housenumber is not null'; $sSQL .= ' or rank_address between 26 and 27)'; - $sSQL .= ' and class not in (\'railway\',\'tunnel\',\'bridge\',\'man_made\')'; + $sSQL .= ' and (rank_address between 26 and 27'; + $sSQL .= ' or ST_GeometryType(geometry) != \'ST_LineString\')'; + $sSQL .= ' and class not in (\'boundary\')'; $sSQL .= ' and indexed_status = 0 and linked_place_id is null'; $sSQL .= ' and (ST_GeometryType(geometry) not in (\'ST_Polygon\',\'ST_MultiPolygon\') '; $sSQL .= ' OR ST_DWithin('.$sPointSQL.', centroid, '.$fSearchDiam.'))'; @@ -315,8 +317,9 @@ class ReverseGeocode $sSQL .= ' WHERE ST_DWithin('.$sPointSQL.', geometry, 0.001)'; $sSQL .= ' AND parent_place_id = '.$iPlaceID; $sSQL .= ' and rank_address != 28'; + $sSQL .= ' and ST_GeometryType(geometry) != \'ST_LineString\''; $sSQL .= ' and (name is not null or housenumber is not null)'; - $sSQL .= ' and class not in (\'railway\',\'tunnel\',\'bridge\',\'man_made\')'; + $sSQL .= ' and class not in (\'boundary\')'; $sSQL .= ' and indexed_status = 0 and linked_place_id is null'; $sSQL .= ' ORDER BY distance ASC limit 1'; if (CONST_Debug) var_dump($sSQL);