Skip to main content
100%

Azimuthal Equidistant Raster Reprojection

✓ Published0🌍 Public
Aandrew-reid
Last edited Mar 17, 2017
Created on Jan 25, 2017

This example demonstrates an azimuthal equidistant raster reprojection, converting a cylindrical equirectangular Blue Marble image into a disc-shaped Earth view using d3.geoAzimuthalEquidistant. It draws the original JPEG to a Canvas, then uses projection.invert and getImageData to sample source pixels for each target pixel, while calculating the projection disc’s radius to blank out areas outside it. The result is a direct pixel-level transformation rendered entirely on canvas.

AI-generated description

This bl.ock is a response to a question on reprojecting rasters in d3. The approach is covered in this answer: Stack Overflow answer.

It assumes a geographic projection that projects the earth on to a disc, so that one can calculate the radius of the disc and trim the image to this area. This is required as the d3 projection function is not one to one.

Similar vizzes