Monday, June 14, 2010

The 10:10 Code

Four years ago I wrote about a way to encode the latitude and longitude of any point on the Earth's surface to 10m of accuracy with a 10 character code. Apart from a modification to the way the check digit is calculated, the code remains unchanged.

The idea is this: instead of giving people addresses, or coordinates, you can give them something like a post code for any point on the Earth's surface. This can then be entered into a GPS device and decoded. Thus a business can provide its 10:10 code and know that people will be able to find it.

I was reminded of this, this weekend when I took the Eurotunnel to France. On their web site they say:


Now those latitude and longitude values are very hard to enter, and, although in the UK post codes are pretty accurate, they are not universal (e.g. in France and the US there's no equivalent). In contrast the 10:10 code is global.

Here's some JavaScript code that calculates the 10:10 code:



The 10:10 code of the Eurotunnel terminal in the UK is: MED 8FV N9K5

PS. Many people have pointed out that there are existing systems like this, and existing patents. As far as I am aware, none of them include a check digit. For example, there's the Military Grid Reference System, the Natural Area Code, this Microsoft patent and Geohash. The check digit is critical because it reduces operator error when entering a location on a GPS device.

30 comments:

Mário Valente said...

You should propose this as worldwide postal code...

-- MV

Mark Russell said...

It'd be nice if the likes of Google maps (or my phone's Navigation or Maps app) understood it.

... and, if there were a web service like bitly for location that put me on the map of my choice in the right place.

... and, as an extension to that idea, if QR barcodes could link to the service.

Ross said...

Probably shouldn't use both "8" and "B" or "D" and "0"...

Bob said...

What about using both lower- and upper-case?

R said...

This looks like simple arithmetic.

I would suggest two basic improvements...

1) Take into account that at higher latitudes, longitude need not be encoded as accurately.

2) don't combine latitude and longitude. Keep them separate, with a space in between. That way, a human reader can tell that two encoded points are near each other.

John said...

What a great idea for a google maps mashup!

Charlie M said...

this code is made less readable by use of single character variable names. :( Is it too much to expand them please?

TextLogic Inc said...

Do you have reverse ? i.e. given the string splits to proper lan/lat ?

Kaveh Shahbazian said...

Very interesting!

Q1: Where in the code the radius 10m is specified? Can we produce code with 500m radius?

Q2: Does this mean all points in a radius of 10m distance of a specific point will produce the same code?

qbxk said...

cool stuff, two comments tho, first i translated your code to perl and couldn't get the same answer, so i then tried it in js and i got the same answer i got in perl!

so i think that the location at 51.09559,1.12207 maps to MEQ N6G 7NY5

secondly, c %= 29 you probably meant c %= base

qbxk said...

cool stuff, two comments tho, first i translated your code to perl and couldn't get the same answer, so i then tried it in js and i got the same answer i got in perl!

so i think that the location at 51.09559,1.12207 maps to MEQ N6G 7NY5

secondly, c %= 29 you probably meant c %= base

jdeisenberg said...

It's a clever idea, but it's too clever for a stupid person like me. I look at "MED 8FV N9K5," and it's not immediately obvious to me that it describes a point north of the equator and east of 0 longitude.

joe.marcato said...

Here is another way to make the resolution approximately consistent across the globe.
Enclose Earth into a cube. Divide each face of the cube into a 8,000,000 by 8,000,000 grid. Project the location onto the cube. The square number is your code. There are 3.84E14 squares on the cube: that's also 10 characters in base 29 but it gives you a resolution better than 1 meter on the ground anywhere in the world.

RJ said...

It would be nice (though technically impossible) to use a system where it's easier to calculate the distance between two points.

Perhaps putting a grid over a Winkel Tripel projection would work better

Yvo said...

I made "GLOCO" a while ago, it encodes lang/lat to a code of 5 up to 10 characters long, since takes into account populair locations in the worlds. Hence city centres have shorter codes, compared to deserts. (www.gloco.com)

Mukesh Agarwal said...

Hey Nice Idea man.. But I propose either to use alphabets only or remove some confusing (look a likes )LIke: (1 and I,l),(0,o,O),(B,8),(b,6)

tjp said...

I like this, even though practically it's not very usable. Yahoos WOEID doesn't do error checking, but does a few things that make it v powerful:

- takes accuracy into consideration
- brings some sort of place hierarchy
- helps when the geocode of a place changes (earthquakes etc)

It's a long way for WOEIDS to become something that can be put into a GPS device, but using smart metadata is always better than, er, not that smart.

London is 44418.

http://developer.yahoo.com/geo/geoplanet/guide/concepts.html

Jonas Hogstrom said...

I translated the code to C#, and I got MEQ N6G 7NY5 as well for the coordinates for the terminal coordinates. The SOC-algoritm from 2006 and the 1010-algorithm differs both in the calculation of the checksum and the alphabet used. the SOC-version uses a 32 character alphabet, and the 1010-version uses only 29 characters. My C# implementation (including exe) for both SOC and 1010 twoway conversions can be found at http://bit.ly/SOC1010

When I converted the 1010-coordinate back to latlong for the eurotunnel terminal, I got a difference of 11.1m from the original coordinates...

rob said...

So far so good but once encoded how does anyone else use it? Need a decode routine ideally with a link to Gmaps. Apart from that I agree with others who suggest eliminating ambiguous characters like I 1 l

suzie said...
This comment has been removed by a blog administrator.
Clay Shannon said...

I am not a scientist, but rather a "jack of all arts" (photography, music, and writing).

I "proposed" a similar way of uniquely encoding locations in my utopian novel "The Vavilovian Conspiracy"

Free to download from www.lulu.com/blackbirdcraven

id.php said...

Not a bad idea (and the checksum is nifty!). However, the GeoHash scheme has two important properties that 10:10 does not:

* arbitrary precision (to nearest 5 bits)
* lat/lon are interleaved

Bit interleaving in particular is useful because a geohash which is the prefix of another contains the other in its bounding box. Two geohashes which share prefixes are near each other. And so on.

This is great for search (e.g. google) and for use as a single database key for a location.

technogeist said...

Talk about a serendipitous finding.

I've been thinking of, and attempting to create something like this, to extend the concept universally unique identifiers. (UUIDs)

William T said...

Agree with id.php - any geo-code needs to have the ability to be humanly interpreted - so if you see two codes you can immediately tell if they are close to each other. Geohash has that ability since the left-hand characters encode enclosing (larger) areas.

mrjbq7 said...

And how about a version in Factor!

By the way, I also get "MEQ N6G 7NY5".

Nick Berardi said...

The US has something similar but it is not used. In the US it is called ZIP+4 and the +4 such as

12345-1234

Identifies a specific property and can be reversed to an address with the right database. However the ZIP+4 is very rarely used.

sneakatdatavibe said...

We don't need a twelfth system for encoding lat/lon tuples. Pick an existing one and start using it.

Currently, we have:

- decimal lat/lon

- d/m/s lat/lon

- UTM ( http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system )

- MGRS ( http://en.wikipedia.org/wiki/Military_grid_reference_system )

- Geohash ( http://geohash.org/ )

- "Natural Area Code" ( http://en.wikipedia.org/wiki/Natural_Area_Code )

Please, suggesting something like this and encouraging people to implement it is like coming out with a device that only charges over micro-USB. Just... don't.

gking86 said...

Maybe it's my military experience, but I find UTM or MGRS the easiest.

Holtwick said...

If you like it even shorter try my modified Geohash algorithm I used in my twittori.com project. http://blog.twittori.com/about-link-format/

Kenn Green said...

May someday every place on earth has its own barcode, visitors can learn its history from scanning its qr code.