Extent indicator globe using d3.geo.orthographic and radial gradients.
Slippy map code from:
http://bl.ocks.org/3943330 by tmcw
http://bl.ocks.org/4132797 by mbostock
Map tiles from Stamen
Extent indicator globe using d3.geo.orthographic and radial gradients.
Slippy map code from:
http://bl.ocks.org/3943330 by tmcw
http://bl.ocks.org/4132797 by mbostock
Map tiles from Stamen
Building on this - experimenting with fake 3d svg arcs using two nested orthographic projections and cardinal line interpolation.
var s=document.createElement('script'); s.type='text/javascript'; s.src='http://d3js.org/d3.v3.min.js'; document.head.appendChild(s); |
// translated from http://stackoverflow.com/questions/20453545/how-to-find-the-nearest-point-in-the-perimeter-of-a-rectangle-to-a-given-point | |
function clamp(n,lower,upper) { | |
return Math.max(lower, Math.min(upper, n)); | |
} | |
function getNearestPointInPerimeter(l,t,w,h,x,y) { | |
var r = l+w, | |
b = t+h; | |
Faux-3d SVG globe using d3.geo.orthographic and a few radial gradients. Labels offset or hidden based on radians from current map center to enhance the effect.
Uncomment svg.append("g").attr("class","countries") for hover-able country outlines.
Experiments faking 3d rotation of a globe and sun in SVG. Illusion is helped by dynamic gradients, two nested orthographic projections, scaling the sun circle's radius based on distance from the 'camera', and toggling a clipping mask that makes the sun appear to move "behind" the earth.
Based on Mike Bostock's Solar Terminator and this past experiment.
This example stems from drafts of maps for Norway the Slow Way. Also see Mike's Pencil Sketch example.
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
.counties { | |
fill: none; | |
stroke: black; | |
opacity:0.2; | |
} |
#!/usr/bin/env osascript -l JavaScript | |
// usage: google-earth-perspective-to-geojson.js xSamples ySamples > currentPerspective.geojson | |
function run(argv) { | |
var xSamples = argv[0] || 50; | |
var ySamples = argv[1] || 50; | |
var ge = Application('Google Earth Pro'); |
# This is a shell function to quickly grab the data for a given Landsat 8 tile ID from Google's servers | |
# For example: | |
# l8get LC81690352014169LGN00 | |
# The echo at the end is to remind myself of the syntax for extracting bands 8, 4, 3, and 2. (Pansharp, Red, Green, Blue) | |
# On OSX this would go into your ~/.bash_profile file. | |
# Requires gsutil from https://developers.google.com/storage/docs/gsutil_install | |
# Most useful in conjunction with USGS' Earth Explorer: http://earthexplorer.usgs.gov/ |
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<style> | |
path { fill:none; stroke:white; } | |
.bg { fill: #446;} | |
.inner { stroke-width: 500px; stroke: #ffc; opacity: .2;} | |
.dark { stroke: #114; opacity:.2;} | |
</style> |