Search for places by type as well as by name - #1118
Merged
Merged
Conversation
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
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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