Rendering sea-ice extent without Matplotlib bloat
2026-01-12 · Piet van Noorden
GlacierPeak's timeline renderer uses SVG rather than a bitmap format. This was the right choice, but not for the obvious reason.
SVG for data correctness
The main argument for SVG in data visualisation is resolution independence. That's true but not the reason I chose it for glacier retreat timelines.
The real reason is that SVG lets me represent uncertainty honestly. Glacier outlines from satellite imagery have varying spatial accuracy depending on when they were acquired, the sensor, and cloud coverage. In GlacierPeak, outlines with higher uncertainty are rendered with a dashed or semi-transparent stroke. In a bitmap render, encoding that information without a separate legend is awkward. In SVG, it's a stroke-dasharray attribute.
Simplification
Raw glacier outlines from NSIDC contain on the order of 50,000 vertices for major ice sheets. Embedding all of them in an SVG produces files that are slow to render and slow to download.
GlacierPeak uses the Visvalingam-Whyatt algorithm rather than Douglas-Peucker for simplification. Visvalingam-Whyatt removes points based on the area of the triangle they form with their neighbours, which tends to preserve the visual character of coastline-like shapes better than the distance-based approach of Douglas-Peucker.