Overture Maps + QGIS
In this example, we'll show you how to get Overture Maps data into QGIS, a powerful and popular open source geographic information system. QGIS can ingest almost every spatial data format, including Parquet and GeoParquet. Once you get your data into QGIS, the sky's the limit for data analysis, data conflation, visualization and beautiful mapmaking.
The trickiest part of this example is making sure you're installing a newer version of QGIS (with GDAL > 3.5) that can directly read Parquet
and GeoParquet
files. We'll walk you through the processs.
Instructions: Install a version of QGIS with GDAL > 3.5 that can read (geo)parquet
- MacOS
- Windows
- Linux
You can find the latest installers for Mac here: github.com/opengisch/qgis-conda-builder/releases
Additionally, the conda packages of QGIS have support for Parquet.
Most distributions of QGIS for Windows have support for parquet.
The conda packages of QGIS have support for Parquet.
Additionally, there is a Flatpak QGIS package that includes support for Parquet:
flatpak install --user https://dl.flathub.org/build-repo/94031/org.qgis.qgis.flatpakref
1. Download Overture Data
- DuckDB
- DuckDB Spatial
- Python
Using only the bbox
parameters, we can efficiently retrieve all Overture data without processing any geometries. With SELECT *
, we will simply download all of the data in Overture across all themes and types. Note: if your query is interupted by a connection error, you might try running the following command first: SET http_keep_alive=false;
.
LOAD httpfs;
COPY(
SELECT
*
FROM
read_parquet("s3://overturemaps-us-west-2/release/2024-07-22.0/theme=*/type=*/*", union_by_name=true)
WHERE
bbox.xmin >= -105.30 AND bbox.ymin >= 39.98
AND bbox.xmax <= -105.24 AND bbox.ymax <= 40.07
) TO 'boulder_co_overture.parquet' WITH (FORMAT PARQUET);
Note that this query gathers data from all Overture themes with theme=*/type=*/*
. The resulting file has all of the columns and multiple geometry types.
The spatial
plugin allows DuckDB to read the geometry and convert the file to a common spatial format. This query will download all of the road
subtypes of segments
in the transportation
theme to a shapefile.
LOAD spatial;
LOAD httpfs;
-- Roads
COPY (
SELECT
names.primary AS name,
JSON_EXTRACT(road, '$.class') AS class,
ST_GeomFromWKB(geometry) as geometry
FROM read_parquet('s3://overturemaps-us-west-2/release/2024-07-22.0/theme=transportation/type=segment/*')
WHERE
subtype = 'road'
AND bbox.xmin > -122.68 AND bbox.xmax < -121.98
AND bbox.ymin > 47.36 AND bbox.ymax < 47.79
) TO 'seattle_roads.shp'
WITH (FORMAT GDAL, DRIVER 'Esri Shapefile', SRS 'EPSG:4326');
The new overturemaps-py
Python utility can download Overture data as both geojson
and geoparquet
. This example downloads buildlings around Boston.
$ pip install overturemaps
$ overturemaps download --bbox=-71.068,42.353,-71.058,42.363 \
-f geoparquet --type=building --output=boston.geoparquet
Note: run overturemaps download --help
for a full list of types and output formats.
2. Add the data to QGIS
All of the data files we created in Step 1 are vector files that can be added as layers in QGIS. The easiest method is to drag-and-drop the file(s) directly into the map canvas.