mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-02-26 11:08:13 +00:00
fix polygon selection for classtable lookups
Polygons should be used preferably with higher address ranks where the areas are smaller.
This commit is contained in:
@@ -296,7 +296,7 @@ class NearSearch(AbstractSearch):
|
|||||||
sql = sql.join(table, t.c.place_id == table.c.place_id)\
|
sql = sql.join(table, t.c.place_id == table.c.place_id)\
|
||||||
.join(tgeom,
|
.join(tgeom,
|
||||||
table.c.centroid.ST_CoveredBy(
|
table.c.centroid.ST_CoveredBy(
|
||||||
sa.case((sa.and_(tgeom.c.rank_address < 9,
|
sa.case((sa.and_(tgeom.c.rank_address > 9,
|
||||||
tgeom.c.geometry.is_area()),
|
tgeom.c.geometry.is_area()),
|
||||||
tgeom.c.geometry),
|
tgeom.c.geometry),
|
||||||
else_ = tgeom.c.centroid.ST_Expand(0.05))))\
|
else_ = tgeom.c.centroid.ST_Expand(0.05))))\
|
||||||
|
|||||||
Reference in New Issue
Block a user