fix(geocode): prefer the settlement when a POI also fits the region

When several candidates fit a "place, region" query, take a settlement or
administrative area over a POI of the same name, so a cafe called "Paris"
in Lyon cannot win "Paris, France" from the nearby pass.

Tests: region queries without a camera bias, whole-word and every-word
region matching, city and county regions, the nearby whole-name answer when
the unbiased request fails, and the settlement preference. The new tests sit
with the other Paris, Texas tests. The station fixture uses its real city.
CURRENT-STATE now describes the order the code applies.
This commit is contained in:
Said Turksever committed 2026-10-28 14:09:56 +00:00
1 parent 81680c5a15
commit 7788168d73
3 files changed
+218 -121

No files matched your search

+6 -5
View File
@@ -5268,11 +5268,12 @@ deadline, with Photon requests capped at six seconds each. Caller/application
cancellation stops retries and late cache writes. Replacing a location search
cancels the previous lookup; disposing its controls cancels the active lookup. Photon uses a soft proximity bias, up to five
candidates, and an unbiased retry for name mismatches. A "place, region" query
only accepts a candidate named exactly for the place whose city, county, state,
country or country code (or USA/UK) contains the region; nearby results that
fail that check are retried unbiased, and a nearby place whose whole name is the
query (one with a comma in it) is the last choice. Invalid or wrapped bounds
returned by providers
prefers a candidate named exactly for the place whose city, county, state,
country or country code (or USA/UK) contains every word of the region, and a
settlement or administrative area over a POI when both fit. Nearby results that
fail that check are retried unbiased. After the region checks of both passes, a
nearby place whose whole name is the query (one with a comma in it) comes next,
then the unbiased name match. Invalid or wrapped bounds returned by providers
are omitted rather than framing the wrong part of the globe.
A location search that finds nothing, or fails, leaves the field open with the