mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-14 18:37:58 +00:00
reverse on street level should compute distance to object
The centroid of a building may be far away even when still inside the building. Fixes #1136.
This commit is contained in:
@@ -247,9 +247,7 @@ class ReverseGeocode
|
||||
// for POI or street level
|
||||
if ($iMaxRank >= 26) {
|
||||
$sSQL = 'select place_id,parent_place_id,rank_address,country_code,';
|
||||
$sSQL .= 'CASE WHEN ST_GeometryType(geometry) in (\'ST_Polygon\',\'ST_MultiPolygon\') THEN ST_distance('.$sPointSQL.', centroid)';
|
||||
$sSQL .= ' ELSE ST_distance('.$sPointSQL.', geometry) ';
|
||||
$sSQL .= ' END as distance';
|
||||
$sSQL .= ' ST_distance('.$sPointSQL.', geometry) as distance';
|
||||
$sSQL .= ' FROM ';
|
||||
$sSQL .= ' placex';
|
||||
$sSQL .= ' WHERE ST_DWithin('.$sPointSQL.', geometry, '.$fSearchDiam.')';
|
||||
|
||||
Reference in New Issue
Block a user