Wednesday, May 15, 2013

MapBox Earth

It's been a busy month for MapBox.  Their new OpenStreetMap editor launched, for one thing, and now they've published a pretty little app to show off their satellite data sets.

In English, yes.
Actual picture of the earth.  NASA photoshops out the labels.

It's WhirlyGlobe-Maply powering that app and, indeed, the whole thing is open source.

How It Happened

I approached MapBox about doing this one a few weeks ago.  It's basically advertising for me and it was really simple to write.  Take a look at the source code, it's just not that big.

Once I put the first version together, Justin@MapBox cleaned it up and generally made the UI elements work better.  That stuff takes more time than you realize.

Then we shipped it and now you can play with.

Future of MapBox Earth

The app's goals were to show off MapBox's lovely satellite data sets and advertise WhirlyGlobe-Maply.  I'd say we're good on both of those.  What's next depends on what people want to do with it.

Since the app itself is open source and the toolkit is open source... you can do whatever you like (within the constraints of an Apache 2.0 license).  Or you can pay me to do whatever you like, which is kind of how I make my living.

We'll see how that goes.  In the mean time there are other interesting things afoot with MapBox and mousebird consulting.


  1. In the spirit of contacting you about 'actively sleazy applications', is it going to be possible to use this to create the truly great UI associated with this GitHub repository - RossAnderson / EarthView?
    Ross built the best tilt/pan & rotate interface I've ever used, and he also layered in altitude data in a super fast Mapbox tileset. And then someone published it & it was so popular he had to delete the mapbox acount because of bandwidth. His EarthView app was/is the only open source app I could find that beat Google Earth.
    Anyway we can create that! I want to help.

  2. Well WhirlyGlobe-Maply is open source. The MapBox Earth app is open source as well, so you've got that as a good starting point.

    My toolkit uses a quaternion for the model matrix and a separate view matrix for tilt and so forth. You can control that however you like, so I'd imagine you could duplicate the interface fairly closely if you're willing to experiment.

    Doing the elevation is a bit more work, but not all that bad. It's the TileQuadLoader that's creating the mesh points. Rather than doing the fake geocentric, just toss in an elevation and crank up the sampling to match whatever data you have. There's already an option for skirts in there, so you'll obviously want that on and maybe a bit bigger than it is now. You need to get the elevation data into the TileQuadLoader, but you could hijack the WhirlyKitLoadedImage to do it. That's how remote images are returned to the loader anyway.

    The problem, as always, is streaming the data. MapBox Earth is pulling down MapBox data, since it's essentially an advertisement for their new satellite layers. You or I can't use that for our own purposes without paying. Moreover, any elevation data you put up there would be a bit limited, unless they can serve 16 bit images. I haven't checked, so perhaps they can or you could just fake it with 8 bit data.

    From a technical perspective, none of this is very difficult. Well, doing overlaid vectors gets a bit tricky, but it's easy enough to just ignore that problem. I haven't done it because no one's paid for it and it isn't one of my particular obsessions.

    But obviously I've thought about it and I've even spec'ed it out for a few clients, though no one's bitten thus far. Doing the features correctly on top of elevation really increases the costs.

    Still, if all you wanted to do was replicate EarthView, I think you totally could. Wouldn't be too hard with WhirlyGlobe as a starting point.