fix(places): a small place in view comes before a far bigger namesake

findPlace looked at the detail tiles only when no city had the typed name,
so a village called Paris in view lost to Paris, France. With
includeSmallPlaces it now reads the places near the view as well and takes
the nearest place of the name there, city or not. With none near, the
largest city of the name still wins.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-18 22:34:59 -08:00
1 parent ec1fc6bc09
commit f414df97eb
5 files changed
+89 -24

No files matched your search

@@ -40,3 +40,8 @@ well-known cities is missing from the result, or a known grouping gets in.
**Limits:** populations are whatever Wikidata states and differ in date and
definition between places (city proper, municipality, urban district). Some
districts and suburbs appear as their own rows.
**Finding a place by name:** `findPlace` takes the nearest place of the name
within 150 km of the view, else the largest city of the name. When asked,
the smaller places of `../wikidata_places` near the view count too, so a
village in view comes before a bigger namesake far away.
@@ -1,8 +1,11 @@
# Wikidata places detail tiles
Smaller towns and villages, below the cut-off of the cities pack
(`../wikidata_cities`), for "places nearby" around one picked or named spot. Read by `placesNear` in `src/data/wikidataCities.js`. The app reads
these files; it does not call Wikidata or any place service for them.
(`../wikidata_cities`), for "places nearby" around one picked or named spot. Read by `placesNear` in `src/data/wikidataCities.js`, and by `findPlace`
when asked to look for a small place by name near the view: a place of that
name in view, or close to it, comes before a bigger city of the name far
away. The app reads these files; it does not call Wikidata or any place
service for them.
| File | Contents |
|------|----------|