X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/ae2ad38040f8515caa79bf274ddc345c6efeb6ef..efddd1339de9876e4f1681ee0629bb09e76ae1a1:/lib/ReverseGeocode.php diff --git a/lib/ReverseGeocode.php b/lib/ReverseGeocode.php index fc5e04d6..9601ecf5 100644 --- a/lib/ReverseGeocode.php +++ b/lib/ReverseGeocode.php @@ -130,6 +130,7 @@ class ReverseGeocode $sSQL .= ' WHERE country_code = \''.$sCountryCode.'\''; $sSQL .= ' AND rank_search = 4 AND rank_address = 4'; $sSQL .= ' AND class in (\'boundary\', \'place\')'; + $sSQL .= ' AND linked_place_id is null'; $sSQL .= ' ORDER BY distance ASC'; if (CONST_Debug) var_dump($sSQL); @@ -262,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.'))'; @@ -314,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);