Skip to main content

Overture Map Data 2 HDX

This project is designed to export geographic data from Overture Maps and upload it to the Humanitarian Data Exchange (HDX). The data is processed using DuckDB and can be exported in various formats such as GeoJSON, GPKG, and ESRI Shapefile.

Features

  • Export geographic data from Overture Maps.
  • Upload data to HDX.
  • Support for multiple output formats.
  • Configurable via YAML and environment variables.
  • Logging setup using environment variables or parameters.

Installation

pip install overture2hdx

Configuration

The application is configured using a YAML file and environment variables.

YAML Configuration

Example config.yaml:

iso3: npl
geom: '{"type": "FeatureCollection", "features": [{"type": "Feature", "properties": {}, "geometry": {"coordinates": [[]], "type": "Polygon"}}]}'
key: osgeonepal_pkr
subnational: true
frequency: yearly
categories:
- Roads:
    select:
        - id
        - names.primary as name
        - class as class
        - subclass as subclass
        - UNNEST(JSON_EXTRACT(road_surface, '$[*].value')) as road_surface
        - UNNEST(JSON_EXTRACT(sources, '$[*].dataset')) AS source
    hdx:
        title: Roads of Pokhara
        notes: Overturemaps Export for Pokhara. Data might have errors but has gone through validation checks.
        tags:
        - geodata
        - transportation
        - roads
    theme:
        - transportation
    feature_type:
        - segment
    formats:
        - gpkg
        - shp

Code Overview

Config: Class to handle configuration. OvertureMapExporter: Class to handle the export process. setup_logging: Function to set up logging.

Default export config

Following is the default yaml used

Category Description License Overture Theme Docs Attributes File Formats
Hospitals Health POIs such as hospitals and clinics, sourced from Meta and Microsoft open data CDLA Permissive 2.0 Places id, name, name_en, category, address, phone, email, website, confidence, source gpkg, shp
Schools Educational POIs including schools, colleges, and universities from Meta and Microsoft CDLA Permissive 2.0 Places id, name, name_en, category, address, phone, website, confidence, source gpkg, shp
Rivers Rivers, lakes, and other water features from OpenStreetMap via the Base theme ODbL 1.0 Base id, name, name_en, subtype, class, is_salt, wikidata, source gpkg, shp
Land Use Land use areas like farmland and forests from OpenStreetMap landuse tags ODbL 1.0 Base id, name, name_en, subtype, class, surface, wikidata, source gpkg, shp
Transportation Hubs POIs like airports, train stations, and terminals from Meta and Microsoft open data CDLA Permissive 2.0 Places id, name, name_en, category, address, phone, website, confidence, source gpkg, shp
Settlements Cities, towns, villages, and hamlets from OSM, geoBoundaries, and Esri ODbL 1.0 Divisions id, name, name_en, population, region, wikidata, source gpkg, shp
Roads Roads including highways and local roads from OpenStreetMap and TomTom ODbL 1.0 Transportation id, name, name_en, class, subclass, subtype, road_surface, source gpkg, shp
Buildings Building footprints from OSM, Microsoft, Google, and Esri ODbL 1.0 Buildings id, name, name_en, class, subtype, height, level, num_floors, num_floors_underground, is_underground, has_parts, roof_material, roof_shape, roof_color, source gpkg, shp

Default python example

import json

geom = json.dumps(
    {
        "type": "FeatureCollection",
        "features": [
            {
                "type": "Feature",
                "properties": {},
                "geometry": {
                    "coordinates": [
                        [
                            [83.98047393581618, 28.255338988044088],
                            [83.973540694181, 28.230486421513703],
                            [83.91927014759125, 28.214265947308945],
                            [83.97832224013575, 28.195093119231174],
                            [83.96971545741735, 28.158212628626416],
                            [84.00175181531534, 28.19361814379657],
                            [84.03187555483152, 28.168540447741847],
                            [84.01059767533235, 28.208788347541898],
                            [84.0342663278089, 28.255549578267903],
                            [83.99960011963498, 28.228801292171724],
                            [83.98047393581618, 28.255338988044088],
                        ]
                    ],
                    "type": "Polygon",
                },
            }
        ],
    }
)
iso3 = "NPL"
dataset_name = "Pokhara, Nepal"
key = "osegonepal_pkr"
subnational = True
frequency = "yearly"

from overture2hdx import DEFAULT_CONFIG_YAML

config_yaml = DEFAULT_CONFIG_YAML.format(
    iso3=iso3,
    geom=geom,
    key=key,
    subnational=subnational,
    frequency=frequency,
    dataset_name=dataset_name,
)


from overture2hdx import Config, Exporter

config = Config(config_yaml=config_yaml)
exporter = Exporter(config)
results = exporter.export()
print(results)

How it works?

overture2hdx

Author and License

Kshitij Raj Sharma , License : GNU GENERAL PUBLIC LICENSE V3

Metadata

Release files for overture2hdx 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for overture2hdx 0.1.1
File Size Uploaded Provenance Actions
overture2hdx-0.1.1.tar.gz 27.9 kB Without provenance Details for overture2hdx-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for overture2hdx 0.1.1
File Interpreter ABI Platform Actions
overture2hdx-0.1.1-py3-none-any.whl Python 3 none any Details for overture2hdx-0.1.1-py3-none-any.whl

Total release size: 53.6 kB

Release files / overture2hdx-0.1.1.tar.gz

Download URL overture2hdx-0.1.1.tar.gz
Size 27.9 kB
Tags Source
SHA-256 checksum
How to use checksums
56a2a4750ccbf102bf6075743d523c9e1bf2501326c5beb57b039d053723128c
BLAKE2b-256 checksum
How to use checksums
6b68b4ea6ef88d4f40bac4009cd4ba68d89f1adbd160af889f26f96305bcf198
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Release files / overture2hdx-0.1.1-py3-none-any.whl

Download URL overture2hdx-0.1.1-py3-none-any.whl
Size 25.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
78b3db7c7d35ba8f2f8171ef217a285c841d19906a2fdb23f9159a0d08755a40
BLAKE2b-256 checksum
How to use checksums
ce38352fd18e14427d9bf9606954296dafddab30fd8b15ed63cfd6374f3de865
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.11

Security for overture2hdx 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page