All examples By author By category About

enjalot

visualizing map distortion II

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!

Try your picture

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

Inspiration

Original prompt by @curran
Bounding box solution by @tyrasd

References

projection comparison
map zoom

forked from enjalot's block: visualizing map distortion