Skip to content

Instantly share code, notes, and snippets.

Last active October 16, 2023 18:49
  • Star 3 You must be signed in to star a gist
  • Fork 13 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Satellite Projection
license: gpl-3.0
<!DOCTYPE html>
<meta charset="utf-8">
.graticule {
fill: none;
stroke: #777;
.boundary {
fill: #ccc;
fill-opacity: .8;
stroke: #000;
<script src="//"></script>
<script src="//"></script>
<script src="//"></script>
var width = 960,
height = 960;
var projection = d3.geo.satellite()
.rotate([76.00, -34.50, 32.12])
.center([-2, 5])
.clipAngle(Math.acos(1 / 1.1) * 180 / Math.PI - 1e-6)
var graticule = d3.geo.graticule()
.extent([[-93, 27], [-47 + 1e-6, 57 + 1e-6]])
.step([3, 3]);
var path = d3.geo.path()
var svg ="body").append("svg")
.attr("width", width)
.attr("height", height);
.attr("class", "graticule")
.attr("d", path);
d3.json("/mbostock/raw/4090846/us-land.json", function(error, us) {
if (error) throw error;
.attr("class", "boundary")
.attr("d", path);
});"height", height + "px");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment