When has_kiwix_wiki is enabled, skip rewriting extratags.wikipedia to
a Kiwix content URL. The wiki_url field already provides the correct
local Kiwix viewer link for the WikiSummarySection.
This preserves the original OSM format (e.g. "en:Title") in
extratags.wikipedia so the frontend LINKS section can properly build
wikipedia.org URLs.
Co-Authored-By: Claude <noreply@anthropic.com>
Add place/linked_place to extratags so wiki enrichment can detect
actual place type (e.g. boundary:administrative with place=city
should match wiki_places osm_key=place, osm_value=city).
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add wiki summary, URLs, and population data from wiki_index.db to
place detail and reverse geocode responses.
- Add lib/wiki_index.py: SQLite read-only lookup module
- Enrich /api/place responses via _enrich_with_wiki_index()
- Enrich /api/reverse responses via _enrich_reverse_result_with_wiki()
- Gate on has_kiwix_wiki feature flag (default false in home.yaml)
- Direct match only on place_name + osm_key + osm_value + state + country_code
- Additive fields: wiki_summary, wiki_url, wikivoyage_url, wiki_population
DB path: /opt/recon/data/wiki_index.db
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Request polygon_geojson=1 from Nominatim to include admin boundary
polygons in place detail responses. Also fetch boundary via OSM
relation ID for wikidata lookups.
- Add get_place_by_wikidata() to place_detail.py
- Queries Wikidata API for entity details (name, description, coords)
- Extracts population, instance_of, OSM relation ID, Wikipedia link
- Add /api/place/wikidata/<id> route to api.py
Supports Navi basemap label enrichment when OSM details unavailable.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Guest users receive local and cached data only. New Google Places API
calls are only triggered for authenticated users, protecting against
cost exploitation on the public navi.echo6.co frontend.
The pattern: cached Google data flows freely (already paid for by an
authed lookup). New API calls require X-Authentik-Username via
get_user_id() check.
Rewrites OSM wikipedia/wikidata/wikivoyage/appropedia extratag values
to local Kiwix URLs (wiki.echo6.co) when the article exists in a loaded
ZIM, falling back silently to public URLs otherwise.
- New lib/wiki_rewrite.py: URL classification, Kiwix OPDS catalog
discovery (xml.etree.ElementTree), HEAD-based availability check,
positive-only SQLite cache, disabled discovery stubs
- place_detail.py: _enrich_wiki_links() at both Nominatim and Overpass
enrichment sites, before cache_put
- Profile flags: has_wiki_rewriting (home/regional: true, minimal: false),
has_wiki_discovery (all: false, stubs for future activation)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fills opening_hours, phone, and website gaps when OSM + Overture data
is incomplete. Only fires for business-class POIs (amenity, shop, tourism,
leisure, office, craft). Daily API call cap with SQLite tracking.
cache_put now preserves google columns across cache refreshes.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ingests 20.9M North America places from Overture Maps Foundation
(release 2026-04-15.0) into PostgreSQL. Enriches /api/place responses
with phone, website, and brand data via spatial + fuzzy name matching
when OSM extratags are sparse.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New /api/place/<osm_type>/<osm_id> endpoint returns cleaned OSM tag data
for PlaceDetail panel enrichment. Routes to local Nominatim (Idaho coverage)
first, falls back to Overpass public API for out-of-region queries. Responses
cached in SQLite (data/place_cache.db) with no expiry.
New modules: lib/place_detail.py (proxy + cache), lib/osm_categories.py
(~50 category humanization mappings). Profile YAMLs updated with
place_details config block and has_nominatim_details flag.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>