Skip to content

feat(satellites): follow a selected satellite live, with a view of the ground below and a 3D model - #515

Merged
simplifaisoul merged 4 commits into
masterfrom
feat/satellite-live-view
Nov 25, 2026
Merged

simplifaisoul merged 4 commits into
masterfrom
feat/satellite-live-view

Conversation

@simplifaisoul

@simplifaisoul simplifaisoul commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

Selecting a satellite now takes the camera to it and follows it live. The readout card shows the satellite's current speed, heading and position every second, and a picture of the ground beneath it from Esri World Imagery. A toggle switches the picture to a 3D model of the satellite.

The selected satellite's orbit line is no longer drawn. The satellite catalogue also no longer shrinks to a fraction of its size when the server restarts.

Changes

Fly to and follow

  • A satellite click eases the camera to the satellite (zoom 3 to 4.5). The first live fix then redirects it to the satellite's current position, because catalogue positions can be minutes old.
  • The selected marker moves with the satellite each second. Only that one instance is re-uploaded (movePoint in satellite-layer.ts); the rest of the catalogue stays as it is.
  • The orbit track is no longer drawn on the globe, and the card's track status row is gone with it. /api/satellites/orbit still returns its segments for API callers.

Live position, speed and heading

  • /api/satellites/orbit also returns live: positions every 10 s for the next 20 minutes, each with the SGP4 orbital speed and the ground-track heading. The card glides between samples once a second (src/lib/satellite-live.ts) and asks again after ten minutes.
  • SGP4 stays on the server. satellite.js ships a threaded WebAssembly build that cannot be bundled for the browser (next build stalls on it), and one request per ten minutes is lighter than polling.
  • t is rounded to the minute, so visitors within the same minute share one cached response.
  • The card's speed now comes from SGP4 (km/s and km/h) instead of a circular-orbit estimate. New fields: heading ("Holds station" for geostationary satellites), live latitude, longitude and altitude, and a LIVE indicator.

View below

  • New SatelliteView: a small non-interactive globe of Esri World Imagery, the same tiles as the SAT basemap, looking straight down at the sub-satellite point.
  • Travel direction is at the top. The lens is 60° in low orbit (about 490 km of ground from the ISS) and the whole Earth from geostationary height, with zoom steps from 1× to 8×.
  • It carries Esri's required credit, and a hover note says it is archive imagery, not a live frame.

3D model

  • New SatelliteModel, behind a VIEW / 3D MODEL toggle. A model of the satellite's kind turns in sunlight; drag to turn it, scroll to zoom.
  • src/lib/satellite-models.ts builds 13 kinds from simple shapes: Starlink V2 Mini and V1.5 (told apart by catalogue number), ISS, Tiangong, Hubble, navigation, Earth observation, geostationary, communications, CubeSat, rocket body, debris (shaped by NORAD number) and a general satellite.
  • Only the designs built to their real size (ISS, Tiangong, Hubble, Starlink) show a span. The card labels every model as illustrative.
  • three.js loads the first time a model opens, and the view releases its WebGL context when it closes.

Catalogue after a restart

  • CelesTrak refuses most groups to an address that downloaded them recently, so the refresh after a restart often returns only about 5,000 of the ~19,000 satellites.
  • The refresh already backfills from the cached catalogue, but a disk cache older than four hours was discarded at startup. That left nothing to backfill from, and the partial answer replaced the full catalogue in memory and on disk.
  • A disk cache up to seven days old is now loaded with its own time. The first request still refreshes, and newer TLEs win wherever CelesTrak answers.

Cleanup

  • The page no longer keeps satellites_at, because the orbit request no longer anchors on the catalogue epoch.

Testing

  • npx vitest run: 178 files, 1,796 tests passed. New tests cover:
    • live state (satelliteState: ISS and geostationary speed and heading)
    • sample interpolation (antimeridian and heading wrap)
    • the view's footprint and zoom maths
    • model selection by name, mission and height
  • npx tsc --noEmit is clean. eslint shows no new findings in the changed files; the satellites route keeps its five existing any errors from master.
  • next build passes; three.js and satellite.js stay out of the main client chunk.
  • With next start, a headless browser selected a Starlink, a debris object, the ISS and a geostationary satellite, and checked:
    • the camera flight and the live readout updating each second
    • Esri tiles loading with no failures, the 1× and 8× views, and the whole-Earth view from geostationary orbit
    • the 3D model opening, turning when dragged, and switching back with its WebGL context released
    • no orbit line drawn on the globe
  • Catalogue: the server restarted with a six-hour-old disk cache. CelesTrak returned 5,028 TLEs and 14,159 were backfilled, so all 19,187 were kept (19,031 propagate).

🤖 Generated with SIMPLIFAI

Gemini CLI added 2 commits November 24, 2026 18:21
…a view of the ground below

- Clicking a satellite eases the camera to it (zoom 3 to 4.5), then to its
  current position once the first live fix arrives, since the catalogue
  position can be minutes old.
- The orbit route now also returns the next twenty minutes of positions,
  every ten seconds, with SGP4 orbital speed and ground-track heading. The
  card glides between them once a second and asks again every ten minutes,
  which also recentres the drawn track. SGP4 stays on the server:
  satellite.js ships a threaded WebAssembly build the browser bundle
  cannot take.
- The selected marker moves with the satellite (one instance re-uploaded,
  not the whole catalogue).
- The card shows live altitude, speed (km/s and km/h), heading, latitude
  and longitude, and a view straight down from the satellite: Esri World
  Imagery on a small globe, travel direction up, 60 degree lens in low
  orbit or the whole Earth from geostationary height, zoom 1x to 8x, with
  Esri's credit.
…e view below

- The card's picture gains a VIEW / 3D MODEL toggle. The model turns on its
  own in sunlight with blue light from the Earth below; drag to turn it,
  scroll to zoom.
- Models are built from simple shapes, one per kind: Starlink V2 Mini and
  V1.5 (told apart by catalogue number), the ISS, Tiangong, Hubble,
  navigation satellites, Earth-observation satellites, geostationary
  satellites, communications satellites, CubeSats, spent rocket stages,
  debris (shaped by NORAD number) and a general satellite.
- The ISS, Tiangong, Hubble and Starlink models are built to their real
  size and show their span; the others stand for satellites of many sizes
  and show none. The card says the model is illustrative.
- three.js loads the first time a model opens, and the view gives its
  WebGL context back when it closes.
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
osiris Ready Ready Preview Nov 25, 2026 3:58am UTC

Gemini CLI added 2 commits November 24, 2026 22:50
…a restart

CelesTrak refuses most groups to an address that downloaded them recently,
so the refresh after a restart often returns only about 5,000 of the
~19,000 satellites. The refresh already backfills from the cached
catalogue, but a disk cache older than four hours was discarded at
startup, leaving nothing to backfill from; the partial answer then
replaced the full catalogue in memory and on disk.

A disk cache up to seven days old is now loaded with its own time, so the
first request still refreshes and newer TLEs win wherever CelesTrak
answers, while the rest are kept.
The orbit line drawn around the globe for a selected satellite is
removed, with the card's track status row and the ten-minute redraw.
Selecting a satellite still flies to it, follows it live and shows the
view below and the 3D model. /api/satellites/orbit keeps returning its
segments for API callers; the page now reads only the period and the
live samples from it.

This branch was successfully deployed

1 active deployment
Preview – osiris — fedd80db Deployed Nov 25, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant