Skip to content

Instantly share code, notes, and snippets.

Forked from mbostock/.block
Last active February 9, 2016 01:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save mbostock/3791255 to your computer and use it in GitHub Desktop.
Satellite Projection Test
license: gpl-3.0

Figure 37.—Tilted Perspective projection. Eastern seaboard viewed from a point about 160 km above Newburg, N.Y. Parameters using symbols in text: φ₁ = 41º 30′ N. lat, λ₀ = 74º 00′ W. long., ω = 55º, γ = 210º, P = 1.025. 1º graticule.

<!DOCTYPE html>
<meta charset="utf-8">
body {
margin: auto;
padding: 10px;
width: 537px;
svg {
background: url(readme.png) no-repeat;
border: solid 1px #000;
.graticule {
fill: none;
stroke: red;
<script src="//"></script>
<script src="//"></script>
var width = 537,
height = 737;
var projection = d3.geo.satellite()
.rotate([74, -41.5, 212])
// The reference 74ºW, 41ºN is at 181px, 710px.
var offset = projection.translate([-181, -710])([-74, 41]);
projection.translate([-offset[0], -offset[1]]);
var graticule = d3.geo.graticule()
.extent([[-74 - 15, 41 - 15], [-74 + 1e-6, 41 + 1e-6]])
.step([1, 1]);
var path = d3.geo.path()
var svg ="body").append("svg")
.attr("width", width)
.attr("height", height);
.attr("class", "graticule")
.attr("d", path);"height", height + 20 + "px");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment