mirror of
https://github.com/zvx-echo6/recon.git
synced 2026-05-20 06:34:40 +02:00
Add place detail proxy with Nominatim-first routing and Overpass fallback
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>
This commit is contained in:
parent
64605b38bb
commit
2121ee4936
5 changed files with 574 additions and 2 deletions
|
|
@ -25,6 +25,7 @@ from werkzeug.utils import secure_filename
|
|||
from .utils import get_config, content_hash, clean_filename_to_title, derive_source_and_category, generate_download_url, setup_logging
|
||||
from .status import StatusDB
|
||||
from .deployment_config import get_deployment_config
|
||||
from .place_detail import get_place_detail
|
||||
|
||||
logger = setup_logging('recon.api')
|
||||
|
||||
|
|
@ -1186,6 +1187,13 @@ def api_traffic_flow(z, x, y):
|
|||
return 'Upstream timeout', 504
|
||||
|
||||
|
||||
@app.route('/api/place/<osm_type>/<int:osm_id>')
|
||||
def api_place_detail(osm_type, osm_id):
|
||||
"""Proxy place details from local Nominatim or Overpass API."""
|
||||
result, status = get_place_detail(osm_type, osm_id)
|
||||
return jsonify(result), status
|
||||
|
||||
|
||||
@app.route('/api/config')
|
||||
def api_config():
|
||||
"""Return deployment profile config for frontend consumption."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue