]> git.openstreetmap.org Git - nominatim.git/commit
Improve main class and category assignment in Lua (#4242)
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 25 Nov 2026 14:15:31 +0000 (15:15 +0100)
committerGitHub <noreply@github.com>
Wed, 25 Nov 2026 14:15:31 +0000 (15:15 +0100)
commit132ffa00a79787c296e8e4fcfcf9b1fd8761155d
tree1e881a12071f6fd59c9e31fb77f8097e8b4b9576
parent2ce9f8c0288fae6303669e7875931381787268b9
parent87bea00ad9b8d6b6e6eee979a3416a849df56ebe
Improve main class and category assignment in Lua (#4242)

This introduces hooks for determining the main tag and categories in the
Lua scripts. Right now the functions behind the hooks are hard-coded but
will be made configurable in a follow-up PR.

The function for determining the main tag now takes semantic priorities
into account instead of going simply by alphabetic order. As a result we
can go back to determining the place ranks directly from the main tag
instead of doing heuristics over the categories. The latter caused quite
a few odd misclassifications.

Categories are still simply derived from the candidates for the main tag
with a few tag combinations blacklisted.

This also resurrects the ability to create more than one place object
for a single OSM object. This is to cater for bridges and tunnels. I had
considered just giving bridges and tunnels the priority and ignoring the
underlying highways/railways but there are [bridges that form part of an
address](https://www.openstreetmap.org/way/122237921). The highway
entries are required for those.

Also fixes a bug in the recently introduced `is_area()` function and
reworks some of the osm2pgsql BDD tests.

First part of #4180.