Whenever we try to represent our 3D earth on a 2D map we necessarily introduce distortion. This tool attempts to visualize the phenomenon. It's a fun riff on my earlier attempt.
The commonly used Mercator projection is shown here by default. Try zooming in and seeing how much less distortion happens as you pan around. This is because the projection is designed to be used in navigating within countries, not showing the whole globe.
For some real fun, switch to the Sinusoidal projection and pan around!
You can fork this and add your own image with this short node script: (remember to npm install get-pixels
)
getPixels = require("get-pixels")
fs = require 'fs'
output = []
getPixels "mbostock.jpg", (err, data) ->
for y in [0...data.shape[1]]
for x in [0...data.shape[0]]
p = [data.get(x,y,0), data.get(x,y, 1), data.get(x,y, 2)]
output.push(p)
fs.writeFileSync 'mbostock.json', JSON.stringify(output)
You can then upload the resulting json file (feel free to rename it) using blockbuilder.org.
For your convenience, this block can be forked quickly here: http://blockbuilder.org/enjalot/5233898432653069ea8e
Original prompt by @curran
Bounding box solution by @tyrasd
projection comparison
map zoom
forked from enjalot's block: visualizing map distortion
https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js
https://cdnjs.cloudflare.com/ajax/libs/d3-geo-projection/0.2.9/d3.geo.projection.min.js
https://cdnjs.cloudflare.com/ajax/libs/topojson/1.6.19/topojson.min.js