GOL 2.2: Download OSM data for arbitrary regions

Thanks for all your interest in the new Geo-Object Bundle file format! We’ve enhanced the gol load command: It can now download sets of data tiles directly from a URL and build a Geo-Object Library in the background.

This capability is available in GOL Tool 2.2 or above (downloadGitHub).

Open Planet Data hosts the full planet as a Geo-Object Bundle (updated daily). At just under 50 GB, it’s the most compact representation of the full OSM dataset. Still, that’s a hefty download, and most applications only need a subset, so you can specify a region using the --area (-a) option:

gol load bodensee https://download.openplanetdata.com/osm/planet/gob/v2/planet-latest.osm.gob \
    -a 9.55,47.4,8.78,47.66,9.01,47.88,9.85,47.58,9.82,47.46 

This creates bodensee.gol, covering the region around Lake Constance. The coordinates can be WKT, GeoJSON or just a simple sequence of lon/lat values (coordinates can be literal, or stored in a file).

There’s a handy tool for drawing bounding boxes and polygons at boundingbox.klokantech.com:

Website (C) Klokan Technologies; map tiles (C) MapTiler; map data (C) OpenStreetMap

Then just paste the coordinates into the command line, and run gol load.

Downloading 38 tiles (53 MB compressed) into bodensee.gol
  from https://download.openplanetdata.com/osm/planet/gob/v2/planet-latest.osm.gob:
00:00:12 Done.

To see the current tile coverage, run gol map with just the name of the GOL as its sole argument. This will open a tile-coverage map in your default browser:

gol map bodensee

You can run gol load multiple times to download additional regions into the same GOL (If regions overlap, only missing tiles are fetched).

Limitations

  1. Currently, you cannot mix tiles from GOBs containing different versions of the OSM dataset. This means that if you download France today, you might not be able to add the tileset for Germany tomorrow (to the same GOL). Open Planet Data creates an updated GOB every night around 03:00 UTC, and this GOB will have a different tileset ID. Once the gol update workflow is implemented, you will be able to merge tilesets from different revisions.

  2. gol load is currently “all or nothing” – if a download is interrupted for any reason, you will have to start over. We’ll soon upgrade the storage engine to enable incremental transactions, which will allow downloads to resume where they left off. If you’re on a slow/flaky connection, you may want to download tilesets in smaller batches (but keeping #1 in mind).

As always, questions/feedback are welcome! If something breaks (or could be enhanced), please open a Github issue, or let me know in this thread.

7 Likes