X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8fd7d319b7ef6ee4d4f8cf3b61eb47903e7fb1eb..369a0974bde0951ac01bd72a421e9f60b52ad7c7:/lib/ReverseGeocode.php diff --git a/lib/ReverseGeocode.php b/lib/ReverseGeocode.php index 8503e1eb..cb8c0c6b 100644 --- a/lib/ReverseGeocode.php +++ b/lib/ReverseGeocode.php @@ -95,8 +95,8 @@ $sSQL .= ' and rank_search != 28 and rank_search >= '.$iMaxRank; $sSQL .= ' and (name is not null or housenumber is not null)'; $sSQL .= ' and class not in (\'waterway\',\'railway\',\'tunnel\',\'bridge\')'; - $sSQL .= ' and (ST_GeometryType(geometry) not in (\'ST_Polygon\',\'ST_MultiPolygon\') '; $sSQL .= ' and indexed_status = 0 '; + $sSQL .= ' and (ST_GeometryType(geometry) not in (\'ST_Polygon\',\'ST_MultiPolygon\') '; $sSQL .= ' OR ST_DWithin('.$sPointSQL.', centroid, '.$fSearchDiam.'))'; $sSQL .= ' ORDER BY ST_distance('.$sPointSQL.', geometry) ASC limit 1'; if (CONST_Debug) var_dump($sSQL);