Files
planet/backend/app/core/earth_boundary_defaults.py
linkong 93eb41a9f7
Some checks failed
ci / backend (push) Has been cancelled
ci / frontend (push) Has been cancelled
ci / delivery (push) Has been cancelled
release / images (push) Has been cancelled
release: bump version to 0.58.0
Release 0.58.0 includes the Earth high-precision boundary PMTiles/MVT pipeline, standardized Earth boundary source collectors, China POV boundary configuration templates, and removal of the legacy low-precision GeoJSON fallback. It also adds Earth news target-location queueing/archive support, fixes datasource task status visibility, documents the Earth surface depth-spacing rules that prevent far-zoom z-fighting snow/black blocks, and updates bilingual operations/developer docs.
2026-05-15 17:40:07 +08:00

50 lines
1.7 KiB
Python

"""Default Earth boundary source configuration."""
from __future__ import annotations
from typing import Any
EARTH_BOUNDARY_SOURCE_MAPPING: dict[str, Any] = {
"source": {"items_path": "$.features[*]"},
"fields": {
"source_id": {"path": "$.properties.id", "type": "string"},
"name": {"path": "$.properties.name", "type": "string"},
"geometry": {"path": "$.geometry", "type": "object"},
"properties": {"path": "$.properties", "type": "object"},
},
}
EARTH_BOUNDARY_DEFAULT_SOURCES: dict[str, dict[str, Any]] = {
"earth_admin0_boundaries": {
"endpoint": "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_admin_0_countries.geojson",
"source_kind": "admin0-boundaries",
"license": "Natural Earth public domain",
},
"earth_coastline": {
"endpoint": "https://raw.githubusercontent.com/nvkelso/natural-earth-vector/master/geojson/ne_10m_coastline.geojson",
"source_kind": "coastline",
"license": "Natural Earth public domain",
},
"earth_claim_lines": {
"endpoint": "https://www.arcgis.com/sharing/rest/content/items/faaa1908c3ab43f0823c6fde9f18389c/data",
"source_kind": "claim-lines",
"license": "CC BY 4.0; source item owner mapmakersami",
},
}
def default_earth_boundary_config(name: str) -> dict[str, Any]:
source = EARTH_BOUNDARY_DEFAULT_SOURCES.get(name)
if not source:
return {}
return {
"method": "GET",
"timeout": 120,
"retry": 3,
"target_schema": "earth_boundary_source",
"license": source["license"],
"mapping_json": EARTH_BOUNDARY_SOURCE_MAPPING,
}