mosstool.map.osm._overpass

HTTP client for public Overpass API instances.

Apache on overpass-api.de often returns 406 Not Acceptable unless the client looks like a normal browser/OSM toolchain: descriptive User-Agent, Referer, and broad Accept — not the default python-requests/... UA nor Accept: application/json alone. See: https://community.openstreetmap.org/t/overpass-api-error-406/

Module Contents

Functions

fetch_overpass

POST query to a public interpreter and return JSON (decoded dict).

Data

API

mosstool.map.osm._overpass.INTERPRETER_ENDPOINTS

(‘https://overpass-api.de/api/interpreter’, ‘https://lz4.overpass-api.de/api/interpreter’)

mosstool.map.osm._overpass._HEADERS

None

mosstool.map.osm._overpass.fetch_overpass(query: str, proxies: Optional[dict[str, str]] = None, timeout: float = 300) dict[str, Any]

POST query to a public interpreter and return JSON (decoded dict).

Tries HTTPS mirrors in order; raises RuntimeError only if every attempt fails.