From TLE to Trajectory: Drawing the ISS Orbit in Cesium
Browser-based satellite tracking and visualization depends on this exact chain: parse TLE, propagate with SGP4/SDP4, then reconcile ECI with Cesium's Earth-fixed coordinates. The single-GMST rule is the difference between an orbit that looks right and one that visibly drifts or twists as the Earth spins.
Two 69-character TLE lines are enough to draw the International Space Station's orbit on a Cesium globe. satellite.js parses them with twoline2satrec into a SatRec structure, then propagate() runs SGP4 for near-Earth objects or SDP4 for deep-space orbits and returns ECI position vectors in kilometers. From there the caller handles the coordinate transform: eciToEcf() rotates the vector around Earth's Z axis by GMST, and Cesium.Cartesian3.fromElements() converts kilometers to meters for the ECEF frame Cesium expects.
The trajectory uses one GMST value for every sample point, so the orbit stays fixed in the inertial frame while the Earth rotates beneath it. Using each sample's own GMST would produce a ground-track line that drifts with Earth. A CallbackProperty recomputes both the ISS marker and the polyline before every frame, and a cached last-valid position prevents the satellite from snapping to Earth's center when propagation returns NaN or Infinity.
satellite.js deliberately stops at ECI and leaves ECEF conversion to the caller. That keeps the library frame-agnostic but pushes the hardest coordinate-frame decision into application code, where most orbit visualizations go wrong.
Using one GMST for the whole trajectory is a subtle but decisive choice: it draws the orbit in inertial space and lets Earth rotate underneath, which matches how a satellite's orbit is actually defined. Ground-track style visualization is a different product, not a bug.
The NaN/Infinity fallback is a reminder that TLE propagation is an approximation with an expiration date; production trackers need to handle model failure gracefully rather than assume propagate() always succeeds.