Skip to main content

Translate the Overture maps schema to OpenStreetMap tags.

Project description

Overture to OSM

GitHub License GitHub last commit PyPI - Version Pepy Total Downlods

This Python project translates objects from the Overture maps schema to the OpenStreetMap (OSM) tagging scheme. The goal is to provide a seamless way to convert map data from Overture's format to a format that can be utilized within the OSM ecosystem. The package currently only supports Overture's places, buildings, and addresses layers. You can improve the Overture categorization that this package uses by editing the Overture categories page on the OSM Wiki or submitting a pull request to the tags.json file.

[!NOTE] Use of this package does not absolve you from following OSM's import guidelines.

Table of Contents

Features

  • Translate Overture map places to OSM tags.
  • Handle various map object types, including buildings and points of interest.
  • Ensure compatibility with OSM data structures and conventions.

Usage

This package is meant to work with GeoJSON files containing Overture maps data, including those produced by the overturemaps Python package.

pip install overturetoosm

You will probably for the most part be handling features from a GeoJSON or other file, but for demonstration purposes I'll define it inline:

>>> import overturetoosm
>>> overture = {
        "id": "123",
        "version": 1,
        "update_time": "2022-01-01T00:00:00Z",
        "sources": [
            {
                "property": "property1",
                "dataset": "dataset1",
                "confidence": 0.8,
            }
        ],
        "names": {
            "primary": "Primary Name",
        },
        "categories": {"main": "restaurant"},
        "confidence": 0.8,
        "addresses": [
            {
                "freeform": "123 E Main Blvd",
                "locality": "City",
                "postcode": "12345",
                "region": "CA",
                "country": "US",
            }
        ],
    }
>>> output = overturetoosm.process_place(overture)
{
        "name": "Primary Name",
        "addr:street_address": "123 E Main Blvd",
        "addr:city": "City",
        "addr:postcode": "12345",
        "addr:state": "CA",
        "addr:country": "US",
        "source": "dataset1 via overturetoosm",
        "amenity": "restaurant",
}

Note that the addr:street_address tag is not suitable for import into OSM, and thus will have to be parsed further. If you are working on places in the US, you can automatically parse the addr:street_address tag using the atlus package, a separate project I've worked on.

>>> import atlus
>>> atlus.get_address(output["addr:street_address"])[0]
{"addr:housenumber": "123", "addr:street": "East Main Boulevard"}

Docs

The documentation for our package is available online at our documentation page. We would greatly appreciate your contributions to help improve the auto-generated docs; please submit any updates or corrections via pull requests.

License

This project is licensed under the MIT License. See the LICENSE file for details.

See also

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

overturetoosm-0.2.2.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

overturetoosm-0.2.2-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file overturetoosm-0.2.2.tar.gz.

File metadata

  • Download URL: overturetoosm-0.2.2.tar.gz
  • Upload date:
  • Size: 3.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for overturetoosm-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d63c20f4f078c535adfe1a475f8b4eb50ba067c9fe33b2eefeebb6fc9785f8f8
MD5 8c8c512d8cfae01b5f5076c2e8892a3f
BLAKE2b-256 e6d1e425061f396f4ff603b9411e1391ca97eb4ecaab399c1b0d27cce78a6f02

See more details on using hashes here.

File details

Details for the file overturetoosm-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for overturetoosm-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9a5231a8cb0c1260e1fc8bd111c7df02149a1009e13e35b6c3fdacc4ebc033ac
MD5 714b93d366e4470485a8c7781b4f2942
BLAKE2b-256 d1ba254051cb810709d1c2e216bdc08a45832de6ebc0b12b2f9f5b52ef6f20d6

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