Monday, October 20, 2014

Dark Sky & Progressive Loading

There's a new Dark Sky for iOS out.  If you're interested in weather apps, I suggest checking it out.

Terrible weather is pretty! is one of my favorite clients (translation: They pay on time), but whenever they ask for something it's going to be hard.  This was no exception.

Tile Loading

Dark Sky has a ton of custom logic in it, not to mention all the custom data they feed it.  But large parts are using standard WhirlyGlobe-Maply.  The tile loading logic, for instance, is all in there.

Let's review.  For the globe, we start loading at level 0 and work our way down.

I will reuse this at least 5 more times.

The app does something funkier when you're zoomed in, but let's ignore that.  This approach works well for the globe, but for one problem:  Animation means frames.

So let's say you're loading 20 frames of animation to show the weather changing over the course of a day.  That means you have to load each tile 20 times.  Sure, you can do it in parallel... but still.  It takes a while.

Progressive Tile Loading

Adam at wanted something better.  "Couldn't we load individual frames" he said?  "Sure", I said.  "Just let me renew my Xanax prescription and we'll give it a try."

And now WG-Maply can load frames progressively.  That means it'll start at your most important frame and work its way outward.  It'll load depth first, so that first frame looks good everywhere and then work outward to the less important frames.

You can set the frame priorities yourself, change them on the fly, and get feedback on what is properly loaded.  When the user moves, we start loading at the most important frame again, then work on the others.

That Sounds... Complicated

Why yes, voice in my head that may never, ever go away, it is complicated!  It's not all that hard to use, though.  You provide your tile sources as normal and let the loader do its thing.  If you want to tell the user what's going on, there's a callback for that.

Weather apps are the most obvious users here, but anything with animation is fair game.  I'd love to see some data visualization apps using this feature.

Wednesday, October 15, 2014

Facebook Open Academy Interns

We've got interns!  Let's see what they're up to.

Drop shadows with 3D?  Yes, I went there.

Wait.  What?  Interns?

Stanford and Facebook run an internship program for open source projects.  It's course credit for doing a bit of work.

As part of LocationTech, I applied for a few slots.  Last weekend I was holed up at Facebook with five talented students.  They're working on a variety of projects with WhirlyGlobe-Maply.

In a few weeks, we might do some guest posts.  For now here's an overview of what they're up to.

Web Feature Service

WFS is used by a big segment of the open source geo community.  It's for communicating vector data from server to client.  Well, the parts we care about are.  Among other projects, it's used in Geoserver.

The project is to interface WG-Maply to WFS.  Mostly that means reading Geography Markup Language (GML).

Keyhole Markup Language

KML is Google Earth's native format.  It's evolved into an interchange standard for vector and other data.  You can encode vector data and image tile sets, sure.  You can also encode behavior and paging.  Oy, it gets complex.

This project is to read KML into WG-Maply.  Probably just the static features for now.

Marine Traffic Visualization

Did you know you can see real time ship movement data online?  Cool.  But wait, it's also collected by a network of volunteers.  If that doesn't make you want to stick an antenna on your roof then you have no soul.

Anyway, the project is to visualize this data.  Perhaps with history, perhaps in real time.  We shall see.


If you haven't played with the NASA (near) real time MODIS data, then go do that.  Come back when you're done.

This project is to put together a similar interface with WhirlyGlobe.  Should make a nice example, plus, NASA imagery.


This is a pretty neat set of projects.  Indeed.  Any code will be published open source.  Some will make nifty examples, others will be merged into the WhirlyGlobe contributed collection.