Skip to content

Commit

Permalink
fix polygon selection for classtable lookups
Browse files Browse the repository at this point in the history
Polygons should be used preferably with higher address ranks
where the areas are smaller.
  • Loading branch information
lonvia committed Nov 25, 2023
1 parent 2d54de0 commit d6fe58f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nominatim/api/search/db_searches.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ async def lookup_category(self, results: nres.SearchResults,
sql = sql.join(table, t.c.place_id == table.c.place_id)\
.join(tgeom,
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),
else_ = tgeom.c.centroid.ST_Expand(0.05))))\
Expand Down

0 comments on commit d6fe58f

Please sign in to comment.