fix(osm): stop using public Overpass by default (#648) (#742)

Traffic roads come from OpenFreeMap vector tiles, or TomTom flow tiles with a
key (Hybrid by default). Military areas use OpenFreeMap polygons with a bundled
worldwide name index; wide views show named points. ALPR reads an hourly
OpenStreetMap extract. Cockpit place context and country, state and US county
outlines use bundled Natural Earth and US Census data. Overpass is used only
when an operator configures their own endpoint.

Also: camera arrivals no longer land below ground, keyless terrain retries on
429, bounded relation geometry for configured Overpass, one shared
OpenStreetMap credit, and separate tile and API transports for embedders.

Co-authored-by: theGaryLarson <[email protected]>
Co-authored-by: Milan Khanal <[email protected]>
This commit is contained in:
authored and GitHub committed 2026-09-28 19:07:57 -05:00
1 parent 81eb44340d
commit f4fcf267c6
200 files changed
+26665 -1977

No files matched your search

+31 -2
View File
@@ -1,4 +1,9 @@
import * as Cesium from 'cesium';
import { createTerrainRetryPolicy } from './terrainRetry.js';
/** Re:Earth / Mapterhorn ellipsoidal quantized mesh, CC BY 4.0. */
export const KEYLESS_TERRAIN_URL =
'https://terrain.reearth.land/cesium-mesh/ellipsoid';
/** These factories are lazy: a hidden globe must not trigger terrain loading. */
export async function createWorldTerrain(accessToken, { signal } = {}) {
@@ -17,12 +22,36 @@ export async function createWorldTerrain(accessToken, { signal } = {}) {
};
}
function logThrottle({ statusCode, delayMs, inWindow }) {
// One line per cooldown window, not per tile: a burst throttles dozens.
if (inWindow !== 1) return;
console.warn(
`[MapStack] Re:Earth terrain answered ${statusCode}; retrying throttled tiles after ${Math.round(delayMs)} ms`,
);
}
/**
* The Re:Earth resource with the tile retry policy attached. Cesium copies
* `retryCallback`/`retryAttempts` onto every derived resource, so layer.json
* and each `{z}/{x}/{y}.terrain` fetch inherit it (see `terrainRetry.js`).
* @param {ReturnType<typeof createTerrainRetryPolicy>} [policy]
* @returns {Cesium.Resource}
*/
export function createKeylessTerrainResource(
policy = createTerrainRetryPolicy({ onThrottle: logThrottle }),
) {
return new Cesium.Resource({
url: KEYLESS_TERRAIN_URL,
retryCallback: policy.retryCallback,
retryAttempts: policy.retryAttempts,
});
}
export async function createKeylessTerrain() {
try {
// Re:Earth / Mapterhorn ellipsoidal quantized mesh, CC BY 4.0.
return {
provider: await Cesium.CesiumTerrainProvider.fromUrl(
'https://terrain.reearth.land/cesium-mesh/ellipsoid',
createKeylessTerrainResource(),
),
};
} catch (error) {