Open Location Code / Plus Code to KML converter

Open Location Codes also known as Plus Codes are an initiative by Google to provide addresses to parts of the world that do not have Street Names or other easily traceable or official addresses. Google has recently announced on the LatLong blog that Plus Codes are now searchable on Google and Google Maps. There is, however, no mention of Google Earth, and as of this writing, they do not work in Google Earth search.

Plus Codes come in several formats. To identify a specific location on the Earth (to an accuracy of a few metres) you typically need 10 or 11 characters looking something like this 8PVCQ9VH+4C. If the general location is already known then the code can be shortened. This also means that a code can be given as a combination of a locality in traditional format and a short code. However, we discovered that currently this mixed format doesn’t work correctly in either Google Search or Google Maps, but does on plus.codes that Google has made available to make it easier to look up the Plus Code for a given location.

To find a Plus Code in Google Earth the easiest way is to search for it in Google Maps, then copy the latitude and longitude that appear in the results into the Google Earth search box. However, we thought it would be fun to create a little converter from Plus Codes to KML. The conversion of Plus Codes to latitude and longitude is provided by Google on GitHub as open source libraries, including a JavaScript library that we have used. Then all we do is insert them into a KML with a little bit of JavaScript. Note that a proper Plus Code defines an area and not a single point, so the generated KML includes a rectangle as defined by the Plus Code as well as a marker for the centre of the rectangle.

Plus Code:

Convert to KML

Note that our converter only works on standard full length plus codes and cannot handle shortened or mixed versions.


When roads are unnamed and not even marked on the map, you can still have an address. And in this remote part of Mongolia, you can even have Street View.

About Timothy Whitehead

Timothy has been using Google Earth since 2004 when it was still called Keyhole before it was renamed Google Earth in 2005 and has been a huge fan ever since. He is a programmer working for Red Wing Aerobatx and lives in Cape Town, South Africa.






PLEASE NOTE: Google Earth Blog is no longer writing regular posts. As a result, we are not accepting new comments or questions about Google Earth. If you have a question, use the official Google Earth and Maps Forums or the Google Earth Community Forums.

Comments

  1. This (Google switching from standard coordinates to a “plus code”) is a complete waste of time! Google maps (in my iPad) would only give me a plus code, trying to lock me into their product. I had to use the converter then find the coordinates in a lot of text, reverse the order of the coordinates to get latitude first, then paste it back in, to test it, just to get the just as short decimal latitude and longitude coordinates that I can paste into other maps.

    • After I’ve further researched this, I’ve realised that what I really want is the ability to get a choice of location code, including latitude and longitude (traditional format and decimal format), as well as Open Location Code / Plus Code, and “Map Code” and “What Three Words”, the last being for a bit of fun, while being very practical for informal sharing, while I like the OLC after reading about it, for formal address sharing, especially for places where the local addresses are so confusing for foreigners.

      The actual waste of time, was (1) firstly that I did not get that choice, I only got something completely unexpected, and unusable for pasting into another mapping system as I had spent hours trying to find an address based on someone’s series of Google Earth (or Maps satellite view) photos (looking at roads and roofs), and then wanting to try to find a topographical map to evaluate the slope of the road for truck access!
      (2) When I found, after Googling, your converter, I was not really looking for KML, just the traditional coordinates that I had to copy and paste out of the KML code.
      (3) Not so much a “waste” of time, as unexpected research, to spend hours reading about different location addressing proposals, and downloading various map apps to try. Still nothing quite does what I want. … The next thing I want is how to get hazard (eg. volcanic and flood) maps (or Google Earth or Maps layer) for Colombia, that got sparked from all of this, as I’m looking at buying some property there. (Much searching remains.)



PLEASE NOTE: Google Earth Blog is no longer writing regular posts. As a result, we are not accepting new comments or questions about Google Earth. If you have a question, use the official Google Earth and Maps Forums or the Google Earth Community Forums.