address review findings on voice outlines

- remove the unused Nominatim reserve(); spacing tests now measure the
  actual transport start across processes
- start each queued building's 2 s ground-sampling budget when it
  reaches the head of the queue, and request a frame on promotion
- accept Nominatim and grounds outlines that cross the antimeridian
- let an unnamed school, university, hospital, cemetery, stadium or zoo
  area answer a grounds ask whose head noun names that kind, using only
  the part that holds the point; compare grounds names symmetrically
- charge shared OpenFreeMap consumers their own slice and keep the
  charged budget at the previous 64 MiB
- share one place-name fold, point-in-polygon, line stitching and
  nextTask helper instead of duplicates
- exclude Who's On First sources licensed only as "CC BY (equivalent)"
  or "CC0 (equivalent)"; rebuild the pack from the pinned archives
- whole-word neighbourhood alias guard; correct the outline size-limit
  comment
- restore DATA_SOURCES.md table formatting, keeping only real edits
- test behaviour instead of private engine fields
This commit is contained in:
manjunath committed 2026-10-30 20:47:20 +05:30
1 parent 5a1cfa6800
commit 2e82425d62
37 files changed
+921 -481

No files matched your search

+34 -1
View File
@@ -9,7 +9,10 @@ import {
createOpenFreeMapSource,
estimateOpenFreeMapProjectionBytes,
} from './openFreeMap.js';
import { createVectorTileSource } from './vectorTiles.js';
import {
createSharedDecodedTileCache,
createVectorTileSource,
} from './vectorTiles.js';
const fixture = (name) =>
readFileSync(new URL(`../data/fixtures/${name}`, import.meta.url));
@@ -145,6 +148,36 @@ test('Camp Mabry tile emits an unnamed polygon and its centroid marker', () => {
);
});
test('a shared consumer is charged only its own slice of each tile', async () => {
const bytes = fixture('ofm-austin-14-3743-6745.pbf');
const sharedDecodedCache = createSharedDecodedTileCache({
maxEntries: 4,
maxCacheBytes: 64 * 1024 * 1024,
});
const source = createOpenFreeMapSource({
template: 'https://tiles.openfreemap.org/planet/v/test/{z}/{x}/{y}.pbf',
sharedDecodedCache,
selectDecoded: ({ military }) => ({ military }),
fetchImpl: async () => new Response(bytes),
});
try {
const box = { south: 30.267, north: 30.268, west: -97.744, east: -97.743 };
const { tiles } = await source.fetchBounds(box, { zoom: 14 });
const stats = source.getStats();
assert.equal(stats.cacheEntries, 1);
assert.equal(
stats.cacheBytes,
estimateOpenFreeMapProjectionBytes(tiles[0]),
'the slice estimate, not the whole decoded tile',
);
assert.ok(stats.cacheBytes < bytes.byteLength * 4);
assert.ok(sharedDecodedCache.stats().bytes >= bytes.byteLength * 4);
} finally {
source.clear();
sharedDecodedCache.clear();
}
});
test('TileJSON is resolved once and decoded tile LRU prevents per-pan refetch', async () => {
const calls = [];
const source = createOpenFreeMapSource({