Skip to main content

Overture Maps + kepler.gl

In this example, we'll query the Overture Maps buildings theme and download data for a specified bounding box. Then we'll load the data into kepler.gl, an open-source tool for working with large map datasets, and visualize the buildings data by data source: OpenStreetMap, Microsoft ML Building Footprints, and Google Open Buildings.

Requirements: you'll need an AWS account and access to an S3 bucket if you want to use Athena. If you're using DuckDB (we recommend 0.10.0), you'll need to install and load the spatial and S3 or Azure extensions. You do not need an account on kepler.gl.

Query the data in AWS Athena

Follow the instructions for running the set-up queries in Amazon Athena. Then you can run this in the Athena query console:

SELECT
id,
theme,
class,
sources[1].dataset AS primary_source,
names.primary AS primary_name,
ST_GeomFromBinary(geometry) AS geometry
FROM overture.release.v2024_05_16_beta_0
WHERE theme='buildings'
AND type='building'
AND bbox.xmin > 78.383144
AND bbox.xmax < 78.565011
AND bbox.ymin > 17.30199
AND bbox.ymax < 17.423426

This outputs around 106,000 buildings in a table view that you can download as a CSV file.

Query the data using DuckDB

Here's a similar query in DuckDB's flavor of SQL that outputs a GeoJSON file.

LOAD spatial;
LOAD httpfs;

COPY (
SELECT
id,
level,
height,
JSON(names) AS names,
sources[1].dataset AS primary_source,
JSON(sources) AS sources,
ST_GeomFromWkb(geometry) AS geometry
FROM read_parquet('s3://overturemaps-us-west-2/release/2024-05-16-beta.0/theme=buildings/type=*/*', filename=true, hive_partitioning=1)
WHERE
bbox.xmin > 78.4194
AND bbox.xmax < 78.5129
AND bbox.ymin > 17.3427
AND bbox.ymax < 17.4192
) TO 'buildings_hyderabad.geojson'
WITH (FORMAT GDAL, DRIVER 'GeoJSON', SRS 'EPSG:4326');

Explore the data in kepler.gl

Drag and drop the CSV or GeoJSON file into kepler.gl. Style the feature layer by choosing different colors based on the primary_source field. Then you can explore the data sources that Overture Maps conflated to create the buildings theme.

kepler.gl example

kepler.gl gif