OSM Conflator
OSM Conflator is a Python package that allows you to conflate GeoJSON features with OpenStreetMap (OSM) data. It helps you identify and modify features in a GeoJSON dataset that intersect with OSM data, providing a convenient way to update properties or perform other actions based on the conflation results.
Installation
You can install OSM Conflator using pip:
pip install osmconflator
Usage
Here's an example of how to use OSM Conflator in your Python code:
from osmconflator import conflate_geojson
geojson_str = '{"type": "FeatureCollection", "features": ... }'
conflated_geojson = conflate_geojson(geojson_str)
print(conflated_geojson)
This output will have input features with conflated properties of duplicate and intersect (boolean) .
In the above example, conflate_geojson is the main function provided by OSM Conflator. It takes a GeoJSON string as input, performs conflation with OSM data, and returns an GeoJSON string with problems of duplicate and overlapping.
Options :
- Pass
remove_conflated=Trueargument to conflate_geojson function to get clean geojson without duplicate or overlap problem.
my_cleaned_geojson = conflate_geojson(geojson_str,remove_conflated=True)
Features Supported :
Currently conflation for following osm features are supported :
- Buildings
Example :
from osmconflator import conflate_geojson
my_geojson = {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[83.98097353206458, 28.203326601546905],
[83.98097353206458, 28.203239142020323],
[83.98110284724493, 28.203239142020323],
[83.98110284724493, 28.203326601546905],
[83.98097353206458, 28.203326601546905],
]
],
"type": "Polygon",
},
},
{
"type": "Feature",
"properties": {},
"geometry": {
"coordinates": [
[
[83.97980503615179, 28.20407835951059],
[83.97980503615179, 28.204017832398932],
[83.97987683972957, 28.204017832398932],
[83.97987683972957, 28.20407835951059],
[83.97980503615179, 28.20407835951059],
]
],
"type": "Polygon",
},
},
],
}
conflated_geojson = conflate_geojson(my_geojson)
print(conflated_geojson)
Output :
{"type": "FeatureCollection", "features": [{"type": "Feature", "properties": {"duplicate": false, "intersect": false}, "geometry": {"coordinates": [[[83.98097353206458, 28.203326601546905], [83.98097353206458, 28.203239142020323], [83.98110284724493, 28.203239142020323], [83.98110284724493, 28.203326601546905], [83.98097353206458, 28.203326601546905]]], "type": "Polygon"}}, {"type": "Feature", "properties": {"duplicate": false, "intersect": true}, "geometry": {"coordinates": [[[83.97980503615179, 28.20407835951059], [83.97980503615179, 28.204017832398932], [83.97987683972957, 28.204017832398932], [83.97987683972957, 28.20407835951059], [83.97980503615179, 28.20407835951059]]], "type": "Polygon"}}]}
Contributing
Contributions are welcome! If you find any issues or have suggestions for improvements, please feel free to open an issue or submit a pull request. When contributing to this project, please follow the Contributing Guidelines.
License
This project is licensed under the MIT License. See the LICENSE file for more information.
Work in Place :::: Development is Going on
Metadata
Release files for osmconflator 0.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| osmconflator-0.0.11.tar.gz | 5.8 kB | Without provenance | Details for osmconflator-0.0.11.tar.gz |
Release files / osmconflator-0.0.11.tar.gz
| Download URL | osmconflator-0.0.11.tar.gz |
|---|---|
| Size | 5.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c867e677e24910dde156ee25e96bb32a7a8378e651373b2434f7e645be8f48e
|
|
BLAKE2b-256 checksum How to use checksums |
4787dcab7dfe89d36a57fbe2b302e70e0842aa6d00d4ba804f549282b6ad7951
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.5
|
Security for osmconflator 0.0.11
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.