mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 10:53:59 +00:00
docs(street-level): shorten docs and comments before merge
Trim the doc text this PR adds (README, CHANGELOG, CURRENT-STATE, KNOWN-ISSUES, SECURITY, DATA_SOURCES, .env.example, the CI job comment), drop code comments that restate the code, cut design-note JSDoc to a line or two, and drop review tags from test names. Comments only; no code changes. Also: README key count (seven keys, two metered), CURRENT-STATE's gate paragraph (CI runs a production build with a dummy token), the stacked doc above meshBoxInRange and the orphaned inMeshRange line in coverage.js, and a duplicate ALPR row in DATA_SOURCES that a merge had brought back. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
c65feda4b1
commit
4ea6631425
85 files changed
+701
-1520
No files matched your search
@@ -5,11 +5,9 @@ export const MAPILLARY_TILE_HOST = 'https://tiles.mapillary.com/maps/vtp';
|
||||
|
||||
/** Public tile layer names this proxy exposes, mapped to Mapillary's ids. */
|
||||
export const TILE_LAYERS = Object.freeze({
|
||||
// Overview points (z0–5), sequences (z6–14) and image points (z14 only).
|
||||
// The app asks for overview z0–5 and sequences z11–14 only (see
|
||||
// src/layers/streetLevel/tileMath.js); region-sized z6–10 tiles are refused.
|
||||
// The z14 `image` point layer is ~98% of a 10 MB tile and unused here:
|
||||
// image positions come from the graph API per sequence. Dropped in transit.
|
||||
// Region-sized z6–10 tiles are refused; the app never asks for them. The
|
||||
// z14 `image` layer is ~98% of a tile and unused (positions come from the
|
||||
// graph API), so it is dropped in transit.
|
||||
coverage: Object.freeze({
|
||||
upstream: 'mly1_public',
|
||||
zoomRanges: Object.freeze([Object.freeze([0, 5]), Object.freeze([11, 14])]),
|
||||
@@ -26,57 +24,41 @@ export const MAPILLARY_CACHE_DIR = path.join(
|
||||
export const TILE_DISK_DIR = path.join(MAPILLARY_CACHE_DIR, 'tiles');
|
||||
|
||||
/**
|
||||
* Tiles change when new imagery is processed, which is far slower than the
|
||||
* 15-minute upstream Cache-Control. A day keeps a session over one city from
|
||||
* re-downloading its tiles on every camera move.
|
||||
* Longer than the 15-minute upstream Cache-Control: tiles change only when new
|
||||
* imagery is processed, and a day avoids re-downloading a city per camera move.
|
||||
*/
|
||||
export const TILE_DISK_TTL_MS = 24 * 60 * 60 * 1000;
|
||||
|
||||
/**
|
||||
* Disk cache bound. A tile write starts a background sweep at most this often:
|
||||
* it deletes files past TILE_DISK_TTL_MS, then the oldest files until the
|
||||
* cache fits in TILE_DISK_MAX_BYTES (thousands of trimmed street-level tiles).
|
||||
* A tile write starts a background sweep at most this often: expired files go
|
||||
* first, then the oldest until the cache fits in TILE_DISK_MAX_BYTES.
|
||||
*/
|
||||
export const TILE_DISK_SWEEP_INTERVAL_MS = 15 * 60 * 1000;
|
||||
export const TILE_DISK_MAX_BYTES = 1024 * 1024 * 1024;
|
||||
/**
|
||||
* What each cached file costs against TILE_DISK_MAX_BYTES on top of its size:
|
||||
* one filesystem block and its directory entry. An empty (no coverage) tile is
|
||||
* 0 bytes but still a file, so without this ocean tiles would never count.
|
||||
*/
|
||||
/** Per-file cost on top of its size, so empty tiles still count. */
|
||||
export const TILE_DISK_FILE_OVERHEAD_BYTES = 4096;
|
||||
|
||||
/** A z14 image tile over a dense city is ~11 MB; anything past this is wrong. */
|
||||
export const TILE_MAX_BYTES = 48 * 1024 * 1024;
|
||||
|
||||
/** In-memory tile cache budget (bytes) and upstream fetch timeout. */
|
||||
export const TILE_MEMORY_BUDGET_BYTES = 96 * 1024 * 1024;
|
||||
/**
|
||||
* What each in-memory entry costs against the budget on top of its bytes (the
|
||||
* key, the map entry and the Buffer object), so empty tiles count too.
|
||||
*/
|
||||
/** Per-entry cost on top of its bytes, so empty tiles still count. */
|
||||
export const TILE_MEMORY_ENTRY_OVERHEAD_BYTES = 1024;
|
||||
export const TILE_FETCH_TIMEOUT_MS = 60_000;
|
||||
/**
|
||||
* Upstream tile fetches running at once; further misses queue for a slot. A
|
||||
* view asks for at most 25 tiles, so a few slots keep it quick while a burst
|
||||
* of distinct misses cannot open thousands of buffered requests at once.
|
||||
* Upstream fetches at once; further misses queue. A view needs at most 25
|
||||
* tiles, and the cap stops a burst of misses opening thousands of requests.
|
||||
*/
|
||||
export const TILE_UPSTREAM_CONCURRENCY = 6;
|
||||
/**
|
||||
* Tile requests per client IP per minute (cache hits included). The app asks
|
||||
* only for tiles it has not loaded yet, at most 9 street + 16 overview tiles
|
||||
* per view after a 320 ms camera debounce (src/layers/streetLevel/providers/
|
||||
* mapillary/policy.js), and the browser keeps each answer for an hour. 600 is
|
||||
* 24 entirely new views a minute, one every 2.5 s, which a person flying the
|
||||
* camera does not reach; it still stops one page from draining the shared
|
||||
* token into Mapillary rate limits that would hold every miss for everyone.
|
||||
* Tile requests per client IP per minute, cache hits included. 600 is 24 new
|
||||
* 25-tile views a minute, more than a person flying the camera reaches, but it
|
||||
* stops one page draining the shared token into a Mapillary rate limit.
|
||||
*/
|
||||
export const TILE_ROUTE_MAX_PER_MIN = 600;
|
||||
/**
|
||||
* After Mapillary rejects the token (401/403), tile misses are answered from
|
||||
* that verdict for this long instead of asking again on every camera move.
|
||||
* A changed token is asked at once.
|
||||
* How long a 401/403 answers tile misses before asking Mapillary again. A
|
||||
* changed token is tried at once.
|
||||
*/
|
||||
export const TILE_KEY_REJECTED_HOLD_MS = 5 * 60 * 1000;
|
||||
/** After a 429 without a usable Retry-After, hold tile misses this long. */
|
||||
|
||||
Reference in new issue
Block a user