Digital Twin 3D Geospatial Coordinate & ECEF Guide

A 3D engine and a surveyor look at the same Earth through different coordinate languages. The engine wants Cartesian meters from a local origin; the surveyor works in latitude, longitude, and heights on a curved ellipsoid. Digital twins live exactly on that border, and most of their coordinate bugs are translation errors between the two worlds. This guide explains the three systems you will meet — geodetic, ECEF, and local tangent frames — with a worked conversion you can reproduce in the converter on this page.

Three coordinate systems, three jobs

SystemCoordinatesUsed for
GeodeticLatitude, longitude (degrees), ellipsoid heightGNSS, GIS data, surveying records — the world's filing system
ECEFX, Y, Z in meters from Earth's center of massThe bridge: global 3D math, 3D Tiles, Cesium's globe
Local tangent (ENU)East, North, Up in meters from a chosen originEngines, robotics, simulation — anywhere linear math must work

Geodetic coordinates are angles on an ellipsoid — superb for storage and exchange, unusable for direct 3D math (a degree of longitude is 111 km at the equator and zero at the poles). ECEF converts the ellipsoid into a true 3D Cartesian frame: unambiguous and global, but with coordinates in the millions of meters. Local tangent frames sacrifice global reach for sanity: pick an origin, and everything nearby gets small, linear, engine-friendly numbers. Every digital twin pipeline is a chain of conversions among these three — and the companion alignment guide covers how models are fitted onto them.

Worked example: Tokyo in ECEF

The conversion is closed-form. With WGS 84 (a = 6,378,137 m, e² = 0.00669438), the prime-vertical radius N = a / √(1 − e²sin²φ), then X = (N+h)cosφcosλ, Y = (N+h)cosφsinλ, Z = (N(1−e²)+h)sinφ. For Tokyo Station (φ = 35.6895°, λ = 139.6917°, h = 40 m (the converter defaults below)):

X = −3,954,869 m   Y = 3,354,958 m   Z = 3,700,288 m

Sanity check worth internalizing: √(X²+Y²+Z²) should land near Earth's radius at that latitude (~6.37 million m) — if your conversion returns anything else, a degrees/radians slip is the usual suspect.

Convert it yourself: Lat/Lon/Height to ECEF

Interactive Lat/Long/Height → ECEF 3D Cartesian Converter

Convert WGS84 coordinates into 3D ECEF Cartesian (X, Y, Z) coordinates for Cesium / Unreal Engine Digital Twins:

The float32 trap: why engines render relative to center

ECEF coordinates are around 4–6 million meters, and single-precision floats (float32, the GPU's native format) carry about 7 significant decimal digits. At magnitudes between 2²² and 2²³ (~4.2–8.4 million), adjacent representable float32 values are 0.5 m apart. Feed raw ECEF into a renderer and vertices snap to a half-meter grid: geometry visibly jitters and crawls as the camera moves. This is not a bug in any engine — it is arithmetic. The standard cure is relative-to-center rendering: subtract a local origin in double precision on the CPU, and hand the GPU only small local offsets. Cesium does this internally; in raw WebGL or a game engine, you must do it yourself — which is the practical reason local tangent frames exist.

3D Tiles, Cesium, and game engines

  • 3D Tiles / Cesium: tilesets are positioned with a transform rooted in ECEF; heights in the source data are ellipsoidal unless a geoid step is documented. A tileset that sits ~30 m too high or low over a city is usually an ellipsoid-vs-orthometric mix-up, not a placement error.
  • Game engines (Unreal/Unity): engines are local-frame worlds. The standard pattern is a georeference object: one surveyed origin (lat/lon/height) plus an ENU tangent frame, with all content placed relative to it. Unreal's Georeferencing plugin and Cesium for Unreal formalize exactly this.
  • GIS-to-3D pipelines: every export step (GIS → mesh → tiles → engine) is a chance to drop the CRS metadata. The transform chain must be documented end-to-end; "it lined up in the viewer" is not documentation.
Try it: convert a surveyed point with the converter above, then check where it lands in the Coordinate Map Viewer; if a dataset arrives in an unknown format, the Coordinate Detector identifies it before you build on it.

Common mistakes

  • Feeding degrees into Cartesian math. Distances, areas, and rotations computed on raw lat/lon are wrong everywhere except near the equator — and subtly wrong even there.
  • Ignoring height type in 3D. Ellipsoid height in a tileset, orthometric height in the BIM model: a silent vertical offset equal to the local geoid separation.
  • Raw ECEF in shaders. The float32 grid described above. If your scene jitters at half-meter steps, you are looking at arithmetic, not a data error.
  • Swapping axis order. ECEF X points at (0°, 0°), Y at (0°, 90°E), Z at the north pole. Engines with Y-up or Z-up conventions need an explicit axis mapping — assumed mappings are a classic source of mirrored worlds.

Frequently Asked Questions

Why not just build the whole twin in ECEF?

You can store and exchange in ECEF, but rendering and physics want local frames: float32 precision at ECEF magnitudes quantizes geometry to ~0.5 m steps. The working pattern is ECEF (or geodetic) as the reference, local ENU as the working frame.

What origin should a local frame use?

A surveyed point near the site's center, recorded with its full CRS and epoch, and shared by every dataset in the twin. One origin, documented once, used by all — most multi-model misalignments trace back to several private origins.

Do I need ECEF at all if my twin is one building?

Only at the boundary: the moment the twin must agree with GNSS, GIS, or another model, the conversion chain through ECEF (or an equivalent documented transform) is how that agreement is made exact rather than visual.

References: NIMA TR8350.2 (WGS 84 definition and ECEF formulas), the OGC 3D Tiles specification (tileset transforms), and Cesium's documentation on relative-to-center rendering and georeferencing in engines.