mirror of
https://github.com/zvx-echo6/recon.git
synced 2026-05-20 06:34:40 +02:00
feat: Add wikidata lookup endpoint for place enrichment
- 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>
This commit is contained in:
parent
07e6d0460b
commit
e9c9cee4f3
2 changed files with 136 additions and 1 deletions
|
|
@ -25,7 +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
|
||||
from .place_detail import get_place_detail, get_place_by_wikidata
|
||||
from .landclass import lookup_landclass, format_summary
|
||||
|
||||
logger = setup_logging('recon.api')
|
||||
|
|
@ -1235,6 +1235,13 @@ def api_place_detail(osm_type, osm_id):
|
|||
return jsonify(result), status
|
||||
|
||||
|
||||
@app.route("/api/place/wikidata/<wikidata_id>")
|
||||
def api_place_wikidata(wikidata_id):
|
||||
"""Fetch place details from Wikidata entity."""
|
||||
result, status = get_place_by_wikidata(wikidata_id)
|
||||
return jsonify(result), status
|
||||
|
||||
|
||||
|
||||
@app.route('/api/landclass')
|
||||
def api_landclass():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue