Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kshitijrajsharma/geojson2osm
Geojson To OSM Xml
https://github.com/kshitijrajsharma/geojson2osm
Last synced: 9 days ago
JSON representation
Geojson To OSM Xml
- Host: GitHub
- URL: https://github.com/kshitijrajsharma/geojson2osm
- Owner: kshitijrajsharma
- License: mit
- Created: 2023-04-07T14:32:36.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-22T10:58:35.000Z (7 months ago)
- Last Synced: 2024-10-14T00:56:45.067Z (23 days ago)
- Language: Python
- Size: 16.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# geojson2osm
A Python package to convert GeoJSON data to OSM XML format.
#### Inspired From [geojsontoosm](https://github.com/tyrasd/geojsontoosm)
## Install
```
pip install geojson2osm
```## Usage
### Command Line
```python
python -m geojson2osm your_geojson_file.geojson output.osm
```### Library
```python
import json
from geojson2osm import geojson2osm# Load your GeoJSON data
geojson_data = json.load(open('your_geojson_file.geojson'))# Convert the GeoJSON data to OSM XML format
osm_xml = geojson2osm(geojson_data)# Save the OSM XML data to a file
with open('output.osm', 'w') as output_file:
output_file.write(osm_xml)