Skip to content
Andrew Voirol
Work → Cartography
CartographyLive

Cartography

Eight approaches to rendering the Earth — Canvas 2D point clouds, d3-geo projection morphing, Leaflet trajectory mapping, and raw GLSL shaders.

8 threads · 36 entries · 4 rendering approaches

Started Apr 8, 2026

Eight codebases, four rendering pipelines, one recurring problem: how to render geographic datasets interactively on a 2D screen while balancing projection distortion, GPU overhead, and garbage collection pressure.

This isn't a single project that grew — it's a problem I kept returning to. Every few months a new constraint surfaced: a new projection to support, a dataset too large for Canvas 2D, a flight path that exposed Mercator's lies about Great-Circle distance. Each time, the "correct" rendering approach turned out to depend entirely on the tradeoff being prioritized — fidelity, interactivity, or raw throughput.

The result is four distinct paradigms, each with its own rendering pipeline, performance ceiling, and set of hard-won tricks. Canvas 2D handles thousands of points with zero dependencies. Leaflet gives tile-map context but locks you into Web Mercator. D3 projection mutators let you morph between any two projections but fight you on the sphere-to-plane seam. WebGL removes the frame-rate ceiling entirely — at the cost of writing every vertex buffer and shader by hand.

Rendering Paradigm Matrix

ParadigmPrimary CodebasesRendering PipelineKey Technical Mechanics
Paradigm 1: Canvas 2D + d3-geoDot Matrix Globe, Globe → MapHTML5 Canvas 2D, TopoJSONPoisson disc point sampling, superellipse clipping, continuous D3 projection blending
Paradigm 2: Leaflet + GeodesicsArtemis Velocity VisLeaflet, GeoJSON, Canvas LayerSpherical slerp interpolation, continuous velocity scrubber (500 to 25k mph), Mach 32 telemetry, E-Ink/NASA themes
Paradigm 3: D3 Projection MutatorsInteractive Globe, GeoGenesisCanvas 2D, D3 Mutators, Angular/ReactPythagorean limb interpolation, multi-projection mutators (Winkel/Mollweide), 24-bit RGB picking
Paradigm 4: WebGL & GLSL ShadersRotating Earth, TerraGeminiThree.js / Raw WebGL, GLSLO(1) vertex buffer slicing (250K pts), Blinn-Phong specular glint, 3×3 Sobel coastlines, MGRS telemetry

Paradigm 1: Canvas 2D & Continuous Projection Morphing

Canvas 2D was the starting point because it's the fastest path to rendering geodata with zero dependencies beyond d3-geo — no build step, no WebGL context, no framework lock-in. The challenge was sustaining 60fps while morphing between two projections without triggering garbage collection pauses from per-frame object allocation.

Lamé: n = 2.0Poisson: ~8k PtsNetwork: 6 Hubs / 6 Arcs
DOT MATRIX GLOBE|CALCULATING POINTS...
LON: +000.0° LAT: -10.0°
SPACING:
GLOBE → MAP TRANSFORM|α = 0.00 (n=2.0)
6 CITIES • 6 ARCS
MORPH:
Interactive Lab SandboxFull-viewport instrument with full controls, HUD & presets
Launch Full Experience ↗
interactive-globe
  • Dot Matrix Globe: Plots ~8,000 Poisson-disc points across Natural Earth TopoJSON landmasses stored in typed Float32Array buffers with dynamic back-face culling (z>0z > 0z>0).
  • Globe → Map Transform: Morphs between orthographic and equirectangular projections via continuous blending factor α∈[0,1]\alpha \in [0, 1]α∈[0,1] and an adaptive superellipse boundary (n:2→32n: 2 \to 32n:2→32).

Paradigm 2: Leaflet & Spherical Geodesic Telemetry

Web Mercator projects spherical meridians as parallel lines, making straight flat segments deviate significantly from true Great-Circle shortest paths. This high-contrast E-Ink flight deck visualizes real-time spherical slerp geodesics, continuous velocity modulation, and cartographic path divergence.

Initializing Orbital Cartography Engine

Loading Web Mercator tiles and Haversine spherical geodesic projection...

STANDBY
|Orbital / Re-entry|24,500 mph (M31.93)|Δ: +0.6%

ARTEMIS

ORBITAL VIS

Spherical Geodesics • Telemetry Deck

Active Mission:Trans-Lunar Return & Skip Entry
Total Arc:3,624 mi
Ground SpeedOrbital / Re-entry
24,500mph
M31.9310.95 km/s
Altitude75.76 mi
400,000ft
Atmospheric Entry Interface (EI-400k)
Sub-Satellite Point 058° ENE
Latitude12.0000° N
Longitude170.0000° W
Flight Progress0.0%
Pacific Entry InterfaceSan Diego Recovery Zone
Elapsed0.0s
Distance0 mi
ETA Remaining8m 52s
Interactive Lab SandboxFull-viewport instrument with full controls, HUD & presets
Launch Full Experience ↗
📖 Deep Dive Projectartemis-velocity-vis

Δσ=2arcsin⁡(sin⁡2(Δϕ2)+cos⁡ϕ1cos⁡ϕ2sin⁡2(Δλ2))\Delta\sigma = 2 \arcsin\left(\sqrt{\sin^2\left(\frac{\Delta\phi}{2}\right) + \cos\phi_1\cos\phi_2\sin^2\left(\frac{\Delta\lambda}{2}\right)}\right)Δσ=2arcsin(sin2(2Δϕ​)+cosϕ1​cosϕ2​sin2(2Δλ​)​)

  • Continuous Velocity & Mach Scrubber: Real-time speed modulation from 500 mph500\text{ mph}500 mph (subsonic aviation) to 25,000 mph25,000\text{ mph}25,000 mph (lunar skip re-entry) with live Mach number calculations (M=v/767.26M = v / 767.26M=v/767.26).
  • Spherical Slerp vs. Mercator Linear Chord: Interactive toggle revealing the +1,078 mile+1,078\text{ mile}+1,078 mile (+18.15%+18.15\%+18.15%) path error and 1,857 mile1,857\text{ mile}1,857 mile lateral separation between true Riemannian spherical geodesics and naïve flat Mercator straight lines.
  • High-Contrast E-Ink & NASA Dark Themes: Scoped GPU-accelerated CSS tile filter pipelines with active camera tracking and real-time heading vector alignment.

Paradigm 3: D3 Unfurling & Projection Mutators

Three distinct approaches to the geometric seam where visible front-face coordinates meet occluded back-face data during an unfold transition.

MOUNTING CANVAS 2D CONTEXT...
Interactive Lab SandboxFull-viewport instrument with full controls, HUD & presets
Launch Full Experience ↗
📖 Deep Dive Projectais-geogenesis (React)
  • GeoGenesis (React 1,053-line Canvas): Full projection laboratory featuring frame-by-frame Pythagorean limb departure (R2−y2\sqrt{R^2 - y^2}R2−y2​), dynamic horizon clipping (α(t)=π2(1+t)\alpha(t) = \frac{\pi}{2}(1+t)α(t)=2π​(1+t)), multi-projection topology mutators (Winkel Tripel with 4th-order Taylor sinc guards and Mollweide equal-area via Newton-Raphson Kepler iteration), 24-bit bijective RGB country hit detection (<0.05 ms<0.05\text{ ms}<0.05 ms), and Great-Circle Haversine SLERP flight arcs.
  • Interactive Globe (344 lines): Solves hidden point emergence using the Pythagorean limb relation, sliding occluded points from the sphere's silhouette edge to their equirectangular slots.
  • GeoGenesis (Angular 21): Implements d3.geoProjectionMutator to mutate the projection pipeline per frame with signal-driven zoneless change detection.

Paradigm 4: WebGL & Fragment-Level GLSL Shaders

When point density exceeds 50,000, CPU-side Canvas 2D loops experience frame drops. Offloading calculations to GPU fragment shaders enables rendering hundreds of thousands of points, raytraced specular ocean glints, and procedural coastlines at 60fps.

MOUNTING WEBGL CONTEXT...
Interactive Lab SandboxFull-viewport instrument with full controls, HUD & presets
Launch Full Experience ↗
📖 Deep Dive Projectais-terragemini (WebGL)
  • Rotating Earth (Three.js + GLSL): Land masses defined via UV-space dot matrix, coastlines extracted with a 3×33 \times 33×3 Sobel edge-detection filter, and view-angle limb falloff producing atmospheric halo in ~50 lines of fragment shader.
  • TerraGemini (Raw WebGL): 918 lines of handwritten WebGL with zero Three.js abstraction. Features O(1)O(1)O(1) GPU vertex buffer slicing from 50k to 250k points without PCIe reallocation, raytraced Blinn-Phong specular ocean reflection with scrubbable 3D solar vector, and WGS84 to MGRS 1-meter geodetic telemetry with screen-to-sphere raycasting.

Cross-Paradigm Benchmark

How the four rendering approaches compare across performance, complexity, and capability:

Loading benchmarks...

What Eight Codebases Taught Me

The biggest lesson wasn't about any single rendering technique — it was about the tradeoff surface itself. Canvas 2D is trivially debuggable but hits a hard ceiling around 10,000 animated points. Leaflet solves the tile-context problem but Mercator distortion makes every geodesic path a lie. D3's projection algebra is mathematically beautiful but the unfurl seam — where occluded back-face data meets visible front-face coordinates — requires frame-by-frame geometric surgery. WebGL removes every CPU bottleneck and introduces every GPU debugging nightmare in exchange.

If I were starting fresh, I'd reach for Canvas 2D for anything under 10K points, Leaflet for any work requiring real-world geographic context, and WebGL for anything where point density or visual fidelity matters more than development speed. D3 projection mutators remain the only option when you need to morph between arbitrary projections — nothing else in the ecosystem does that.

d3-geoCanvasVisualizationShaders

Related Threads

Dot matrix globe in dark mode — crimson land outlines and sonar city markers on a deep black background, showing an orthographic projection of the Pacific view with graticule lines

Building the Dot Matrix Globe

From Natural Earth TopoJSON to a theme-reactive, 60fps canvas globe — ~8,000 dots plotting the Earth as ambient generative art.

Interactive globe in orthographic 3D projection showing the Americas and Atlantic Ocean with Toggle to Map button

Building the Globe → Map Transform

Morphing a 3D globe into a flat map with real projection math — custom d3 projection interpolation, back-face culling, and great-circle connection arcs.

Artemis Velocity Vis mission control dashboard at 24,500 mph Mach 32.1

Artemis Velocity Vis

From AI Studio export to an interactive mission control orbital mechanics laboratory — velocity scrubbing (500 to 25,000 mph), Mach 32 telemetry, Catmull-Rom skip entry modeling, and real-time Geodesic vs. Mercator distortion comparison.

GeoGenesis orthographic globe in dark mode — stark slate continents with graticule grid, stars behind, and UNFOLD WORLD button below

Building the GeoGenesis Unfold

An AI Studio D3 globe export becomes a buttery orthographic-to-equirectangular transition — through clip artifact rewrites, hemisphere math, and one very important minus sign.

GeoGenesis 3D orthographic sphere with phosphor green CRT scanlines and starfield

GeoGenesis: mathematical projection unfurling and geodesic routing

1,053 lines of Canvas 2D, continuous Pythagorean limb departure unfurling, multi-projection topology mutators (Winkel Tripel & Mollweide), 24-bit RGB country hit-testing, and Haversine SLERP flight arcs.

Interactive Globe in 3D orthographic projection showing Americas and Atlantic with minimal dark UI and Toggle to Map button

Interactive Globe

An AI Studio export with genuinely clever math — a custom D3 projection interpolator that unfurls a 3D globe into a flat map and back.

GLOBE.GL — GLSL dot-matrix Earth with Sobel edge-detected coastlines, specular highlights, and SYSTEM ONLINE indicator showing lat/lng coordinates

Dot-matrix globe: GLSL coastlines on a specular map

The easiest AI Studio rescue — a 3D rotating Earth built entirely in custom GLSL shaders. UV-space dot grid, Sobel coastlines, and atmospheric glow in ~50 lines of fragment shader.

TerraGemini WebGL globe in Night Radar mode with crimson land outlines and glowing specular ocean reflection

TerraGemini: raw WebGL globe and planetary telemetry

918 lines of raw WebGL, Blinn-Phong specular ocean glint, 3×3 Sobel coastline convolution, O(1) vertex buffer slicing up to 250,000 points, and military MGRS telemetry.


Andrew Voirol

Builder, hacker, shipper. Currently leaving localhost.

Navigate

WorkThreadsBuilder's LogAboutContactRSS Feed

Connect

X / TwitterGitHubLinkedIn

© 2026 Andrew Voirol·Back to top ↑
✦Just one prompt away from figuring it all out.