Justinsomnia Maps

I’ve been working on this for an obscene amount of time. I’ve been working on it for so long, I can’t even remember when I started it. I think it was back in February, and then I got interrupted by another slightly more important project, so progress stalled.

I’m occasionally thinking about ways to expose my archives. One of my first attempts was creating the random image plugin for WordPress which displays, at random, one of the 400+ photos I’ve included in my blog posts, with a link back to that post. It’s like visual serendipity.

Then it occurred to me that many of my blog posts, especially since moving to California, have a geographic focus. Usually they’re about a place I went and often include a photo or two (or three).

Anton Zuiker's Travels MapIt got me thinking about Anton’s travels page, powered by this flash app called IndyJunior which displays some of the places around the world that he’s been. Of course Anton’s pretty lucky, he spent time in Vanuatu doing Peace Corps, so his travel map looks awesome. But at the same time, it only really works well if you put in very granular data about the states or countries you visited.

Then it occurred to me, what if I could associate some geospatial data with my blog posts? Data that I could then extract and display on a map…using the Google Maps API, for instance. As long as I remembered to enter the metadata with my posts, the map would stay automatically updated, and it would provide a neat visualization of my archived posts and the places I’ve traveled. Here’s a screenshot:

Map of Justinsomnia blog posts

The hard part was going through my archive of several hundred posts (almost 4 years!) and entering latitude and longitude data as precisely as possible for all relevant posts. 152 coordinates in all, so far. That was like 152 mini-research projects. Hmm, where again were those botanical gardens just outside of Accra, Ghana?

Of course it turns out that some posts necessitated multiple coordinates, but thankfully many, especially the earlier posts, had no geospatial associations. Luckily Google Maps is a great tool for gathering latitude and longitude data. Just center the map on your location, click “Link to this page”, and the coordinates for that point will be accessible in the URL as the ll query string variable, e.g. ll=33.66121,-95.556507. Consider it the poor man’s geocoder.

For the WordPress geeks out there, I stored this data as a custom field called geographic_coordindate in the format latitude,longitude;location where location was a short description of the specific location. This was especially useful for posts with multiple coordindates. Then I wrote a script that selected all those posts from the database and generated the javascript function calls necessary to build the markers and info bubbles in Google Maps.

Eventually maybe I’ll release a plugin or some code so others can do this, in the meantime, just leave a comment or send me an email if you’re interested.

Otherwise, go forth, explore my geospatial history.