Download OLC grid

890 views
Skip to first unread message

Pablo Pardo

unread,
Oct 23, 2017, 4:46:53 AM10/23/17
to open-location-code
Hi.
Before all, congratulations for the project. I think is a great idea.
I was thinking to implement it in a project, and I as wondering if is possible to download all the grid in any GIS format (KML, geoJSON...)

Thanks.

Philip Newton

unread,
Oct 23, 2017, 5:06:57 AM10/23/17
to Pablo Pardo, open-location-code
On 23 October 2017 at 10:46, Pablo Pardo <geogra...@gmail.com> wrote:
> I as wondering if is
> possible to download all the grid in any GIS format (KML, geoJSON...)

That's a bit like asking whether it's possible to download the
longitude-and-latitude grid, isn't it?

The OLC grid is arbitrarily fine depending on how many symbols you
use, pretty much like the longitude-and-latitude grid; you would have,
for example, lines at not only 4° E and 5° E but also at 4.5° E, 4.05°
E, 4.005° E, 4.0005° E etc. etc.

Cheers,
Philip
--
Philip Newton <philip...@gmail.com>

Doug Rinckes

unread,
Oct 23, 2017, 5:42:27 AM10/23/17
to Philip Newton, Pablo Pardo, open-location-code
Phil's right - downloading "the grid" for an area is a bit tricky, but one thing we have been working on is providing a KML network link, so that apps that support KML, like Google Earth, will be able to show a grid that depends on the zoom/area.

This isn't yet ready to push out but here's a couple screenshots:










Doug Rinckes, Technical Program Manager, Google Switzerland GmbH; 9GHJ+P88 Zürich


--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.
To post to this group, send an email to open-location-code@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.
To view this discussion on the web, visit https://groups.google.com/d/msgid/open-location-code/CA%2BcwSm8TFwwfpHVuGFicoj6qhYmUVmkW4e8LT4QT%2BLyocfb0Kg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Pablo

unread,
Oct 23, 2017, 5:55:32 AM10/23/17
to Doug Rinckes, Philip Newton, open-location-code
Ok. 
I was thinking on something like download by OLC accuracy level, and get a GIS vector file with more or less polygons /points depending on this level (11, 10, 8...)
As I understand, by the moment the only way I can get it is specifying a network of points, and generating it by myself with the libray, isn't it?

Thanks


To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsubscribe@googlegroups.com.

Doug Rinckes

unread,
Oct 23, 2017, 6:55:08 AM10/23/17
to Pablo, Philip Newton, open-location-code
Yes, or you can do it just with a couple of loops and you might not need the library at all. The grid size is defined in degrees, so if you wanted the xxxxxxxx+xx grid between 40 and 41 degrees latitude, and -122 and -121 degrees longitude, you just need a grid spaced at 0.000125 degree intervals:

for lat = 40; lat <= 41; lat = lat + .000125 {
  for lng = -122; lnt <= -121; lng = lng + .000125 {
    // lat & lng denote the SW corner of a .000125x.000125 degree area for 10 digit OLC resolution
  }
}

A couple of points:
  • if you want to draw a grid, your file will be much smaller if you use lines than if you use polys. A single 20x20 grid needs 42 lines, but 400 square polys.
  • depending on the programming language, it turns out that adding .000125 to a number 8000 times may experience rounding errors (hi, javascript!) making it very slightly less or more than the amount in the loop. You should be able to ignore this if you change the condition in the loop to something like lat <= (41 - 1e-10)



Doug Rinckes, Technical Program Manager, Google Switzerland GmbH; 9GHJ+P88 Zürich

To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.
To post to this group, send email to open-location-code@googlegroups.com.

Emmor Nile

unread,
Mar 6, 2018, 12:56:47 PM3/6/18
to open-location-code
Plus Codes appears to be a promising tool to help people locate themselves on the planet.  It looks much better than other systems like W3W, MGRS, & Maidenhead.
I approach this as a Geospatial professional and don't quite understand the structure yet.
Are there some graphics showing the OLC nested structure? The code isn't helping my understanding.
I would like to be able to download GIS polygon layers of the 4, 6, and 8 digit codes.

Emmor
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.
To post to this group, send an email to open-loca...@googlegroups.com.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.
To post to this group, send email to open-loca...@googlegroups.com.

Doug Rinckes

unread,
Mar 7, 2018, 4:32:49 AM3/7/18
to Emmor Nile, open-location-code
Hi Emmor,

You can turn on the grid display using the map at plus.codes/map/. As you zoom the grid redraws to more or less detail. We're also working on other material but I can't give timelines yet.


Ngā mihi,
Doug Rinckes, Technical Program Manager, Google Switzerland GmbH; 9GHJ+P88 Zürich
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsubscribe@googlegroups.com.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsubscribe@googlegroups.com.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.
To post to this group, send email to open-location-code@googlegroups.com.

Blake Girardot

unread,
Aug 11, 2018, 6:55:47 PM8/11/18
to Plus Codes Community Forum
Hi Doug,

What Emmor and Pablo are asking for is the same thing I need. Some of us would like to visualize the grid in our existing tools, which means either a KML, shapefile or a TMS end point to a transparent rendering of them we can use in our tools.

Generating one ourselves is a bit beyond many of us, well, at least myself.

This same topic, OLC grid for overlaying also applies to our integration with other tools like Fieldpapers and the HOT Tasking Manager.

So it would be great to figure out a good way make this possible. It is just a tiny bit beyond me.

I love the examples you posted up thread, we just want the same sort of grid in our tools, kml, shapefile, geojson, TMS layers all work for us.

Cheers!
Blake

For reference, the issues I created related to this on other projects I contribute to:



Cheers,
Blake
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.
To post to this group, send email to open-loca...@googlegroups.com.

Doug Rinckes

unread,
Aug 13, 2018, 7:15:39 AM8/13/18
to bgir...@gmail.com, open-location-code EXTERNAL
I think generating something like this is easily possible. I'm happy to open this up to understand what you would actually like it to output.

Specifically, do you need something like a TMS service, or if there was a web form where you entered the coordinates and got a geojson or kml file would that be sufficient?

Ngā mihi,
Doug Rinckes, Technical Program Manager, Google Switzerland GmbH; 9G8F+6W Zürich


To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.

To post to this group, send email to open-loca...@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.
You received this message because you are subscribed to the Google Groups "Plus Codes Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.

To post to this group, send email to open-loca...@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.

Blake Girardot

unread,
Aug 13, 2018, 10:41:19 AM8/13/18
to Doug Rinckes, open-location-code EXTERNAL
HI Doug,

We need the scale-able grid like we get with graticules now.

For us to use it we need to see it, understand it and use it at scale, not at the look up an individual building level, all though that will come from having access to it in our existing tools.

Please see this tweet of a mock of up on how we work and why having a graticule like grid overlay in our tools would make such a difference to our ability to evaluate and use: https://twitter.com/BlakeGirardot/status/1028689726088388609

Having it as a TMS layer would it it into a lot of our tools right away as they all support TMS now, especially the ones we use for large and small scale project planning.

I hope that helps, I really look forward to getting OLC support into more of the open geospatial tools that humanitarian organizations around the world use every day!

Cheers,
Blake

To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.

To post to this group, send email to open-loca...@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "Plus Codes Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-code+unsub...@googlegroups.com.
To post to this group, send email to open-location-code@googlegroups.com.



--
----------------------------------------------------
Blake Girardot
OSM Wiki - https://wiki.openstreetmap.org/wiki/User:Bgirardot
HOTOSM Member - https://hotosm.org/users/blake_girardot
skype: jblakegirardot

Doug Rinckes

unread,
Aug 13, 2018, 11:00:53 AM8/13/18
to Blake Girardot, open-location-code EXTERNAL
Thanks for that.

If I understand TMS correctly, it serves image tiles, right? Or can it also serve GeoJSON vector (which might be easier)?

If so, the tiles would be transparent PNGs, with:
  • the lines on them
    • a fine grid level (say, for the 10 digit, normal precision, grid)
    • the next larger grid level (for the 8 digit grid)
  • labels
    • the row and column digits for the fine grid
    • the larger grid code (in the center or in the corners or something)
The grid levels displayed will depend on the zoom level. (We might want to include a parameter so you can "nudge" it up or down from the default, but in comparison to everything else that would be easy.)

Does that sound right?

BTW if anyone knows anything about writing a TMS server, and might be able to help with advice, that would be great.

Ngā mihi,
Doug Rinckes, Technical Program Manager, Google Switzerland GmbH; 9G8F+6W Zürich

To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "open-location-code" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.

To post to this group, send email to open-loca...@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "Plus Codes Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.

To post to this group, send email to open-loca...@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.



--
----------------------------------------------------
Blake Girardot
OSM Wiki - https://wiki.openstreetmap.org/wiki/User:Bgirardot
HOTOSM Member - https://hotosm.org/users/blake_girardot
skype: jblakegirardot

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "Plus Codes Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.

To post to this group, send email to open-loca...@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.

Sascha Brawer

unread,
Aug 13, 2018, 1:05:29 PM8/13/18
to Doug Rinckes, Blake Girardot, open-location-code

Nikhil VJ

unread,
Sep 9, 2018, 4:57:57 AM9/9/18
to Plus Codes Community Forum
Hello,

I found this post from a web search for the same!

IMHO what we need is the precise co-ordinates of OpenLocationCode's grid lines, and different sets of that data for the different levels of precision. With a list of longitudes and a list of latitudes we can generate our grids easily.

The plus.codes website's map does show this grid, meaning they have generated it. Can we have that please? :D

I'm looking at the code on python side but its confusing for now.
It seems there are methods given for finding the bounding lat-longs for a given location code.

One way of going about this would be to generate a listing of all location codes, and then run the decoding method on them all. But I feel like this will be a reverse work while in the internal processes the grids may be generated first and then the location codes are generated.

This would be a one-time exercise, we can create a shapefile having the gridlines and put it on github.

If anybody's already done this then please say so!

-Nikhil VJ
Pune, India

Nikhil VJ

unread,
Sep 9, 2018, 9:08:30 AM9/9/18
to Plus Codes Community Forum
Hi, sorry I just now read Doug's reply earlier in this thread. Thats what it amounts to!

precision : intervals in lat-long units
precision 10 : 0.000125
precision 8 : 0.0025
precision 6 : 0.05
precision 4 : 1
precision 2 : 20

If I try this in python: (first four numbers are the lat-long bounds)

olc.decode('7J000000+')
> [10.0, 60.0, 30.0, 80.0, 20.0, 70.0, 2]

olc.decode('7J220000+')
> [10.0, 60.0, 11.0, 61.0, 10.5, 60.5, 4]

olc.decode('7J222200+')
> [10.0, 60.0, 10.049999999999997, 60.05000000000001, 10.024999999999999, 60.025000000000006, 6]

olc.decode('7J222222+')
> [10.0, 60.0, 10.002499999999998, 60.0025, 10.001249999999999, 60.00125, 8]


In QGIS, you can generate a grid by:
Menu > Vector > Research tools > Vector Grid

grid extent (xmin,xmax,ymin,ymax): 78.1,79,16.9,18.2 (in my example, a city in India)
set both lat and lon interval as per the precision level you want
And that should generate the grid for you. You can save that layer as a shapefile in any format.

-Nikhil VJ
Pune, India

Doug Rinckes

unread,
Sep 10, 2018, 4:38:43 AM9/10/18
to nikh...@gmail.com, open-location-code EXTERNAL
Code to provide a tile server is now in github: https://github.com/google/open-location-code/tree/master/tile_server

Ngā mihi,
Doug Rinckes, Technical Program Manager, Google Switzerland GmbH; 9G8F+6W Zürich

--
Public site: http://www.openlocationcode.com/
Github project: https://github.com/google/open-location-code
Demo site: http://plus.codes/
---
You received this message because you are subscribed to the Google Groups "Plus Codes Community Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to open-location-c...@googlegroups.com.
To post to this group, send email to open-loca...@googlegroups.com.
Visit this group at https://groups.google.com/group/open-location-code.

Doug Rinckes

unread,
Nov 20, 2018, 6:24:48 AM11/20/18
to Plus Codes Community Forum
It took a while but we also have a public TMS endpoint, and network KML service for Google Earth.

Of the two, I really like using Google Earth Web in a browser tab. You can load the network KML to draw the grid, clicking on a grid square displays the code and coordinates, and it remembers that you've loaded the KML when you close the window:

earthweb - Edited.png



To see examples of using the TMS endpoint or to see instructions about how to use Google Earth to view the grid, see https://grid.plus.codes.

Have fun!

Doug Rinckes
Reply all
Reply to author
Forward
0 new messages