ogr2ogr and .
In the example below we will import a tornadoes data set that is available from the US National Weather Service (NWS).
Please refer to the documentation of your GIS software for instructions on exporting GIS data to Shapefiles.
Before you begin
To follow along with the example below, you will need the following prerequisites:- CockroachDB and
ogr2ogr
An
ogr2ogr version of 3.1.0 or higher is required to generate data that can be imported into CockroachDB.- Python 3
-
The tornado data:
Step 1. Convert the Shapefile data to CSV
Navigate to the folder containing the data:ogr2ogr command:
Step 2. Host the file where the cluster can access it
Each node in the CockroachDB cluster needs to have access to the files being imported. There are several ways for the cluster to access the data; for a complete list of the types of storage can pull from, see . For local testing, you can . The following command will start a local file server listening on port 3000:Step 3. Prepare the CockroachDB database
Create a database to hold the bus-stop data:Step 4. Create a CockroachDB table
To import the CSV data, you need to create a table with the necessary columns and data types. Convert the Shapefile data to SQL using the followingogr2ogr command:
tornadoes.sql:

