Skip to main content

Overture Maps Downloader simplifies geospatial data manipulation

Project description

Overture Maps Downloader

This repository is still under heavy development. Features may change, and documentation will be updated accordingly. Use at your own risk and feel free to contribute!

Docker build and push Deploy static content to Pages Publish Python Package

Overview

OvertureMapsDownloader is a monorepo that contains two main projects aimed at simplifying the process of working with Overture Maps data in Parquet format.

DuckDB-WASM with Map

The first project is a browser-based application that leverages DuckDB-WASM and mapping functionalities. This allows you to query Overture Maps data in Parquet format directly within your web browser. It offers a seamless and interactive way to work with geospatial data without the need for any backend services. The codebase for this project is located in the /app folder.

Data Manipulation/Downloading and Conversion

The second project focuses on data manipulation, downloading, and conversion of Overture Maps data. It utilizes technologies like DuckDB, Python, and IPython Notebooks, along with GDAL/OGR for data conversion. This project is containerized using Docker, making it easy to integrate into existing pipelines and ETL workflows. For hands-on examples, check out the Jupyter notebooks available in the examples folder.

Whether you're a data scientist, a geospatial analyst, or a developer, OvertureMapsDownloader offers comprehensive solutions for your geospatial data needs.

Table of Contents

DuckDB-WASM in Browser (Developers)

For developers interested in running DuckDB-WASM in the browser, the relevant codebase is located in the /app folder at the root of the repository. This setup allows you to develop, run, and build the DuckDB-WASM component seamlessly.

Getting Started

  1. Navigate to the /app folder:

    cd /app
    
  2. Install the required packages:

    yarn install
    

    Note: Make sure you have npm version 18 or above for compatibility.

  3. Start the development server:

    yarn dev
    

then open http://localhost:5173/OvertureMapsDownloader in your browser

Visual Demo

DuckDB-WASM in action

Data Manipulation/Downloading and Conversion

Prerequisites

  • Docker and Docker Compose
  • GeoJSON file containing the bounding box polygon (e.g., bbox.geojson) you can make yours easly on https://geojson.io or use examples/bbox.json for testing

Installation

To get started, you'll need to pull the Docker image from the GitHub Container Registry:

docker pull ghcr.io/youssef-harby/overturemapsdownloader:latest

the docker image manily contains the following tools:

  • GDAL/OGR v3.8.4
  • Python v3.10 (and GDAL/OGR Python bindings + duckdb python bindings)
  • DuckDB v0.10.0
  • Jupyter.. and more

Usage

Download Geospatial Data

  1. Create a folder and place your bounding box polygon in GeoJSON format inside it (e.g., bbox.geojson).

  2. Navigate to the folder:

    cd /examples # e.g., cd /path/to/your/folder contains bbox.geojson and will contain the output file
    
  3. Run the following command to download geospatial data:

    docker run -v $(pwd):/examples ghcr.io/youssef-harby/overturemapsdownloader:latest OMDownloader omaps --theme places --ptype place --bbox /examples/bbox.geojson --output /examples/places.parquet
    

Commands

The omaps Command

OMDownloader omaps [OPTIONS]

options:

  • --theme [admins|buildings|buildings|places|transportation] Theme of the data to download
  • --ptype [locality|administrativeBoundary|building|place|water|connector|segment] Type of the data to download
  • --bbox PATH Bounding box polygon in GeoJSON format as a path to a file
  • --output PATH Output file path (e.g., places.parquet)
  • --help Show this message and exit.

Examples of downloading data CLI:

With Docker:

# admins/locality
docker run -v $(pwd):/examples ghcr.io/youssef-harby/overturemapsdownloader:latest OMDownloader omaps --theme admins --ptype locality --bbox /examples/bbox.geojson --output /examples/locality.parquet

# admins/administrativeBoundary
docker run -v $(pwd):/examples ghcr.io/youssef-harby/overturemapsdownloader:latest OMDownloader omaps --theme admins --ptype administrativeBoundary --bbox /examples/bbox.geojson --output /examples/admins.parquet

# buildings/building
docker run -v $(pwd):/examples ghcr.io/youssef-harby/overturemapsdownloader:latest OMDownloader omaps --theme buildings --ptype building --bbox /examples/bbox.geojson --output /examples/building.parquet

# places/place
docker run -v $(pwd):/examples ghcr.io/youssef-harby/overturemapsdownloader:latest OMDownloader omaps --theme places --ptype place --bbox /examples/bbox.geojson --output /examples/place.parquet

# transportation/connector
docker run -v $(pwd):/examples ghcr.io/youssef-harby/overturemapsdownloader:latest OMDownloader omaps --theme transportation --ptype connector --bbox /examples/bbox.geojson --output /examples/connector.parquet

# transportation/segment
docker run -v $(pwd):/examples ghcr.io/youssef-harby/overturemapsdownloader:latest OMDownloader omaps --theme transportation --ptype segment --bbox /examples/bbox.geojson --output /examples/segment.parquet

Without Docker you can use the following commands with (pip install overturemapsdownloader):

# admins/locality
OMDownloader omaps --theme admins --ptype locality --bbox examples/bbox.geojson --output examples/locality.parquet

# admins/administrativeBoundary
OMDownloader omaps --theme admins --ptype administrativeBoundary --bbox examples/bbox.geojson --output examples/admins.parquet

# buildings/building
OMDownloader omaps --theme buildings --ptype building --bbox examples/bbox.geojson --output examples/building.parquet

# places/place
OMDownloader omaps --theme places --ptype place --bbox examples/bbox.geojson --output examples/place.parquet

# transportation/connector
OMDownloader omaps --theme transportation --ptype connector --bbox examples/bbox.geojson --output examples/connector.parquet

# transportation/segment
OMDownloader omaps --theme transportation --ptype segment --bbox examples/bbox.geojson --output examples/segment.parquet

Convert Parquet to GeoPackage

To convert the downloaded data to GeoPackage format, run the following command:

docker run -v $(pwd):/examples ghcr.io/youssef-harby/overturemapsdownloader:latest ogr2ogr /examples/output.gpkg /examples/places.parquet

Convert Parquet to MBTiles (will support tippecanoe in the future)

docker run -v $(pwd):/examples ghcr.io/youssef-harby/overturemapsdownloader:latest ogr2ogr -dsco MAXZOOM=14 /examples/output.mbtiles /examples/places.parquet

Convert Parquet to ESRI File Geodatabase vector (OpenFileGDB)

docker run -v $(pwd):/examples ghcr.io/youssef-harby/overturemapsdownloader:latest ogr2ogr /examples/output.gdb /examples/places.parquet

Using Jupyter Notebooks (Data Scientists/GIS Analysts)

If you prefer to use Jupyter notebooks for your geospatial data manipulation tasks, you can easily set up a Jupyter environment using Docker Compose.

  1. Clone the repository:

    git clone https://github.com/Youssef-Harby/OvertureMapsDownloader.git
    
  2. Navigate to the repository folder:

    cd OvertureMapsDownloader
    
  3. Run the following Docker Compose command:

    docker compose up
    

This will start a Jupyter notebook server accessible at http://localhost:8888/lab.

Configuration

For advanced configurations, please refer to the config.yml file.

Roadmap

DuckDB-WASM in Browser (Developers) (ReactJS)

  • Add Popup on click of the feautre to show the result of the query
  • Add a button to use local parquet url instead of the remote one
  • Add a button to download the result of the query as GeoJSON..etc
  • Add a loading spinner while the query is running
  • Query by bbox drawn on the map
  • feel free to add more ...

Data Manipulation/Downloading and Conversion (Python)

  • Resolve JSON values to be parsed to the correct data type OSGeo/gdal#8227

Contributing

Everyone is invited to contribute to this project. Whether you're a beginner or experienced, your help is valuable. Don't worry about not getting it right the first time; the idea is to grow and learn together.

You can contribute by:

If you're new and have questions or need guidance, the discussions page is a great place to start.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

overturemapsdownloader-0.1.9.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

overturemapsdownloader-0.1.9-py3-none-any.whl (13.9 kB view details)

Uploaded Python 3

File details

Details for the file overturemapsdownloader-0.1.9.tar.gz.

File metadata

  • Download URL: overturemapsdownloader-0.1.9.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.1 CPython/3.10.12 Linux/6.5.0-1018-azure

File hashes

Hashes for overturemapsdownloader-0.1.9.tar.gz
Algorithm Hash digest
SHA256 b95a6e8784d5f819f6c5db2b5286a4b537c888169ab997c4ae478a7b5f4a7cc6
MD5 fe6ee1ea4cbd6fa06d3294238cf9b854
BLAKE2b-256 f88f1181847fb1ed49b36fe40dabc370e617d36c1dee94e3291a923a72fc1853

See more details on using hashes here.

File details

Details for the file overturemapsdownloader-0.1.9-py3-none-any.whl.

File metadata

File hashes

Hashes for overturemapsdownloader-0.1.9-py3-none-any.whl
Algorithm Hash digest
SHA256 d17c3a49acedb4b8e8960ab29333bab6b1e168e9bd28c0e2164b35fa5dcf93fd
MD5 c11ff2997f480a66fcaa96f15cf040b5
BLAKE2b-256 7a581a9a5ced3b4bc18bc78935345df846457170918558224695351dfc2a3266

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page