Geohashing

Summer seems to have arrived, at last.

As you may have noticed, today’s comic contains an algorithm for converting dates into local coordinates. For a given day, you can calculate what that day’s coordinate is for your region. Dan has put together a tool for calculating a day’s coordinates and show it using Google Maps. Note that you can’t calculate a day’s coordinates before the stock market opens on that day (about 9:00 EST) — except for weekends and holidays, when it uses the most recent opening price.

We’ve been having fun trying to reach these coordinates for some time now, when the coordinate is reachable — that is, when it’s not over water, in a military base, or in the middle of Bill Gates’s house.

If you happen to be looking for somewhere to go, driving to the coordinates can be an adventure. If you do, please take pictures and drop them on the geohashing wiki (feel free to help fill it out).  I’m gonna get some rest and then, at 10 AM tomorrow, see if I can get to the Boston coordinates (I have no way of knowing where they’ll be until then, of course).

And finally, when the coordinates are reachable, meetups are Saturday afternoon at 4:00.

Edit: I answered a bunch of questions in a comment below.  Further discussion is also happening on the wiki. I’m going to get some sleep and then head out to today’s coordinates (or as close as I can get).

586 replies on “Geohashing”

  1. Shouldn’t the opening quote for thursday be available by now? It says “Market data is not available for 2008-05-22” on mine at 16:23 CET, but by now DOW should have been available for an hour.

    Like

  2. Hmm – now it has appeared, but only after 10.30 EDT – isn’t that an hour late?

    Like

  3. It occurs to me that there is a simple modification to the game that both somewhat reduces the expected amount of driving required, solves all of the issues with the locations of the boundaries and individual locations being unreachable, and even makes the meetup groups non-constant: given that the algorithm lays a regular grid of location points around the globe, rather than going to the one in the same box as you are in, go to the closest reachable meetup to your current location.

    Like

  4. I find a problem with geohashing because i live in Denmark, the meeting places is often at sea 🙂

    For instance on the 2007-05-02 (55.226641°, 12.686399°) is at sea.

    Like

  5. > Nice job, Randall–you just broke a piece off Manhattan–and joined it with ***New Jersey***…

    Finally Jersey get’s its claim on the statue of liberty!

    Like

  6. A friend of mine suggested geocaching, and I thought “eh, maybe” but I like this idea: just pick a random spot, and go see what’s there. Yesterday it was an apartment complex, but with a massive State Park taking up a quarter of the graticule (Anchorage, Alaska), we should be in for some fun times. Darn you Munroe, getting me all curious about stuff. Now I gotta buy a GPS receiver…

    Kim H: San Diego, California has that same problem; a significant majority of their area is either in Mexico or out at sea. One suggestion offered on the wiki was to “correct” the meeting point by moving it 0.5 degrees inland. It’s important to clearly define /when/ the correction should be applied, though; if the uncorrected location is already on land, people might get confused and arrive at two different places. Others (like jonored right before you) have suggested going to the nearest accessible point, regardless of whether it’s in the same graticule as your home town.

    Like

  7. Mikhail, you’re entirely correct. And, in fact, that might be what I end up doing. ^_^

    Like

  8. @DFectuoso

    Why should they email you? Just show up, and they will too. Part of the fun is not knowing who will be there, and meeting new people, not just people out of your inbox…

    Like

  9. I have to agree that for San Francisco if you don’t have a car or can’t afford to drive almost to Santa Cruz and back it’s not really very feasible. Not to mention the problems with water.

    Cutting the graticles in half or smaller would at least help with this somewhat. Not to mention the many ideas to have more effective divisions created for each area.

    Like

  10. You don’t have to go to the location within your graticule. If you’re closer to the location in a different graticule (or it’s easier to get to), just go there instead.

    Like

  11. Why not multiply the resulting fractions by 10 (or 16, whichever) and make geohashing chains?

    This would place the location in a different graticule and you could have a road trip whenever you want.

    It would also be cool to see when this formed loops.

    Like

  12. What do you think would be the best way to get geohashing coordinates for a city like Sydney which straddles four coordinate points? Take the coordinate which falls in the centre of the city? Or the one which has the most amount of land?

    Like

  13. Rats. 41, -88 was just a few miles from my house today. But I didn’t read xkcd this week until now. It looks like it was a nice open (private?) field.
    I would have brought my Great Dane and German Shepherd (and maybe even my wife – but she just turned her nose up at the idea.) We will see what the weekend brings for 41, -88 or 41, -87.

    Like

  14. I believe there is a bug in the default implementation at http://xkcd.com/geohashing, caused by bad data. There are a bunch of Dow opening values with carriage returns on the end. The carriage return is affecting the hash. I’m pretty sure that it’s not stripping out whitespace before hashing. I’d know for sure, but either the website died, or my IP got blocked for poking around in your bad data. 🙂

    Also, 1970-3-19 is missing

    Like

  15. Actually, I believe there is a bug in my pants. And by bug, I don’t mean insect 😉

    Like

  16. When i zoom in and out, the meetup location changes (only happened once the host was running again…)

    Like

  17. It might just be me, but when I zoomed in to see where it had labelled, it moved. not sure it’s supposed to be doing that. I can even keep on the same box on the map, no zooming, and click update on the date entered again and the site moved. 😦

    Anyone else having this problem? If it helps, I’m in the UK so scrolling over from the US and then zooming to see it.

    Like

  18. Seems there is a bug in the irc.peeron.com implementation. Here’s some debug, same input, two different tries:

    Graticule: (32, -111) – (33, -110)
    Market open on 2008-05-23 = 12620.90000000000000000000
    MD5(2008-05-23-12620.900000000000000000000): a8ade96b116b198d2e520ce6dad4f4b6

    Graticule: (32, -111) – (33, -110)
    Market open on 2008-05-23 = 12620.9000000000000000000000
    MD5(2008-05-23-12620.90000000000000000000000): 9085f58a1180363acc0d76ceb8ad9dd7

    Different number of decimal places in the Market Open value is causing the problem.

    Like

  19. I’m having the same problem. Every time I click update the location changes. If there’s a fix by Saturday I’d love to try to get to the Clovis, NM. meet.

    Awesome idea Ryan!!

    Like

  20. Official tool works fine for me. Does anybody know if that reservoir beach near Clinton for the Boston-area meetup is public?

    Like

  21. And the electronicwar one seems to be buggy. Not only does it give me different results than the official one, it gives me results over water telling me they aren’t over water and they’re accessible.

    Like

  22. Ah yes, Firefox seems to use two decimal places for the Market Open, so gets a consistent result.

    Like

  23. Geocaching has the advantage that you get to swap treasure. So what if everyone brings some old tat to their geohash meet? It could be like a 21st century Saturday Swap Shop (British 80’s TV programme) – “John is offering a python script to calculate geohashing co-ordinates (used twice). He would like a Star Wars figurine. Or a girlfriend…”

    Like

  24. For reference: I’m in the 44/-93 graticle.

    Fun comic! I’ve got a couple problems with the Saturday 4 p.m. meetup:

    1. It’s Bass Angling Opener this weekend in Minnesota. I actually WANT the coordinates to be in the middle of a lake! Alas, they appear to be along the side of a road in rural S. Minn., which leads to…

    2. 135-mile round trip this Sat. -> $27.43 gas plus 3 hr. driving time -> pass. Cost, alas, is a factor.

    Your comic does generate some interesting alternative ideas. One I like is the following:

    1. Choose a city, town, burg… enter the name in a map site (let’s say Google). Google will return a consistent point for that town: Chicago’s is just by City Hall near Lasalle and Randolph. This works for small towns, too (Hesston, KS — never been there, but telecommuted in for a contract I.T. gig — gets its Googlecenter on Ridge Road between Randall and Smith). Every town APPEARS to get a consistent Googlecenter.

    2. Do the MD5 dance on the following:
    yyyy-mm-dd–

    3. Agree on the following:
    distance units
    meetup time

    4. Use agreed portions of the MD5 to determine:
    distance from Googlecenter
    compass direction (normalize part of MD5 to degrees or 2pi-radians)

    I may have missed something, but the bones are there… adjustments can be made for coastal towns.

    Enjoy the comic: thanks for all the fish…

    Like

  25. Step 3 above should read: yyyy-mm-dd-[town name]-[postal code]

    treating the tokens like… well… tokens (don’t put in the square brackets, that is).

    Like

  26. Is it just me or is the tool on xkcd.com/geohashing broken? Every time I click Update, it appends an extra 0 to the end of the market open value, thus changing the location.

    Also, Vancouver is cut off about half way, so only about half of the Lower Mainland is included depending which region you are in. Can the map be modified to have a different region size so that I could maybe get rid of all the mountainous area and make it so the geohashes are more accessible?

    Like

  27. This vaguely reminds me of a CS project I did a while ago, which was a fractal landscape generator. It used the standard triangle-subdividing midpoint-displacement thing, but computed the amount to displace the midpoints based on a hash of the endpoints. So given a starting triangle, you could zoom into part of it, without computing the whole thing, and fly around. In practice, though, I ended up with lots of skinny little triangles when one zoomed in and the other didn’t. It was fun though.

    Like

  28. Too bad I’m not in Santa Barbara anymore. This weekend’s coordinates there seem very accessible.

    Like

  29. I guess Debian should have switched their random number generator to a hash of the Dow.

    Like

  30. For those of you in Chicago and Washington DC who are complaining about bad divvying up of your cities, I might recommend the Israeli solution to this one – make up your own granicule that’s more convenient and/or modify the algorithm so it gives you useful results more often (http://wiki.xkcd.com/geohashing/Israel) If you have someone with access to a webhost, have someone set up their own implementation of the algorithm that is aware of your modifications.

    Like

  31. This is cool. Unfortunately I’m currently in (12,77), South Bangalore (India), with no transport, and it’s hard to get around *anywhere*, let along trek miles out of the city… so unless it happens to fall on a nearby spot, I’m unlikely to make it… But it’s still cool!

    Like

  32. This all reminds me of a thing called The Random Geographical survey done here in New Zealand a while ago.

    The fellow generated a set of random coordinates by using map indexes for maps in NZ and then the random points within that. He then attempted to visit every place identified and take a picture or two there. That was the art work.

    Some of the places required major three day hikes to reach etc..
    http://halo.gen.nz/rgs/moss.htm

    .. what with NZ having a lot of inaccessible wilderness country you get that.

    Like

  33. Yes, in fact, New Zealand has bountiful fields from which one can graze on the grass of yore for hours. This too, reminds me of a little story I wrote back in ye old yonder years, entitled “The story of New Zealand and how I came to become Cheif Rambletasm.” Oh dear boy, what what and all that. Crumpets and vegimite?

    Like

  34. It may be a better idea to get the co-ordinates of where you want to go and check dates and stock prices to decide when to travel there.

    A cheaper alternative strategy, given the cost of travel and the state of the world, would be to get the co-ordinates to where you already live and calculate the cost of living and how long you can afford to keep your house.

    Just a thought ;¬)

    Like

  35. My region ( in washington state) cuts my small ( 3-square mile) town in half, I seriously live 3 blocks away from the boundry line.

    Like

  36. Pingback: nouvelle star soma
  37. dude!!!

    please help I’m from natal in south Africa

    is there a way to get this to work for South Africa?

    Like

Comments are closed.