Skip to main content
CockroachDB supports efficiently storing and querying . This page has instructions for migrating data from OpenStreetMap .pbf data files into CockroachDB using osm2pgsql and IMPORT. In the example below we will import the OSM data for Australia that is available from GeoFabrik GmbH.

Before You Begin

To follow along with the example below, you will need the following prerequisites:

Step 1. Download the OpenStreetMap data

First, download the OSM data:

Step 2. Prepare the database

Next, create a database to hold the Australia map data:

Step 3. Import the OpenStreetMap data

Run the osm2pgsql command shown below to convert the OSM data and import it into the australia database. The arguments to osm2pgsql shown below assume a and may need to be changed depending on your system. You may also need to tweak the cache setting (-C) depending on your system’s hardware.
This will take a few (30+) minutes to run on a laptop, and there will be a lot of output. A successful run will look something like the following:

See also