No files matched your search
@@ -223,19 +223,23 @@ The optional Local ADS-B layer and the broadcast-FM receiver use radio you recei
|
||||
The numerical minima come from US 14 CFR 91.227(c), not a published jamming
|
||||
classifier. Readsb's [JSON contract](https://github.com/wiedehopf/readsb/blob/dev/README-json.md)
|
||||
describes the quality field origins and GPS-loss flag.
|
||||
2. **GPSJAM aggregation:** score = `100 × max(0, bad − 1) / total`, with percent
|
||||
bands < 2, 2–10, > 10. One bad aircraft is discounted. This is not the raw
|
||||
share of bad aircraft. See the [GPSJAM FAQ](https://gpsjam.org/faq).
|
||||
3. **GEV window:** 30 minutes over visited views, at least three aircraft per
|
||||
0.5° cell. These bands were developed for daily totals; with fewer than ten
|
||||
observations a cell can skip the middle band. Source timestamps date evidence
|
||||
even through cache replays, and degraded evidence expires independently.
|
||||
2. **GPSJAM aggregation:** aircraft are binned into H3 resolution-4 hexagons
|
||||
(about 1,770 km² each), and score = `100 × max(0, bad − 1) / total`, with
|
||||
percent bands < 2, 2–10, > 10. One bad aircraft is discounted. This is not
|
||||
the raw share of bad aircraft. As on GPSJAM there is no minimum aircraft
|
||||
count: every hexagon with an aircraft is shown, and the discount is the only
|
||||
small-sample guard. See the [GPSJAM FAQ](https://gpsjam.org/faq).
|
||||
3. **GEV window:** 30 minutes over visited views. These bands were developed
|
||||
for daily totals; with fewer than ten observations a cell can skip the
|
||||
middle band. Source timestamps date evidence even through cache replays,
|
||||
and degraded evidence expires independently.
|
||||
|
||||
Medium/high cells report navigation-integrity anomalies. Interference is one
|
||||
possible explanation, not a detected or located emitter. Avionics faults and
|
||||
manoeuvring military trainers can also lower reported accuracy. Blank areas
|
||||
can be outside coverage or lack enough observations. Attribution: adsb.lol
|
||||
contributors, ODbL 1.0; GPSJAM for aggregation only.
|
||||
are outside coverage or had no qualifying aircraft in the window.
|
||||
Attribution: adsb.lol contributors, ODbL 1.0; GPSJAM for the grid and
|
||||
aggregation only.
|
||||
|
||||
|
||||
- **adsbdb enrichment.** `/api/adsbdb` resolves an ICAO hex to aircraft type, model name and registration, and the tracked flight's callsign to an airline and an origin/destination pair. Fan-out is deliberately small because adsbdb is a free community API that publishes no quota: at most 4 requests in flight, dispatches dripped to roughly 5/s, and each key asked for at most once per session (for the flights layer's enrichment, a lookup that failed temporarily, such as an outage, a timeout, a rate limit or an authorization refusal that may clear, may be asked again after a 60-second cool-down; an answer, found or not, and a permanent refusal such as a 404 are final; Local ADS-B lookups are asked once), with route lookups reserved for the tracked aircraft. The dev-server proxy caches each key for 24 hours in `.gev-cache/adsbdb.json`, negative answers included, so fresh entries survive server restarts. That gitignored cache remains local to the deployment and is not bundled with this repo. adsbdb publishes no general service license; its README says the route data may not be copied, published, or incorporated into other databases without the explicit permission of David J Taylor, Edinburgh. Deployers are responsible for obtaining any permission their use requires. Enrichment is best-effort and fail-silent — a flight that gets no answer keeps what the flight feed already gave it.
|
||||
|
||||
@@ -2,29 +2,25 @@
|
||||
|
||||
# 🌐 God's Eye View
|
||||
|
||||
[](https://github.com/bilawalsidhu/gods-eye-view/actions/workflows/ci.yml) [](https://x.com/bilawalsidhu/status/2093798887815348521)
|
||||
**Official site: [godseyeview.ai](https://godseyeview.ai)** · [Download](https://godseyeview.ai/download/) · [Guide](https://godseyeview.ai/guide/) · [Releases](https://godseyeview.ai/releases/) · [Hosted version waitlist](https://godseyeview.ai/online/) · [Media](https://godseyeview.ai/press/)
|
||||
|
||||
### A spy-satellite simulator in your browser — then you realize the sources are public and the data is real.
|
||||
[](https://github.com/bilawalsidhu/gods-eye-view/actions/workflows/ci.yml) [](https://www.star-history.com/?type=date&repos=bilawalsidhu%2Fgods-eye-view) [](https://github.com/bilawalsidhu/gods-eye-view/stargazers) [](LICENSE)
|
||||
|
||||
Photorealistic 3D globe. Live aircraft, ships, satellites, earthquakes, traffic, and public cameras. Hands-free voice control powered by a realtime AI agent.
|
||||
### A spy-satellite simulator in your browser. Except the data is real.
|
||||
|
||||
_No place left behind._
|
||||
_The window through which we see our world._
|
||||
|
||||

|
||||
[](https://godseyeview.ai)
|
||||
|
||||
<a href="https://www.youtube.com/@bilawalsidhu">
|
||||
<img src="docs/media/youtube-popular-videos.png" alt="The God's Eye View video series on YouTube" width="100%">
|
||||
</a>
|
||||
Click any satellite, plane, ship or public camera and you can track it. Turn on FLIR mode and suddenly you're wondering, holy crap, is this real? And it's free, and open source.
|
||||
|
||||
▶️ **From the project behind the viral God's Eye View series** _(formerly WorldView)_ — [5M+ on YouTube](https://youtube.com/playlist?list=PL6qSg2I-7_koPbDnSMo0QeeHX_RknA2uv&si=nBGYMoHWQw41v93Q) · [25M+ across socials](https://www.google.com/search?q=god%27s+eye+view)
|
||||
**[One-click install with Pinokio](https://pinokio.co/apps/github-com-bilawalsidhu-gods-eye-view)** · **[Run it from the terminal](#-quick-start)** · **[Hosted version waitlist](https://godseyeview.ai/online/)**
|
||||
|
||||
🏆 **Reached #1 on GitHub Trending, daily and weekly · August 2026**
|
||||
🏆 **#1 on GitHub Trending**, daily and weekly · **[#8 Product of the Day](https://www.producthunt.com/products/god-s-eye-view?launch=god-s-eye-view)**, hunted by Chris Messina · _“pretty cool”_ — [Brendan Eich](https://x.com/BrendanEich/status/2094592096401490266), creator of JavaScript · Featured on **[Pinokio](https://pinokio.co/posts/01m1m4p9xxm3qw7dnnpj2wr93g)**
|
||||
|
||||
**[#8 Product of the Day](https://www.producthunt.com/products/god-s-eye-view?launch=god-s-eye-view)** · Hunted by Chris Messina, creator of the hashtag
|
||||
▶️ **From the project behind the God's Eye View series** _(formerly WorldView)_ — [25M+ views on YouTube](https://youtube.com/playlist?list=PL6qSg2I-7_koPbDnSMo0QeeHX_RknA2uv&si=nBGYMoHWQw41v93Q)
|
||||
|
||||
_“pretty cool”_ — [Brendan Eich](https://x.com/BrendanEich/status/2094592096401490266), creator of JavaScript and co-founder of Mozilla and Brave · Featured on **[Pinokio](https://pinokio.co/posts/01m1m4p9xxm3qw7dnnpj2wr93g)**
|
||||
|
||||
⚡ **Start without API keys.** Install with [Pinokio](https://pinokio.co/apps/github-com-bilawalsidhu-gods-eye-view) or run locally from the terminal. Add optional keys inside the app. **[→ Quick Start](#-quick-start)**
|
||||
**As seen on** [Matt Wolfe](https://www.youtube.com/watch?v=S2VJU5DQqlU) · [Riley Brown](https://www.youtube.com/watch?v=NR_GMq2lDCE) · [Digg](https://digg.com/tech/r7whv988) · [The Escapist](https://www.escapistmagazine.com/news-gods-eye-view-spy-satellite-simulator-setup-focus-keyphrase-gods-eye-view/) · [UNILAD Tech](https://www.uniladtech.com/social-media/youtube/viewers-concerned-youtubers-safety-built-gods-eye-monitor-889810-20260309) · [Al Jazeera](https://www.aljazeera.com/video/the-stream/2026/3/8/how-do-you-track-a-war-in-real-time) · [NDTV](https://www.ndtv.com/video/strait-of-hormuz-news-hormuz-stranglehold-no-end-in-sight-1080351) · [Mojo Story](https://www.youtube.com/watch?v=UXkJjyFfrwc) · [all media](https://godseyeview.ai/press/)
|
||||
|
||||
</div>
|
||||
|
||||
@@ -32,7 +28,7 @@ _“pretty cool”_ — [Brendan Eich](https://x.com/BrendanEich/status/20945920
|
||||
|
||||
<div align="center">
|
||||
|
||||
**[Quick Start](#-quick-start) · [First Five Minutes](#-the-first-five-minutes) · [Talk to It](#-talk-to-it) · [What's Live](#-whats-on-the-globe) · [Under the Hood](#-under-the-hood) · [Keys & Costs](#-api-keys) · [Contributing](CONTRIBUTING.md)**
|
||||
**[Quick Start](#-quick-start) · [What It Does](#️-what-this-thing-does) · [First Five Minutes](#-the-first-five-minutes) · [Talk to It](#️-talk-to-it) · [What's Live](#️-whats-on-the-globe) · [Keys & Costs](#-api-keys) · [Contributing](CONTRIBUTING.md)**
|
||||
|
||||
</div>
|
||||
|
||||
@@ -56,6 +52,36 @@ Start with the included data sources, then add your own. Each layer is a separat
|
||||
|
||||
## 🎛️ What This Thing Does
|
||||
|
||||
The world is already broadcasting. We fuse it together into a 3D globe for you and your agents.
|
||||
|
||||
We've got a plurality of sensor systems watching the planet right now. Satellite imagery, flights, ships, weather, public cameras. Each captures a sliver of what's happening. God's Eye View pulls that treasure trove of public data into a single picture.
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/voice.webp" alt="Ask the planet in God's Eye View" width="100%"><br><b>Ask the planet</b><br><sub>Use voice to ask the planet questions in natural language, and it annotates the 3D globe with the answer.</sub></td>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/flights.webp" alt="Flights and vessels in God's Eye View" width="100%"><br><b>Flights and vessels</b><br><sub>Click on a satellite, plane, ship or public camera and you can track it.</sub></td>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/satellites.webp" alt="Satellites in God's Eye View" width="100%"><br><b>Satellites</b><br><sub>Toggle on different kinds of satellites, everything from GPS to Starlink.</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/cameras.webp" alt="Public cameras in God's Eye View" width="100%"><br><b>Public cameras</b><br><sub>Some layers, like traffic and camera poses, are estimates, and the app says so.</sub></td>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/cockpit.webp" alt="Cockpit in God's Eye View" width="100%"><br><b>Cockpit</b><br><sub>Visualize a flight from the third-person perspective and jump into a rendered cockpit view.</sub></td>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/weather.webp" alt="World class weather in God's Eye View" width="100%"><br><b>World class weather</b><br><sub>Clouds, rain radar, lightning density and cyclone tracks with forecast cones. And since we say 4D, you can scrub the cloud imagery backwards in time.</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/imagery.webp" alt="Recent imagery in God's Eye View" width="100%"><br><b>Recent imagery</b><br><sub>Draw a bounding box around a fire and it'll retrieve the Sentinel-2 images, draped on the 3D terrain. All keyless, ladies and gentlemen.</sub></td>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/transit.webp" alt="Transit in God's Eye View" width="100%"><br><b>Transit</b><br><sub>Click a bus in Boston and it starts leaving a trail. This might be the most overkill way to track your bus.</sub></td>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/sdr.webp" alt="RF and SDR support in God's Eye View" width="100%"><br><b>RF and SDR support</b><br><sub>Now you can connect your own SDR and visualize everything you're detecting. The SDR nerds know all the other possibilities.</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/radio.webp" alt="World radio in God's Eye View" width="100%"><br><b>World radio</b><br><sub>Ask for radio near anywhere and the globe starts broadcasting. Drag the tuner across up to 750 stations.</sub></td>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/mcp.webp" alt="MCP server in God's Eye View" width="100%"><br><b>MCP server</b><br><sub>We've built MCP access so your agents can query the same picture and add their findings to a shared canvas.</sub></td>
|
||||
<td width="33%" valign="top"><img src="docs/media/site/director.webp" alt="Director Mode in God's Eye View" width="100%"><br><b>Director Mode</b><br><sub>Draw outlines, sketch paths, drop your annotations on the map.</sub></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<details>
|
||||
<summary><b>Everything else it does</b></summary>
|
||||
|
||||
- **🛩️ Cockpit view:** Ride inside a tracked flight — the camera holds the terrain under you all the way down.
|
||||
- **📡 Contacts:** A 250 km roster of everything near your target — step through live aircraft and drop into any cockpit.
|
||||
- **🎯 Click-to-track anything:** Camera locks on, draws a fading trail, surfaces full metadata — and a tracked fire or vessel hands you off to the nearest live camera in one click.
|
||||
@@ -77,6 +103,8 @@ Start with the included data sources, then add your own. Each layer is a separat
|
||||
- **📦 Shareable scenes:** Import, preview and share Director scenes as files or bundles, with camera anchors, authored moves and data packs.
|
||||
- **🌊 Nepal flood scene:** Replay the Bhote Koshi flood: flood path, witness sources and before-and-after imagery (bundled data is non-commercial; see [DATA_SOURCES.md](DATA_SOURCES.md)).
|
||||
|
||||
</details>
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
@@ -156,7 +184,8 @@ See [docs/PERFORMANCE.md](docs/PERFORMANCE.md).
|
||||
**macOS shortcut:** `./scripts/dev-fresh.sh` clears the Vite cache and pulls any
|
||||
configured keys straight from the Keychain. It starts keyless too.
|
||||
|
||||
### Path 3 — Docker
|
||||
<details>
|
||||
<summary><b>Path 3 — Docker</b></summary>
|
||||
|
||||
No Node install needed; the container publishes the same dev server.
|
||||
|
||||
@@ -234,7 +263,10 @@ the container.
|
||||
|
||||
</details>
|
||||
|
||||
### Path 4 — GitHub Codespaces (cloud, no local install)
|
||||
</details>
|
||||
|
||||
<details>
|
||||
<summary><b>Path 4 — GitHub Codespaces (cloud, no local install)</b></summary>
|
||||
|
||||
Codespaces requires a GitHub account. Overpass queries, the News layer and OpenAI
|
||||
voice token requests return HTTP 403 through its forwarded HTTPS URL, even with API keys
|
||||
@@ -272,6 +304,8 @@ wider-publish case in [Sharing an instance](#-sharing-an-instance). Provider
|
||||
Settings is unavailable on the forwarded URL. Never commit your workspace
|
||||
`.env`. [SECURITY.md](SECURITY.md) has the threat model.
|
||||
|
||||
</details>
|
||||
|
||||
### Then power it up — in the app, not in a file
|
||||
|
||||
For a local setup, keys are upgrades, not prerequisites. When you want one,
|
||||
@@ -314,54 +348,30 @@ and it carries the LAN-sharing rules alongside [Keys & Costs](#-api-keys).
|
||||
|
||||
## 🕐 The First Five Minutes
|
||||
|
||||
Choose a first-run mission, or try these in order. The GIFs show Google Photorealistic 3D; your starting basemap depends on the keys you've added.
|
||||
Choose a first-run mission, or try these in order. Your starting basemap depends on the keys you've added.
|
||||
|
||||
1. **Light up the sky.** Take the **Live Contacts** mission (or turn on **Flights** yourself) — thousands of live aircraft, gliding on real telemetry, detection mesh already reading the scene. Click one: the camera locks on, a trail draws behind it, and its live telemetry card comes up.
|
||||
2. **Take the controls.** Hit **COCKPIT** on your tracked plane and ride it down, switching sensors mid-flight: NVG into Ironbow FLIR.
|
||||
|
||||

|
||||
|
||||
3. **Drop into a busy airport.** Search one and descend to the taxiways with **3D** aircraft on — grounded contacts, taxi trails, the whole apron working in real time.
|
||||
|
||||

|
||||
|
||||
4. **Look through a public camera.** Turn on **Cameras** over Austin, London, California, Finland, or Delaware (live video). The feeds aren't webcam embeds — they project _into_ the 3D city. Cycle coverage to **VIEWSHED** and every camera draws its estimated coverage volume — where it reaches, and where it goes blind.
|
||||
|
||||

|
||||
|
||||
5. **Track something in orbit.** Turn on **Satellites** and click the ISS — you ride along at orbital distance, orbit ring and all.
|
||||
|
||||

|
||||
|
||||
6. **Switch the optics.** Tap `1`–`6` — CRT, NVG, FLIR — and the whole live planet re-renders through a different sensor.
|
||||
|
||||

|
||||
|
||||
7. **Talk to it** _(needs an OpenAI key)_: _"Take me to LAX and select the nearest airborne aircraft."_
|
||||
8. **Come home.** Hit **Reset Globe** — or just say _"zoom out to a globe view."_
|
||||
|
||||
**Keyboard:** `1`–`6` visual styles · `H` HUD · `D` detection · `C` CCTV · `` ` `` frame rate · `Esc` out. Trackpad pinch zooms the globe.
|
||||
|
||||
---
|
||||
|
||||
## 🛩️ The Cockpit
|
||||
|
||||
> Every plane should let you do this.
|
||||
|
||||
Real-time cockpit mode, built from live flight data: the camera rides your contact with real terrain holding underneath, all the way down — sensor styles come along for the ride, and **Contacts** keeps the 250 km roster one click away: jump plane to plane and fall straight into the next cockpit.
|
||||
|
||||

|
||||
|
||||
The cockpit even carries its own briefing strip: nearby live signals, regional headlines, and real local weather — with an opt-in **WX** mode that renders volumetric clouds from actual observations around your aircraft.
|
||||
|
||||

|
||||
|
||||
_Why cockpit mode exists: you're riding a real aircraft over real terrain — and you get to pick which sensor you see the world through._
|
||||
|
||||
---
|
||||
|
||||
## 🎙️ Talk to It
|
||||
|
||||
<details>
|
||||
<summary><b>Providers, chat, ChatGPT OAuth and the voice check</b></summary>
|
||||
|
||||
The standalone app offers **OpenAI** and **Gemini** under **AI Provider** in Settings, one choice shared by voice and chat. OpenAI is the initial default; your choice is saved in this browser. To use Gemini, add `GEMINI_API_KEY` in Provider Settings or your local `.env` file, then select Gemini. `GEMINI_LIVE_MODEL` defaults to `gemini-3.8-live`. The permanent key stays on the local server, which issues a constrained, single-use session credential.
|
||||
|
||||
Changing provider ends the current conversation. If voice is on, the new provider starts with the same open-mic or push-to-talk mode; a held Space key is not carried over. Gemini uses the same map actions and captions, but has no OpenAI cost meter or MINI tier. When Gemini reports that its session has expired, start voice again for a new conversation. The AI Provider setting does not change the OpenAI-backed AI HUD summary.
|
||||
@@ -376,6 +386,8 @@ GEV reads Codex's file credentials but does not write or refresh them. It checks
|
||||
|
||||
For a live voice check, run `node scripts/qa-voice-auth.mjs http://127.0.0.1:4189 oauth microphone.wav` against your local dev server. Use a WAV with three seconds of leading silence followed by a short spoken reply request. Replace `oauth` with `api-key` to check the API-key path. The check verifies audio input, a completed spoken reply, usage, resource cleanup, and reconnect. It saves screenshots and credential-free results under `.gev-logs/voice-auth/`.
|
||||
|
||||
</details>
|
||||
|
||||
Click **GEV MIC**, grant the microphone, and just talk. This is more than a voice-controlled remote:
|
||||
|
||||
- **🧠 It knows what it's looking at.** The agent pulls live scene context before answering — including coordinates, street names, active layers, and view scale. Ask _"what city is this?"_ mid-flight and it knows.
|
||||
@@ -400,10 +412,6 @@ camera input stops rotation.
|
||||
|
||||
**✍️ Or draw it yourself** — UTILITIES ▸ **Draw**: pick Area, Line or Pin and a colour, click the vertices on the real world, double-click to finish, then name, recolour, hide or fly to each shape from its row. Same whiteboard, same persistence, no microphone needed.
|
||||
|
||||

|
||||
|
||||

|
||||
|
||||
**🔎 Interrogate it** — analyst queries against the live layers:
|
||||
|
||||
> 🗣️ _"How many flights are over Texas right now?"_ · _"Which ships are headed to Oakland?"_ · _"What is the biggest fire near Los Angeles?"_ · _"Is anything flying above forty thousand feet?"_ · _"When does the ISS pass over next?"_ · _"How many datacenters are in view?"_
|
||||
@@ -416,10 +424,6 @@ camera input stops rotation.
|
||||
|
||||
> 🗣️ _"Show me global infrastructure."_ (stages the layers and pulls back to the globe) · _"Play Orbital Watch."_ (a full cinematic scene) · _"Set detection density to fifty percent."_ · _"Next contact — helicopters only."_ (mid-cockpit) · _"Show me space missions."_ · _"Switch to OSM."_ · _"Sharpen the image a touch."_ · _"Switch to the tactical layout."_ · _"What's turned on right now?"_
|
||||
|
||||

|
||||
|
||||
_Ask for radio near anywhere and the globe starts broadcasting — every station is a real place you can fly to._
|
||||
|
||||
---
|
||||
|
||||
**💬 Or ask from Claude and Codex.** God's Eye View is also an MCP server: ask Claude Desktop, Codex or ChatGPT desktop to show a place, and the live globe opens right in the conversation. Setup takes a minute — see [docs/MCP_SETUP.md](docs/MCP_SETUP.md).
|
||||
@@ -428,6 +432,9 @@ _Ask for radio near anywhere and the globe starts broadcasting — every station
|
||||
|
||||
Twenty-three layers and map sources. **Twenty-one have a keyless path.** Some offer additional capabilities with a provider key. (🟢 no key · 🟡 free key · 🔴 metered.)
|
||||
|
||||
<details>
|
||||
<summary><b>All twenty-three layers and map sources, with sources and keys</b></summary>
|
||||
|
||||
| Layer | What you get | Source | Auth |
|
||||
| --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | --------------------------------------------------------------------------------------------------- |
|
||||
| 🗺️ **Map Stack** | Esri satellite imagery, Google Photorealistic 3D, OSM, plus additional ion-hosted stacks | Esri / Google / Ion / OSM | 🟢 Esri satellite + OSM · 🟡 ion-hosted Google 3D + world terrain · 🔴 direct Google + place search |
|
||||
@@ -459,6 +466,8 @@ Twenty-three layers and map sources. **Twenty-one have a keyless path.** Some of
|
||||
| 🌦️ **Observed Weather** | Rain radar (contiguous US), Satellite clouds (GOES regional or global infrared, Clouds only or Full image) and Lightning density (Americas and Pacific) on one history timeline | NOAA nowCOAST | 🟢 |
|
||||
| 🌀 **Cyclones** | Advisory positions, forecast tracks and uncertainty cones for the Atlantic and eastern/central North Pacific | NOAA NHC / CPHC | 🟢 |
|
||||
|
||||
</details>
|
||||
|
||||
**Weather, keyless.** **Wind** animates 10 m forecast flow from NOAA GFS or ECMWF IFS, with an optional color field and a reading at map center. **Rain radar**, **Satellite clouds** and **Lightning density** are observations on one history timeline in the **WEATHER** panel (step back, **Play**, **Latest**); **Cyclone advisories** draw NHC and CPHC positions, forecast tracks and cones. On Google 3D Tiles the observed layers float above the city as translucent shells, sharpened around your view.
|
||||
|
||||
In the app, **Data Layers** groups them as Movement, Cameras, Infrastructure, Events, Weather and Audio; Directions and OSM Places sit in the separate **Utilities** panel with Draw and Import.
|
||||
@@ -471,20 +480,17 @@ In the app, **Data Layers** groups them as Movement, Cameras, Infrastructure, Ev
|
||||
| 🟡 A free Cesium ion token | **Google Photorealistic 3D cities** and world terrain — eligible personal, non-commercial use; current ion terms and quotas apply |
|
||||
| 🔴 A Google Maps key | The same 3D direct from Google, plus Google place search — the billing-enabled, metered route |
|
||||
|
||||

|
||||
|
||||
_The Space Missions layer replaying a Falcon 9 ascent — labeled `RECONSTRUCTED ESTIMATE`, scrubbable 0.25×–4×._
|
||||
|
||||
**Also on the globe:** neighborhood overlays · an optional cockpit WX cloud effect. **Bundled static infrastructure:** Datacenters (4,352), Dams (704), and Submarine Cables (712).
|
||||
|
||||

|
||||
|
||||
**Missing a layer you want?** Open an issue — or add it and send the PR.
|
||||
|
||||
---
|
||||
|
||||
## 📷 Street Level
|
||||
|
||||
<details>
|
||||
<summary><b>Street Level setup and use</b></summary>
|
||||
|
||||
> Street-level photos from any provider in one panel. This build ships **Mapillary** (a free client token), **Google Street View** (your Google Maps key), **KartaView** and **Panoramax** (no key).
|
||||
|
||||
**Setup.** At [mapillary.com/dashboard/developers](https://www.mapillary.com/dashboard/developers), register an application with **Read** access and copy its **Client Token** (`MLY|…`). Paste it into **POWER UP → Mapillary**, or set `MAPILLARY_CLIENT_TOKEN` in `.env` and restart. Without it Street Level starts on **KartaView** instead, and the Mapillary chip says which key to add. **Google Street View** uses `GOOGLE_MAPS_API_KEY` with the **Maps JavaScript API** enabled for it in Google Cloud; its chip starts off, since every panorama is billed to the key. **KartaView** and **Panoramax** need nothing: their public APIs are keyless.
|
||||
@@ -493,37 +499,26 @@ _The Space Missions layer replaying a Falcon 9 ascent — labeled `RECONSTRUCTED
|
||||
|
||||
Share links carry the provider switches and filters (`0.m.0` Mapillary off, `0.m.0_0.r.google-1` Street View on, `0.m.0_0.r.google-0*kartaview-1*panoramax-0` KartaView on and `0.m.0_0.r.google-0*kartaview-0*panoramax-1` Panoramax on, as the app writes them (`0.m.0_0.r.kartaview-1` and `0.m.0_0.r.panoramax-1` work too; a link that leaves out `m` keeps Mapillary, the default, lit), `0.p.p` panoramas only, `0.s.365` the last year). To add a provider, implement the contract in `src/layers/streetLevel/registry.js` and register it in `src/app/layers/streetLevel.js`.
|
||||
|
||||
## 🎖️ Field Missions
|
||||
</details>
|
||||
|
||||
Once the basics click, run these:
|
||||
## 🎬 Reconstructions and the Series
|
||||
|
||||
| Mission | How |
|
||||
| ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
||||
| **🚁 Ask the planet** | _"Why are all these military helicopters flying in circles?"_ Select a military track — it silently backfills ~24 h of real trace history — and see what it's been doing, resolved as stacked 3D loops. |
|
||||
| **✈️ Final approach** | Click-track an airliner lining up for a runway, hop into the **cockpit**, and ride it down. |
|
||||
| **🌃 Night watch** | Fly to your own city, switch to **NVG**, and let the detection mesh and HUD read the scene. |
|
||||
| **🚢 Port call** | Vessels on over the Port of Long Beach. Click a tanker for its tactical card and wake trail — then hit **NEAREST** in the CCTV panel and look at the same water through a public camera. |
|
||||
| **📻 Tokyo FM** | Orbit Shibuya with the **Radio** layer on — then drag the analog tuner needle: every position snaps to a real station and the globe flies to whoever's broadcasting. |
|
||||
| **🔥 Fire line** | FIRMS over California. Click a detection — the camera dives to it — read the intensity, then hit **NEAREST** in the CCTV panel for a ground view. |
|
||||
| **🚶 Ask for a walking route** _🎙️_ | Tell the world where you want to go and watch a real street-following route trace itself through the 3D city — then _"fly it"_: banked turns, eased ends, a camera that leads the path like a drone shot. |
|
||||
| **📏 Measure LAX to DFW** _🎙️_ | _"How far is LAX from DFW?"_ — an arrow spans the country, the distance lands in the caption, and the endpoints stay pinned to the real world as you orbit. |
|
||||
| **🚀 Launch replay** | Open **Space Missions**, pick a launch from the last 30 days, and ride the T-minus countdown through ascent to orbit — scrub it at 0.25×–4×. Labeled `RECONSTRUCTED ESTIMATE`, because it is one. |
|
||||
| **🪦 Walk the boneyard** | Fly from regional context down into dense, fully resolved rows of retired aircraft. |
|
||||
| **🏗️ Orbit Three Gorges** | Sweep the dam and its terrain at a glance — then flip on the **Dams** layer and find 703 more. |
|
||||
This started as a mad science experiment that suddenly blew up. Next thing you know, Iran happened. Bilawal reconstructed it in 4D. The questions we kept getting: when can I use this thing, and can I bring my own data to the party?
|
||||
|
||||
_🎙️ = voice missions — they need an OpenAI key._
|
||||
<table>
|
||||
<tr>
|
||||
<td width="33%" valign="top"><a href="https://www.youtube.com/watch?v=o_FJ1NIH9yw"><img src="https://img.youtube.com/vi/o_FJ1NIH9yw/mqdefault.jpg" alt="God's Eye View Blew Up. Here's What You Can Do With It." width="100%"></a><br><a href="https://www.youtube.com/watch?v=o_FJ1NIH9yw"><b>God's Eye View Blew Up. Here's What You Can Do With It.</b></a><br><sub>3.1M views on YouTube</sub></td>
|
||||
<td width="33%" valign="top"><a href="https://www.youtube.com/watch?v=0p8o7AeHDzg"><img src="https://img.youtube.com/vi/0p8o7AeHDzg/mqdefault.jpg" alt="I Built God's Eye View to Monitor Iran in 4D" width="100%"></a><br><a href="https://www.youtube.com/watch?v=0p8o7AeHDzg"><b>I Built God's Eye View to Monitor Iran in 4D</b></a><br><sub>1.9M views on YouTube</sub></td>
|
||||
<td width="33%" valign="top"><a href="https://www.youtube.com/watch?v=GRJaKcXZS94"><img src="https://img.youtube.com/vi/GRJaKcXZS94/mqdefault.jpg" alt="We Got Open Source God's Eye Before GTA 6" width="100%"></a><br><a href="https://www.youtube.com/watch?v=GRJaKcXZS94"><b>We Got Open Source God's Eye Before GTA 6</b></a><br><sub>1.2M views on YouTube</sub></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="33%" valign="top"><a href="https://www.youtube.com/watch?v=pMZR4HmziyA"><img src="https://img.youtube.com/vi/pMZR4HmziyA/mqdefault.jpg" alt="Florida Learjet Crash - Final 78 Seconds Reconstructed in God's Eye View" width="100%"></a><br><a href="https://www.youtube.com/watch?v=pMZR4HmziyA"><b>Florida Learjet Crash - Final 78 Seconds Reconstructed in God's Eye View</b></a><br><sub>3.5M views on YouTube</sub></td>
|
||||
<td width="33%" valign="top"><a href="https://www.youtube.com/watch?v=ccZzOGnT4Cg"><img src="https://img.youtube.com/vi/ccZzOGnT4Cg/mqdefault.jpg" alt="God's Eye View Reveals Iran's Chokehold on the Global Economy" width="100%"></a><br><a href="https://www.youtube.com/watch?v=ccZzOGnT4Cg"><b>God's Eye View Reveals Iran's Chokehold on the Global Economy</b></a><br><sub>700K views on YouTube</sub></td>
|
||||
<td width="33%" valign="top"><a href="https://www.youtube.com/watch?v=g3toZwkrQQE"><img src="https://img.youtube.com/vi/g3toZwkrQQE/mqdefault.jpg" alt="God's Eye View Just Got a Massive Upgrade (Thanks To You!)" width="100%"></a><br><a href="https://www.youtube.com/watch?v=g3toZwkrQQE"><b>God's Eye View Just Got a Massive Upgrade (Thanks To You!)</b></a><br><sub>502K views on YouTube</sub></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||

|
||||
|
||||
_Ask the planet: a military contact's last ~24 hours of real trace history, resolved as stacked 3D loops._
|
||||
|
||||

|
||||
|
||||
_"Draw the walking route… now fly it" — banked turns, eased ends, the camera leading the path like a drone shot._
|
||||
|
||||

|
||||
|
||||
_Walk the boneyard: rows of retired airframes, fully resolved in 3D._
|
||||
More reconstructions, interviews and press: [godseyeview.ai/press](https://godseyeview.ai/press/) · [the full series on YouTube](https://youtube.com/playlist?list=PL6qSg2I-7_koPbDnSMo0QeeHX_RknA2uv&si=nBGYMoHWQw41v93Q)
|
||||
|
||||
---
|
||||
|
||||
@@ -590,10 +585,6 @@ metered and Liveuamap is a paid subscription:
|
||||
| 🟡 | **World News API** | 📰 News layer, Local: the news of the country in view. The free plan allows 50 points a day; `WORLDNEWSAPI_DAILY_READS` (default 30) keeps Core inside it. Core keeps each country's news for up to 1 hour, and World News API's [terms](https://worldnewsapi.com/terms/) allow caching only with its prior written permission, which is yours to get. The Data attribution popover credits it with a link | [worldnewsapi.com/console](https://worldnewsapi.com/console/) — free plan |
|
||||
| 🔴 | **Liveuamap** | 📰 News layer, Conflicts: Liveuamap's mapped items beside GDELT's reports (🟢 Conflicts works without) | [liveuamap.com/promo/api](https://liveuamap.com/promo/api) — paid API |
|
||||
|
||||

|
||||
|
||||
_What the TomTom key buys you: rush-hour density painted on the city — then dive from the jam straight into the camera watching it._
|
||||
|
||||
### Cherry on top
|
||||
|
||||
| | Key | Why | Get it |
|
||||
@@ -704,7 +695,7 @@ God's Eye View runs on **public data, clear sources, and local-first execution.*
|
||||
|
||||
**Maintainers:** [Bilawal Sidhu](https://github.com/bilawalsidhu) and [Sameh Khamis](https://github.com/samehkhamis) at [Halfpixel](https://halfpixel.ai).
|
||||
|
||||
<sub>Media note: the capture GIFs on this page show Google Photorealistic 3D Tiles and live data layers, used promotionally with in-frame attribution; they aren't licensed for standalone reuse. See [media provenance and permissions](docs/media/README.md); full source terms in [DATA_SOURCES.md](DATA_SOURCES.md).</sub>
|
||||
<sub>Media note: the clips on this page are the ones shown on godseyeview.ai. Some show Google Photorealistic 3D Tiles and live data layers, used promotionally with in-frame attribution; they aren't licensed for standalone reuse. See [media provenance and permissions](docs/media/README.md); full source terms in [DATA_SOURCES.md](DATA_SOURCES.md).</sub>
|
||||
|
||||
> [!IMPORTANT]
|
||||
> God's Eye View is an exploratory visualization of public and third-party data.
|
||||
@@ -725,13 +716,13 @@ So here it is. Step inside the spy-thriller cockpit — except the data is real
|
||||
|
||||
One heads-up from the inside: build in this space for a week and you learn that **the present is the cheap part**. The moment you try to go back in time — tiling, serving, and scrubbing _what happened_ and _what changed_ at any real resolution — the data gets expensive and the compute gets brutal. That's the long game.
|
||||
|
||||
**Update — a hosted version is coming.** We originally planned to keep this repository as the open-source client and build a separate professional product. Then the launch happened, and the loudest request wasn't another feature — it was _"just give me a link."_ So we're building an official hosted God's Eye View at [Halfpixel](https://halfpixel.ai): no installation, just open it in your browser. The hosted version is the easiest way into this open-source project. More soon.
|
||||
**Update — a hosted version is coming.** We originally planned to keep this repository as the open-source client and build a separate professional product. Then the launch happened, and the loudest request wasn't another feature — it was _"just give me a link."_ So we're building an official hosted God's Eye View at [Halfpixel](https://halfpixel.ai): no installation, just open it in your browser. The hosted version is the easiest way into this open-source project. Sign up for the [waitlist](https://godseyeview.ai/online/) and get notified.
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
|
||||
▶️ [Watch the God's Eye View series](https://youtube.com/playlist?list=PL6qSg2I-7_koPbDnSMo0QeeHX_RknA2uv&si=nBGYMoHWQw41v93Q) · 📬 [Map the World](https://maptheworld.ai/) — the newsletter behind the project
|
||||
🌐 [godseyeview.ai](https://godseyeview.ai), the official site · ▶️ [Watch the God's Eye View series](https://youtube.com/playlist?list=PL6qSg2I-7_koPbDnSMo0QeeHX_RknA2uv&si=nBGYMoHWQw41v93Q) · 📬 [Map the World](https://maptheworld.ai/) — the newsletter behind the project
|
||||
|
||||
**🌐 God's Eye View. No place left behind.**
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
|
||||
The project depends on third-party npm packages whose own licenses apply. This
|
||||
file records the packages added for the browser-local SDR feature, the
|
||||
Street Level viewer and the Data Library's GeoParquet reader; the complete resolved dependency inventory remains in
|
||||
Street Level viewer, the Data Library's GeoParquet reader and the GNSS Integrity
|
||||
layer's hexagon grid; the complete resolved dependency inventory remains in
|
||||
`package-lock.json`.
|
||||
|
||||
## Web RTL-SDR
|
||||
@@ -68,3 +69,12 @@ Street Level viewer and the Data Library's GeoParquet reader; the complete resol
|
||||
- Author: Copyright (c) 2018, Vladimir Agafonkin
|
||||
- Source: <https://github.com/mourner/kdbush>
|
||||
- License: ISC
|
||||
|
||||
## H3 (h3-js)
|
||||
|
||||
- Package: `h3-js` 4.4.0 (the GNSS Integrity layer's H3 hexagon cells)
|
||||
- Author: Copyright 2017-2021 Uber Technologies, Inc. (includes the H3 C
|
||||
library 4.4.1, compiled to JavaScript)
|
||||
- Source: <https://github.com/uber/h3-js>
|
||||
- License: Apache License 2.0
|
||||
- License text: <https://www.apache.org/licenses/LICENSE-2.0>
|
||||
@@ -0,0 +1,6 @@
|
||||
- GNSS Integrity bins aircraft into H3 resolution-4 hexagons, the grid
|
||||
gpsjam.org uses, and draws each as its hexagon instead of a 0.5° square. As
|
||||
on gpsjam.org, every hexagon with an aircraft is shown: the three-aircraft
|
||||
minimum is gone, and discounting one bad aircraft remains the only
|
||||
small-sample guard. Cells are keyed by their H3 index and carry their centre
|
||||
and boundary.
|
||||
@@ -0,0 +1,3 @@
|
||||
### Changed
|
||||
|
||||
- While anything moves (layers in motion, the camera, a followed contact), the globe now draws at the display's own refresh rate instead of a fixed 60 frames a second. A parked scene still ticks at most 60 times a second. Waits that counted frames (a followed contact's first position, a shared follow view, a trail's temporary copy) now count drawn time, so they last the same at any refresh rate. Screen marks over a followed contact fade out over the same time at any refresh rate.
|
||||
@@ -0,0 +1,3 @@
|
||||
### Fixed
|
||||
|
||||
- A civil or military aircraft whose feed sends neither a ground track nor a true heading now faces the way its newer positions went, instead of north, so a taxiing aircraft no longer appears to move sideways or backwards. An older position from another feed, or position noise on a parked aircraft, never turns it.
|
||||
@@ -0,0 +1,4 @@
|
||||
### Changed
|
||||
|
||||
- Playing the world clock away from live now draws at the display's own refresh rate instead of at most 60 FPS.
|
||||
- Vessels following a playing clock are moved again once the fastest would have moved half a pixel on screen, at least once a second, and at once when the camera moves or zooms. Before, every drawn vessel moved every frame by a fraction of a pixel, which took most of each frame with thousands of vessels in view.
|
||||
@@ -1,5 +1,31 @@
|
||||
# God's Eye View Current State
|
||||
|
||||
An aircraft (civil or military) faces its reported ground track, else its
|
||||
true heading (readsb `true_heading`). With neither, it faces the way its own
|
||||
fixes went (`courseFromFixes`, `src/data/courseFromFixes.js`): the course runs
|
||||
from an anchor fix to the newest once they are 30 m apart, and the anchor then
|
||||
moves on, so frequent fixes of a slow aircraft add up while position noise on
|
||||
a parked one never makes a course. A fix that is not a second newer (a repeat,
|
||||
or an older position from another feed) and one reported slower than 2 m/s
|
||||
give no course and keep the last; an aircraft with no course at all faces
|
||||
north.
|
||||
|
||||
While anything moves (a layer in motion, the camera, a followed contact), the
|
||||
globe draws at the display's own refresh rate; there is no fixed 60 FPS cap.
|
||||
The Cesium frame port (`src/render/cesium/ports.js`, its `idleFps`) caps a
|
||||
parked scene at `IDLE_FRAME_RATE` (60, `src/renderGovernor.js`) ticks a
|
||||
second while no hold is out, because Cesium still runs the clock, data sources
|
||||
and update listeners on every animation frame even when it skips the draw; the
|
||||
viewer starts at that cap until the frame port takes over. Through the idle
|
||||
render governor, the camera port holds continuous render from `moveStart` to `moveEnd`, and samples its
|
||||
pose every 250 ms in between, so a camera drifting by rounding errors (no
|
||||
`moveEnd`) is released after half a second at rest and held again if it moves. The world clock holds continuous render while
|
||||
it plays away from the live edge (not while it steps or waits for data), so
|
||||
playback draws at the display's rate too. Waits that used to count frames (a followed contact's first
|
||||
position, a shared follow view) count drawn time
|
||||
through `src/time/frameWait.js`, at most 100 ms a frame, so they last the same
|
||||
at any refresh rate and a background tab does not use them up.
|
||||
|
||||
Docker Compose mounts the checkout with the shared SELinux `:z` label so
|
||||
containers can read it on enforcing SELinux hosts. The separate image-owned
|
||||
`node_modules` volume and loopback-only port publishing remain unchanged.
|
||||
@@ -2061,8 +2087,12 @@ Playing, the layer stays a snapshot ahead of the time, and play does not pass a
|
||||
snapshot still loading for more than 8 seconds. Those snapshots apply as polls
|
||||
do, so contacts move on smoothly: aircraft are drawn at the clock's time
|
||||
rather than behind it, and vessels between two fixes move along the great
|
||||
circle, never past the newer one, redrawn every frame with frames asked for
|
||||
as for placed live vessels (vessels out of view move on every 250 ms). Records, absences and the Layers panel's age
|
||||
circle, never past the newer one. Drawn vessels move again once the fastest
|
||||
of them would have moved half a pixel on screen at the speed it last moved,
|
||||
at least once a second, and at once when the camera moves or changes height
|
||||
by a tenth of its height or the view zooms, with frames asked for as for
|
||||
placed live vessels; vessels out of view move on a share of them each frame,
|
||||
each within 250 ms, and one that comes into view is moved to the time first. Records, absences and the Layers panel's age
|
||||
are judged at the clock's time. Outside the coverage the layer shows no
|
||||
contacts and loads nothing; while the coverage is unknown it loads nothing and
|
||||
clears nothing. A snapshot that fails clears the time and is asked again after
|
||||
@@ -5577,7 +5607,7 @@ its criteria cannot be silently ignored.
|
||||
| FIRMS Active Fires ▲ | NASA FIRMS live (VIIRS ×2 NRT + MODIS NRT, trailing 24h) | `src/data/firmsHeatmap.js` | `/api/firms` (`FIRMS_MAP_KEY`) | 10 min (proxy TTL 30 min) |
|
||||
| Street Level 📷 | Mapillary street-level imagery (vector tiles, Graph API, MapillaryJS) | `src/layers/streetLevel/` via `src/app/layers/streetLevel.js` | `/api/mapillary/status`, `/api/mapillary/tiles/coverage/{z}/{x}/{y}` (`MAPILLARY_CLIENT_TOKEN`) | camera-driven (320 ms debounce, ≤9 tiles, server memory cache 24 h) |
|
||||
| Wind 🌬 | NOAA GFS 10 m wind (keyless, 0.25°→1° grid; animated particles) | `src/data/wind.js` | `/api/wind` | 1 h (forecast cycle) |
|
||||
| GNSS Integrity 📡 (`gnss-integrity`) | adsb.lol point snapshot, low navigation accuracy binned per 0.5° cell (GEV NIC/NACp threshold + gpsjam.org formula and bands, keyless, ODbL) | `src/layers/gnss/` via `src/app/layers/gnss.js` | `/api/gnss-integrity` | camera-driven (600 ms debounce, minimum 2.5 s between reads) + 60s poll (server cache 60 s; 30 min rolling window) |
|
||||
| GNSS Integrity 📡 (`gnss-integrity`) | adsb.lol point snapshot, low navigation accuracy binned per H3 res-4 hexagon (GEV NIC/NACp threshold + gpsjam.org grid, formula and bands, keyless, ODbL) | `src/layers/gnss/` via `src/app/layers/gnss.js` | `/api/gnss-integrity` | camera-driven (600 ms debounce, minimum 2.5 s between reads) + 60s poll (server cache 60 s; 30 min rolling window) |
|
||||
| S2 GhostMaps 👻 (`s2-ghostmaps`) | S2 Underground's public GhostMaps repository on GitHub (KMZ intel products, keyless, CC BY-NC-SA 4.0) | `src/layers/ghostMaps/` via `src/app/layers/ghostMaps.js` | `/api/ghostmaps/catalog`, `/api/ghostmaps/events` (server-sent events), `/api/ghostmaps/file/{product}` | branch head checked every 15 s; new commits pushed to the page; 5 min catalog backstop |
|
||||
| Sea Marks ⚓ (`sea-marks`) | OpenSeaMap seamark raster tiles (keyless; CC BY-SA 2.0 tiles, OSM data ODbL) | `src/data/osmOverlays.js` | — (browser-direct tiles) | on view (Cesium tile requests; no polling) |
|
||||
| Ski Pistes ⛷ (`ski-pistes`) | OpenSnowMap piste raster tiles (keyless; CC BY-SA tiles, OSM data ODbL; no bulk download) | `src/data/osmOverlays.js` | — (browser-direct tiles) | on view (Cesium tile requests; no polling) |
|
||||
@@ -5591,8 +5621,13 @@ GNSS Integrity samples a 250 nm circle around the Earth point under the screen
|
||||
centre. Camera reads debounce for 600 ms with a monotonic 2.5 s minimum gap;
|
||||
nearby views share whole-degree cache keys, and a minute poll refreshes data.
|
||||
Counts and bands cover visited views over 30 minutes, including regions now off
|
||||
screen. Non-pickable ground primitives preserve Street Level and perimeter
|
||||
selection. The legend describes a low-accuracy score, not the raw aircraft share;
|
||||
screen. Cells are H3 resolution-4 hexagons, gpsjam.org's grid, keyed by their H3
|
||||
index (`gnssCellKey`) and drawn from `cellToBoundary` (via `h3-js`) as clamped
|
||||
polygons in one shapes set of the draw port, redrawn only when a cell or band changes; a cell across the
|
||||
antimeridian is drawn with its longitudes unwrapped around its centre. As on
|
||||
gpsjam.org there is no minimum aircraft count: every cell with an aircraft is
|
||||
shown, and the one-aircraft discount is the only small-sample guard.
|
||||
Non-pickable ground primitives preserve Street Level and perimeter selection. The legend describes a low-accuracy score, not the raw aircraft share;
|
||||
`getStats().levels` exposes nominal, medium and high counts separately.
|
||||
|
||||
Transient source failures keep activation enabled and show unavailable/degraded
|
||||
|
||||
@@ -32,6 +32,11 @@ hardware-rendered overlay scenes.
|
||||
| 3 | 558.527 ms | 1,809.592 ms | 438.8 ms | 60 / 60 FPS | 105.1 MiB |
|
||||
| Median | 604.849 ms | 1,855.836 ms | 439.5 ms | 60 / 60 FPS | 105.1 MiB |
|
||||
|
||||
These frame rates were measured when the globe was capped at 60 FPS. It now
|
||||
draws at the display's refresh rate while anything moves and ticks at most 60
|
||||
times a second when parked (the Cesium frame port's idle rate,
|
||||
`IDLE_FRAME_RATE` in `src/renderGovernor.js`).
|
||||
|
||||
The initial-settle measurement is the more useful launch reference because it
|
||||
includes the first visual and data settling window. All three samples reached
|
||||
the display ceiling during both motion and rest.
|
||||
|
||||
|
Before Width: | Height: | Size: 981 KiB |
|
Before Width: | Height: | Size: 5.6 MiB |
|
Before Width: | Height: | Size: 5.8 MiB |
|
Before Width: | Height: | Size: 3.0 MiB |
|
Before Width: | Height: | Size: 4.8 MiB |
|
Before Width: | Height: | Size: 5.3 MiB |
|
Before Width: | Height: | Size: 6.0 MiB |
|
Before Width: | Height: | Size: 4.8 MiB |
|
Before Width: | Height: | Size: 889 KiB |
|
Before Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 2.2 MiB |
|
Before Width: | Height: | Size: 3.0 MiB |
|
Before Width: | Height: | Size: 2.6 MiB |
@@ -1,39 +1,36 @@
|
||||
# README media provenance
|
||||
|
||||
## Capture GIFs
|
||||
## Site clips
|
||||
|
||||
Bilawal Sidhu created and owns the following 17 GIFs and has authorized their inclusion and redistribution as part of this public repository and its project documentation. Any appearance by Bilawal Sidhu in these captures is included with his permission.
|
||||
The following animated images in `site/` are the clips shown on [godseyeview.ai](https://godseyeview.ai), converted to animated WebP for the README. Bilawal Sidhu and Halfpixel, Inc. created them and have authorized their inclusion and redistribution as part of this public repository and its project documentation.
|
||||
|
||||
- `hero-open-source-reveal.gif`
|
||||
- `06-cockpit-ar.gif`
|
||||
- `start-here/airport-ground-traffic-google-3d.gif`
|
||||
- `03-austin-cctv.gif`
|
||||
- `14-iss-over-ukraine.gif`
|
||||
- `01-style-sweep.gif`
|
||||
- `12-switch-aircraft-cockpit.gif`
|
||||
- `start-here/military-cockpit-dense-google-3d.gif`
|
||||
- `01-voice-annotate-zilker.gif`
|
||||
- `04-airport-distance.gif`
|
||||
- `15-global-radio-layer.gif`
|
||||
- `08-falcon9-replay.gif`
|
||||
- `09-undersea-cables.gif`
|
||||
- `07-helicopter-loops.gif`
|
||||
- `10-walking-route-flythrough.gif`
|
||||
- `08-boneyard.gif`
|
||||
- `05-traffic-to-cctv.gif`
|
||||
- `site/hero.webp`
|
||||
- `site/voice.webp`
|
||||
- `site/flights.webp`
|
||||
- `site/satellites.webp`
|
||||
- `site/cameras.webp`
|
||||
- `site/cockpit.webp`
|
||||
- `site/weather.webp`
|
||||
- `site/imagery.webp`
|
||||
- `site/transit.webp`
|
||||
- `site/sdr.webp`
|
||||
- `site/radio.webp`
|
||||
- `site/mcp.webp`
|
||||
- `site/director.webp`
|
||||
|
||||
Copyright © Bilawal Sidhu. These files are not covered by the project's MIT License. Permission is limited to their inclusion and redistribution with this repository and its project documentation. No permission is granted for standalone reuse or modification. Commercial reuse outside this repository requires separate permission. No share-alike license applies.
|
||||
Copyright © Bilawal Sidhu and Halfpixel, Inc. These files are not covered by the project's MIT License. Permission is limited to their inclusion and redistribution with this repository and its project documentation. No permission is granted for standalone reuse or modification. Commercial reuse outside this repository requires separate permission. No share-alike license applies.
|
||||
|
||||
The GIFs are promotional captures of God's Eye View. They include Google Photorealistic 3D Tiles and public or third-party data layers with in-frame attribution. Bilawal Sidhu's ownership and permission cover the captures and his likeness; they do not replace the terms of Google Maps Platform or any displayed data provider. Keep the visible attribution intact.
|
||||
The clips are promotional captures and renders of God's Eye View. Some include Google Photorealistic 3D Tiles and public or third-party data layers with in-frame attribution. The permission above covers the clips; it does not replace the terms of Google Maps Platform or any displayed data provider. Keep the visible attribution intact.
|
||||
|
||||
The launch-era capture GIFs that this page listed before were removed from the README and from the repository in November 2026. They remain in the Git history under the terms stated for them at the time.
|
||||
|
||||
## Public README PNGs
|
||||
|
||||
Bilawal Sidhu published the following PNGs in the existing public `bilawalsidhu/gods-eye-view` repository and authorized their continued inclusion and redistribution with this repository and its project documentation:
|
||||
Bilawal Sidhu published the following PNG in the existing public `bilawalsidhu/gods-eye-view` repository and authorized their continued inclusion and redistribution with this repository and its project documentation:
|
||||
|
||||
- `youtube-popular-videos.png`
|
||||
- `open-source-survey.png`
|
||||
|
||||
Source: [`assets/youtube-popular-videos.png`](https://github.com/bilawalsidhu/gods-eye-view/blob/7afb3beefb2dd39110ed117c8f06825e9ca2ada4/assets/youtube-popular-videos.png) and [`assets/open-source-survey.png`](https://github.com/bilawalsidhu/gods-eye-view/blob/7afb3beefb2dd39110ed117c8f06825e9ca2ada4/assets/open-source-survey.png) in public repository commit [`7afb3beefb2dd39110ed117c8f06825e9ca2ada4`](https://github.com/bilawalsidhu/gods-eye-view/commit/7afb3beefb2dd39110ed117c8f06825e9ca2ada4). The localized files preserve the source bytes unchanged.
|
||||
Source: [`assets/open-source-survey.png`](https://github.com/bilawalsidhu/gods-eye-view/blob/7afb3beefb2dd39110ed117c8f06825e9ca2ada4/assets/open-source-survey.png) in public repository commit [`7afb3beefb2dd39110ed117c8f06825e9ca2ada4`](https://github.com/bilawalsidhu/gods-eye-view/commit/7afb3beefb2dd39110ed117c8f06825e9ca2ada4). The localized files preserve the source bytes unchanged.
|
||||
|
||||
These files are not covered by the project's MIT License. No permission is granted for standalone reuse or modification. Commercial reuse outside this repository requires separate permission. No share-alike license applies.
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 MiB |
|
After Width: | Height: | Size: 467 KiB |
|
After Width: | Height: | Size: 447 KiB |
|
After Width: | Height: | Size: 538 KiB |
|
After Width: | Height: | Size: 664 KiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 314 KiB |
|
After Width: | Height: | Size: 405 KiB |
|
After Width: | Height: | Size: 453 KiB |
|
After Width: | Height: | Size: 304 KiB |
|
After Width: | Height: | Size: 299 KiB |
|
After Width: | Height: | Size: 788 KiB |
|
After Width: | Height: | Size: 370 KiB |
|
After Width: | Height: | Size: 690 KiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 8.2 MiB |
|
Before Width: | Height: | Size: 958 KiB |
@@ -16,6 +16,7 @@
|
||||
"cesium": "^1.124.0",
|
||||
"egm96-universal": "^1.1.1",
|
||||
"fzstd": "0.1.1",
|
||||
"h3-js": "^4.4.0",
|
||||
"hls.js": "^1.7.3",
|
||||
"hyparquet": "1.31.2",
|
||||
"kdbush": "^4.0.2",
|
||||
@@ -2534,6 +2535,17 @@
|
||||
"integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==",
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/h3-js": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/h3-js/-/h3-js-4.4.0.tgz",
|
||||
"integrity": "sha512-DvJh07MhGgY2KcC4OeZc8SSyA+ZXpdvoh6uCzGpoKvWtZxJB+g6VXXC1+eWYkaMIsLz7J/ErhOalHCpcs1KYog==",
|
||||
"license": "Apache-2.0",
|
||||
"engines": {
|
||||
"node": ">=4",
|
||||
"npm": ">=3",
|
||||
"yarn": ">=1.3.0"
|
||||
}
|
||||
},
|
||||
"node_modules/happy-dom": {
|
||||
"version": "20.14.6",
|
||||
"resolved": "https://registry.npmjs.org/happy-dom/-/happy-dom-20.14.6.tgz",
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"author": "Bilawal Sidhu",
|
||||
"homepage": "https://github.com/bilawalsidhu/gods-eye-view#readme",
|
||||
"homepage": "https://godseyeview.ai",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/bilawalsidhu/gods-eye-view.git"
|
||||
@@ -70,6 +70,7 @@
|
||||
"cesium": "^1.124.0",
|
||||
"egm96-universal": "^1.1.1",
|
||||
"fzstd": "0.1.1",
|
||||
"h3-js": "^4.4.0",
|
||||
"hls.js": "^1.7.3",
|
||||
"hyparquet": "1.31.2",
|
||||
"kdbush": "^4.0.2",
|
||||
|
||||
@@ -1552,7 +1552,8 @@
|
||||
"src/render/vectorBase/index.js",
|
||||
"src/render/vectorBase/style.js",
|
||||
"src/render/vectorBase/paint.js",
|
||||
"src/render/vectorBase/expressions.js"
|
||||
"src/render/vectorBase/expressions.js",
|
||||
"src/time/frameWait.js"
|
||||
],
|
||||
"external": [
|
||||
"cesium",
|
||||
@@ -1910,7 +1911,8 @@
|
||||
"src/render/cesium/sceneOcclusionProbe.js",
|
||||
"src/render/occlusion/depthProbe.js",
|
||||
"src/data/detectionOcclusion.js",
|
||||
"src/layers/flights/placed.js"
|
||||
"src/layers/flights/placed.js",
|
||||
"src/data/courseFromFixes.js"
|
||||
],
|
||||
"external": ["cesium", "kdbush"]
|
||||
},
|
||||
@@ -2048,7 +2050,9 @@
|
||||
"src/render/cesium/sceneOcclusionProbe.js",
|
||||
"src/render/occlusion/depthProbe.js",
|
||||
"src/data/detectionOcclusion.js",
|
||||
"src/layers/flights/placed.js"
|
||||
"src/layers/flights/placed.js",
|
||||
"src/data/courseFromFixes.js",
|
||||
"src/data/approxDistance.js"
|
||||
],
|
||||
"external": ["cesium", "kdbush"]
|
||||
},
|
||||
@@ -2277,6 +2281,7 @@
|
||||
"src/maps/keylessTerrain.js",
|
||||
"src/render/stub/viewRectangle.js",
|
||||
"src/render/cesium/follow.js",
|
||||
"src/time/frameWait.js",
|
||||
"src/render/cesium/cameraControls.js",
|
||||
"src/render/camera/events.js",
|
||||
"src/render/camera/followTransition.js",
|
||||
@@ -2420,7 +2425,8 @@
|
||||
"src/render/vectorBase/index.js",
|
||||
"src/render/vectorBase/style.js",
|
||||
"src/render/vectorBase/paint.js",
|
||||
"src/render/vectorBase/expressions.js"
|
||||
"src/render/vectorBase/expressions.js",
|
||||
"src/time/frameWait.js"
|
||||
],
|
||||
"external": ["cesium", "pbf", "@mapbox/vector-tile", "kdbush"]
|
||||
},
|
||||
@@ -5310,7 +5316,9 @@
|
||||
"src/viewWeather.js",
|
||||
"src/render/weather.js",
|
||||
"src/layers/flights/placed.js",
|
||||
"src/data/placementProvider.js"
|
||||
"src/data/placementProvider.js",
|
||||
"src/data/courseFromFixes.js",
|
||||
"src/time/frameWait.js"
|
||||
],
|
||||
"external": [
|
||||
"hls.js",
|
||||
@@ -5324,6 +5332,7 @@
|
||||
"@jtarrio/webrtlsdr",
|
||||
"hyparquet",
|
||||
"fzstd",
|
||||
"h3-js",
|
||||
"vue",
|
||||
"pinia",
|
||||
"vue-i18n",
|
||||
@@ -6135,7 +6144,9 @@
|
||||
"src/layers/vessels/photos.js",
|
||||
"src/data/openVesselPhoto.js",
|
||||
"src/layers/flights/placed.js",
|
||||
"src/data/placementProvider.js"
|
||||
"src/data/placementProvider.js",
|
||||
"src/data/courseFromFixes.js",
|
||||
"src/time/frameWait.js"
|
||||
],
|
||||
"external": [
|
||||
"hls.js",
|
||||
@@ -6147,6 +6158,7 @@
|
||||
"mgrs",
|
||||
"mapillary-js",
|
||||
"@jtarrio/webrtlsdr",
|
||||
"h3-js",
|
||||
"vue",
|
||||
"pinia",
|
||||
"vue-i18n",
|
||||
@@ -6551,7 +6563,8 @@
|
||||
"src/data/aircraftEmergency.js",
|
||||
"src/data/fleetModels.js",
|
||||
"src/data/vesselTypes.js",
|
||||
"src/data/fleetTrailAnchors.js"
|
||||
"src/data/fleetTrailAnchors.js",
|
||||
"src/data/courseFromFixes.js"
|
||||
],
|
||||
"external": []
|
||||
},
|
||||
@@ -6573,7 +6586,9 @@
|
||||
"src/data/aircraftMeta.js",
|
||||
"src/data/renderAltitude.js",
|
||||
"src/data/aircraftClass.js",
|
||||
"src/data/aircraftEmergency.js"
|
||||
"src/data/aircraftEmergency.js",
|
||||
"src/data/courseFromFixes.js",
|
||||
"src/data/approxDistance.js"
|
||||
],
|
||||
"external": []
|
||||
},
|
||||
@@ -7411,7 +7426,7 @@
|
||||
"src/ui/statusText.js",
|
||||
"src/ui/layerNames.js"
|
||||
],
|
||||
"external": ["cesium"]
|
||||
"external": ["cesium", "h3-js"]
|
||||
},
|
||||
"gnss-source": {
|
||||
"exports": ["./layers/gnss/source"],
|
||||
|
||||
@@ -11,15 +11,17 @@
|
||||
* (i) LIVE — over Poland and the southern Baltic the layer settles with no error,
|
||||
* its cells drawn and legend band counts that sum to the cell
|
||||
* count; cells are required only when the returned rows, binned
|
||||
* with the layer's own rules, reach the per-cell minimum (live
|
||||
* traffic varies by hour). Requires a non-stale response no older than 60 s.
|
||||
* into H3 cells with the layer's own rules, give at least one cell
|
||||
* (live traffic varies by hour). Requires a non-stale response no older than 60 s.
|
||||
* (ii) BANDS (synthetic) — a 10-aircraft cell with 5 degraded is high,
|
||||
* a 30-aircraft cell with 2 degraded is medium, a 3-aircraft cell
|
||||
* with 1 degraded is low (first bad discounted), a clean cell at sea
|
||||
* is low, a 2-aircraft cell is withheld; `stale: true` reaches
|
||||
* is low, a 2-aircraft cell with 2 degraded is shown high (no
|
||||
* minimum aircraft count, as on gpsjam.org); `stale: true` reaches
|
||||
* getStats. Every band is drawn and low is shown over land and sea.
|
||||
* The row reads as low navigation accuracy, and stats carry the
|
||||
* machine-readable provenance (GEV classifier, gpsjam bands, window).
|
||||
* machine-readable provenance (GEV classifier, gpsjam bands and H3
|
||||
* grid, window).
|
||||
* PICK verifies actual perimeter and empty-ground clicks under GNSS.
|
||||
* CAMERA/GLOBE verify automatic sampling and the screen-centre anchor.
|
||||
* (iii) FAILURE — the route stubbed to 502: stats.error is set and the
|
||||
@@ -210,7 +212,7 @@ async function shoot(page, name) {
|
||||
/** Build state of every GNSS ground primitive: DONE = 0, PENDING = 1. */
|
||||
const cellStates = `() => (${gnssGround})().map(({ primitive }) => (primitive.ready ? 0 : 1))`;
|
||||
|
||||
/** Wait until every GNSS cell's ground rectangle has finished building. */
|
||||
/** Wait until every GNSS cell's ground polygon has finished building. */
|
||||
async function waitForBuiltCells(page, timeoutMs = 60000) {
|
||||
const built = await page
|
||||
.waitForFunction(`(${cellStates})().every((state) => state === 0)`, {
|
||||
@@ -236,22 +238,23 @@ const fixtureRow = (hex, lat, lon, degraded) => ({
|
||||
});
|
||||
|
||||
/**
|
||||
* Synthetic 0.5° cells: high at sea (5/10 bad), medium on land (2/30 bad),
|
||||
* low on land (1/3 bad), low at sea (0/4 bad), withheld (2 aircraft).
|
||||
* Synthetic H3 res-4 cells, each group inside one hexagon: high at sea
|
||||
* (5/10 bad), medium on land (2/30 bad), low on land (1/3 bad), low at sea
|
||||
* (0/4 bad), and high from only 2 aircraft (2/2 bad; no minimum count).
|
||||
*/
|
||||
function fixturePayload() {
|
||||
const rows = [];
|
||||
const hex = (prefix, i) => `${prefix}${i.toString(16).padStart(2, '0')}`;
|
||||
for (let i = 0; i < 10; i++)
|
||||
rows.push(fixtureRow(hex('a000', i), 55.1 + i * 0.01, 19.1, i < 5));
|
||||
rows.push(fixtureRow(hex('a000', i), 55.1 + i * 0.001, 19.1, i < 5));
|
||||
for (let i = 0; i < 30; i++)
|
||||
rows.push(fixtureRow(hex('d000', i), 54.1 + i * 0.01, 19.6, i < 2));
|
||||
rows.push(fixtureRow(hex('d000', i), 54.1 + i * 0.001, 19.6, i < 2));
|
||||
for (let i = 0; i < 3; i++)
|
||||
rows.push(fixtureRow(hex('b000', i), 54.1 + i * 0.01, 18.1, i === 0));
|
||||
rows.push(fixtureRow(hex('b000', i), 54.1 + i * 0.001, 18.1, i === 0));
|
||||
for (let i = 0; i < 4; i++)
|
||||
rows.push(fixtureRow(hex('e000', i), 55.1 + i * 0.01, 18.1, false));
|
||||
rows.push(fixtureRow(hex('e000', i), 55.1 + i * 0.001, 18.1, false));
|
||||
for (let i = 0; i < 2; i++)
|
||||
rows.push(fixtureRow(hex('c000', i), 53.1 + i * 0.01, 17.1, true));
|
||||
rows.push(fixtureRow(hex('c000', i), 53.1 + i * 0.001, 17.1, true));
|
||||
return {
|
||||
fetchedAt: Date.now(),
|
||||
anchor: { lat: 55, lon: 19 },
|
||||
@@ -398,8 +401,8 @@ async function main() {
|
||||
const l = await enableAndSettle(live);
|
||||
const legendTotal = l.legend.reduce((sum, { count }) => sum + count, 0);
|
||||
// Bin what adsb.lol actually returned with the layer's own rules: live
|
||||
// traffic varies by hour, so cells are required only when some cell
|
||||
// really reached the minimum aircraft count.
|
||||
// traffic varies by hour, so cells are required only when the rows
|
||||
// really bin into some cell.
|
||||
const liveSnapshots = (await Promise.allSettled(liveBodies))
|
||||
.filter((r) => r.status === 'fulfilled')
|
||||
.map((r) => r.value);
|
||||
@@ -442,7 +445,7 @@ async function main() {
|
||||
);
|
||||
} else {
|
||||
console.log(
|
||||
` [info] ${liveRows} live rows, no cell reaches the minimum — cell count not asserted`,
|
||||
` [info] ${liveRows} live rows bin into no cell — cell count not asserted`,
|
||||
);
|
||||
}
|
||||
record(
|
||||
@@ -452,7 +455,7 @@ async function main() {
|
||||
);
|
||||
const liveBuilt = await waitForBuiltCells(live);
|
||||
record(
|
||||
'LIVE: every cell rectangle is built on a parked camera',
|
||||
'LIVE: every cell polygon is built on a parked camera',
|
||||
liveBuilt.built,
|
||||
liveBuilt.detail,
|
||||
);
|
||||
@@ -467,7 +470,7 @@ async function main() {
|
||||
await page.setViewport({ width: 1440, height: 900 });
|
||||
page.on('pageerror', (e) => errors.push(e.message));
|
||||
// Stub the route in-page rather than with request interception: an
|
||||
// intercepted page stalls Cesium's geometry workers, so ground rectangles
|
||||
// intercepted page stalls Cesium's geometry workers, so ground polygons
|
||||
// never finish building and the screenshot would not show real behaviour.
|
||||
await stubRoute(page);
|
||||
await boot(page, { lon: 18.6, lat: 54.6, height: 450_000 });
|
||||
@@ -475,25 +478,27 @@ async function main() {
|
||||
const band = (prefix) =>
|
||||
f.legend.find(({ label }) => label.startsWith(prefix))?.count;
|
||||
record(
|
||||
'BANDS: 4 cells shown, the 2-aircraft cell withheld',
|
||||
f.stats.count === 4 && f.drawn,
|
||||
'BANDS: 5 cells shown, the 2-aircraft cell included',
|
||||
f.stats.count === 5 && f.drawn,
|
||||
`cells=${f.stats.count} drawn=${f.drawn}`,
|
||||
);
|
||||
record(
|
||||
'BANDS: 5/10 is high, 2/30 is medium, 1/3 and 0/4 are low',
|
||||
band('Low-accuracy score >') === 1 &&
|
||||
'BANDS: 5/10 and 2/2 are high, 2/30 is medium, 1/3 and 0/4 are low',
|
||||
band('Low-accuracy score >') === 2 &&
|
||||
band('Low-accuracy score 2') === 1 &&
|
||||
band('Low-accuracy score <') === 2,
|
||||
JSON.stringify(f.legend),
|
||||
);
|
||||
const prov = f.stats.provenance;
|
||||
record(
|
||||
'PROVENANCE: GEV classifier, gpsjam bands and visited-view window are machine-readable',
|
||||
'PROVENANCE: GEV classifier, gpsjam bands and H3 grid, and visited-view window are machine-readable',
|
||||
prov?.classifier?.id === 'gev-nic-nacp-v2' &&
|
||||
prov.classifier.definedBy === 'GEV' &&
|
||||
prov.classifier.validated === false &&
|
||||
prov.aggregation?.source === 'https://gpsjam.org/faq' &&
|
||||
JSON.stringify(prov.aggregation.bands) === '[2,10]' &&
|
||||
prov.aggregation.grid === 'h3' &&
|
||||
prov.aggregation.h3Resolution === 4 &&
|
||||
prov.window?.minutes === 30 &&
|
||||
prov.window.scope === 'visited-view' &&
|
||||
prov.interpretation?.validated === false,
|
||||
@@ -516,7 +521,7 @@ async function main() {
|
||||
);
|
||||
const bandsBuilt = await waitForBuiltCells(page);
|
||||
record(
|
||||
'BANDS: every cell rectangle is built on a parked camera',
|
||||
'BANDS: every cell polygon is built on a parked camera',
|
||||
bandsBuilt.built,
|
||||
bandsBuilt.detail,
|
||||
);
|
||||
@@ -782,7 +787,7 @@ async function main() {
|
||||
const e = await enableAndSettle(page, { refresh: true });
|
||||
record(
|
||||
'FAILURE: error surfaced, cells kept',
|
||||
Boolean(e.stats.error) && e.stats.count === 4 && e.drawn,
|
||||
Boolean(e.stats.error) && e.stats.count === 5 && e.drawn,
|
||||
`error=${JSON.stringify(e.stats.error)} cells=${e.stats.count}`,
|
||||
);
|
||||
await shoot(page, 'failure');
|
||||
@@ -812,7 +817,7 @@ async function main() {
|
||||
'KEYBOARD: Enter on the focused toggle enables the layer and keeps focus',
|
||||
on.enabled &&
|
||||
on.focused &&
|
||||
on.count === 4 &&
|
||||
on.count === 5 &&
|
||||
/^GNSS Integrity: /.test(on.label) &&
|
||||
!/OFF$/.test(on.label),
|
||||
JSON.stringify(on),
|
||||
@@ -921,7 +926,7 @@ async function main() {
|
||||
return (
|
||||
layer.enabled &&
|
||||
layer.module.getStats().error === null &&
|
||||
layer.module.getStats().count === 4
|
||||
layer.module.getStats().count === 5
|
||||
);
|
||||
},
|
||||
{ timeout: 20000 },
|
||||
@@ -972,7 +977,7 @@ async function main() {
|
||||
const recent = await enableAndSettle(aged, { refresh: true });
|
||||
record(
|
||||
'AGE: the same snapshot observed 29 min ago is still inside the window',
|
||||
recent.stats.count === 4 && recent.drawn,
|
||||
recent.stats.count === 5 && recent.drawn,
|
||||
`cells=${recent.stats.count} drawn=${recent.drawn}`,
|
||||
);
|
||||
await aged.close();
|
||||
|
||||
@@ -406,7 +406,12 @@ export function createScreenAnnotationRenderer(
|
||||
// from the host's ACTUAL painted rectangle after final layout; the billboard extent
|
||||
// is unioned for aircraft/satellites that also own a native tracked graphic.
|
||||
const TRACKED_BBOX_MARGIN = 8; // px buffer added around the footprint
|
||||
const TRACKED_FADE_EASE = 0.22; // per-frame ease toward hidden(0) / visible(1)
|
||||
// Ease toward hidden(0) / visible(1): this share of the gap closes in one
|
||||
// 60 Hz frame (about 200 ms to settle), scaled by elapsed time so the fade
|
||||
// takes as long at any refresh rate.
|
||||
const TRACKED_FADE_EASE = 0.22;
|
||||
const TRACKED_FADE_FRAME_MS = 1000 / 60;
|
||||
let trackedFadeAtMs = -Infinity;
|
||||
const TRACKED_HYSTERESIS_PX = 18; // dead-band so the overlap test can't flip-flop
|
||||
|
||||
// Evaluate a NearFarScalar (billboard scaleByDistance) at a camera distance.
|
||||
@@ -677,6 +682,14 @@ export function createScreenAnnotationRenderer(
|
||||
// safe and not jarring.
|
||||
function fadeTracked(trackedRect) {
|
||||
if (!shown()) return;
|
||||
const nowMs = performance.now();
|
||||
// A gap longer than a slow frame means the fade was not running (nothing
|
||||
// followed): it starts again as from one 60 Hz frame.
|
||||
const gapMs = nowMs - trackedFadeAtMs;
|
||||
const stepMs = gapMs >= 0 && gapMs <= 100 ? gapMs : TRACKED_FADE_FRAME_MS;
|
||||
trackedFadeAtMs = nowMs;
|
||||
const ease =
|
||||
1 - Math.pow(1 - TRACKED_FADE_EASE, stepMs / TRACKED_FADE_FRAME_MS);
|
||||
let changed = false;
|
||||
for (const rec of records.values()) {
|
||||
const { anno, group } = rec;
|
||||
@@ -705,10 +718,10 @@ export function createScreenAnnotationRenderer(
|
||||
}
|
||||
}
|
||||
const target = overlapping ? 0 : 1;
|
||||
const next = cur + (target - cur) * TRACKED_FADE_EASE;
|
||||
const next = cur + (target - cur) * ease;
|
||||
rec._trackedFade = Math.abs(next - target) < 0.02 ? target : next;
|
||||
// The base alpha applies unless faded. (The CSS `transition: opacity` was
|
||||
// removed from .gev-anno so this per-frame JS ease is the ONLY easing —
|
||||
// removed from .gev-anno so this JS ease is the ONLY easing —
|
||||
// previously the two fought and produced an opacity oscillation.)
|
||||
const opacity = String(
|
||||
(anno.alpha ?? 1) * (rec._trackedFade !== 1 ? rec._trackedFade : 1),
|
||||
|
||||
@@ -234,9 +234,8 @@ test('a GNSS integrity source can set the layer evidence window', (t) => {
|
||||
};
|
||||
const shows = (layer, minutes) => {
|
||||
assert.equal(layer.provenance.window.minutes, minutes);
|
||||
const { info, legend } = layer.getRowControls();
|
||||
const { info } = layer.getRowControls();
|
||||
assert.match(info, new RegExp(`visited views over ${minutes} min`));
|
||||
assert.match(legend[0].blurb, new RegExp(`over ${minutes} minutes`));
|
||||
};
|
||||
shows(gnssLayer({ windowMs: 65 * 60_000 }), 65);
|
||||
shows(gnssLayer({}), 30);
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
installRenderGovernor,
|
||||
uninstallRenderGovernor,
|
||||
governorRequestRender,
|
||||
releaseContinuousRender,
|
||||
} from '../renderGovernor.js';
|
||||
import { describeError } from './errors.js';
|
||||
import { isEmbeddedInline } from './embed.js';
|
||||
@@ -104,8 +105,9 @@ export async function createApplicationScene({
|
||||
const viewer = scene.host;
|
||||
// The governor keeps its holds on the renderer's frame port. The loop
|
||||
// draws every frame until the application's tools are up (they release
|
||||
// 'boot'), as it did before anything could hold it.
|
||||
installRenderGovernor(renderer.frame);
|
||||
// 'boot'), as it did before anything could hold it. A camera move holds
|
||||
// it drawing every frame too.
|
||||
installRenderGovernor(renderer.frame, { camera: renderer.camera });
|
||||
holdContinuousRender('boot');
|
||||
defer(() => {
|
||||
try {
|
||||
@@ -159,6 +161,12 @@ export async function createApplicationScene({
|
||||
followWorldTime(viewer, worldTimeFor('sky'), {
|
||||
subscribe: worldClock.subscribe,
|
||||
requestRender: () => governorRequestRender('world-time'),
|
||||
// A playing world time moves something every frame: draw at the
|
||||
// display's rate meanwhile, not the parked scene's cap.
|
||||
onPlaying: (playing) =>
|
||||
playing
|
||||
? holdContinuousRender('world-time')
|
||||
: releaseContinuousRender('world-time'),
|
||||
}),
|
||||
);
|
||||
registerDataCredits(viewer, credits);
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* The course of a contact whose feed reports neither a ground track nor a
|
||||
* true heading, read from its own fixes.
|
||||
*
|
||||
* The course runs from an anchor fix to the newest fix once they are at least
|
||||
* COURSE_FROM_FIXES_MIN_M apart; the anchor then moves to the newest fix.
|
||||
* Nearer fixes leave the anchor where it is, so frequent fixes of a slow
|
||||
* aircraft still add up to a course, while position noise on a parked one
|
||||
* never makes one. A fix that does not move time on by a second (a repeat, or
|
||||
* an older position from another feed) never moves the anchor or gives a
|
||||
* course, and neither does one reported slower than
|
||||
* COURSE_FROM_FIXES_MIN_SPEED_MPS.
|
||||
*/
|
||||
import { approxDistanceKm } from './approxDistance.js';
|
||||
|
||||
/** Metres between fixes before a course is read from them. */
|
||||
export const COURSE_FROM_FIXES_MIN_M = 30;
|
||||
/** A contact reported slower than this (m/s) is standing: no course is read. */
|
||||
export const COURSE_FROM_FIXES_MIN_SPEED_MPS = 2;
|
||||
|
||||
/**
|
||||
* Initial great-circle bearing from one point to another, in degrees from
|
||||
* true north (0–360), or null when either is missing or they are less than
|
||||
* COURSE_FROM_FIXES_MIN_M apart.
|
||||
*/
|
||||
export function courseBetweenFixes(fromLat, fromLon, toLat, toLon) {
|
||||
if (![fromLat, fromLon, toLat, toLon].every(Number.isFinite)) return null;
|
||||
if (
|
||||
approxDistanceKm(fromLat, fromLon, toLat, toLon) * 1000 <
|
||||
COURSE_FROM_FIXES_MIN_M
|
||||
)
|
||||
return null;
|
||||
const φ1 = (fromLat * Math.PI) / 180;
|
||||
const φ2 = (toLat * Math.PI) / 180;
|
||||
const Δλ = ((toLon - fromLon) * Math.PI) / 180;
|
||||
const y = Math.sin(Δλ) * Math.cos(φ2);
|
||||
const x =
|
||||
Math.cos(φ1) * Math.sin(φ2) - Math.sin(φ1) * Math.cos(φ2) * Math.cos(Δλ);
|
||||
return ((Math.atan2(y, x) * 180) / Math.PI + 360) % 360;
|
||||
}
|
||||
|
||||
/**
|
||||
* Read a course from a new fix.
|
||||
* @param {{lat: number, lon: number, ms: number}|null|undefined} anchor The
|
||||
* anchor fix kept from the last call (null at first).
|
||||
* @param {{lat: number, lon: number, ms: number, speedMps?: number|null}} fix
|
||||
* @returns {{courseDeg: number|null, anchor: {lat: number, lon: number, ms: number}|null}}
|
||||
* The course, or null when none can be read, and the anchor to keep.
|
||||
*/
|
||||
export function courseFromFixes(anchor, { lat, lon, ms, speedMps = null }) {
|
||||
const keep = anchor ?? null;
|
||||
if (![lat, lon, ms].every(Number.isFinite))
|
||||
return { courseDeg: null, anchor: keep };
|
||||
if (!keep) return { courseDeg: null, anchor: { lat, lon, ms } };
|
||||
if (ms < keep.ms + 1000) return { courseDeg: null, anchor: keep };
|
||||
if (Number.isFinite(speedMps) && speedMps < COURSE_FROM_FIXES_MIN_SPEED_MPS)
|
||||
return { courseDeg: null, anchor: keep };
|
||||
const courseDeg = courseBetweenFixes(keep.lat, keep.lon, lat, lon);
|
||||
if (courseDeg === null) return { courseDeg: null, anchor: keep };
|
||||
return { courseDeg, anchor: { lat, lon, ms } };
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { courseBetweenFixes, courseFromFixes } from './courseFromFixes.js';
|
||||
|
||||
test('course between fixes reads true bearings, across the antimeridian too', () => {
|
||||
assert.ok(Math.abs(courseBetweenFixes(0, 0, 0, 0.01) - 90) < 1e-6);
|
||||
assert.ok(Math.abs(courseBetweenFixes(0, 0, -0.01, 0) - 180) < 1e-6);
|
||||
assert.ok(
|
||||
Math.abs(courseBetweenFixes(0, 179.9997, 0, -179.9997) - 90) < 1e-6,
|
||||
);
|
||||
assert.equal(courseBetweenFixes(30, -97, 30.0001, -97), null, 'about 11 m');
|
||||
assert.equal(courseBetweenFixes(null, 0, 0, 0.01), null);
|
||||
});
|
||||
|
||||
test('the anchor moves only with a course, and only forward in time', () => {
|
||||
let state = courseFromFixes(null, { lat: 0, lon: 0, ms: 0 });
|
||||
assert.equal(state.courseDeg, null);
|
||||
assert.deepEqual(state.anchor, { lat: 0, lon: 0, ms: 0 });
|
||||
const first = state.anchor;
|
||||
state = courseFromFixes(first, { lat: 0, lon: 0.0001, ms: 1000 });
|
||||
assert.equal(state.courseDeg, null, '11 m: no course');
|
||||
assert.equal(state.anchor, first, 'the anchor stays');
|
||||
state = courseFromFixes(first, { lat: 0, lon: 0.0005, ms: 500 });
|
||||
assert.equal(state.courseDeg, null, 'not a second newer');
|
||||
state = courseFromFixes(first, {
|
||||
lat: 0,
|
||||
lon: 0.0005,
|
||||
ms: 2000,
|
||||
speedMps: 1,
|
||||
});
|
||||
assert.equal(state.courseDeg, null, 'standing');
|
||||
state = courseFromFixes(first, {
|
||||
lat: 0,
|
||||
lon: 0.0005,
|
||||
ms: 2000,
|
||||
speedMps: 8,
|
||||
});
|
||||
assert.ok(Math.abs(state.courseDeg - 90) < 1e-6);
|
||||
assert.deepEqual(state.anchor, { lat: 0, lon: 0.0005, ms: 2000 });
|
||||
state = courseFromFixes(first, { lat: NaN, lon: 0, ms: 3000 });
|
||||
assert.equal(state.anchor, first);
|
||||
});
|
||||
@@ -1696,8 +1696,8 @@
|
||||
"GNSS integrity source unavailable": "مصدر سلامة GNSS غير متاح",
|
||||
"Retrying automatically at {time} UTC": "إعادة المحاولة تلقائيًا عند {time} UTC",
|
||||
"Retrying automatically after provider cooldown": "إعادة المحاولة تلقائيًا بعد انتهاء مهلة المزوّد",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "يُحدَّث تلقائيًا بعد التحريك أو التكبير/التصغير ومرة كل دقيقة. يغطي المصدر العام دائرة نصف قطرها 250 ميلًا بحريًا حول مركز العرض؛ والتصغير لا يجعله لقطة عالمية. الخلايا الفارغة خارج نطاق العيّنة أو أرصادها غير كافية.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "مؤشر ضعف الدقة = 100 × max(0, الضعيفة − 1) / الإجمالي: تُستبعد طائرة واحدة، لذا فهو ليس النسبة الخام. تحتاج كل خلية إلى {aircraft} طائرات خلال {minutes} دقيقة. شذوذ سلامة الملاحة ليس كشفًا للتشويش أو الانتحال.",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "يُحدَّث تلقائيًا بعد التحريك أو التكبير/التصغير ومرة كل دقيقة. يغطي المصدر العام دائرة نصف قطرها 250 ميلًا بحريًا حول مركز العرض؛ والتصغير لا يجعله لقطة عالمية. المناطق الفارغة لم تُبلغ فيها أي طائرة عن دقة الملاحة خلال النافذة الزمنية.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "مؤشر ضعف الدقة = 100 × max(0, الضعيفة − 1) / الإجمالي: تُستبعد طائرة واحدة، لذا فهو ليس النسبة الخام. شذوذ سلامة الملاحة ليس كشفًا للتشويش أو الانتحال.",
|
||||
"GNSS snapshot needs a view anchor": "لقطة GNSS تحتاج إلى نقطة ارتكاز للعرض",
|
||||
"GNSS feed rate limited (HTTP 429)": "مصدر GNSS تجاوز حد الطلبات (HTTP 429)",
|
||||
"Malformed GNSS integrity snapshot": "لقطة سلامة GNSS مشوّهة",
|
||||
|
||||
@@ -1623,8 +1623,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "Regionale Stichprobe · Radius 250 NM · Zellen aus besuchten Ansichten der letzten {minutes} min",
|
||||
"Retrying automatically at {time} UTC": "Automatischer neuer Versuch um {time} UTC",
|
||||
"Retrying automatically after provider cooldown": "Automatischer neuer Versuch nach der Sperrzeit des Anbieters",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "Aktualisiert sich nach Schwenken oder Zoomen und einmal pro Minute automatisch. Der öffentliche Feed deckt einen Kreis von 250 Seemeilen um die Bildmitte ab; Herauszoomen macht daraus keinen weltweiten Snapshot. Leere Zellen liegen außerhalb der Stichprobe oder haben zu wenige Beobachtungen.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Ungenauigkeitswert = 100 × max(0, schlecht − 1) / gesamt: Ein Luftfahrzeug wird abgezogen, das ist also nicht der reine Anteil. Zellen brauchen {aircraft} Luftfahrzeuge über {minutes} Minuten. Anomalien der Navigationsintegrität sind kein Nachweis von Jamming oder Spoofing.",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "Aktualisiert sich nach Schwenken oder Zoomen und einmal pro Minute automatisch. Der öffentliche Feed deckt einen Kreis von 250 Seemeilen um die Bildmitte ab; Herauszoomen macht daraus keinen weltweiten Snapshot. In leeren Bereichen hat im Zeitfenster kein Flugzeug seine Navigationsgenauigkeit gemeldet.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Ungenauigkeitswert = 100 × max(0, schlecht − 1) / gesamt: Ein Luftfahrzeug wird abgezogen, das ist also nicht der reine Anteil. Anomalien der Navigationsintegrität sind kein Nachweis von Jamming oder Spoofing.",
|
||||
"GNSS snapshot needs a view anchor": "GNSS-Snapshot braucht einen Ansichtsanker",
|
||||
"GNSS feed rate limited (HTTP 429)": "GNSS-Feed hat das Anfragelimit erreicht (HTTP 429)",
|
||||
"Malformed GNSS integrity snapshot": "Fehlerhafter GNSS-Integritäts-Snapshot",
|
||||
|
||||
@@ -2334,8 +2334,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "Muestra regional · radio de 250 NM · celdas de las vistas visitadas en {minutes} min",
|
||||
"Retrying automatically at {time} UTC": "Reintento automático a las {time} UTC",
|
||||
"Retrying automatically after provider cooldown": "Reintento automático tras la pausa del proveedor",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "Se actualiza automáticamente al desplazar el mapa o hacer zoom y una vez por minuto. La fuente pública cubre un círculo de 250 millas náuticas alrededor del centro de la vista; alejarte no la convierte en una instantánea mundial. Las celdas vacías están fuera de la cobertura muestreada o no tienen observaciones suficientes.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Índice de baja precisión = 100 × max(0, malas − 1) / total: se descuenta una aeronave, así que no es la proporción bruta. Cada celda necesita {aircraft} aeronaves en {minutes} minutos. Las anomalías de integridad de navegación no son una detección de interferencias ni de suplantación.",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "Se actualiza automáticamente al desplazar el mapa o hacer zoom y una vez por minuto. La fuente pública cubre un círculo de 250 millas náuticas alrededor del centro de la vista; alejarte no la convierte en una instantánea mundial. En las zonas vacías ningún avión informó su precisión de navegación durante la ventana.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Índice de baja precisión = 100 × max(0, malas − 1) / total: se descuenta una aeronave, así que no es la proporción bruta. Las anomalías de integridad de navegación no son una detección de interferencias ni de suplantación.",
|
||||
"SQUAWK {code} · {status}": "SQUAWK {code} · {status}",
|
||||
"ADS-B PRIORITY · {status}": "ADS-B PRIORIDAD · {status}",
|
||||
"ADS-B EMERGENCY · {status}": "ADS-B EMERGENCIA · {status}",
|
||||
|
||||
@@ -861,8 +861,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "Échantillon régional · rayon de 250 NM · cellules des vues visitées sur {minutes} min",
|
||||
"Retrying automatically at {time} UTC": "Nouvel essai automatique à {time} UTC",
|
||||
"Retrying automatically after provider cooldown": "Nouvel essai automatique après la pause du fournisseur",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "Mise à jour automatique après un déplacement ou un zoom, et une fois par minute. Le flux public couvre un cercle de 250 milles nautiques autour du centre de la vue ; dézoomer n'en fait pas un instantané mondial. Les cellules vides sont hors de la couverture échantillonnée ou manquent d'observations.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Indice de faible précision = 100 × max(0, mauvais − 1) / total : un aéronef est déduit, ce n'est donc pas la proportion brute. Chaque cellule exige {aircraft} aéronefs sur {minutes} minutes. Les anomalies d'intégrité de navigation ne constituent pas une détection de brouillage ou de leurrage.",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "Mise à jour automatique après un déplacement ou un zoom, et une fois par minute. Le flux public couvre un cercle de 250 milles nautiques autour du centre de la vue ; dézoomer n'en fait pas un instantané mondial. Dans les zones vides, aucun avion n'a signalé sa précision de navigation pendant la fenêtre.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Indice de faible précision = 100 × max(0, mauvais − 1) / total : un aéronef est déduit, ce n'est donc pas la proportion brute. Les anomalies d'intégrité de navigation ne constituent pas une détection de brouillage ou de leurrage.",
|
||||
"GNSS snapshot needs a view anchor": "L'instantané GNSS nécessite un point d'ancrage de la vue",
|
||||
"GNSS feed rate limited (HTTP 429)": "Flux GNSS : limite de requêtes atteinte (HTTP 429)",
|
||||
"Malformed GNSS integrity snapshot": "Instantané d'intégrité GNSS mal formé",
|
||||
|
||||
@@ -788,8 +788,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "דגימה אזורית · רדיוס 250 מייל ימי · תאים מתצפיות שביקרת על פני {minutes} דק׳",
|
||||
"Retrying automatically at {time} UTC": "מנסה שוב אוטומטית ב-{time} UTC",
|
||||
"Retrying automatically after provider cooldown": "מנסה שוב אוטומטית אחרי תקופת ההמתנה של הספק",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "מתעדכן אוטומטית אחרי הזזה או זום ופעם בדקה. הפיד הציבורי מכסה מעגל של 250 מייל ימי סביב מרכז התצוגה; זום החוצה לא הופך אותו לתמונת-מצב עולמית. תאים ריקים נמצאים מחוץ לדגימה או שאין בהם די תצפיות.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "ציון דיוק נמוך = 100 × מקס(0, פגומים − 1) / סה\"כ: מטוס אחד מנוכה, ולכן זה אינו השבר הגולמי. לתאים דרושים {aircraft} מטוסים על פני {minutes} דקות. אנומליות שלמות ניווט אינן זיהוי של שיבוש או הטעיה.",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "מתעדכן אוטומטית אחרי הזזה או זום ופעם בדקה. הפיד הציבורי מכסה מעגל של 250 מייל ימי סביב מרכז התצוגה; זום החוצה לא הופך אותו לתמונת-מצב עולמית. באזורים ריקים אף מטוס לא דיווח על דיוק הניווט שלו בחלון הזמן.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "ציון דיוק נמוך = 100 × מקס(0, פגומים − 1) / סה\"כ: מטוס אחד מנוכה, ולכן זה אינו השבר הגולמי. אנומליות שלמות ניווט אינן זיהוי של שיבוש או הטעיה.",
|
||||
"GNSS snapshot needs a view anchor": "תמונת מצב GNSS דורשת עוגן תצוגה",
|
||||
"GNSS feed rate limited (HTTP 429)": "פיד GNSS מוגבל בקצב (HTTP 429)",
|
||||
"Malformed GNSS integrity snapshot": "תמונת מצב שלמות GNSS פגומה",
|
||||
|
||||
@@ -861,8 +861,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "Campione regionale · raggio di 250 NM · celle dalle viste visitate negli ultimi {minutes} min",
|
||||
"Retrying automatically at {time} UTC": "Nuovo tentativo automatico alle {time} UTC",
|
||||
"Retrying automatically after provider cooldown": "Nuovo tentativo automatico dopo la pausa del provider",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "Si aggiorna automaticamente dopo uno spostamento o uno zoom e una volta al minuto. Il feed pubblico copre un cerchio di 250 miglia nautiche attorno al centro della vista; allontanare lo zoom non lo rende un'istantanea mondiale. Le celle vuote sono fuori dalla copertura campionata o hanno osservazioni insufficienti.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Indice di bassa precisione = 100 × max(0, anomali − 1) / totale: dal conteggio degli aerei anomali si sottrae un aereo, quindi non è la percentuale grezza. Le celle richiedono {aircraft} aerei in {minutes} minuti. Le anomalie di integrità della navigazione non costituiscono un rilevamento di jamming o spoofing.",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "Si aggiorna automaticamente dopo uno spostamento o uno zoom e una volta al minuto. Il feed pubblico copre un cerchio di 250 miglia nautiche attorno al centro della vista; allontanare lo zoom non lo rende un'istantanea mondiale. Nelle aree vuote nessun aereo ha comunicato la propria precisione di navigazione nella finestra.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Indice di bassa precisione = 100 × max(0, anomali − 1) / totale: dal conteggio degli aerei anomali si sottrae un aereo, quindi non è la percentuale grezza. Le anomalie di integrità della navigazione non costituiscono un rilevamento di jamming o spoofing.",
|
||||
"GNSS snapshot needs a view anchor": "Lo snapshot GNSS richiede un punto di riferimento della vista",
|
||||
"GNSS feed rate limited (HTTP 429)": "Limite di richieste del feed GNSS raggiunto (HTTP 429)",
|
||||
"Malformed GNSS integrity snapshot": "Snapshot di integrità GNSS non valido",
|
||||
|
||||
@@ -833,8 +833,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "地域サンプル · 半径250海里 · 過去{minutes}分間に表示したビューのセル",
|
||||
"Retrying automatically at {time} UTC": "{time} UTCに自動で再試行します",
|
||||
"Retrying automatically after provider cooldown": "プロバイダーのクールダウン後に自動で再試行します",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "パンやズームの後、および1分ごとに自動で更新されます。公開フィードは表示中心から半径250海里の円をカバーします。ズームアウトしても全世界のスナップショットにはなりません。空白のセルは、サンプリング範囲外か観測が不十分です。",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "低精度スコア = 100 × max(0, bad − 1) / total:航空機1機分を差し引くため、単純な割合ではありません。セルには{minutes}分間で{aircraft}機の航空機が必要です。航法インテグリティの異常は、妨害(ジャミング)やなりすまし(スプーフィング)を検出したことを意味しません。",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "パンやズームの後、および1分ごとに自動で更新されます。公開フィードは表示中心から半径250海里の円をカバーします。ズームアウトしても全世界のスナップショットにはなりません。空白の区域では、期間内に航法精度を報告した航空機がありませんでした。",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "低精度スコア = 100 × max(0, bad − 1) / total:航空機1機分を差し引くため、単純な割合ではありません。航法インテグリティの異常は、妨害(ジャミング)やなりすまし(スプーフィング)を検出したことを意味しません。",
|
||||
"GNSS snapshot needs a view anchor": "GNSSスナップショットにはビューのアンカーが必要です",
|
||||
"GNSS feed rate limited (HTTP 429)": "GNSSフィードがレート制限中です(HTTP 429)",
|
||||
"Malformed GNSS integrity snapshot": "GNSSインテグリティのスナップショットの形式が不正です",
|
||||
|
||||
@@ -859,8 +859,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "Amostra regional · raio de 250 NM · células das áreas visualizadas nos últimos {minutes} min",
|
||||
"Retrying automatically at {time} UTC": "Nova tentativa automática às {time} UTC",
|
||||
"Retrying automatically after provider cooldown": "Nova tentativa automática após a pausa do provedor",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "Atualiza automaticamente após mover ou dar zoom e uma vez por minuto. O feed público cobre um círculo de 250 milhas náuticas ao redor do centro da vista; afastar o zoom não o transforma em um snapshot mundial. Células vazias estão fora da cobertura amostrada ou não têm observações suficientes.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Índice de baixa precisão = 100 × max(0, ruins − 1) / total: uma aeronave é descontada, então não é a proporção bruta. Cada célula precisa de {aircraft} aeronaves em {minutes} minutos. Anomalias de integridade de navegação não são detecção de interferência (jamming) nem de falsificação (spoofing).",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "Atualiza automaticamente após mover ou dar zoom e uma vez por minuto. O feed público cobre um círculo de 250 milhas náuticas ao redor do centro da vista; afastar o zoom não o transforma em um snapshot mundial. Nas áreas vazias, nenhuma aeronave informou sua precisão de navegação na janela.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Índice de baixa precisão = 100 × max(0, ruins − 1) / total: uma aeronave é descontada, então não é a proporção bruta. Anomalias de integridade de navegação não são detecção de interferência (jamming) nem de falsificação (spoofing).",
|
||||
"GNSS snapshot needs a view anchor": "O snapshot GNSS precisa de um ponto de referência da vista",
|
||||
"GNSS feed rate limited (HTTP 429)": "Feed GNSS: limite de requisições atingido (HTTP 429)",
|
||||
"Malformed GNSS integrity snapshot": "Snapshot de integridade GNSS malformado",
|
||||
|
||||
@@ -2372,8 +2372,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "Региональная выборка · радиус 250 мор. миль · ячейки из просмотренных видов за {minutes} мин",
|
||||
"Retrying automatically at {time} UTC": "Автоматический повтор в {time} UTC",
|
||||
"Retrying automatically after provider cooldown": "Автоматический повтор после паузы провайдера",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "Обновляется автоматически после сдвига или масштабирования карты и раз в минуту. Публичный поток данных охватывает круг радиусом 250 морских миль вокруг центра вида; при отдалении карта не становится снимком всего мира. Пустые ячейки — вне охвата выборки или с недостаточным числом наблюдений.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Доля неточных = 100 × max(0, неточные − 1) / всего: один самолёт не учитывается, поэтому это не прямая доля. Для ячейки нужно самолётов: {aircraft} за {minutes} мин. Аномалии целостности навигации — не обнаружение глушения или подмены сигнала.",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "Обновляется автоматически после сдвига или масштабирования карты и раз в минуту. Публичный поток данных охватывает круг радиусом 250 морских миль вокруг центра вида; при отдалении карта не становится снимком всего мира. В пустых областях за это окно ни один самолёт не сообщил точность навигации.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Доля неточных = 100 × max(0, неточные − 1) / всего: один самолёт не учитывается, поэтому это не прямая доля. Аномалии целостности навигации — не обнаружение глушения или подмены сигнала.",
|
||||
"SQUAWK {code} · {status}": "СКВОК {code} · {status}",
|
||||
"ADS-B PRIORITY · {status}": "ADS-B ПРИОРИТЕТ · {status}",
|
||||
"ADS-B EMERGENCY · {status}": "ADS-B АВАРИЯ · {status}",
|
||||
|
||||
@@ -1545,8 +1545,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "Regionalt urval · radie 250 NM · celler från besökta vyer under {minutes} min",
|
||||
"Retrying automatically at {time} UTC": "Försöker igen automatiskt kl. {time} UTC",
|
||||
"Retrying automatically after provider cooldown": "Försöker igen automatiskt när leverantörens spärrtid är över",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "Uppdateras automatiskt efter panorering eller zoomning och en gång i minuten. Det öppna flödet täcker en cirkel på 250 nautiska mil runt vyns mitt; att zooma ut gör det inte till en global ögonblicksbild. Tomma celler ligger utanför den samplade täckningen eller har för få observationer.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Värdet för låg noggrannhet = 100 × max(0, dåliga − 1) / totalt: ett luftfartyg räknas bort, så detta är inte den råa andelen. Cellerna kräver {aircraft} luftfartyg under {minutes} minuter. Avvikelser i navigeringsintegriteten innebär inte att störsändning eller vilseledning (jamming eller spoofing) har upptäckts.",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "Uppdateras automatiskt efter panorering eller zoomning och en gång i minuten. Det öppna flödet täcker en cirkel på 250 nautiska mil runt vyns mitt; att zooma ut gör det inte till en global ögonblicksbild. I tomma områden rapporterade inget flygplan sin navigeringsnoggrannhet under fönstret.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Värdet för låg noggrannhet = 100 × max(0, dåliga − 1) / totalt: ett luftfartyg räknas bort, så detta är inte den råa andelen. Avvikelser i navigeringsintegriteten innebär inte att störsändning eller vilseledning (jamming eller spoofing) har upptäckts.",
|
||||
"GNSS snapshot needs a view anchor": "GNSS-ögonblicksbilden behöver ett vyankare",
|
||||
"GNSS feed rate limited (HTTP 429)": "GNSS-flödet har nått gränsen för förfrågningar (HTTP 429)",
|
||||
"Malformed GNSS integrity snapshot": "Felformaterad ögonblicksbild av GNSS-integritet",
|
||||
|
||||
@@ -874,8 +874,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "Регіональна вибірка · радіус 250 мор. миль · комірки з переглянутих ділянок карти за {minutes} хв",
|
||||
"Retrying automatically at {time} UTC": "Автоматичний повтор о {time} UTC",
|
||||
"Retrying automatically after provider cooldown": "Автоматичний повтор після паузи постачальника",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "Оновлюється автоматично після зсуву чи масштабування карти та раз на хвилину. Публічний потік даних охоплює коло радіусом 250 морських миль навколо центру карти; у разі віддалення карта не стає знімком усього світу. Порожні комірки — поза охопленням вибірки або з недостатньою кількістю спостережень.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Показник неточності = 100 × max(0, неточні − 1) / усього: один літак не враховується, тож це не пряма частка літаків із неточними навігаційними даними. Мінімальна кількість літаків у комірці за {minutes} хв: {aircraft}. Аномалії цілісності навігації не означають виявлення глушіння чи підміни сигналу.",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "Оновлюється автоматично після зсуву чи масштабування карти та раз на хвилину. Публічний потік даних охоплює коло радіусом 250 морських миль навколо центру карти; у разі віддалення карта не стає знімком усього світу. У порожніх областях за це вікно жоден літак не повідомив точність навігації.",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "Показник неточності = 100 × max(0, неточні − 1) / усього: один літак не враховується, тож це не пряма частка літаків із неточними навігаційними даними. Аномалії цілісності навігації не означають виявлення глушіння чи підміни сигналу.",
|
||||
"GNSS snapshot needs a view anchor": "Для знімка GNSS потрібна опорна точка на карті",
|
||||
"GNSS feed rate limited (HTTP 429)": "Потік GNSS: перевищено ліміт запитів (HTTP 429)",
|
||||
"Malformed GNSS integrity snapshot": "Некоректний знімок цілісності GNSS",
|
||||
|
||||
@@ -810,8 +810,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "区域采样 · 半径 250 海里 · {minutes} 分钟内浏览过的视野中的网格",
|
||||
"Retrying automatically at {time} UTC": "将于 {time} UTC 自动重试",
|
||||
"Retrying automatically after provider cooldown": "服务商冷却结束后自动重试",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "平移或缩放后以及每分钟自动更新。公共数据源覆盖以视野中心为圆心、半径 250 海里的范围;缩小地图并不会使其成为全球快照。空白网格位于采样覆盖范围之外,或观测数据不足。",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "低精度评分 = 100 × max(0, bad − 1) / total:扣除一架飞机,因此并非原始占比。每个网格需在 {minutes} 分钟内有 {aircraft} 架飞机。导航完好性异常不等于检测到干扰或欺骗。",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "平移或缩放后以及每分钟自动更新。公共数据源覆盖以视野中心为圆心、半径 250 海里的范围;缩小地图并不会使其成为全球快照。空白区域在该时间窗内没有飞机报告导航精度。",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "低精度评分 = 100 × max(0, bad − 1) / total:扣除一架飞机,因此并非原始占比。导航完好性异常不等于检测到干扰或欺骗。",
|
||||
"GNSS snapshot needs a view anchor": "GNSS 快照需要视图锚点",
|
||||
"GNSS feed rate limited (HTTP 429)": "GNSS 数据源已被限流(HTTP 429)",
|
||||
"Malformed GNSS integrity snapshot": "GNSS 完好性快照格式错误",
|
||||
|
||||
@@ -805,8 +805,8 @@
|
||||
"Regional sample · 250 nm radius · cells from visited views over {minutes} min": "區域採樣 · 半徑 250 海里 · {minutes} 分鐘內瀏覽過的視野中的網格",
|
||||
"Retrying automatically at {time} UTC": "將於 {time} UTC 自動重試",
|
||||
"Retrying automatically after provider cooldown": "服務商冷卻結束後自動重試",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.": "平移或縮放後以及每分鐘自動更新。公共數據源覆蓋以視野中心為圓心、半徑 250 海里的範圍;縮小地圖並不會使其成為全球快照。空白網格位於採樣覆蓋範圍之外,或觀測數據不足。",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "低精度評分 = 100 × max(0, bad − 1) / total:扣除一架飛機,因此並非原始佔比。每個網格需在 {minutes} 分鐘內有 {aircraft} 架飛機。導航完好性異常不等於檢測到干擾或欺騙。",
|
||||
"Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.": "平移或縮放後以及每分鐘自動更新。公共數據源覆蓋以視野中心為圓心、半徑 250 海里的範圍;縮小地圖並不會使其成為全球快照。空白區域在該時間窗內沒有飛機報告導航精度。",
|
||||
"Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.": "低精度評分 = 100 × max(0, bad − 1) / total:扣除一架飛機,因此並非原始佔比。導航完好性異常不等於檢測到干擾或欺騙。",
|
||||
"GNSS snapshot needs a view anchor": "GNSS 快照需要視圖錨點",
|
||||
"GNSS feed rate limited (HTTP 429)": "GNSS 數據源已被限流(HTTP 429)",
|
||||
"Malformed GNSS integrity snapshot": "GNSS 完好性快照格式錯誤",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { stickyNumber, stickyText } from '../../data/aircraftMeta.js';
|
||||
import { courseFromFixes } from '../../data/courseFromFixes.js';
|
||||
import {
|
||||
geoidSurfaceLastResortM,
|
||||
pickRenderAltitudeM,
|
||||
@@ -291,6 +292,12 @@ export class FlightRecords {
|
||||
observation.positionTimeMs > 0
|
||||
? observation.positionTimeMs
|
||||
: this.now();
|
||||
const course = courseFromFixes(prevMeta?.courseAnchor, {
|
||||
lat,
|
||||
lon,
|
||||
ms: fixEpochMs,
|
||||
speedMps: velocity,
|
||||
});
|
||||
const meta = {
|
||||
sourceReference: observation.reference,
|
||||
observedReceiptMs: this.now(),
|
||||
@@ -309,7 +316,14 @@ export class FlightRecords {
|
||||
// applies to contacts that actually flew this session.
|
||||
wasAirborne: prevMeta?.wasAirborne === true || !onGround,
|
||||
velocity: stickyNumber(velocity, prevMeta?.velocity, 0),
|
||||
true_track: stickyNumber(true_track, prevMeta?.true_track, 0),
|
||||
// With no reported track or true heading, a moving contact faces the
|
||||
// way its fixes went (src/data/courseFromFixes.js); else the last one.
|
||||
true_track: stickyNumber(
|
||||
true_track,
|
||||
course.courseDeg ?? prevMeta?.true_track,
|
||||
0,
|
||||
),
|
||||
courseAnchor: course.anchor,
|
||||
category: cat,
|
||||
// An adsbdb-enriched type code outranks the coarse OpenSky category.
|
||||
klass: classifyAircraft({
|
||||
|
||||
@@ -319,3 +319,49 @@ test('a ground vehicle or station with no altitude stands on the ground; an airc
|
||||
).meta;
|
||||
assert.equal(unloaded.onGround, false);
|
||||
});
|
||||
|
||||
test('a contact reported with no course faces the way its newer fixes went', () => {
|
||||
const store = records();
|
||||
const T = 1700000000000;
|
||||
const taxi = (latitude, seconds, fields = {}) =>
|
||||
store.receive(
|
||||
observation({
|
||||
latitude,
|
||||
longitude: -97.6588,
|
||||
courseDeg: null,
|
||||
onGround: true,
|
||||
speedMps: 8,
|
||||
positionTimeMs: T + seconds * 1000,
|
||||
...fields,
|
||||
}),
|
||||
view(),
|
||||
);
|
||||
const course = () => store.data.get('abc123').true_track;
|
||||
taxi(30.1908, 0);
|
||||
assert.equal(course(), 0, 'nothing known yet');
|
||||
// Fixes a second apart, 8 m each: they add up until 30 m are covered.
|
||||
taxi(30.19073, 1);
|
||||
taxi(30.19066, 2);
|
||||
assert.equal(course(), 0, 'under 30 m: still nothing');
|
||||
taxi(30.19059, 3);
|
||||
taxi(30.19052, 4);
|
||||
assert.ok(Math.abs(course() - 180) < 0.1, 'southbound');
|
||||
// An older fix from another feed, behind it: never turns it around.
|
||||
taxi(30.1912, 2);
|
||||
assert.ok(Math.abs(course() - 180) < 0.1, 'an older fix gives no course');
|
||||
taxi(30.1901, 8);
|
||||
assert.ok(Math.abs(course() - 180) < 0.1);
|
||||
// Standing (reported under 2 m/s) with 40 m of position noise: kept.
|
||||
taxi(30.18974, 12, { speedMps: 0.5, longitude: -97.6584 });
|
||||
assert.ok(
|
||||
Math.abs(course() - 180) < 0.1,
|
||||
'a standing contact keeps its course',
|
||||
);
|
||||
// A reported course always wins.
|
||||
taxi(30.189, 16, { courseDeg: 175 });
|
||||
assert.equal(course(), 175);
|
||||
// A reset forgets where it was: it starts again from north.
|
||||
store.reset();
|
||||
taxi(30.188, 20);
|
||||
assert.equal(course(), 0);
|
||||
});
|
||||
@@ -7,10 +7,10 @@ import { formatNumber, msg, t } from '../../i18n/index.js';
|
||||
import { translateFeedError } from '../../ui/statusText.js';
|
||||
import {
|
||||
GNSS_LEVEL_COLORS,
|
||||
GNSS_MIN_AIRCRAFT,
|
||||
GNSS_WINDOW_MS,
|
||||
accumulateGnssObservations,
|
||||
binGnssCells,
|
||||
gnssCellRing,
|
||||
gnssProvenance,
|
||||
pruneGnssObservations,
|
||||
} from './records.js';
|
||||
@@ -74,7 +74,7 @@ export function defaultGnssViewAnchor(viewer) {
|
||||
|
||||
/**
|
||||
* Own one GNSS navigation-integrity display: rolling integrity observations
|
||||
* around the views the user visits, binned into cells coloured by the
|
||||
* around the views the user visits, binned into H3 hexagons coloured by the
|
||||
* gpsjam low-accuracy score. Share links retain token 3.
|
||||
*/
|
||||
export function createGnssIntegrityLayer({
|
||||
@@ -190,20 +190,19 @@ export function createGnssIntegrityLayer({
|
||||
if (signature === _signature) return;
|
||||
_signature = signature;
|
||||
_fills.set(
|
||||
_cells.map((cell) => ({
|
||||
id: `${layer.id}:${cell.id}`,
|
||||
geometry: {
|
||||
kind: 'rectangle',
|
||||
rect: {
|
||||
west: cell.west,
|
||||
south: cell.south,
|
||||
east: cell.east,
|
||||
north: cell.north,
|
||||
},
|
||||
},
|
||||
fill: hexColor(GNSS_LEVEL_COLORS[cell.level], FILL_ALPHA[cell.level]),
|
||||
height: 'clampGround',
|
||||
})),
|
||||
_cells.map((cell) => {
|
||||
const ring = gnssCellRing(cell);
|
||||
const positions = [];
|
||||
for (let i = 0; i < ring.length; i += 2)
|
||||
positions.push({ lon: ring[i], lat: ring[i + 1] });
|
||||
return {
|
||||
id: `${layer.id}:${cell.id}`,
|
||||
// H3 edges are great-circle arcs, as a polygon's edges are drawn.
|
||||
geometry: { kind: 'polygon', rings: [positions] },
|
||||
fill: hexColor(GNSS_LEVEL_COLORS[cell.level], FILL_ALPHA[cell.level]),
|
||||
height: 'clampGround',
|
||||
};
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -386,7 +385,7 @@ export function createGnssIntegrityLayer({
|
||||
}`
|
||||
: ''),
|
||||
infoTitle: t(
|
||||
'Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank cells are outside sampled coverage or have insufficient observations.',
|
||||
'Updates automatically after pan or zoom and once a minute. The public feed covers a 250-nautical-mile circle around the view centre; zooming out does not make it a worldwide snapshot. Blank areas had no aircraft reporting navigation accuracy in the window.',
|
||||
),
|
||||
legend: ['high', 'medium', 'low'].map((level, index) => ({
|
||||
label: t(LEVEL_LABELS[level]),
|
||||
@@ -395,11 +394,7 @@ export function createGnssIntegrityLayer({
|
||||
...(index === 0
|
||||
? {
|
||||
blurb: t(
|
||||
'Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Cells need {aircraft} aircraft over {minutes} minutes. Navigation-integrity anomalies are not a detection of jamming or spoofing.',
|
||||
{
|
||||
aircraft: formatNumber(GNSS_MIN_AIRCRAFT),
|
||||
minutes: formatNumber(provenance.window.minutes),
|
||||
},
|
||||
'Low-accuracy score = 100 × max(0, bad − 1) / total: one aircraft is discounted, so this is not the raw share. Navigation-integrity anomalies are not a detection of jamming or spoofing.',
|
||||
),
|
||||
}
|
||||
: {}),
|
||||
|
||||
@@ -69,8 +69,8 @@ function harness(
|
||||
const MIN = 60_000;
|
||||
const threeHealthy = () => [
|
||||
row('a1', 1.1, false),
|
||||
row('a2', 1.2, false),
|
||||
row('a3', 1.3, false),
|
||||
row('a2', 1.12, false),
|
||||
row('a3', 1.14, false),
|
||||
];
|
||||
|
||||
const flush = () => new Promise((resolve) => setImmediate(resolve));
|
||||
@@ -246,25 +246,29 @@ test('an enabled refresh bins the snapshot into coloured ground cells', async ()
|
||||
assert.equal(fills().show, true);
|
||||
assert.equal(await layer.update(), true);
|
||||
const cells = [...fills().items.values()];
|
||||
assert.equal(cells.length, 1, 'the one-aircraft cell is withheld');
|
||||
assert.equal(cells[0].id, 'gnss-integrity:280:420');
|
||||
assert.deepEqual(cells[0].geometry, {
|
||||
kind: 'rectangle',
|
||||
rect: { west: 30, south: 50, east: 30.5, north: 50.5 },
|
||||
});
|
||||
assert.equal(cells[0].height, 'clampGround');
|
||||
assert.equal(cells.length, 2, 'a one-aircraft cell is shown too');
|
||||
assert.deepEqual(
|
||||
cells.map(({ id }) => id),
|
||||
['gnss-integrity:841e631ffffffff', 'gnss-integrity:841f6b3ffffffff'],
|
||||
);
|
||||
for (const cell of cells) {
|
||||
assert.equal(cell.geometry.kind, 'polygon');
|
||||
assert.equal(cell.geometry.rings.length, 1);
|
||||
assert.equal(cell.geometry.rings[0].length, 6, 'a hexagon');
|
||||
assert.equal(cell.height, 'clampGround');
|
||||
}
|
||||
assert.equal(fills().spec.pickable, false, 'cells never take part in picks');
|
||||
const stats = layer.getStats();
|
||||
assert.equal(stats.count, 1);
|
||||
assert.equal(stats.count, 2);
|
||||
assert.equal(stats.error, null);
|
||||
assert.equal(stats.fallback, false);
|
||||
const { legend } = layer.getRowControls();
|
||||
assert.deepEqual(
|
||||
legend.map(({ count }) => count),
|
||||
[1, 0, 0],
|
||||
[1, 0, 1],
|
||||
);
|
||||
assert.match(legend[0].blurb, /not a detection/);
|
||||
assert.match(legend[0].blurb, /need 3 aircraft/);
|
||||
assert.doesNotMatch(legend[0].blurb, /need \d+ aircraft/);
|
||||
});
|
||||
|
||||
test('the visible layer leads with low navigation accuracy and exposes its provenance', async () => {
|
||||
@@ -296,10 +300,10 @@ test('the visible layer leads with low navigation accuracy and exposes its prove
|
||||
assert.deepEqual(layer.provenance.window, {
|
||||
minutes: 30,
|
||||
scope: 'visited-view',
|
||||
cellDeg: 0.5,
|
||||
minAircraft: 3,
|
||||
definedBy: 'GEV',
|
||||
});
|
||||
assert.equal(layer.provenance.aggregation.grid, 'h3');
|
||||
assert.equal(layer.provenance.aggregation.h3Resolution, 4);
|
||||
assert.equal(layer.provenance.interpretation.validated, false);
|
||||
assert.equal(layer.getStats().provenance, layer.provenance);
|
||||
});
|
||||
@@ -311,8 +315,8 @@ test('a failed refresh keeps the last cells and reports the error', async () =>
|
||||
return {
|
||||
rows: [
|
||||
row('a1', 1.1, false),
|
||||
row('a2', 1.2, false),
|
||||
row('a3', 1.3, false),
|
||||
row('a2', 1.12, false),
|
||||
row('a3', 1.14, false),
|
||||
],
|
||||
stale: true,
|
||||
};
|
||||
@@ -339,7 +343,11 @@ test('observations expire with the window, and disable aborts the request in fli
|
||||
layer.enable();
|
||||
let result = layer.update();
|
||||
pending.resolve({
|
||||
rows: [row('a1', 1.1, false), row('a2', 1.2, false), row('a3', 1.3, false)],
|
||||
rows: [
|
||||
row('a1', 1.1, false),
|
||||
row('a2', 1.12, false),
|
||||
row('a3', 1.14, false),
|
||||
],
|
||||
});
|
||||
assert.equal(await result, true);
|
||||
assert.equal(layer.getStats().count, 1);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Low navigation accuracy reported by ADS-B aircraft, binned into cells.
|
||||
* Low navigation accuracy reported by ADS-B aircraft, binned into H3 cells.
|
||||
*
|
||||
* Aircraft broadcasting DO-260 version 1/2 ADS-B report how much they trust
|
||||
* their own position: NIC (integrity containment radius) and NACp (position
|
||||
@@ -16,9 +16,12 @@
|
||||
* from the US 14 CFR 91.227(c) ADS-B Out performance minima, which are not
|
||||
* a published interference classifier) or the readsb/tar1090 `gpsOkBefore`
|
||||
* flag. gpsjam.org does not publish its per-aircraft threshold.
|
||||
* - Cell aggregation: gpsjam.org's published formula and 2% / 10% bands.
|
||||
* - Cell aggregation: gpsjam.org's published formula, 2% / 10% bands and
|
||||
* hex grid (H3 resolution 4). Every cell with an aircraft is shown, as on
|
||||
* gpsjam.org; the one-aircraft discount is the only small-sample guard.
|
||||
* - Window: a GEV-defined rolling 30 minutes over the views the user visits.
|
||||
*/
|
||||
import { cellToBoundary, cellToLatLng, latLngToCell } from 'h3-js';
|
||||
|
||||
/** Position source can switch to MLAT after GPS loss; quality must remain aircraft-reported. */
|
||||
const QUALIFYING_TYPES = new Set(['adsb_icao', 'mlat']);
|
||||
@@ -30,10 +33,8 @@ export const GNSS_NIC_THRESHOLD = 7;
|
||||
export const GNSS_NACP_THRESHOLD = 8;
|
||||
/** Positions older than this are not current evidence of the local sky. */
|
||||
const MAX_POSITION_AGE_S = 60;
|
||||
/** Cell edge in degrees: roughly 55 km north-south, similar in area to an H3 res-4 cell. */
|
||||
export const GNSS_CELL_DEG = 0.5;
|
||||
/** Hide sparse one- and two-aircraft cells; the aggregation separately discounts one bad report. */
|
||||
export const GNSS_MIN_AIRCRAFT = 3;
|
||||
/** H3 resolution of the cells, gpsjam.org's grid: hexagons of about 1,770 km² (22.6 km edge). */
|
||||
export const GNSS_H3_RESOLUTION = 4;
|
||||
/** Rolling window over which aircraft seen in a cell are counted. */
|
||||
export const GNSS_WINDOW_MS = 30 * 60_000;
|
||||
/** gpsjam.org band edges, in percent of aircraft (after discounting one). */
|
||||
@@ -68,14 +69,14 @@ export function gnssProvenance({ windowMs = GNSS_WINDOW_MS } = {}) {
|
||||
id: 'gpsjam-cell-bands',
|
||||
formula: '100 * max(0, bad - 1) / total',
|
||||
bands: Object.freeze([GNSS_MEDIUM_PERCENT, GNSS_HIGH_PERCENT]),
|
||||
grid: 'h3',
|
||||
h3Resolution: GNSS_H3_RESOLUTION,
|
||||
source: 'https://gpsjam.org/faq',
|
||||
definedBy: 'gpsjam.org',
|
||||
}),
|
||||
window: Object.freeze({
|
||||
minutes: windowMs / 60_000,
|
||||
scope: 'visited-view',
|
||||
cellDeg: GNSS_CELL_DEG,
|
||||
minAircraft: GNSS_MIN_AIRCRAFT,
|
||||
definedBy: 'GEV',
|
||||
}),
|
||||
state: Object.freeze({
|
||||
@@ -161,11 +162,30 @@ export function normalizeGnssAircraft(payload) {
|
||||
return rows;
|
||||
}
|
||||
|
||||
/** Stable key of the cell containing a position. */
|
||||
export function gnssCellKey(lat, lon, cellDeg = GNSS_CELL_DEG) {
|
||||
const row = Math.floor((Math.min(lat, 89.999999) + 90) / cellDeg);
|
||||
const col = Math.floor((Math.min(lon, 179.999999) + 180) / cellDeg);
|
||||
return `${row}:${col}`;
|
||||
/** Stable key of the cell containing a position: its H3 index. */
|
||||
export function gnssCellKey(lat, lon, resolution = GNSS_H3_RESOLUTION) {
|
||||
return latLngToCell(lat, lon, resolution);
|
||||
}
|
||||
|
||||
/**
|
||||
* The ring to draw for a cell, as flat `[lon, lat, lon, lat, ...]` degrees.
|
||||
* Longitudes are unwrapped to within 180° of the cell centre, so a cell
|
||||
* across the antimeridian stays one narrow polygon (some longitudes then lie
|
||||
* just outside ±180°) instead of spanning the globe. A cell around a pole
|
||||
* keeps its full turn of longitudes; drawn on the globe it is still small.
|
||||
*
|
||||
* @param {{lat: number, lon: number, boundary: {lat: number, lon: number}[]}} cell
|
||||
* @returns {number[]}
|
||||
*/
|
||||
export function gnssCellRing(cell) {
|
||||
const ring = [];
|
||||
for (const { lat, lon } of cell.boundary) {
|
||||
let unwrapped = lon;
|
||||
while (unwrapped - cell.lon > 180) unwrapped -= 360;
|
||||
while (unwrapped - cell.lon < -180) unwrapped += 360;
|
||||
ring.push(unwrapped, lat);
|
||||
}
|
||||
return ring;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -183,7 +203,7 @@ export function gnssCellKey(lat, lon, cellDeg = GNSS_CELL_DEG) {
|
||||
* @param {Map<string, {cell: string, seenAt: number, degradedAt: number|null}>} store
|
||||
* @param {ReturnType<typeof normalizeGnssAircraft>} rows
|
||||
* @param {number} nowMs
|
||||
* @param {{windowMs?: number, cellDeg?: number, observedAt?: number}} [options]
|
||||
* @param {{windowMs?: number, resolution?: number, observedAt?: number}} [options]
|
||||
* `observedAt` is the snapshot's observation time (defaults to `nowMs`;
|
||||
* a future time is clamped to `nowMs`, a non-finite one adds nothing).
|
||||
* @returns {Map} The same store, pruned to the window.
|
||||
@@ -194,7 +214,7 @@ export function accumulateGnssObservations(
|
||||
nowMs,
|
||||
{
|
||||
windowMs = GNSS_WINDOW_MS,
|
||||
cellDeg = GNSS_CELL_DEG,
|
||||
resolution = GNSS_H3_RESOLUTION,
|
||||
observedAt = nowMs,
|
||||
} = {},
|
||||
) {
|
||||
@@ -202,7 +222,7 @@ export function accumulateGnssObservations(
|
||||
if (Number.isFinite(at) && nowMs - at <= windowMs) {
|
||||
for (const row of rows || []) {
|
||||
if (!Number.isFinite(row?.lat) || !Number.isFinite(row?.lon)) continue;
|
||||
const cell = gnssCellKey(row.lat, row.lon, cellDeg);
|
||||
const cell = gnssCellKey(row.lat, row.lon, resolution);
|
||||
const key = `${row.hex}|${cell}`;
|
||||
const previous = store.get(key);
|
||||
const previousDegradedAt = previous?.degradedAt ?? null;
|
||||
@@ -264,16 +284,16 @@ export function gnssIntegrityLevel(total, degraded) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Aggregate the observation store into displayable cells. Expects a store
|
||||
* already pruned to the window by `accumulateGnssObservations` or
|
||||
* `pruneGnssObservations`.
|
||||
* Aggregate the observation store into displayable cells, one per H3 cell
|
||||
* with at least one aircraft (gpsjam.org has no minimum count). Expects a
|
||||
* store already pruned to the window by `accumulateGnssObservations` or
|
||||
* `pruneGnssObservations`. `lat`/`lon` is the cell centre and `boundary` its
|
||||
* vertices in order (six for a hexagon, five for a pentagon), with
|
||||
* longitudes in -180..180; `gnssCellRing` gives the ring to draw.
|
||||
*
|
||||
* @returns {{id: string, south: number, west: number, north: number, east: number, lat: number, lon: number, aircraft: number, degraded: number, percentDegraded: number, level: 'low'|'medium'|'high', state: string, interpretation: string|null}[]}
|
||||
* @returns {{id: string, lat: number, lon: number, boundary: {lat: number, lon: number}[], aircraft: number, degraded: number, percentDegraded: number, level: 'low'|'medium'|'high', state: string, interpretation: string|null}[]}
|
||||
*/
|
||||
export function binGnssCells(
|
||||
store,
|
||||
{ cellDeg = GNSS_CELL_DEG, minAircraft = GNSS_MIN_AIRCRAFT } = {},
|
||||
) {
|
||||
export function binGnssCells(store) {
|
||||
const tallies = new Map();
|
||||
for (const { cell, degradedAt } of store.values()) {
|
||||
const tally = tallies.get(cell) || { aircraft: 0, degraded: 0 };
|
||||
@@ -283,22 +303,16 @@ export function binGnssCells(
|
||||
}
|
||||
const cells = [];
|
||||
for (const [id, { aircraft, degraded }] of tallies) {
|
||||
if (aircraft < minAircraft) continue;
|
||||
const [row, col] = id.split(':').map(Number);
|
||||
const south = row * cellDeg - 90;
|
||||
const west = col * cellDeg - 180;
|
||||
const [lat, lon] = cellToLatLng(id);
|
||||
const { percent, level, state, interpretation } = gnssIntegrityLevel(
|
||||
aircraft,
|
||||
degraded,
|
||||
);
|
||||
cells.push({
|
||||
id,
|
||||
south,
|
||||
west,
|
||||
north: south + cellDeg,
|
||||
east: west + cellDeg,
|
||||
lat: south + cellDeg / 2,
|
||||
lon: west + cellDeg / 2,
|
||||
lat,
|
||||
lon,
|
||||
boundary: cellToBoundary(id).map(([lat, lon]) => ({ lat, lon })),
|
||||
aircraft,
|
||||
degraded,
|
||||
percentDegraded: Math.round(percent * 10) / 10,
|
||||
|
||||
@@ -1,12 +1,17 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import test from 'node:test';
|
||||
import { getResolution, isPentagon, isValidCell } from 'h3-js';
|
||||
import {
|
||||
accumulateGnssObservations,
|
||||
binGnssCells,
|
||||
GNSS_CLASSIFIER,
|
||||
GNSS_H3_RESOLUTION,
|
||||
GNSS_HIGH_PERCENT,
|
||||
GNSS_MEDIUM_PERCENT,
|
||||
GNSS_PROVENANCE,
|
||||
GNSS_WINDOW_MS,
|
||||
gnssCellKey,
|
||||
gnssCellRing,
|
||||
gnssIntegrityLevel,
|
||||
gnssProvenance,
|
||||
normalizeGnssAircraft,
|
||||
@@ -117,13 +122,87 @@ test('low NIC, low NACp or a readsb GPS-loss flag each mark an aircraft degraded
|
||||
);
|
||||
});
|
||||
|
||||
test('cell keys are stable half-degree bins, clamped at the poles and antimeridian', () => {
|
||||
assert.equal(gnssCellKey(50.1, 19.9), gnssCellKey(50.4, 19.6));
|
||||
assert.notEqual(gnssCellKey(50.1, 19.9), gnssCellKey(50.6, 19.9));
|
||||
assert.equal(gnssCellKey(90, 180), gnssCellKey(89.9, 179.9));
|
||||
assert.equal(gnssCellKey(-90, -180), '0:0');
|
||||
// Just south-west of the origin falls in the last cell before 0°, not cell 0.
|
||||
assert.equal(gnssCellKey(-0.1, -0.1), '179:359');
|
||||
test('cell keys are the H3 resolution-4 cells gpsjam.org uses', () => {
|
||||
assert.equal(GNSS_H3_RESOLUTION, 4);
|
||||
// Kraków: a known lat/lon lands in its known res-4 hexagon.
|
||||
assert.equal(gnssCellKey(50.1, 19.9), '841e2e7ffffffff');
|
||||
assert.equal(getResolution(gnssCellKey(50.1, 19.9)), 4);
|
||||
// Nearby points share the hexagon; a point ~50 km north does not.
|
||||
assert.equal(gnssCellKey(50.1, 19.9), gnssCellKey(50.12, 19.95));
|
||||
assert.notEqual(gnssCellKey(50.1, 19.9), gnssCellKey(50.55, 19.9));
|
||||
// The poles and both sides of the antimeridian still key valid cells.
|
||||
for (const [lat, lon] of [
|
||||
[90, 180],
|
||||
[-90, -180],
|
||||
[0, 179.99],
|
||||
[0, -179.99],
|
||||
]) {
|
||||
const key = gnssCellKey(lat, lon);
|
||||
assert.ok(isValidCell(key), `${lat},${lon} → ${key}`);
|
||||
assert.equal(getResolution(key), 4);
|
||||
}
|
||||
});
|
||||
|
||||
const cellAt = (lat, lon) => {
|
||||
const store = new Map();
|
||||
accumulateGnssObservations(
|
||||
store,
|
||||
[{ hex: 'c1', lat, lon, degraded: false }],
|
||||
0,
|
||||
);
|
||||
return binGnssCells(store)[0];
|
||||
};
|
||||
|
||||
test('a cell carries its H3 centre and hexagon boundary', () => {
|
||||
const cell = cellAt(50.1, 19.9);
|
||||
assert.equal(cell.id, '841e2e7ffffffff');
|
||||
assert.ok(Math.abs(cell.lat - 50.17184) < 1e-4);
|
||||
assert.ok(Math.abs(cell.lon - 20.12566) < 1e-4);
|
||||
assert.equal(cell.boundary.length, 6);
|
||||
for (const { lat, lon } of cell.boundary) {
|
||||
// Res-4 hexagons are about 45 km across.
|
||||
assert.ok(Math.abs(lat - cell.lat) < 0.4, `lat ${lat}`);
|
||||
assert.ok(Math.abs(lon - cell.lon) < 0.6, `lon ${lon}`);
|
||||
}
|
||||
for (const key of ['south', 'west', 'north', 'east'])
|
||||
assert.equal(key in cell, false, `no rectangle field ${key}`);
|
||||
assert.deepEqual(
|
||||
gnssCellRing(cell),
|
||||
cell.boundary.flatMap(({ lat, lon }) => [lon, lat]),
|
||||
);
|
||||
});
|
||||
|
||||
test('a cell across the antimeridian is drawn as one narrow polygon', () => {
|
||||
for (const lon of [179.99, -179.99]) {
|
||||
const cell = cellAt(0, lon);
|
||||
const lons = cell.boundary.map((vertex) => vertex.lon);
|
||||
assert.ok(
|
||||
Math.max(...lons) - Math.min(...lons) > 300,
|
||||
'the raw boundary straddles ±180°',
|
||||
);
|
||||
const drawn = gnssCellRing(cell).filter((_, index) => index % 2 === 0);
|
||||
const width = Math.max(...drawn) - Math.min(...drawn);
|
||||
assert.ok(width < 1, `drawn width ${width}° stays narrow`);
|
||||
for (const value of drawn) assert.ok(Math.abs(value - cell.lon) < 1);
|
||||
}
|
||||
});
|
||||
|
||||
test('pentagon and polar cells give closed rings', () => {
|
||||
// 8408001ffffffff is one of the twelve res-4 pentagons.
|
||||
const pentagon = cellAt(64.7, 10.5);
|
||||
assert.ok(isPentagon(pentagon.id));
|
||||
assert.equal(pentagon.boundary.length, 5);
|
||||
assert.equal(gnssCellRing(pentagon).length, 10);
|
||||
for (const lat of [89.99, -89.99]) {
|
||||
const polar = cellAt(lat, 10);
|
||||
assert.ok(polar.boundary.length >= 6);
|
||||
for (const vertex of polar.boundary)
|
||||
assert.ok(Math.abs(vertex.lat) > 89 && Math.abs(vertex.lat) <= 90);
|
||||
// Unwrapped longitudes stay within half a turn of the centre.
|
||||
gnssCellRing(polar)
|
||||
.filter((_, index) => index % 2 === 0)
|
||||
.forEach((value) => assert.ok(Math.abs(value - polar.lon) <= 180));
|
||||
}
|
||||
});
|
||||
|
||||
test('integrity level follows the gpsjam.org published cell formula and bands', () => {
|
||||
@@ -156,8 +235,8 @@ test('the primary state is a navigation-integrity anomaly; interference is only
|
||||
store,
|
||||
[
|
||||
{ hex: 'h1', lat: 10.1, lon: 10.1, degraded: true },
|
||||
{ hex: 'h2', lat: 10.2, lon: 10.2, degraded: true },
|
||||
{ hex: 'h3', lat: 10.3, lon: 10.3, degraded: false },
|
||||
{ hex: 'h2', lat: 10.11, lon: 10.11, degraded: true },
|
||||
{ hex: 'h3', lat: 10.12, lon: 10.12, degraded: false },
|
||||
],
|
||||
0,
|
||||
);
|
||||
@@ -182,14 +261,14 @@ test('provenance separates the GEV classifier from the gpsjam aggregation and th
|
||||
id: 'gpsjam-cell-bands',
|
||||
formula: '100 * max(0, bad - 1) / total',
|
||||
bands: [2, 10],
|
||||
grid: 'h3',
|
||||
h3Resolution: 4,
|
||||
source: 'https://gpsjam.org/faq',
|
||||
definedBy: 'gpsjam.org',
|
||||
});
|
||||
assert.deepEqual(GNSS_PROVENANCE.window, {
|
||||
minutes: 30,
|
||||
scope: 'visited-view',
|
||||
cellDeg: 0.5,
|
||||
minAircraft: 3,
|
||||
definedBy: 'GEV',
|
||||
});
|
||||
assert.equal(GNSS_PROVENANCE.state.id, 'navigation-integrity-anomaly');
|
||||
@@ -225,14 +304,13 @@ test('observations count each aircraft once per cell and expire after the window
|
||||
assert.equal(cell.aircraft, 3);
|
||||
assert.equal(cell.degraded, 1);
|
||||
assert.equal(cell.level, 'low');
|
||||
assert.deepEqual(
|
||||
[cell.south, cell.west, cell.north, cell.east],
|
||||
[50, 20, 50.5, 20.5],
|
||||
);
|
||||
assert.equal(cell.id, gnssCellKey(50.2, 20.1));
|
||||
|
||||
accumulateGnssObservations(store, [], 1200, { windowMs: 1000 });
|
||||
assert.equal(store.size, 1);
|
||||
assert.deepEqual(binGnssCells(store), []);
|
||||
[cell] = binGnssCells(store);
|
||||
assert.equal(cell.aircraft, 1, 'only a1, seen inside the window, remains');
|
||||
assert.equal(cell.degraded, 0);
|
||||
});
|
||||
|
||||
const MIN = 60_000;
|
||||
@@ -396,22 +474,66 @@ test('rows without finite coordinates never key a cell', () => {
|
||||
assert.equal(store.size, 0);
|
||||
});
|
||||
|
||||
test('cells below the minimum aircraft count are withheld', () => {
|
||||
test('every cell with an aircraft is shown, as on gpsjam.org; only the bad − 1 discount guards small samples', () => {
|
||||
const store = new Map();
|
||||
accumulateGnssObservations(
|
||||
store,
|
||||
[
|
||||
{ hex: 'b1', lat: 10.1, lon: 10.1, degraded: true },
|
||||
{ hex: 'b2', lat: 10.2, lon: 10.2, degraded: true },
|
||||
],
|
||||
[{ hex: 'b1', lat: 10.1, lon: 10.1, degraded: true }],
|
||||
0,
|
||||
);
|
||||
assert.deepEqual(binGnssCells(store), []);
|
||||
const [cell] = binGnssCells(store, { minAircraft: 2 });
|
||||
let [cell] = binGnssCells(store);
|
||||
assert.equal(cell.aircraft, 1);
|
||||
assert.equal(cell.level, 'low', 'one bad aircraft is discounted');
|
||||
assert.equal(cell.percentDegraded, 0);
|
||||
accumulateGnssObservations(
|
||||
store,
|
||||
[{ hex: 'b2', lat: 10.12, lon: 10.12, degraded: true }],
|
||||
0,
|
||||
);
|
||||
[cell] = binGnssCells(store);
|
||||
assert.equal(cell.aircraft, 2);
|
||||
assert.equal(cell.level, 'high');
|
||||
assert.equal(cell.percentDegraded, 50);
|
||||
});
|
||||
|
||||
test('the gpsjam bands are unchanged by the hex grid', () => {
|
||||
assert.equal(GNSS_MEDIUM_PERCENT, 2);
|
||||
assert.equal(GNSS_HIGH_PERCENT, 10);
|
||||
// [total, bad] → level, at and either side of both band edges.
|
||||
for (const [total, bad, level] of [
|
||||
[100, 0, 'low'],
|
||||
[100, 1, 'low'],
|
||||
[100, 2, 'low'],
|
||||
[100, 3, 'medium'],
|
||||
[50, 2, 'medium'],
|
||||
[100, 11, 'medium'],
|
||||
[100, 12, 'high'],
|
||||
[10, 2, 'medium'],
|
||||
[10, 3, 'high'],
|
||||
])
|
||||
assert.equal(
|
||||
gnssIntegrityLevel(total, bad).level,
|
||||
level,
|
||||
`${bad}/${total}`,
|
||||
);
|
||||
// Binned cells band the same way: 3 bad of 10 in one hexagon is high.
|
||||
const store = new Map();
|
||||
accumulateGnssObservations(
|
||||
store,
|
||||
Array.from({ length: 10 }, (_, index) => ({
|
||||
hex: `h${index}`,
|
||||
lat: 50.1,
|
||||
lon: 19.9,
|
||||
degraded: index < 3,
|
||||
})),
|
||||
0,
|
||||
);
|
||||
const [cell] = binGnssCells(store);
|
||||
assert.equal(cell.id, '841e2e7ffffffff');
|
||||
assert.equal(cell.level, 'high');
|
||||
assert.equal(cell.percentDegraded, 20);
|
||||
});
|
||||
|
||||
test('MLAT GPS-loss evidence uses the last good GNSS location and ignores MLAT NIC', () => {
|
||||
const [row] = normalizeGnssAircraft({
|
||||
ac: [
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { pickRenderAltitudeM } from '../../data/renderAltitude.js';
|
||||
import { stickyText, stickyNumber } from '../../data/aircraftMeta.js';
|
||||
import { courseFromFixes } from '../../data/courseFromFixes.js';
|
||||
import { classifyAircraft } from '../../data/aircraftClass.js';
|
||||
import { aircraftEmergency } from '../../data/aircraftEmergency.js';
|
||||
import {
|
||||
@@ -175,6 +176,12 @@ export class MilitaryFlightRecords {
|
||||
// last-known-good (bounded by the layer's eviction, which deletes the entry).
|
||||
const stickyType = stickyText(type, prevMeta?.type);
|
||||
const fixEpochMs = aircraft.positionTimeMs ?? observedAtMs;
|
||||
const course = courseFromFixes(prevMeta?.courseAnchor, {
|
||||
lat,
|
||||
lon,
|
||||
ms: fixEpochMs,
|
||||
speedMps: aircraft.speedMps,
|
||||
});
|
||||
const meta = {
|
||||
sourceReference: aircraft.reference,
|
||||
observedReceiptMs: this.now(),
|
||||
@@ -206,7 +213,14 @@ export class MilitaryFlightRecords {
|
||||
onGround ? 0 : prevMeta?.speedMps,
|
||||
0,
|
||||
),
|
||||
track: stickyNumber(aircraft.courseDeg, prevMeta?.track, 0),
|
||||
// With no reported track or true heading, a moving contact faces the
|
||||
// way its fixes went (src/data/courseFromFixes.js); else the last one.
|
||||
track: stickyNumber(
|
||||
aircraft.courseDeg,
|
||||
course.courseDeg ?? prevMeta?.track,
|
||||
0,
|
||||
),
|
||||
courseAnchor: course.anchor,
|
||||
// Analyst seam (additive): sticky like the other kinematics.
|
||||
verticalRateMps: stickyNumber(
|
||||
verticalRateMps,
|
||||
|
||||
@@ -269,3 +269,26 @@ test('a repeated military fix time marks the contact as not updated; removal is
|
||||
records.forget('aaa001');
|
||||
assert.equal(records.fixRepeated.has('aaa001'), false);
|
||||
});
|
||||
|
||||
test('a military contact reported with no course faces the way its newer fixes went', () => {
|
||||
const records = store();
|
||||
const T = 1700000000000;
|
||||
const taxi = (latitude, seconds) =>
|
||||
records.receive(
|
||||
observation({
|
||||
latitude,
|
||||
onGround: true,
|
||||
baroAltitudeM: null,
|
||||
courseDeg: null,
|
||||
speedMps: 8,
|
||||
positionTimeMs: T + seconds * 1000,
|
||||
}),
|
||||
context({ observedAtMs: T + seconds * 1000 + 500 }),
|
||||
);
|
||||
assert.equal(taxi(39, 0).meta.track, 0);
|
||||
assert.ok(Math.abs(taxi(38.9995, 5).meta.track - 180) < 0.1);
|
||||
assert.ok(
|
||||
Math.abs(taxi(39.002, 3).meta.track - 180) < 0.1,
|
||||
'an older fix gives no course',
|
||||
);
|
||||
});
|
||||
@@ -55,37 +55,36 @@ export function vesselPositionAt(record, tMs) {
|
||||
|
||||
const RAD = Math.PI / 180;
|
||||
|
||||
/** The point `fraction` of the way from one position to another. */
|
||||
/** The point `fraction` of the way from one position to another. It runs
|
||||
* for every drawn vessel as the clock plays, so it builds no arrays. */
|
||||
function greatCircleAt(lat1, lon1, lat2, lon2, fraction) {
|
||||
const p1 = unit(lat1, lon1);
|
||||
const p2 = unit(lat2, lon2);
|
||||
const dot = Math.min(
|
||||
1,
|
||||
Math.max(-1, p1[0] * p2[0] + p1[1] * p2[1] + p1[2] * p2[2]),
|
||||
);
|
||||
const phi1 = lat1 * RAD;
|
||||
const lambda1 = lon1 * RAD;
|
||||
const phi2 = lat2 * RAD;
|
||||
const lambda2 = lon2 * RAD;
|
||||
const cos1 = Math.cos(phi1);
|
||||
const cos2 = Math.cos(phi2);
|
||||
const x1 = cos1 * Math.cos(lambda1);
|
||||
const y1 = cos1 * Math.sin(lambda1);
|
||||
const z1 = Math.sin(phi1);
|
||||
const x2 = cos2 * Math.cos(lambda2);
|
||||
const y2 = cos2 * Math.sin(lambda2);
|
||||
const z2 = Math.sin(phi2);
|
||||
const dot = Math.min(1, Math.max(-1, x1 * x2 + y1 * y2 + z1 * z2));
|
||||
const angle = Math.acos(dot);
|
||||
if (angle < 1e-12) return { lat: lat2, lon: lon2 };
|
||||
const a = Math.sin((1 - fraction) * angle) / Math.sin(angle);
|
||||
const b = Math.sin(fraction * angle) / Math.sin(angle);
|
||||
const x = a * p1[0] + b * p2[0];
|
||||
const y = a * p1[1] + b * p2[1];
|
||||
const z = a * p1[2] + b * p2[2];
|
||||
const sinAngle = Math.sin(angle);
|
||||
const a = Math.sin((1 - fraction) * angle) / sinAngle;
|
||||
const b = Math.sin(fraction * angle) / sinAngle;
|
||||
const x = a * x1 + b * x2;
|
||||
const y = a * y1 + b * y2;
|
||||
const z = a * z1 + b * z2;
|
||||
return {
|
||||
lat: Math.atan2(z, Math.hypot(x, y)) / RAD,
|
||||
lon: Math.atan2(y, x) / RAD,
|
||||
};
|
||||
}
|
||||
|
||||
function unit(lat, lon) {
|
||||
const phi = lat * RAD;
|
||||
const lambda = lon * RAD;
|
||||
return [
|
||||
Math.cos(phi) * Math.cos(lambda),
|
||||
Math.cos(phi) * Math.sin(lambda),
|
||||
Math.sin(phi),
|
||||
];
|
||||
}
|
||||
|
||||
// Whether each fixes array moves, read once per array: records keep theirs
|
||||
// until a snapshot brings new ones.
|
||||
const moving = new WeakMap();
|
||||
|
||||
@@ -375,8 +375,7 @@ test('following the clock moves drawn vessels in place each world time, prepares
|
||||
const before = visuals.map((visual) => ({ ...visual.position }));
|
||||
const positions = visuals.map((visual) => visual.position);
|
||||
|
||||
// The first pass also moves hidden vessels, so the next stays within
|
||||
// HIDDEN_FOLLOW_MS of it.
|
||||
// The first pass moves hidden vessels too.
|
||||
layer.testing._runClockPassForTest(10_000);
|
||||
mono += 16;
|
||||
layer.testing._runClockPassForTest(20_000);
|
||||
@@ -390,10 +389,7 @@ test('following the clock moves drawn vessels in place each world time, prepares
|
||||
);
|
||||
assert.equal(timers.size, 1, 'moving vessels ask for a frame');
|
||||
|
||||
// The hidden vessel waits for HIDDEN_FOLLOW_MS.
|
||||
mono += 16;
|
||||
layer.testing._runClockPassForTest(30_000);
|
||||
assert.deepEqual({ ...visuals[1].position }, hiddenAt);
|
||||
// Hidden vessels move a share each pass, each within HIDDEN_FOLLOW_MS.
|
||||
mono += 250;
|
||||
layer.testing._runClockPassForTest(40_000);
|
||||
assert.notDeepEqual({ ...visuals[1].position }, hiddenAt);
|
||||
@@ -466,3 +462,263 @@ test('following the clock, a vessel draws no icon before it was there, and draws
|
||||
layer.testing._runVisibilityPassForTest(true);
|
||||
assert.equal(shown(), true, 'half a minute before it: reaching it');
|
||||
});
|
||||
|
||||
/** Motion north along a meridian off Rotterdam, `toMs` after the epoch. */
|
||||
const northbound = (toLat, toMs) => ({
|
||||
fromLat: 51.93,
|
||||
fromLon: 4.05,
|
||||
fromMs: 0,
|
||||
toLat,
|
||||
toLon: 4.05,
|
||||
toMs,
|
||||
});
|
||||
|
||||
/** Put the double camera `heightM` above `lon`/`lat`, as Cesium's camera
|
||||
* reports its position in both forms. */
|
||||
function placeCamera(camera, lon, lat, heightM) {
|
||||
camera.positionWC = Cesium.Cartesian3.fromDegrees(lon, lat, heightM);
|
||||
camera.positionCartographic = Cesium.Cartographic.fromDegrees(
|
||||
lon,
|
||||
lat,
|
||||
heightM,
|
||||
);
|
||||
}
|
||||
|
||||
/** Stand in a page with no overlay host element, for the label pass. */
|
||||
function noOverlayDocument(t) {
|
||||
const originalDocument = globalThis.document;
|
||||
globalThis.document = { getElementById: () => null };
|
||||
t.after(() => {
|
||||
if (originalDocument === undefined) delete globalThis.document;
|
||||
else globalThis.document = originalDocument;
|
||||
});
|
||||
}
|
||||
|
||||
test('following the clock, drawn vessels move again once the fastest would have moved half a pixel, a second has gone by or the camera changed height', (t) => {
|
||||
let mono = 0;
|
||||
t.mock.method(performance, 'now', () => mono);
|
||||
noOverlayDocument(t);
|
||||
const { layer, camera } = setup();
|
||||
// 20 km above, in a 1,000 px tall view about 57° tall: half a pixel is
|
||||
// about 11 m. The vessel makes about 1.9 m a second of world time.
|
||||
placeCamera(camera, 4.05, 51.93, 20_000);
|
||||
camera.frustum = { fovy: 1 };
|
||||
const record = {
|
||||
mmsi: '111',
|
||||
lat: 51.93,
|
||||
lon: 4.05,
|
||||
motion: northbound(51.94, 600_000),
|
||||
};
|
||||
const viewer = { camera, scene: {}, canvas: { clientHeight: 1000 } };
|
||||
bindFakeCesiumScene(viewer);
|
||||
layer.testing._setVesselStateForTest({ viewer, records: [record] });
|
||||
const visual = layer.testing._prepareVesselVisualForTest(record);
|
||||
// Drawn: on the camera's side of the horizon.
|
||||
visual.visible = true;
|
||||
const at = () => ({ ...visual.position });
|
||||
const pass = (atMs, wallMs = 16) => {
|
||||
mono += wallMs;
|
||||
layer.testing._runClockPassForTest(atMs);
|
||||
};
|
||||
// Two passes a world second apart measure how fast it moves on screen.
|
||||
pass(10_000);
|
||||
pass(11_000);
|
||||
let drawn = at();
|
||||
// A few metres more stay under half a pixel: it is left where it is.
|
||||
pass(12_000);
|
||||
pass(14_000);
|
||||
assert.deepEqual(at(), drawn);
|
||||
// About 13 m on from where it was drawn: it moves.
|
||||
pass(18_000);
|
||||
assert.notDeepEqual(at(), drawn);
|
||||
drawn = at();
|
||||
// Under half a pixel, but a second later: it moves.
|
||||
pass(19_000, 1_000);
|
||||
assert.notDeepEqual(at(), drawn);
|
||||
drawn = at();
|
||||
pass(20_000);
|
||||
assert.deepEqual(at(), drawn);
|
||||
// Under half a pixel, but the camera came down by half: it moves.
|
||||
placeCamera(camera, 4.05, 51.93, 10_000);
|
||||
pass(21_000);
|
||||
assert.notDeepEqual(at(), drawn);
|
||||
// Scrubbed well back, it moves back at once.
|
||||
drawn = at();
|
||||
pass(1_000);
|
||||
assert.notDeepEqual(at(), drawn);
|
||||
});
|
||||
|
||||
test('a vessel is drawn lifted above the sea surface, its waterline on it, as Cesium places them', () => {
|
||||
const { layer, camera } = setup();
|
||||
const record = { mmsi: '111', lat: 51.93, lon: 4.05 };
|
||||
const viewer = { camera, scene: {} };
|
||||
bindFakeCesiumScene(viewer);
|
||||
layer.testing._setVesselStateForTest({ viewer, records: [record] });
|
||||
const visual = layer.testing._prepareVesselVisualForTest(record);
|
||||
const heightOf = (position) =>
|
||||
Cesium.Ellipsoid.WGS84.cartesianToCartographic(
|
||||
new Cesium.Cartesian3(position.x, position.y, position.z),
|
||||
).height;
|
||||
const close = (actual, expected) =>
|
||||
assert.ok(
|
||||
Cesium.Cartesian3.distance(
|
||||
new Cesium.Cartesian3(actual.x, actual.y, actual.z),
|
||||
expected,
|
||||
) < 1e-6,
|
||||
`${JSON.stringify(actual)} is not ${expected}`,
|
||||
);
|
||||
close(
|
||||
visual.position,
|
||||
Cesium.Cartesian3.fromDegrees(4.05, 51.93, heightOf(visual.position)),
|
||||
);
|
||||
close(
|
||||
visual.waterline,
|
||||
Cesium.Cartesian3.fromDegrees(4.05, 51.93, heightOf(visual.waterline)),
|
||||
);
|
||||
assert.ok(heightOf(visual.position) > heightOf(visual.waterline));
|
||||
});
|
||||
|
||||
test('following the clock, a pass moves hidden vessels in proportion to the wall time since the last, so all move within HIDDEN_FOLLOW_MS', (t) => {
|
||||
let mono = 0;
|
||||
t.mock.method(performance, 'now', () => mono);
|
||||
noOverlayDocument(t);
|
||||
const { layer, camera } = setup();
|
||||
const records = Array.from({ length: 100 }, (_, i) => ({
|
||||
mmsi: String(i),
|
||||
lat: 51.93,
|
||||
lon: 4.05,
|
||||
motion: northbound(51.94, 600_000),
|
||||
}));
|
||||
const viewer = { camera, scene: {}, canvas: { clientHeight: 1000 } };
|
||||
bindFakeCesiumScene(viewer);
|
||||
layer.testing._setVesselStateForTest({ viewer, records });
|
||||
const visuals = records.map((record) =>
|
||||
layer.testing._prepareVesselVisualForTest(record),
|
||||
);
|
||||
// Hidden: past the horizon.
|
||||
for (const visual of visuals) visual.visible = false;
|
||||
layer.testing._runClockPassForTest(10_000);
|
||||
const moved = (atMs) => visuals.filter((v) => v.followedAtMs === atMs).length;
|
||||
assert.equal(moved(10_000), 100, 'the first pass moves them all');
|
||||
mono += 25;
|
||||
layer.testing._runClockPassForTest(20_000);
|
||||
assert.equal(moved(20_000), 10, 'a tenth of HIDDEN_FOLLOW_MS, a tenth');
|
||||
for (let i = 0; i < 9; i += 1) {
|
||||
mono += 25;
|
||||
layer.testing._runClockPassForTest(20_000);
|
||||
}
|
||||
assert.equal(moved(20_000), 100, 'all within HIDDEN_FOLLOW_MS');
|
||||
});
|
||||
|
||||
test('following the clock, the step gate measures each vessel from when it was drawn, and reopens for a pan, a zoom or a pause', (t) => {
|
||||
let mono = 0;
|
||||
t.mock.method(performance, 'now', () => mono);
|
||||
noOverlayDocument(t);
|
||||
const { layer, camera } = setup();
|
||||
placeCamera(camera, 4.05, 51.93, 20_000);
|
||||
camera.frustum = { fovy: 1 };
|
||||
const record = {
|
||||
mmsi: '111',
|
||||
lat: 51.93,
|
||||
lon: 4.05,
|
||||
motion: northbound(51.94, 600_000),
|
||||
};
|
||||
const viewer = { camera, scene: {}, canvas: { clientHeight: 1000 } };
|
||||
bindFakeCesiumScene(viewer);
|
||||
layer.testing._setVesselStateForTest({ viewer, records: [record] });
|
||||
const visual = layer.testing._prepareVesselVisualForTest(record);
|
||||
visual.visible = true;
|
||||
const at = () => ({ ...visual.position });
|
||||
const pass = (atMs) => {
|
||||
mono += 16;
|
||||
layer.testing._runClockPassForTest(atMs);
|
||||
};
|
||||
// About 0.08 px a world second: measured over a second.
|
||||
pass(10_000);
|
||||
pass(11_000);
|
||||
pass(13_000);
|
||||
// A snapshot draws it afresh just before the next pass: the pass after
|
||||
// it measures the move over that short time, not since 11 s.
|
||||
layer.testing._followClockForTest(17_900);
|
||||
layer.testing._prepareVesselVisualForTest(record);
|
||||
pass(18_000);
|
||||
let drawn = at();
|
||||
pass(19_000);
|
||||
assert.deepEqual(at(), drawn, 'the speed it measured is still its own');
|
||||
pass(24_500);
|
||||
assert.notDeepEqual(at(), drawn, 'and it moves once half a pixel is up');
|
||||
|
||||
// Panned sideways by more than a tenth of the camera's height: it moves.
|
||||
drawn = at();
|
||||
pass(25_000);
|
||||
assert.deepEqual(at(), drawn);
|
||||
placeCamera(camera, 4.1, 51.93, 20_000);
|
||||
pass(25_500);
|
||||
assert.notDeepEqual(at(), drawn);
|
||||
|
||||
// Zoomed in by narrowing the view: it moves.
|
||||
drawn = at();
|
||||
pass(26_000);
|
||||
assert.deepEqual(at(), drawn);
|
||||
camera.frustum = { fovy: 0.5 };
|
||||
pass(26_500);
|
||||
assert.notDeepEqual(at(), drawn);
|
||||
|
||||
// Paused just after a pass that left it short: the next frame at the same
|
||||
// time draws it where it is.
|
||||
drawn = at();
|
||||
pass(27_000);
|
||||
assert.deepEqual(at(), drawn);
|
||||
pass(27_000);
|
||||
assert.notDeepEqual(at(), drawn);
|
||||
const where = at();
|
||||
pass(27_000);
|
||||
assert.deepEqual(at(), where, 'then holds');
|
||||
});
|
||||
|
||||
test('following the clock, a vessel the visibility pass shows before the clock passes moved it is drawn at the time', (t) => {
|
||||
let mono = 0;
|
||||
t.mock.method(performance, 'now', () => mono);
|
||||
noOverlayDocument(t);
|
||||
const { layer, camera } = setup();
|
||||
placeCamera(camera, 4.05, 51.93, 20_000);
|
||||
camera.frustum = { fovy: 1 };
|
||||
const vessel = (mmsi) => ({
|
||||
mmsi,
|
||||
lat: 51.93,
|
||||
lon: 4.05,
|
||||
motion: northbound(52.93, 3_600_000),
|
||||
});
|
||||
const records = Array.from({ length: 40 }, (_, i) => vessel(String(i)));
|
||||
const last = records.at(-1);
|
||||
const viewer = { camera, scene: {}, canvas: { clientHeight: 1000 } };
|
||||
const { query } = bindFakeCesiumScene(viewer);
|
||||
// Every label off screen: the labels are not placed.
|
||||
query.projectMany = (_world, screen) => screen.fill(Number.NaN);
|
||||
layer.testing._setVesselStateForTest({ viewer, records });
|
||||
layer.testing._followClockForTest(0);
|
||||
const visual = layer.testing._prepareVesselVisualForTest(last);
|
||||
for (const record of records.slice(0, -1))
|
||||
layer.testing._prepareVesselVisualForTest(record);
|
||||
// Hidden until the visibility pass finds them in view.
|
||||
for (const record of records)
|
||||
layer.testing._vesselVisualForTest(record).visible = false;
|
||||
layer.testing._runClockPassForTest(10_000);
|
||||
// Paused, a seek far on: the next frame moves only a share of the hidden
|
||||
// vessels, not the last.
|
||||
mono += 16;
|
||||
layer.testing._runClockPassForTest(11_000);
|
||||
mono += 16;
|
||||
layer.testing._runClockPassForTest(1_800_000);
|
||||
assert.notEqual(visual.followedAtMs, 1_800_000);
|
||||
layer.testing._runVisibilityPassForTest(true);
|
||||
assert.equal(visual.visible, true);
|
||||
const { latitude } = Cesium.Ellipsoid.WGS84.cartesianToCartographic(
|
||||
new Cesium.Cartesian3(
|
||||
visual.position.x,
|
||||
visual.position.y,
|
||||
visual.position.z,
|
||||
),
|
||||
);
|
||||
assert.ok(Math.abs(Cesium.Math.toDegrees(latitude) - 52.43) < 1e-6);
|
||||
});
|
||||
@@ -45,8 +45,8 @@ import { isAidToNavigation } from '../../data/vesselTypes.js';
|
||||
const VESSEL_STEP_PX = 0.5;
|
||||
/** A frame is asked for at least this often while any drawn vessel moves. */
|
||||
const PLACEMENT_FRAME_MS = 1000;
|
||||
/** How often vessels not drawn move on as the world clock plays (wall ms),
|
||||
* so one that comes into view is judged where it is. */
|
||||
/** How often each vessel not drawn moves on as the world clock plays (wall
|
||||
* ms), so one that comes into view is judged where it is. */
|
||||
const HIDDEN_FOLLOW_MS = 250;
|
||||
|
||||
/** The ship artwork's own raster size (px). */
|
||||
@@ -57,6 +57,14 @@ let instances = 0;
|
||||
/** How often the vessels near enough for a model are gathered again (wall ms). */
|
||||
const MODEL_CANDIDATES_MS = 500;
|
||||
|
||||
/** How far the camera may move or change height, as a share of its height,
|
||||
* before vessels following the world clock move again however little they
|
||||
* moved. */
|
||||
const CAMERA_STEP = 0.1;
|
||||
/** The least height that share is taken of (metres), so a camera just above
|
||||
* the sea, or below the ellipsoid, still lets vessels rest between steps. */
|
||||
const CAMERA_STEP_FLOOR_M = 100;
|
||||
|
||||
/** Scratch for where a moved vessel was drawn. */
|
||||
const _movedFrom = vec();
|
||||
|
||||
@@ -98,6 +106,10 @@ export function createRendering({
|
||||
visual.waterline = anchorAt(lat, lon, 0);
|
||||
visual.drawnLat = lat;
|
||||
visual.drawnLon = lon;
|
||||
// The world time it is drawn at, while it follows the clock.
|
||||
visual.drawnAtMs = followsClock(vesselState)
|
||||
? vesselState.worldNow()
|
||||
: Number.NaN;
|
||||
return visual;
|
||||
}
|
||||
|
||||
@@ -523,12 +535,14 @@ export function createRendering({
|
||||
|
||||
// The layer does not hold the continuous render loop. Its passes run in
|
||||
// preRender, which idle mode fires only for rendered frames: moving vessels
|
||||
// ask for the frame that next moves them visibly (askMotionFrame), a forced
|
||||
// pass (new data, selection) requests its frame, a frame that moved the
|
||||
// camera but fell inside the 800 ms cadence leaves a trailing frame so the view the camera stopped on is always
|
||||
// evaluated, and the continuous hold is kept only while focus emphasis is
|
||||
// animating. The trailing frame is keyed to camera motion alone: the pass's
|
||||
// own label publication requests a frame, and scheduling on that would loop.
|
||||
// ask for the frame that next moves them visibly (askMotionFrame; while the
|
||||
// world clock plays, the scene draws every frame anyway), a forced pass
|
||||
// (new data, selection) requests its frame, a frame that moved the camera
|
||||
// but fell inside the 800 ms cadence leaves a trailing frame so the view
|
||||
// the camera stopped on is always evaluated, and the continuous hold is
|
||||
// kept only while focus emphasis is animating. The trailing frame is keyed
|
||||
// to camera motion alone: the pass's own label publication requests a
|
||||
// frame, and scheduling on that would loop.
|
||||
function installRuntime(viewer) {
|
||||
if (state.preRenderRemover || !viewer) return;
|
||||
state.preRenderRemover =
|
||||
@@ -542,37 +556,181 @@ export function createRendering({
|
||||
}) ?? null;
|
||||
}
|
||||
|
||||
// As the world clock plays, vessels between two fixes move on along them:
|
||||
// drawn ones every frame, each once per world time, hidden ones (which may
|
||||
// come into view) every HIDDEN_FOLLOW_MS.
|
||||
let hiddenFollowedAtWallMs = -Infinity;
|
||||
// As the world clock plays, vessels between two fixes move on along them.
|
||||
// Drawn ones move each world time once the fastest would have moved
|
||||
// VESSEL_STEP_PX on screen, at least once a second, and at once when the
|
||||
// camera moves or zooms (underClockStep). Hidden ones (which may come into
|
||||
// view) move a share of them each pass, so each moves at least every
|
||||
// HIDDEN_FOLLOW_MS without one frame moving them all. The scene renders as
|
||||
// fast as the display while the clock plays, and moving thousands of
|
||||
// vessels a fraction of a pixel each frame would take most of every frame.
|
||||
let hiddenFollowedAtWallMs = null;
|
||||
let hiddenCursor = 0;
|
||||
let clockPassAtMs = null;
|
||||
// Whether the last pass left drawn vessels short of its world time.
|
||||
let drawnBehind = false;
|
||||
function followClockPositions() {
|
||||
const atMs = vesselState.worldNow();
|
||||
const motion = startMotionPass();
|
||||
const moveHidden =
|
||||
motion.wallMs - hiddenFollowedAtWallMs >= HIDDEN_FOLLOW_MS;
|
||||
if (moveHidden) hiddenFollowedAtWallMs = motion.wallMs;
|
||||
for (const record of state.records.all) {
|
||||
if (!record.motion && !fixesMove(record.fixes)) continue;
|
||||
let visual = visualRecords.get(record);
|
||||
if (!visual?.position) {
|
||||
visual = prepareRecordVisual(record);
|
||||
visual.followedAtMs = atMs;
|
||||
syncRecordIcon(record);
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
visual.followedAtMs === atMs ||
|
||||
(!drawnNow(record, visual) && !moveHidden)
|
||||
)
|
||||
continue;
|
||||
visual.followedAtMs = atMs;
|
||||
const { lat, lon } = vesselPositionAt(record, atMs);
|
||||
// At either end of its fixes a vessel holds still.
|
||||
if (lat === visual.drawnLat && lon === visual.drawnLon) continue;
|
||||
moveDrawnVisual(record, visual, lat, lon, motion);
|
||||
const wallMs = performance.now();
|
||||
const all = state.records.all;
|
||||
// Each vessel moves once per world time; drawn ones a pass left short
|
||||
// move to it on the next, so a paused clock shows them where they are.
|
||||
const sameTime = atMs === clockPassAtMs;
|
||||
const moveDrawn = sameTime ? drawnBehind : !underClockStep(atMs, wallMs);
|
||||
clockPassAtMs = atMs;
|
||||
if (moveDrawn) drawnBehind = false;
|
||||
else if (!sameTime) {
|
||||
drawnBehind = true;
|
||||
askFrameIn(PLACEMENT_FRAME_MS);
|
||||
}
|
||||
const motion = moveDrawn ? startMotionPass() : null;
|
||||
if (moveDrawn)
|
||||
for (const record of all) followRecord(record, atMs, true, motion);
|
||||
// As much of the list as the wall time since the last pass is of
|
||||
// HIDDEN_FOLLOW_MS, going round it.
|
||||
const sinceMs =
|
||||
hiddenFollowedAtWallMs === null
|
||||
? HIDDEN_FOLLOW_MS
|
||||
: wallMs - hiddenFollowedAtWallMs;
|
||||
const share = Math.min(
|
||||
all.length,
|
||||
Math.ceil((all.length * Math.max(0, sinceMs)) / HIDDEN_FOLLOW_MS),
|
||||
);
|
||||
if (share > 0) hiddenFollowedAtWallMs = wallMs;
|
||||
for (let k = 0; k < share; k += 1) {
|
||||
if (hiddenCursor >= all.length) hiddenCursor = 0;
|
||||
followRecord(all[hiddenCursor], atMs, false, motionPass);
|
||||
hiddenCursor += 1;
|
||||
}
|
||||
if (!moveDrawn) return;
|
||||
askMotionFrame(motion);
|
||||
noteClockStep(atMs, motion);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw a vessel where it is at world time `atMs` if the clock passes have
|
||||
* not yet; true when it moved.
|
||||
*/
|
||||
function catchUpVisual(record, atMs) {
|
||||
const visual = visualRecords.get(record);
|
||||
if (!visual?.position || visual.followedAtMs === atMs) return false;
|
||||
if (!record.motion && !fixesMove(record.fixes)) return false;
|
||||
visual.followedAtMs = atMs;
|
||||
visual.drawnAtMs = atMs;
|
||||
const { lat, lon } = vesselPositionAt(record, atMs);
|
||||
if (lat === visual.drawnLat && lon === visual.drawnLon) return false;
|
||||
moveRecordVisual(record, visual, lat, lon);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Move a vessel to where it is at world time `atMs`, if it is drawn
|
||||
* (`drawn`) or hidden (not `drawn`) as asked; one with no visual yet is
|
||||
* prepared either way. A hidden vessel's move notes nothing in `motion`.
|
||||
*/
|
||||
function followRecord(record, atMs, drawn, motion) {
|
||||
if (!record.motion && !fixesMove(record.fixes)) return;
|
||||
let visual = visualRecords.get(record);
|
||||
if (!visual?.position) {
|
||||
visual = prepareRecordVisual(record);
|
||||
visual.followedAtMs = atMs;
|
||||
syncRecordIcon(record);
|
||||
return;
|
||||
}
|
||||
if (drawnNow(record, visual) !== drawn || visual.followedAtMs === atMs)
|
||||
return;
|
||||
visual.followedAtMs = atMs;
|
||||
const { lat, lon } = vesselPositionAt(record, atMs);
|
||||
const elapsedMs = Math.abs(atMs - visual.drawnAtMs);
|
||||
visual.drawnAtMs = atMs;
|
||||
// At either end of its fixes a vessel holds still.
|
||||
if (lat === visual.drawnLat && lon === visual.drawnLon) return;
|
||||
moveDrawnVisual(record, visual, lat, lon, motion, elapsedMs);
|
||||
}
|
||||
|
||||
// The clock pass that last moved drawn vessels: its world time and wall
|
||||
// time, how fast the fastest drawn vessel moved on screen (pixels per world
|
||||
// ms), and the camera then: where it was, its height and its view's size.
|
||||
const clockStep = {
|
||||
atMs: null,
|
||||
wallMs: 0,
|
||||
pxPerMs: Infinity,
|
||||
heightM: 0,
|
||||
eye: vec(),
|
||||
fovy: Number.NaN,
|
||||
width: Number.NaN,
|
||||
};
|
||||
|
||||
/** Measure, after a pass that moved drawn vessels, how fast the fastest
|
||||
* moved on screen: each over the world time since it was last drawn. */
|
||||
function noteClockStep(atMs, motion) {
|
||||
const pose = motion.pose;
|
||||
if (!motion.moving || motion.unmeasured || !pose?.position) {
|
||||
clockStep.atMs = null;
|
||||
return;
|
||||
}
|
||||
const pxPerMs = movedPixels({
|
||||
pose,
|
||||
angle: motion.angleRate,
|
||||
metres: motion.metresRate,
|
||||
});
|
||||
clockStep.pxPerMs = pxPerMs > 0 ? pxPerMs : Infinity;
|
||||
clockStep.atMs = atMs;
|
||||
clockStep.wallMs = motion.wallMs;
|
||||
clockStep.heightM = poseHeightM(pose);
|
||||
copyInto(pose.position, clockStep.eye);
|
||||
clockStep.fovy = pose.fovy;
|
||||
clockStep.width = viewWidth(pose);
|
||||
}
|
||||
|
||||
/** Forget how fast vessels moved, so the next clock pass moves the drawn
|
||||
* ones however little they moved (they were drawn somewhere else). */
|
||||
function forgetClockStep() {
|
||||
clockStep.atMs = null;
|
||||
clockPassAtMs = null;
|
||||
}
|
||||
|
||||
/** The width of the view (metres) of a camera with no field of view (an
|
||||
* orthographic one, `2 / m00`), NaN for one that has a field of view. */
|
||||
function viewWidth(pose) {
|
||||
if (pose.fovy > 0) return Number.NaN;
|
||||
try {
|
||||
return 2 / findCamera(state.viewer).matrices().projection[0];
|
||||
} catch {
|
||||
return Number.NaN;
|
||||
}
|
||||
}
|
||||
const sameNumber = (a, b) => a === b || (Number.isNaN(a) && Number.isNaN(b));
|
||||
|
||||
/** The camera's height above the ellipsoid (metres), NaN without one. */
|
||||
const poseHeightM = (pose) =>
|
||||
Number.isFinite(pose?.height) ? pose.height : Number.NaN;
|
||||
|
||||
/**
|
||||
* Whether the fastest drawn vessel would have moved less than
|
||||
* VESSEL_STEP_PX on screen since the clock pass that last moved them, at
|
||||
* the speed it moved then: drawn vessels are left where they are. They
|
||||
* move anyway once PLACEMENT_FRAME_MS has gone by, or once the camera has
|
||||
* moved or changed height by more than CAMERA_STEP of its height, or its
|
||||
* view has changed size (a pixel then covers another distance).
|
||||
*/
|
||||
function underClockStep(atMs, wallMs) {
|
||||
if (clockStep.atMs === null || !(clockStep.pxPerMs < Infinity))
|
||||
return false;
|
||||
if (wallMs - clockStep.wallMs >= PLACEMENT_FRAME_MS) return false;
|
||||
const pose = state.viewer ? findCamera(state.viewer)?.pose() : null;
|
||||
if (!pose?.position) return false;
|
||||
const limitM =
|
||||
CAMERA_STEP * Math.max(clockStep.heightM, CAMERA_STEP_FLOOR_M);
|
||||
if (!(Math.abs(poseHeightM(pose) - clockStep.heightM) <= limitM))
|
||||
return false;
|
||||
if (!(distance(pose.position, clockStep.eye) <= limitM)) return false;
|
||||
if (
|
||||
!sameNumber(pose.fovy, clockStep.fovy) ||
|
||||
!sameNumber(viewWidth(pose), clockStep.width)
|
||||
)
|
||||
return false;
|
||||
return Math.abs(atMs - clockStep.atMs) * clockStep.pxPerMs < VESSEL_STEP_PX;
|
||||
}
|
||||
|
||||
// Live with a host-supplied placement, vessels move on between refreshes:
|
||||
@@ -608,6 +766,9 @@ export function createRendering({
|
||||
moving: false,
|
||||
angle: 0,
|
||||
metres: 0,
|
||||
angleRate: 0,
|
||||
metresRate: 0,
|
||||
unmeasured: false,
|
||||
};
|
||||
function startMotionPass() {
|
||||
const wallMs = performance.now();
|
||||
@@ -619,6 +780,9 @@ export function createRendering({
|
||||
motionPass.moving = false;
|
||||
motionPass.angle = 0;
|
||||
motionPass.metres = 0;
|
||||
motionPass.angleRate = 0;
|
||||
motionPass.metresRate = 0;
|
||||
motionPass.unmeasured = false;
|
||||
motionPassWallMs = wallMs;
|
||||
return motionPass;
|
||||
}
|
||||
@@ -641,18 +805,27 @@ export function createRendering({
|
||||
);
|
||||
}
|
||||
|
||||
/** Move a drawn visual, noting how far it moved as seen from the camera. */
|
||||
function moveDrawnVisual(record, visual, lat, lon, motion) {
|
||||
/** Move a drawn visual, noting how far it moved as seen from the camera,
|
||||
* and, given the world time since it was last drawn (`elapsedMs`), how
|
||||
* fast. */
|
||||
function moveDrawnVisual(record, visual, lat, lon, motion, elapsedMs) {
|
||||
const from = copyInto(visual.position, _movedFrom);
|
||||
moveRecordVisual(record, visual, lat, lon);
|
||||
if (!drawnNow(record, visual)) return;
|
||||
motion.moving = true;
|
||||
const metres = distance(from, visual.position);
|
||||
motion.metres = Math.max(motion.metres, metres);
|
||||
const timed = elapsedMs > 0;
|
||||
if (elapsedMs !== undefined && !timed) motion.unmeasured = true;
|
||||
if (timed)
|
||||
motion.metresRate = Math.max(motion.metresRate, metres / elapsedMs);
|
||||
const eye = motionPose(motion)?.position;
|
||||
if (!eye) return;
|
||||
const range = distance(eye, from);
|
||||
if (range > 0) motion.angle = Math.max(motion.angle, metres / range);
|
||||
if (!(range > 0)) return;
|
||||
motion.angle = Math.max(motion.angle, metres / range);
|
||||
if (timed)
|
||||
motion.angleRate = Math.max(motion.angleRate, metres / range / elapsedMs);
|
||||
}
|
||||
|
||||
/** How far the fastest drawn vessel moved on screen in a pass (pixels):
|
||||
@@ -691,7 +864,12 @@ export function createRendering({
|
||||
const movedPx = movedPixels(motion);
|
||||
if (movedPx > 0 && motion.sinceMs > 0)
|
||||
waitMs = Math.min(waitMs, (VESSEL_STEP_PX * motion.sinceMs) / movedPx);
|
||||
// A frame already asked for no later than this one stands.
|
||||
askFrameIn(waitMs);
|
||||
}
|
||||
|
||||
/** Ask for a vessel frame `waitMs` from now; one already asked for no
|
||||
* later stands. */
|
||||
function askFrameIn(waitMs) {
|
||||
const runtime = vesselState._aisRuntime;
|
||||
const dueMs = runtime.now() + waitMs;
|
||||
if (placementFrameTimer !== null) {
|
||||
@@ -708,6 +886,9 @@ export function createRendering({
|
||||
/** Stop asking for placement frames (the layer turned off or went away). */
|
||||
function cancelPlacementFrame() {
|
||||
motionPassWallMs = null;
|
||||
forgetClockStep();
|
||||
drawnBehind = false;
|
||||
hiddenFollowedAtWallMs = null;
|
||||
if (placementFrameTimer === null) return;
|
||||
vesselState._aisRuntime.clearTimeout(placementFrameTimer);
|
||||
placementFrameTimer = null;
|
||||
@@ -790,9 +971,21 @@ export function createRendering({
|
||||
if (pose) vesselState._lastCamPoseSig = poseSignature(pose);
|
||||
const occluder = makeOccluder(pose);
|
||||
const labelCandidates = [];
|
||||
// The time the clock pass drew (a playing clock's time moves on within
|
||||
// the frame), so only vessels it did not reach are moved.
|
||||
const catchUpAtMs = worldMs === null ? null : (clockPassAtMs ?? worldMs);
|
||||
for (const record of state.records.all) {
|
||||
const visual = getVisual(record);
|
||||
visual.visible = isVisible(visual.cullPosition, occluder, record);
|
||||
// One in view that the clock passes have not moved to the time yet
|
||||
// (a seek while paused shows it before its turn) is moved there and
|
||||
// judged again: no later pass would move it while the clock rests.
|
||||
if (
|
||||
visual.visible &&
|
||||
catchUpAtMs !== null &&
|
||||
catchUpVisual(record, catchUpAtMs)
|
||||
)
|
||||
visual.visible = isVisible(visual.cullPosition, occluder, record);
|
||||
// A vessel the time drawn reaches (or leaves) shows (or hides) its icon.
|
||||
if (visual.seen !== seenYet(record)) syncRecordIcon(record);
|
||||
if (visual.visible) labelCandidates.push(record);
|
||||
@@ -1080,6 +1273,7 @@ export function createRendering({
|
||||
return {
|
||||
getVisual,
|
||||
iconPosition,
|
||||
forgetClockStep,
|
||||
prepareRecordVisual,
|
||||
anchorPosition,
|
||||
resetRecordVisuals,
|
||||
|
||||
@@ -70,7 +70,9 @@ export function createTracking({
|
||||
visual.drawnLat = NaN;
|
||||
visual.drawnLon = NaN;
|
||||
visual.followedAtMs = undefined;
|
||||
visual.drawnAtMs = Number.NaN;
|
||||
}
|
||||
components.rendering.forgetClockStep();
|
||||
// The rows moved with no poll behind them: draw the frame that shows it.
|
||||
governorRequestRender('ais-vessels-refloor');
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ function setup({ geoidN = 40, track = null } = {}) {
|
||||
getVisual: (record) => visuals.get(record) ?? record,
|
||||
anchorPosition: (record) => ({ anchoredAt: [record.lon, record.lat] }),
|
||||
syncRecordIcon: (record) => synced.push(record),
|
||||
forgetClockStep: () => synced.push('forgetClockStep'),
|
||||
},
|
||||
};
|
||||
const renders = [];
|
||||
@@ -135,7 +136,9 @@ test('refloor re-anchors every fixed record through the rendering part', () => {
|
||||
visuals.set(fixed, visual);
|
||||
tracking.refloorVesselRecords();
|
||||
assert.deepEqual(visual.position, { anchoredAt: [4.05, 51.9] });
|
||||
assert.deepEqual(synced, [fixed]);
|
||||
// Drawn somewhere else, the vessels move on the next clock pass however
|
||||
// little they would.
|
||||
assert.deepEqual(synced, [fixed, 'forgetClockStep']);
|
||||
assert.deepEqual(renders, ['ais-vessels-refloor']);
|
||||
});
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ import { bindRenderer } from '../rendererOf.js';
|
||||
import { FREE_LOOK_MAX_HEIGHT_METERS } from '../../globeInView.js';
|
||||
import { createCesiumInput } from './input.js';
|
||||
import { cesiumCapabilities, createCesiumPorts } from './ports.js';
|
||||
import { IDLE_FRAME_RATE } from '../../renderGovernor.js';
|
||||
import { cesiumMapEngine } from './mapEngine.js';
|
||||
import { installFreeLookHeightLimit } from './freeLookLimit.js';
|
||||
import { trimStaleSceneCommands } from './sceneCommandRelease.js';
|
||||
@@ -112,6 +113,8 @@ export function createCesiumRendererPlugin({
|
||||
capabilities = new ReadonlySet(cesiumCapabilities(viewer.scene));
|
||||
ports = createCesiumPorts(viewer, {
|
||||
capabilities,
|
||||
// Ticking at the display's rate only while anything moves.
|
||||
idleFps: IDLE_FRAME_RATE,
|
||||
credentials: { googleApiKey, googleTokens, worldDataToken },
|
||||
...(cameraController ? { cameraController } : {}),
|
||||
});
|
||||
|
||||
@@ -3,6 +3,7 @@ import test from 'node:test';
|
||||
import * as Cesium from 'cesium';
|
||||
import { CONTRACT_VERSION, checkRendererShape } from '../contract/index.js';
|
||||
import { rendererOf } from '../rendererOf.js';
|
||||
import { IDLE_FRAME_RATE } from '../../renderGovernor.js';
|
||||
import { cesiumMapEngine } from './mapEngine.js';
|
||||
import {
|
||||
ReadonlySet,
|
||||
@@ -168,6 +169,30 @@ test('the plugin wraps the viewer it is given, behind the accessor only', async
|
||||
assert.deepEqual(log, ['resize', 'destroy'], 'destroying twice is safe');
|
||||
});
|
||||
|
||||
test('the application’s loop ticks at the idle rate while nothing moves, and at the display’s while anything does', async (t) => {
|
||||
withDocument(t, fakeDocument());
|
||||
let viewer;
|
||||
const plugin = createCesiumRendererPlugin({
|
||||
createViewer() {
|
||||
viewer = fakeViewer([]);
|
||||
// The viewer starts at the idle rate (createApplicationViewer).
|
||||
viewer.targetFrameRate = IDLE_FRAME_RATE;
|
||||
return viewer;
|
||||
},
|
||||
});
|
||||
const renderer = await plugin.create({
|
||||
container: {},
|
||||
signal: new AbortController().signal,
|
||||
});
|
||||
assert.equal(viewer.targetFrameRate, IDLE_FRAME_RATE);
|
||||
assert.equal(renderer.frame.diagnostics().targetFps, 0, 'no cap');
|
||||
const release = renderer.frame.holdContinuous('flights');
|
||||
assert.equal(viewer.targetFrameRate, undefined);
|
||||
release();
|
||||
assert.equal(viewer.targetFrameRate, IDLE_FRAME_RATE);
|
||||
renderer.destroy();
|
||||
});
|
||||
|
||||
test('work pending at destroy settles and lets go of the scene', async (t) => {
|
||||
withDocument(t, fakeDocument());
|
||||
const viewers = [];
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import * as Cesium from 'cesium';
|
||||
import { applyModelAtmosphereWorkaround } from '../../app/atmosphereCompat.js';
|
||||
import { IDLE_FRAME_RATE } from '../../renderGovernor.js';
|
||||
import { preloadImageryAhead } from './imageryLookAhead.js';
|
||||
import { StarrySky } from './starrySky.js';
|
||||
|
||||
@@ -95,7 +96,9 @@ export function createApplicationViewer({
|
||||
applicationViewerOptions(creditContainer, { showRenderLoopErrors }),
|
||||
);
|
||||
try {
|
||||
viewer.targetFrameRate = 60;
|
||||
// Until the frame port takes over (appRenderer.js), tick at the idle
|
||||
// rate so the startup load does not compete with drawing at 240 fps.
|
||||
viewer.targetFrameRate = IDLE_FRAME_RATE;
|
||||
// No double-click follow or zoom: the Viewer's own (it tracked or
|
||||
// zoomed to the entity picked) is off. Following is a layer's click.
|
||||
viewer.screenSpaceEventHandler.removeInputAction(
|
||||
|
||||
@@ -2365,8 +2365,9 @@ test('the GNSS layer draws its cells as ground fills that stay out of the pick p
|
||||
assert.equal(fill.allowPicking, false);
|
||||
assert.equal(fill.classificationType, Cesium.ClassificationType.BOTH);
|
||||
const [instance] = fill.geometryInstances;
|
||||
assert.ok(instance.geometry instanceof Cesium.RectangleGeometry);
|
||||
assert.equal(instance.id.id, 'gnss-integrity:280:420');
|
||||
// An H3 hexagon, drawn as a polygon.
|
||||
assert.ok(instance.geometry instanceof Cesium.PolygonGeometry);
|
||||
assert.equal(instance.id.id, 'gnss-integrity:841e631ffffffff');
|
||||
// A ground primitive draws its stencil in the pick pass even unpickable,
|
||||
// erasing picks of ground geometry under it; these skip that pass.
|
||||
let updates = 0;
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
* so an autodetect `viewFrom` is renderer-specific.
|
||||
*/
|
||||
import * as Cesium from 'cesium';
|
||||
import { createFrameWait } from '../../time/frameWait.js';
|
||||
import { toCartesian } from './common.js';
|
||||
import { trackedEntityViewEntity } from './internals.js';
|
||||
import {
|
||||
@@ -24,7 +25,8 @@ import {
|
||||
} from '../camera/followTransition.js';
|
||||
|
||||
/** Frames to wait for a target's first position before giving up framing. */
|
||||
const MAX_FRAME_ATTEMPTS = 120;
|
||||
/** Drawn time (ms) to wait for the followed target's first position. */
|
||||
const MAX_POSITION_WAIT_MS = 2_000;
|
||||
const TRANSPARENT = new Cesium.Color(0, 0, 0, 0);
|
||||
const ZOOM_STATES = new WeakMap();
|
||||
/** Each helper entity's FollowTarget. */
|
||||
@@ -220,7 +222,8 @@ export function createCesiumFollow({
|
||||
target.position(msOf(time));
|
||||
|
||||
/** @type {null | {target: object, helper: object, framed: boolean,
|
||||
* attempts: number, previous: Cesium.Cartesian3, releaseZoom: () => void}} */
|
||||
* positionWait: {tick: () => boolean}, previous: Cesium.Cartesian3,
|
||||
* releaseZoom: () => void}} */
|
||||
let current = null;
|
||||
let removePreUpdate = null;
|
||||
/** What `followChanged` last announced: it fires only when that changes. */
|
||||
@@ -312,7 +315,6 @@ export function createCesiumFollow({
|
||||
*/
|
||||
function frame(entry) {
|
||||
const { target } = entry;
|
||||
entry.attempts += 1;
|
||||
const time = widget.clock.currentTime;
|
||||
const at = positionOf(target, time);
|
||||
if (target.frame !== 'enu') {
|
||||
@@ -373,11 +375,12 @@ export function createCesiumFollow({
|
||||
}
|
||||
|
||||
/**
|
||||
* With no position to frame for MAX_FRAME_ATTEMPTS frames, the follow
|
||||
* leaves the camera to Cesium: no framing, no zoom hold, no clamp.
|
||||
* With no position to frame for MAX_POSITION_WAIT_MS of drawn frames (the
|
||||
* same at any refresh rate), the follow leaves the camera to Cesium: no
|
||||
* framing, no zoom hold, no clamp.
|
||||
*/
|
||||
function giveUpAfterWaiting(entry) {
|
||||
if (entry.attempts >= MAX_FRAME_ATTEMPTS) giveUp(entry);
|
||||
if (entry.positionWait.tick()) giveUp(entry);
|
||||
}
|
||||
function giveUp(entry) {
|
||||
entry.gaveUp = true;
|
||||
@@ -399,7 +402,7 @@ export function createCesiumFollow({
|
||||
helper: helperFor(target),
|
||||
framed: false,
|
||||
gaveUp: false,
|
||||
attempts: 0,
|
||||
positionWait: createFrameWait(MAX_POSITION_WAIT_MS, now),
|
||||
previous: new Cesium.Cartesian3(),
|
||||
releaseZoom: () => {},
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ import { headlessCamera } from './cameraGoldens.js';
|
||||
import { createCesiumCamera } from './camera.js';
|
||||
import { holdFollowZoom, pickThroughFollowHelper } from './follow.js';
|
||||
|
||||
function trackingHost() {
|
||||
function trackingHost({ now } = {}) {
|
||||
const { scene, camera } = headlessCamera();
|
||||
for (const name of ['preUpdate', 'postUpdate', 'preRender', 'postRender'])
|
||||
scene[name] = new Cesium.Event();
|
||||
@@ -52,6 +52,7 @@ function trackingHost() {
|
||||
report: (error) => {
|
||||
throw error;
|
||||
},
|
||||
...(now ? { now } : {}),
|
||||
});
|
||||
return { widget, scene, camera, port: part.port, dispose: part.dispose };
|
||||
}
|
||||
@@ -207,12 +208,28 @@ test('targets are asked for their position at sub-millisecond scene time', () =>
|
||||
h.dispose();
|
||||
});
|
||||
|
||||
test('a target without a position gives up framing after 120 frames', () => {
|
||||
const h = trackingHost();
|
||||
test('a target without a position gives up framing after two seconds of drawn frames', () => {
|
||||
let at = 0;
|
||||
const h = trackingHost({ now: () => at });
|
||||
const controller = h.scene.screenSpaceCameraController;
|
||||
h.port.follow(target('a', { position: () => null, minRange: 150 }));
|
||||
for (let i = 0; i < 119; i++) h.scene.preUpdate.raiseEvent(h.scene);
|
||||
// 240 frames a second: a second of them is 240 frames, past the 120 a
|
||||
// fixed frame count would wait, and not yet the wait.
|
||||
for (let i = 0; i < 240; i++) {
|
||||
h.scene.preUpdate.raiseEvent(h.scene);
|
||||
at += 1000 / 240;
|
||||
}
|
||||
assert.equal(controller.inertiaZoom, 0, 'still waiting');
|
||||
// A parked scene's gap counts at most one step, so it does not end it.
|
||||
at += 60_000;
|
||||
h.scene.preUpdate.raiseEvent(h.scene);
|
||||
assert.equal(controller.inertiaZoom, 0, 'still waiting after a gap');
|
||||
for (let i = 0; i < 200; i++) {
|
||||
at += 1000 / 240;
|
||||
h.scene.preUpdate.raiseEvent(h.scene);
|
||||
}
|
||||
assert.equal(controller.inertiaZoom, 0, 'still waiting');
|
||||
at += 100;
|
||||
h.scene.preUpdate.raiseEvent(h.scene);
|
||||
assert.equal(h.port.followFramed, false);
|
||||
assert.equal(controller.inertiaZoom, 0.8, 'the zoom hold let go');
|
||||
|
||||
@@ -111,11 +111,17 @@ export function cesiumCapabilities(scene, only) {
|
||||
/**
|
||||
* @param {object} widget A Cesium `CesiumWidget` or `Viewer`.
|
||||
* @param {{capabilities: ReadonlySet<string>, credentials?: object,
|
||||
* cameraController?: Function, now?: () => number}} options
|
||||
* cameraController?: Function, now?: () => number,
|
||||
* idleFps?: number}} options
|
||||
* The renderer's capabilities, which gate the members that need them, and
|
||||
* the credentials its globe loads photoreal tiles and world data with
|
||||
* (`googleApiKey`, `googleTokens`, `worldDataToken`). `now` is the clock
|
||||
* each tick reads (`performance.now` by default; a test's virtual one).
|
||||
* With `idleFps`, the loop ticks at most that often while no hold is out
|
||||
* (Cesium ticks its clock and every update listener each animation frame
|
||||
* even when it draws nothing), and at the display's rate while one is;
|
||||
* `setTargetFps` then caps both, and the loop starts with no cap of its
|
||||
* own. Without it, the widget's own rate is the cap.
|
||||
* With
|
||||
* `cameraController`, the camera port is that controller's over Cesium's
|
||||
* camera (`controlledCamera.js`); the ports then have `attachInput` and
|
||||
@@ -128,6 +134,7 @@ export function createCesiumPorts(
|
||||
credentials = {},
|
||||
cameraController,
|
||||
now: clockNow = () => performance.now(),
|
||||
idleFps = 0,
|
||||
},
|
||||
) {
|
||||
const scene = widget.scene;
|
||||
@@ -262,15 +269,25 @@ export function createCesiumPorts(
|
||||
const holds = new Map();
|
||||
function applyHolds() {
|
||||
const continuous = holds.size > 0;
|
||||
if (idleFps > 0) applyRate();
|
||||
if (scene.requestRenderMode === !continuous) return;
|
||||
scene.requestRenderMode = !continuous;
|
||||
}
|
||||
/** The loop's rate: the cap, and at most `idleFps` while nothing holds. */
|
||||
function applyRate() {
|
||||
const idle = holds.size === 0 && idleFps > 0;
|
||||
const rate =
|
||||
idle && !(targetFps > 0 && targetFps < idleFps) ? idleFps : targetFps;
|
||||
widget.targetFrameRate = rate || undefined;
|
||||
}
|
||||
// On demand means drawn when asked, held or the view changed: never
|
||||
// because scene time moved on by itself. With no holds yet, it starts so.
|
||||
scene.maximumRenderTimeChange = Infinity;
|
||||
scene.requestRenderMode = true;
|
||||
let suspended = false;
|
||||
let targetFps = widget.targetFrameRate > 0 ? widget.targetFrameRate : 0;
|
||||
let targetFps =
|
||||
idleFps <= 0 && widget.targetFrameRate > 0 ? widget.targetFrameRate : 0;
|
||||
if (idleFps > 0) applyRate();
|
||||
|
||||
// Pending one-shot renders; disposal settles them rather than leave them
|
||||
// attached to a scene that will not render again.
|
||||
@@ -352,7 +369,7 @@ export function createCesiumPorts(
|
||||
renderOnce: (options) => nextPostRender(options),
|
||||
setTargetFps(fps) {
|
||||
targetFps = fps > 0 ? fps : 0;
|
||||
widget.targetFrameRate = targetFps || undefined;
|
||||
applyRate();
|
||||
},
|
||||
/**
|
||||
* Moves the clock to `ms` and draws it; in `preUpdate`, the frame under
|
||||
|
||||
@@ -507,6 +507,29 @@ test('suspend stops the loop at once and resumes it; target fps caps it', () =>
|
||||
ports.dispose();
|
||||
});
|
||||
|
||||
test('with an idle rate, idle ticks at it and anything held draws at the display rate', () => {
|
||||
const { widget } = tickingWidget();
|
||||
widget.targetFrameRate = 60;
|
||||
const ports = createCesiumPorts(widget, { capabilities: all, idleFps: 60 });
|
||||
assert.equal(widget.targetFrameRate, 60, 'idle: the idle rate');
|
||||
assert.equal(ports.frame.diagnostics().targetFps, 0, 'no cap of its own');
|
||||
const release = ports.frame.holdContinuous('flights');
|
||||
assert.equal(widget.targetFrameRate, undefined, 'held: the display rate');
|
||||
release();
|
||||
assert.equal(widget.targetFrameRate, 60);
|
||||
// A cap holds while held, and idle ticks at the lower of the two.
|
||||
ports.frame.setTargetFps(30);
|
||||
assert.equal(widget.targetFrameRate, 30);
|
||||
const again = ports.frame.holdContinuous('flights');
|
||||
assert.equal(widget.targetFrameRate, 30);
|
||||
ports.frame.setTargetFps(120);
|
||||
assert.equal(widget.targetFrameRate, 120);
|
||||
again();
|
||||
assert.equal(widget.targetFrameRate, 60);
|
||||
assert.equal(ports.frame.diagnostics().targetFps, 120);
|
||||
ports.dispose();
|
||||
});
|
||||
|
||||
test('rendering holds the tick’s answer once the tick is over', () => {
|
||||
const { widget, scene, raise } = tickingWidget();
|
||||
const ports = createCesiumPorts(widget, { capabilities: all });
|
||||
|
||||
@@ -29,14 +29,27 @@
|
||||
* short stable strings ('flights', 'traffic', 'style-anim', …) so the
|
||||
* diagnostics read like a story.
|
||||
*
|
||||
* Frame rate: in continuous mode the loop draws at the display's own
|
||||
* refresh rate. In idle mode the renderer's frame port ticks it at most at
|
||||
* IDLE_FRAME_RATE, because Cesium still ticks the clock, data sources and
|
||||
* every pre/post-update listener once per animation frame even when it skips
|
||||
* the draw. Camera movement takes a 'camera' hold from `moveStart` to
|
||||
* `moveEnd`, so drags and flights run at the full rate too.
|
||||
*
|
||||
* The governor is O(1) passive: no per-frame work of its own, ever.
|
||||
*/
|
||||
|
||||
/** @typedef {import('./render/contract/frame').FramePort} FramePort */
|
||||
/** @typedef {import('./render/contract/camera').CameraPort} CameraPort */
|
||||
|
||||
/** Frames a second the loop ticks while nothing moves. */
|
||||
export const IDLE_FRAME_RATE = 60;
|
||||
|
||||
let _frame = null;
|
||||
/** Owners holding, each with the frame port's release once installed. */
|
||||
const _holds = new Map();
|
||||
/** Removes the camera move listeners added at install. */
|
||||
let _removeCameraListeners = null;
|
||||
|
||||
/** Debug trail of the most recent one-shot render requests (idle mode only). */
|
||||
const _recentRequests = [];
|
||||
@@ -47,23 +60,120 @@ function holdOnFrame(ownerId) {
|
||||
_holds.set(ownerId, _frame.holdContinuous(ownerId));
|
||||
}
|
||||
|
||||
/** Pose sampling while the camera moves (see watchCameraMotion). */
|
||||
const CAMERA_SAMPLE_MS = 250;
|
||||
const CAMERA_POSITION_TOLERANCE_M = 1e-3;
|
||||
const CAMERA_DIRECTION_TOLERANCE = 1e-9;
|
||||
|
||||
function near(a, b, tolerance) {
|
||||
return (
|
||||
Math.abs(a.x - b.x) <= tolerance &&
|
||||
Math.abs(a.y - b.y) <= tolerance &&
|
||||
Math.abs(a.z - b.z) <= tolerance
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Hold continuous render while the camera moves. The camera port's
|
||||
* `moveStart` takes the hold and `moveEnd` releases it. Cesium compares the
|
||||
* pose with the last frame's to the last rounding error, and at some poses
|
||||
* the camera drifts by a rounding error every frame, so `moveEnd` never
|
||||
* comes (see `installGlobeInViewRecovery` in app/globeInViewRecovery.js). So from `moveStart` until
|
||||
* `moveEnd` the pose is also sampled every 250 ms with a tolerance for that
|
||||
* drift: half a second at rest releases the hold and a later move takes it
|
||||
* again (Cesium raises no new `moveStart` under that drift). Sampling runs
|
||||
* until `moveEnd`, however long that takes; it costs four checks a second.
|
||||
* @returns {(() => void)|null} Removes the listeners and the sampling.
|
||||
*/
|
||||
function watchCameraMotion(camera, { schedule, unschedule }) {
|
||||
if (typeof camera?.on !== 'function') return null;
|
||||
const pose = () => camera.pose?.() ?? null;
|
||||
const last = { position: null, direction: null };
|
||||
let timer = null;
|
||||
let restingSamples = 0;
|
||||
const copy = (v) => (v ? { x: v.x, y: v.y, z: v.z } : null);
|
||||
const remember = () => {
|
||||
const now = pose();
|
||||
last.position = copy(now?.position);
|
||||
last.direction = copy(now?.direction);
|
||||
};
|
||||
const stopSampling = () => {
|
||||
if (timer !== null) unschedule(timer);
|
||||
timer = null;
|
||||
};
|
||||
const sample = () => {
|
||||
timer = null;
|
||||
const now = pose();
|
||||
const position = now?.position;
|
||||
const direction = now?.direction;
|
||||
const atRest =
|
||||
!position ||
|
||||
!direction ||
|
||||
!last.position ||
|
||||
(near(position, last.position, CAMERA_POSITION_TOLERANCE_M) &&
|
||||
near(direction, last.direction, CAMERA_DIRECTION_TOLERANCE));
|
||||
if (atRest) {
|
||||
restingSamples += 1;
|
||||
if (restingSamples >= 2) releaseContinuousRender('camera');
|
||||
} else {
|
||||
restingSamples = 0;
|
||||
holdContinuousRender('camera');
|
||||
}
|
||||
remember();
|
||||
timer = schedule(sample, CAMERA_SAMPLE_MS);
|
||||
};
|
||||
const removeStart = camera.on('moveStart', () => {
|
||||
holdContinuousRender('camera');
|
||||
stopSampling();
|
||||
restingSamples = 0;
|
||||
remember();
|
||||
timer = schedule(sample, CAMERA_SAMPLE_MS);
|
||||
});
|
||||
const removeEnd = camera.on('moveEnd', () => {
|
||||
stopSampling();
|
||||
releaseContinuousRender('camera');
|
||||
});
|
||||
return () => {
|
||||
stopSampling();
|
||||
removeStart();
|
||||
removeEnd();
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Install the governor on the renderer's frame port, which keeps the loop
|
||||
* drawing every frame while any owner holds and on demand otherwise (and
|
||||
* draws one settling frame when the last hold goes). Idempotent. Before
|
||||
* install, hold/release still record into the holds (and apply at install
|
||||
* time); requests are safe no-ops — so modules can call all three
|
||||
* unconditionally in tests without a renderer.
|
||||
* unconditionally in tests without a renderer. With `camera`, a camera move
|
||||
* holds the loop drawing every frame (see watchCameraMotion); installing
|
||||
* again watches the camera given then.
|
||||
* @param {FramePort} frame
|
||||
* @param {{camera?: CameraPort|null, setTimeout?: Function,
|
||||
* clearTimeout?: Function}} [options] The renderer's camera port, and
|
||||
* injectable timers for tests.
|
||||
* @returns {void}
|
||||
*/
|
||||
export function installRenderGovernor(frame) {
|
||||
export function installRenderGovernor(
|
||||
frame,
|
||||
{
|
||||
camera = null,
|
||||
setTimeout: schedule = globalThis.setTimeout,
|
||||
clearTimeout: unschedule = globalThis.clearTimeout,
|
||||
} = {},
|
||||
) {
|
||||
if (typeof frame?.holdContinuous !== 'function')
|
||||
throw new TypeError('installRenderGovernor requires a frame port');
|
||||
if (_frame === frame) return;
|
||||
if (_frame) releaseFrameHolds();
|
||||
_frame = frame;
|
||||
for (const ownerId of _holds.keys()) holdOnFrame(ownerId);
|
||||
_removeCameraListeners?.();
|
||||
_removeCameraListeners = null;
|
||||
releaseContinuousRender('camera');
|
||||
if (_frame !== frame) {
|
||||
if (_frame) releaseFrameHolds();
|
||||
_frame = frame;
|
||||
for (const ownerId of _holds.keys()) holdOnFrame(ownerId);
|
||||
}
|
||||
_removeCameraListeners = watchCameraMotion(camera, { schedule, unschedule });
|
||||
}
|
||||
|
||||
function releaseFrameHolds() {
|
||||
@@ -134,6 +244,8 @@ export function getRenderGovernorDiagnostics() {
|
||||
/** Release the installed frame port after its animation owners have stopped. */
|
||||
export function uninstallRenderGovernor(frame) {
|
||||
if (!_frame || _frame !== frame) return;
|
||||
_removeCameraListeners?.();
|
||||
_removeCameraListeners = null;
|
||||
releaseFrameHolds();
|
||||
_frame = null;
|
||||
_holds.clear();
|
||||
@@ -142,6 +254,8 @@ export function uninstallRenderGovernor(frame) {
|
||||
|
||||
/** Test seam: reset module state between unit tests. */
|
||||
export function _resetRenderGovernorForTest() {
|
||||
_removeCameraListeners?.();
|
||||
_removeCameraListeners = null;
|
||||
_frame = null;
|
||||
_holds.clear();
|
||||
_recentRequests.length = 0;
|
||||
|
||||
@@ -123,3 +123,126 @@ test('holds registered before install apply at install time', () => {
|
||||
releaseContinuousRender('flights');
|
||||
assert.equal(scene.requestRenderMode, true);
|
||||
});
|
||||
|
||||
/** A camera port double: `moveStart`/`moveEnd` listeners and a pose. */
|
||||
function makeCamera({ position = null, direction = null } = {}) {
|
||||
const listeners = { moveStart: new Set(), moveEnd: new Set() };
|
||||
const camera = {
|
||||
position,
|
||||
direction,
|
||||
on(event, cb) {
|
||||
listeners[event]?.add(cb);
|
||||
return () => listeners[event]?.delete(cb);
|
||||
},
|
||||
pose: () =>
|
||||
camera.position
|
||||
? { position: camera.position, direction: camera.direction }
|
||||
: null,
|
||||
raise(event) {
|
||||
for (const cb of [...listeners[event]]) cb();
|
||||
},
|
||||
size: (event) => listeners[event].size,
|
||||
};
|
||||
return camera;
|
||||
}
|
||||
|
||||
// The frame rate each mode draws at is the frame port's (ports.test.mjs:
|
||||
// 'with an idle rate, …'); the governor only holds and releases.
|
||||
|
||||
test('a camera move holds continuous render from moveStart to moveEnd', () => {
|
||||
const { viewer, scene } = makeViewer();
|
||||
const frame = framePortFor(viewer.scene);
|
||||
const camera = makeCamera();
|
||||
installRenderGovernor(frame, { camera });
|
||||
camera.raise('moveStart');
|
||||
assert.equal(scene.requestRenderMode, false);
|
||||
assert.deepEqual(getRenderGovernorDiagnostics().holds, ['camera']);
|
||||
camera.raise('moveEnd');
|
||||
assert.equal(scene.requestRenderMode, true);
|
||||
// Installing again does not double the listeners; uninstall removes them.
|
||||
installRenderGovernor(frame, { camera });
|
||||
assert.equal(camera.size('moveStart'), 1);
|
||||
uninstallRenderGovernor(frame);
|
||||
assert.equal(camera.size('moveStart'), 0);
|
||||
assert.equal(camera.size('moveEnd'), 0);
|
||||
});
|
||||
|
||||
function fakeTimers() {
|
||||
const queue = new Map();
|
||||
let next = 1;
|
||||
return {
|
||||
setTimeout: (fn) => {
|
||||
queue.set(next, fn);
|
||||
return next++;
|
||||
},
|
||||
clearTimeout: (id) => queue.delete(id),
|
||||
run() {
|
||||
const due = [...queue.entries()];
|
||||
queue.clear();
|
||||
for (const [, fn] of due) fn();
|
||||
},
|
||||
get pending() {
|
||||
return queue.size;
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
test('a camera that drifts by rounding errors and never raises moveEnd still releases its hold', () => {
|
||||
const { viewer, scene } = makeViewer();
|
||||
const timers = fakeTimers();
|
||||
const camera = makeCamera({
|
||||
position: { x: 6_400_000, y: 0, z: 0 },
|
||||
direction: { x: -1, y: 0, z: 0 },
|
||||
});
|
||||
installRenderGovernor(framePortFor(viewer.scene), { camera, ...timers });
|
||||
camera.raise('moveStart');
|
||||
assert.equal(scene.requestRenderMode, false);
|
||||
// Still moving: the hold stays.
|
||||
camera.position = { x: 6_399_000, y: 0, z: 0 };
|
||||
timers.run();
|
||||
assert.equal(scene.requestRenderMode, false);
|
||||
// Drifting by far less than a millimetre: half a second of this is at rest.
|
||||
camera.position = { x: 6_399_000 + 1e-7, y: 0, z: 0 };
|
||||
timers.run();
|
||||
timers.run();
|
||||
assert.equal(scene.requestRenderMode, true);
|
||||
// A later move with no new moveStart takes the hold again.
|
||||
camera.position = { x: 6_000_000, y: 0, z: 0 };
|
||||
timers.run();
|
||||
assert.equal(scene.requestRenderMode, false);
|
||||
// moveEnd stops the sampling and releases.
|
||||
camera.raise('moveEnd');
|
||||
assert.equal(scene.requestRenderMode, true);
|
||||
assert.equal(timers.pending, 0);
|
||||
});
|
||||
|
||||
test('sampling keeps running until moveEnd, so a move after a long drift still takes the hold', () => {
|
||||
const { viewer, scene } = makeViewer();
|
||||
const timers = fakeTimers();
|
||||
const camera = makeCamera({
|
||||
position: { x: 1, y: 0, z: 0 },
|
||||
direction: { x: -1, y: 0, z: 0 },
|
||||
});
|
||||
installRenderGovernor(framePortFor(viewer.scene), { camera, ...timers });
|
||||
camera.raise('moveStart');
|
||||
// Ten minutes at rest (2,400 samples): released, still sampling.
|
||||
for (let i = 0; i < 2_400; i++) timers.run();
|
||||
assert.equal(scene.requestRenderMode, true);
|
||||
assert.equal(timers.pending, 1);
|
||||
camera.position = { x: 1_000, y: 0, z: 0 };
|
||||
timers.run();
|
||||
assert.equal(scene.requestRenderMode, false);
|
||||
});
|
||||
|
||||
test('installing again drops a camera hold the old listeners can no longer release', () => {
|
||||
const { viewer, scene } = makeViewer();
|
||||
const timers = fakeTimers();
|
||||
const frame = framePortFor(viewer.scene);
|
||||
const camera = makeCamera();
|
||||
installRenderGovernor(frame, { camera, ...timers });
|
||||
camera.raise('moveStart');
|
||||
assert.equal(scene.requestRenderMode, false);
|
||||
installRenderGovernor(frame, { camera, ...timers });
|
||||
assert.equal(scene.requestRenderMode, true);
|
||||
assert.equal(timers.pending, 0);
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* A wait measured in time spent drawing frames, the same at any display
|
||||
* refresh rate.
|
||||
*
|
||||
* Each call to `tick()` adds the time since the previous call, but at most
|
||||
* MAX_STEP_MS, so a background tab, a parked scene or a hidden owner (which
|
||||
* draw no frames for this wait) does not use the wait up while nothing is on
|
||||
* screen.
|
||||
*/
|
||||
|
||||
/** The most one frame may add to a wait, in milliseconds. */
|
||||
export const MAX_STEP_MS = 100;
|
||||
|
||||
/**
|
||||
* Start a wait of `limitMs` drawn time.
|
||||
* @param {number} limitMs How long to wait, in milliseconds.
|
||||
* @param {() => number} [now] Clock in milliseconds.
|
||||
* @returns {{tick: () => boolean, pause: () => void}} `tick()` counts one
|
||||
* drawn frame and answers whether the wait is over; `pause()` makes the
|
||||
* next tick count nothing for the gap since the last one.
|
||||
*/
|
||||
export function createFrameWait(limitMs, now = () => performance.now()) {
|
||||
let waitedMs = 0;
|
||||
let lastMs = NaN;
|
||||
return {
|
||||
tick() {
|
||||
const at = now();
|
||||
if (Number.isFinite(lastMs))
|
||||
waitedMs += Math.min(Math.max(at - lastMs, 0), MAX_STEP_MS);
|
||||
lastMs = at;
|
||||
return waitedMs >= limitMs;
|
||||
},
|
||||
pause() {
|
||||
lastMs = NaN;
|
||||
},
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import { test } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { createFrameWait, MAX_STEP_MS } from './frameWait.js';
|
||||
|
||||
function clock() {
|
||||
let at = 0;
|
||||
return { now: () => at, advance: (ms) => (at += ms) };
|
||||
}
|
||||
|
||||
test('the wait lasts the same time at 60 and 240 frames a second', () => {
|
||||
for (const hz of [60, 240]) {
|
||||
const c = clock();
|
||||
const wait = createFrameWait(2_000, c.now);
|
||||
let frames = 0;
|
||||
while (!wait.tick()) {
|
||||
c.advance(1000 / hz);
|
||||
frames += 1;
|
||||
}
|
||||
assert.ok(Math.abs(c.now() - 2_000) <= 1000 / hz + 1e-6, `${hz} Hz ended at ${c.now()}`);
|
||||
assert.ok(frames > 0);
|
||||
}
|
||||
});
|
||||
|
||||
test('a long gap between frames adds at most one step', () => {
|
||||
const c = clock();
|
||||
const wait = createFrameWait(2_000, c.now);
|
||||
wait.tick();
|
||||
c.advance(60_000);
|
||||
assert.equal(wait.tick(), false, 'a background tab does not use the wait up');
|
||||
let drawnMs = MAX_STEP_MS;
|
||||
while (!wait.tick()) {
|
||||
c.advance(16);
|
||||
drawnMs += 16;
|
||||
}
|
||||
assert.ok(drawnMs >= 2_000 && drawnMs < 2_000 + 16 + MAX_STEP_MS);
|
||||
});
|
||||
|
||||
test('after pause the next tick adds nothing', () => {
|
||||
const c = clock();
|
||||
const wait = createFrameWait(150, c.now);
|
||||
wait.tick();
|
||||
c.advance(90);
|
||||
wait.tick();
|
||||
wait.pause();
|
||||
c.advance(90);
|
||||
assert.equal(wait.tick(), false);
|
||||
c.advance(60);
|
||||
assert.equal(wait.tick(), true);
|
||||
});
|
||||
@@ -10,9 +10,12 @@ import { findFrame } from '../render/rendererOf.js';
|
||||
* moment the layers read that frame.
|
||||
* @param {object} viewer
|
||||
* @param {() => number} readTime Epoch ms the sky is drawn at.
|
||||
* @param {{subscribe?: Function, requestRender?: () => void}} [options]
|
||||
* @param {{subscribe?: Function, requestRender?: () => void,
|
||||
* onPlaying?: (playing: boolean) => void}} [options]
|
||||
* A world clock to hear moves from, so a resting scene repaints when the
|
||||
* world time jumps.
|
||||
* world time jumps. `onPlaying` hears when the world clock starts and stops
|
||||
* playing away from live (not stepped by a driver and not waiting for a
|
||||
* layer's data), so the scene can draw every frame meanwhile.
|
||||
* @returns {() => void} Stop following.
|
||||
*/
|
||||
export function followWorldTime(
|
||||
@@ -21,13 +24,25 @@ export function followWorldTime(
|
||||
{
|
||||
subscribe,
|
||||
requestRender = () => findFrame(viewer)?.requestRender('world-time'),
|
||||
onPlaying = () => {},
|
||||
} = {},
|
||||
) {
|
||||
let playing = false;
|
||||
const setPlaying = (next) => {
|
||||
if (next === playing) return;
|
||||
playing = next;
|
||||
onPlaying(next);
|
||||
};
|
||||
const frame = findFrame(viewer);
|
||||
const off = frame?.on('preUpdate', () => frame.setTime(readTime())) ?? null;
|
||||
let last = readTime();
|
||||
const unsubscribe =
|
||||
subscribe?.(() => {
|
||||
subscribe?.((state) => {
|
||||
setPlaying(
|
||||
Boolean(
|
||||
state?.playing && !state.live && !state.stepping && !state.buffering,
|
||||
),
|
||||
);
|
||||
const next = readTime();
|
||||
if (next === last) return;
|
||||
last = next;
|
||||
@@ -36,5 +51,6 @@ export function followWorldTime(
|
||||
return () => {
|
||||
off?.();
|
||||
unsubscribe();
|
||||
setPlaying(false);
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import { followWorldTime } from './viewerClock.js';
|
||||
|
||||
function fakeViewer() {
|
||||
const listeners = new Set();
|
||||
return {
|
||||
clock: { currentTime: {} },
|
||||
scene: {
|
||||
requestRender() {},
|
||||
preUpdate: {
|
||||
addEventListener(fn) {
|
||||
listeners.add(fn);
|
||||
return () => listeners.delete(fn);
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
test('the scene hears when the world time plays on its own, and when it stops', () => {
|
||||
let listener = null;
|
||||
const subscribe = (fn) => {
|
||||
listener = fn;
|
||||
return () => (listener = null);
|
||||
};
|
||||
const heard = [];
|
||||
let at = 0;
|
||||
const stop = followWorldTime(fakeViewer(), () => at, {
|
||||
subscribe,
|
||||
requestRender: () => {},
|
||||
onPlaying: (playing) => heard.push(playing),
|
||||
});
|
||||
const state = (fields) => ({
|
||||
live: false,
|
||||
playing: false,
|
||||
stepping: false,
|
||||
buffering: false,
|
||||
...fields,
|
||||
});
|
||||
listener(state({ live: true, playing: true }));
|
||||
assert.deepEqual(heard, [], 'live time is not playback');
|
||||
listener(state({ playing: true }));
|
||||
listener(state({ playing: true }));
|
||||
assert.deepEqual(heard, [true], 'heard once');
|
||||
listener(state({ playing: true, buffering: true }));
|
||||
assert.deepEqual(heard, [true, false], 'waiting for a layer: still');
|
||||
listener(state({ playing: true }));
|
||||
listener(state({ playing: true, stepping: true }));
|
||||
assert.deepEqual(heard, [true, false, true, false], 'a driver steps it');
|
||||
listener(state({ playing: true }));
|
||||
stop();
|
||||
assert.deepEqual(
|
||||
heard,
|
||||
[true, false, true, false, true, false],
|
||||
'stopping releases',
|
||||
);
|
||||
assert.equal(listener, null);
|
||||
});
|
||||
@@ -21,6 +21,7 @@ import {
|
||||
sub,
|
||||
vec,
|
||||
} from '../geo/vector.js';
|
||||
import { createFrameWait } from '../time/frameWait.js';
|
||||
import {
|
||||
SHARE_VIEW_ENTITY_KINDS,
|
||||
SHARE_VIEW_FOLLOW_RANGE_MAX_M,
|
||||
@@ -38,7 +39,8 @@ import {
|
||||
const KIND_BY_LAYER = new Map(
|
||||
SHARE_VIEW_ENTITY_KINDS.map((entry) => [entry.layerId, entry.kind]),
|
||||
);
|
||||
const MAX_FRAMES = 120;
|
||||
/** Drawn time (ms) to wait for the follow to frame the entity. */
|
||||
const MAX_FRAMING_WAIT_MS = 2_000;
|
||||
const EPSILON10 = 1e-10;
|
||||
|
||||
/** Where `followed` is shown now, as an ECEF position, or null. */
|
||||
@@ -225,6 +227,7 @@ export function applyShareFollowOffset(viewer, followed, offset) {
|
||||
if (!frames || !followed || !(offset?.range > 0)) return () => {};
|
||||
const local = followOffsetToEnu(offset);
|
||||
let count = 0;
|
||||
const framingWait = createFrameWait(MAX_FRAMING_WAIT_MS);
|
||||
let remove = null;
|
||||
const stop = () => {
|
||||
remove?.();
|
||||
@@ -245,7 +248,7 @@ export function applyShareFollowOffset(viewer, followed, offset) {
|
||||
(ported ? camera.followFramed : frame !== null && !isIdentity(frame));
|
||||
const target = framed && frame ? shownAt(viewer, followed) : null;
|
||||
if (!target) {
|
||||
if (count >= MAX_FRAMES) stop();
|
||||
if (framingWait.tick()) stop();
|
||||
return;
|
||||
}
|
||||
// The offset is east/north/up at the entity; the follow's own frame may
|
||||
|
||||