X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/8fd7d319b7ef6ee4d4f8cf3b61eb47903e7fb1eb..1d248ac86db873873bc06896573e3dd81113ff5f:/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);