Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That's an @dwtkns special. Mike Bostock helped with getting a D3 Rotated Transverse Mercator projection exactly aligned with our particular stitched-together crop of Landsat photos — so a lot of the geographic stuff in the graphic (the label placement, the city outlines, and the locator map) are powered by geographic coordinates instead of pixel positions. The "X Miles to Baghdad" works in the same fashion. Makes it way easier to place / resize / redraw things for all of the different widths this has to render at.

Edit:

Because this is a programming site, after all — let's share Mike's projection:

    // φ is the central meridian (e.g., 45° for UTM Zone 38)
    // θ is the screen rotation
    function rotatedTransverseMercator(φ, θ) {
      var π = Math.PI,
          cosθ = Math.cos(θ = -(90 + θ) / 180 * π),
          sinθ = Math.sin(θ);
    
      function raw(λ, φ) {
        var x = λ,
            y = Math.log(Math.tan(π / 4 + φ / 2));
        return [
          x * cosθ - y * sinθ,
          x * sinθ + y * cosθ
        ];
      }

      raw.invert = function(x, y) {
        return [
          x * cosθ + y * sinθ,
          2 * Math.atan(Math.exp(y * cosθ - x * sinθ)) - π / 2
        ];
      };

      var rotate = [-φ, 0, 90],
          rotation = d3.geo.rotation(rotate),
          projection = d3.geo.projection(raw).rotate(rotate),
          center = projection.center;

      projection.center = function(_) {
        return _
            ? center(rotation(_))
            : ((_ = center()), rotation.invert(_));
      };
    
      delete projection.rotate;
      return projection;
    }


And there's still people who think there's no place for Math in programming.


Funny how math and code make journalism so much better.


Anybody who says that can't be taken seriously. You need math anywhere there is meaningful manipulation of symbols/data/entity. That statement itself will end up including nearly ever profession on earth.

The problem with programming interviews is they test math tricks, arcane knowledge, trivia and puzzles.

Far more important than mathematical knowledge, is mathematical capability.


Math is a tool used in programming, programming isn't defined by math though (there are plenty of non-math activities that dominate the process). What is so hard about that?


Actually there's a deep equivalence theorem between mathematical statements and programs. Here are people doing ZFC as a program - http://en.metamath.org/


Most of programming involves figuring out what to do, not doing it.


The same is said of mathematics.


Yes, but that creative process isn't really doing math either (as defined by performing mathematical reasoning). The best we can say is that creative processes are involved in all disciplines.

Programming can involve math, math can involve programming, but neither is defined by the other.


You do realize that algorithms were invented in Euclid's day, right? Was he not doing math, or are algorithms no longer programming?

Even string processing is math (c.f. Godel).


Maths... with a feckin' S on the end!


Blasphemy!


This maybe a weird question, but where do most of the normal and landsat photos come from? If it all exclusive to NY or you use a freelance/marketplace service? I ask since I have a project ongoing with a similar photo requirements and have difficulty acquiring the images. (I have no problem paying, I just don't have the experience to know where to get them)


You're in luck. Landsat 8 photos are paid for by the American taxpayer, and therefore freely available.

Sign up for an account here, then go nuts: http://earthexplorer.usgs.gov/

More detail on the images: http://landsat.usgs.gov/landsat8.php

The Euphrates River map here, for example, is stitched together from about 15 gigs worth of raw Landsat tiles. Photoshop beware!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: