Skip to content

Search for places by type as well as by name - #1118

Merged
davecraig merged 1 commit into
Scottish-Tech-Army:mainfrom
davecraig:main
Sep 28, 2026
Merged

davecraig merged 1 commit into
Scottish-Tech-Army:mainfrom
davecraig:main

Conversation

@davecraig

Copy link
Copy Markdown
Contributor

A search which names a type of place - "pharmacy", "chemist", "Boots pharmacy", "pharmacie" - now finds the nearest places of that type, whatever they're called, ahead of the usual name search.

The type is recognised from the translated osm_* name of every ResourceMapper value, plus new translatable search_synonyms_* strings for commonly searched types. A phrase matches as a whole, or by whole words from its start or end ("butcher" is the "Butcher Shop"); a word which is part of too many phrases ("shop") isn't a type.

Photon is searched with /reverse filtered by osm_tag, which is sorted by distance - /api matches its query against names even when filtered by tag. Offline, TileSearch spirals out through the poi layer matching class/subclass, falling back to the loaded grid when there are no extracts. The reader opening, tile spiral and settlement lookup are factored out of TileSearch.search() to share them, which also fixes the hamlet lookup measuring from the user rather than the result.

Claude-Session: https://claude.ai/code/session_01THRgoVbh1G3pVacd7csDqJ

A search which names a type of place - "pharmacy", "chemist", "Boots
pharmacy", "pharmacie" - now finds the nearest places of that type,
whatever they're called, ahead of the usual name search.

The type is recognised from the translated osm_* name of every
ResourceMapper value, plus new translatable search_synonyms_* strings
for commonly searched types. A phrase matches as a whole, or by whole
words from its start or end ("butcher" is the "Butcher Shop"); a word
which is part of too many phrases ("shop") isn't a type.

Photon is searched with /reverse filtered by osm_tag, which is sorted by
distance - /api matches its query against names even when filtered by
tag. Offline, TileSearch spirals out through the poi layer matching
class/subclass, falling back to the loaded grid when there are no
extracts. The reader opening, tile spiral and settlement lookup are
factored out of TileSearch.search() to share them, which also fixes the
hamlet lookup measuring from the user rather than the result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01THRgoVbh1G3pVacd7csDqJ
@davecraig
davecraig merged commit 47185ca into Scottish-Tech-Army:main Sep 28, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
development — a16f6389 Deployed Sep 28, 2026 by davecraig via lint #1559
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant