How Much of My Graticule is Covered With Water?

I’m a moderately-keen geohasher, as you might be aware if you follow my geohashing logs or you saw that video of me going ‘hashing earlier this month.

For those that don’t know, the skinny version is this: in May 2008 an XKCD comic was published proposing (or at least joking about) a new game with a name reminiscient of geocaching. To play the game, participants use a mathematical hashing function on the current date and the most recent Dow Jones Industrial Average opening value to generate sets of random coordinates around the globe and then try to find their way to them, hopefully experiencing adventures along the way. The nature of stock markets and hashing functions means that the coordinates for any given day are effectively random and impossible to predict (far) in advance, so it’s sometimes described as a spontaneous adventure generator.

XKCD comic #426, "Geohashing"
The XKCD comic that started it all.

Recently, I found myself wondering about how much of a disadvantage players are at if they live in very “wet” graticules. Residents of the Channel Islands graticule (49 -2), for example, are confined to two land masses surrounded entirely by water. And while it’s true that water hashpoints can be visited if you’re determined enough, it’s still got to be considered to be playing at a disadvantage compared to those of us lucky ones in landlocked graticules like mine (51 -1).

And because I’m me and so can’t comfortably leave a question unanswered, I wrote a program to try to answer it! It’s among the hackiest, dirtiest software solutions I’ve ever written, so if it works for you then it’s a flipping miracle. What it does is:

  1. Determines which OpenStreetMap tiles (the image files served to your browser when you use OpenStreetMap) cover the graticule in question, and downloads them.
  2. Extracts information about the colour of each pixel in each tile.
  3. Counts the proportion of “water blue” pixels to other pixels (this isn’t perfect, because it trips over things like ferry lines on the map as being “not water”, especially at low zoom-levels).
Extreme zoom-in on Worcester College Lake, on OpenStreetMap.
Some parts of Worcester College Lake are identified as “not water” on account of the text overlay.

I mentioned it was hacky, right?

You can try it for yourself, if you’d like. You’ll need NodeJS, wget, wc, and ImageMagick – all pretty standard or easy-to-get things on a typical Linux box. Run with node geohash-pcwater.js 51 -1, where 51 -1 is the identifier for the graticule you’re interested in. And in case you’re interested – the Swindon graticule (where I live) is about 0.68% water, but the Channel Islands graticule is closer to 93.13% water. That’s no small disadvantage: sorry, Channel Islands geohashers!

Update 2018-08-22: discovered some prior art that takes a somewhat-similar approach.

Extreme zoom-in on Worcester College Lake, on OpenStreetMap.×

How To Set Up an OSRM Server on Ubuntu 14.04

This article is a repost promoting content originally published elsewhere. See more things Dan's reposted.

How To Set Up an OSRM Server on Ubuntu 14.04 | DigitalOcean (DigitalOcean)

The OpenStreetMap project consists of raw map data, collected and aggregated by thousands of users. This tutorial covers the configuration and maintenance of a web service using Open Source Routing Machine (OSRM), which is based on the OpenStreetMap d

The OpenStreetMap project consists of raw map data, collected and aggregated by thousands of users. However, its open access policy sparked a number of collateral projects, which collectively cover many of the features typically offered by commercial mapping services.

The most obvious advantage in using OpenStreetMap-based software over a commercial solution is economical convenience, because OpenStreetMap comes as free (both as in beer and as in speech) software. The downside is that it takes a little configuration in order to setup a working web service.

This tutorial covers the configuration and maintenance of a web service which can answer questions such as:

  • What is the closest street to a given pair of coordinates?
  • What’s the best way to get from point A to point B?
  • How long does it take to get from point A to point B with a car, or by foot?

The software that makes this possible is an open-source project called Open Source Routing Machine (OSRM), which is based on the OpenStreetMap data. Functionalities to embed OpenStreetMaps in Web pages are already provided out-of-the-box by APIs such as OpenLayers.

While slightly dated, I found this guide to be really valuable in my effort to set up a server that could spit out fastest walking routes around Oxford to support a PWA-driven tour of places relevant to J. R. R. Tolkien’s life, at my “day job”.

Maps Showing California as an Island – The Public Domain Review

This article is a repost promoting content originally published elsewhere. See more things Dan's reposted.

http://publicdomainreview.org/collections/maps-showing-california-as-an-island/ (publicdomainreview.org)

If California were a country its economy would be the fifth largest in the world (just ahead of the UK). Yet the tech boom is not the starkest way California has ever stood apart from its neighbours. That would surely be the maps depicting it as an island, entire of itself. Below we have featured our pick of these glorious seventeenth- and eighteenth-century aberrations, from a collection of hundreds held at Stanford.

The intriguing story of how the maps came to be deserves a little mapping itself. In the 1530s Spanish explorers led by Hernán Cortés encountered the strip of land we now know as the Baja Peninsula. They mistook it for an island and called it California.

Google Maps’s Moat

This article is a repost promoting content originally published elsewhere. See more things Dan's reposted.

Google Maps’s Moat (Justin O’Beirne)

How far ahead of Apple Maps is Google Maps?

Over the past year, we’ve been comparing Google Maps and Apple Maps in New York, San Francisco, and London—but some of the biggest differences are outside of large cities.

Take my childhood neighborhood in rural Illinois. Here the maps are strikingly different, and Apple’s looks empty compared to Google’s:

Similar to what we saw earlier this year at Patricia’s Green in San Francisco, Apple’s parks are missing their green shapes. But perhaps the biggest difference is the building footprints: Google seems to have them all, while Apple doesn’t have any.

Edinburgh Free Fringe 2012 Venue Map

After a few years break, I’m once again heading up to Edinburgh for the Fringe Festival. As on previous ocassions, I expect to spend a lot of time enjoying Peter Buckley Hill‘s Free Fringe, which is just about the best thing to happen to the Fringe ever. And this time, I’m going to be better-prepared than ever. I’ve made a map.

Map of the 2012 Free Fringe.
You can be better-prepared, too, because my PBH Edinburgh Free Fringe Map 2012 is here for you, as well.

Sharing is caring, so I’ve made the map available to you, too. Click on the picture to see the map. Because it’s in Google Maps it ought to work on your mobile phone. If you’ve got GPS then you can get lost in Edinburgh in high-tech ways you never before thought possible. Click on any given venue for a web address where you can find a list of events that are occurring at that venue.

Or if you’re really nerdy, you can download the KML and go geocaching-for-comedy. Just me? Okay then…

Update: you can now view the map on the frontpage of the Free Fringe website, too.

8-Bit Google Maps

It’s like stepping back in time through videogaming history. And also sideways, into a parallel universe of knights and dragons.

8-bit Google Maps. At different view levels, you’ll see mountainous areas (Wales is worth looking at) and sprites for cities of different sizes.

It’s like Google Maps, but in the style of retro top-down, turn-based RPGs. It’s really quite impressive: it’s presumably being generated at least semi-dynamically (as it covers the whole world), but it’s more than a little impressive. It sometimes makes mistakes with rivers – perhaps where their visibility from the air is low – but nonetheless an interesting feat from a technical perspective.

There’s “8-bit Street View”, too.

Nice one, Google. Go take a look.