Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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)