settlements: drop costly relation tier from place query (timed whole cells out), 3 mirror rounds with jitter, per-cell progress log; verified live: 1747 places -> 3855 lights

This commit is contained in:
Richard Zink committed 2026-10-10 13:37:35 +02:00
1 parent aebe311e32
commit 73d5c3f6a7
1 file changed
+11 -7
+11 -7
View File
@@ -1905,12 +1905,12 @@ function opQuery(q, startIdx, attempt) {
} }
// full retry ladder over all mirrors, 2.5 s pause between failed attempts // full retry ladder over all mirrors, 2.5 s pause between failed attempts
function opTry(q, startIdx) { function opTry(q, startIdx) {
var MAX = CAR_ENDPOINTS.length * 2; var MAX = CAR_ENDPOINTS.length * 3; // three full mirror rounds
function go(a) { function go(a) {
if (a >= MAX) return Promise.resolve(null); if (a >= MAX) return Promise.resolve(null);
return opQuery(q, startIdx, a).then(function (txt) { return opQuery(q, startIdx, a).then(function (txt) {
if (txt) return txt; if (txt) return txt;
return new Promise(function (r) { setTimeout(r, 2500); }) return new Promise(function (r) { setTimeout(r, 2500 + Math.random() * 2000); })
.then(function () { return go(a + 1); }); .then(function () { return go(a + 1); });
}); });
} }
@@ -2154,11 +2154,11 @@ function fetchSettlements() {
cells.push({ cells.push({
id: 'geo/place_' + la.toFixed(2) + '_' + lo.toFixed(2), id: 'geo/place_' + la.toFixed(2) + '_' + lo.toFixed(2),
start: ci % CAR_ENDPOINTS.length, // spread mirror load start: ci % CAR_ENDPOINTS.length, // spread mirror load
// all three geometry types: many places (esp. German city // node + way: way carries districts mapped as areas; the
// districts) exist only as way/relation, not as a node // relation tier costs the server ~3x the time for <1% extra
q: '[out:json][timeout:40];(node' + rx + '(' + bb + ');' + // places and regularly timed whole cells out
'way' + rx + '(' + bb + ');' + q: '[out:json][timeout:35];(node' + rx + '(' + bb + ');' +
'relation' + rx + '(' + bb + '););out center tags;' 'way' + rx + '(' + bb + '););out center tags;'
}); });
ci++; ci++;
} }
@@ -2221,7 +2221,11 @@ function fetchSettlements() {
}); });
}).then(function (txt) { }).then(function (txt) {
if (txt) { if (txt) {
var before = list.length;
parse(txt); parse(txt);
if (list.length > before)
console.log('[clouds3d] place cell ' + entry.id + ': +' +
(list.length - before) + ' places (total ' + list.length + ')');
if (!entry._cached) fresh++; if (!entry._cached) fresh++;
if (!entry._cached || !cityGeo) scheduleRebuild(); if (!entry._cached || !cityGeo) scheduleRebuild();
} }