Adaptive Resampling
Three D3 v3 projections apply adaptive resampling to a rotating world map, showing how line simplification improves efficiency. The example compares no resampling, uniform resampling, and adaptive resampling, with red points marking each projected sample. The code uses `d3.geo.path` and a custom buffer context to extract resampled points from a graticule and a sample line. Animation runs via `d3.timer`, updating the equirectangular projection continuously.
AI-generated descriptionD3 3.0’s projections use adaptive resampling to increase the accuracy of projected lines and polygons while still performing efficiently. On the left is no resampling, where obvious polygonal artifacts are visible due to projected lines becoming curves. Uniform resampling improves the appearance, but is inefficient because most of the resampling points are wasted, and areas of extreme distortion still exhibit artifacts. Adaptive resampling takes an idea from line simplification and resamples only where needed, producing high-quality results with low computational overhead.