Overture to OSM
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 for the places layer by editing the Overture categories page on the OSM Wiki or submitting a pull request to the tags.json file.
There is also a Pydantic model for the transportation layer's segment object via overturetoosm.segments.SegmentProperties, but the conversion to OSM tags is not yet supported because of the Overture schema's complexity.
The package also allows you to use the module directly from the command line.
With the overturemaps Python package installed, you can download and convert
Overture data to OSM in two lines of code.
$ python -m pip install overturemaps overturetoosm
$ overturemaps download --bbox=-71.068,42.353,-71.058,42.363 \\
-f geojson --type=place -o boston.geojson
$ python -m overturetoosm place -i boston.geojson --in-place --confidence 0.9
[!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:full": "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:full"])[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
Metadata
Release files for overturetoosm 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| overturetoosm-1.2.0.tar.gz | 513.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| overturetoosm-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 545.6 kB
Release files / overturetoosm-1.2.0.tar.gz
| Download URL | overturetoosm-1.2.0.tar.gz |
|---|---|
| Size | 513.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8161abc3676625367ee758ca870bf00ee7ff310050084e6fdc85220ebb567ad1
|
|
BLAKE2b-256 checksum How to use checksums |
a57c61a0bc5eda572f2ca41b8851560d33dbdf3ada3785be560bbb0d2024c6cd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.0
|
Release files / overturetoosm-1.2.0-py3-none-any.whl
| Download URL | overturetoosm-1.2.0-py3-none-any.whl |
|---|---|
| Size | 32.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
375ed15c011a7f8476ad03ba33041027edee9801b1e7da82ff275f5079b98c0b
|
|
BLAKE2b-256 checksum How to use checksums |
4f83de21bafce1fe44a36ce297ac383551ed53415fa40cf1a872c1bb4de7e028
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.0
|