forked from kshitijrajsharma/geojson2osm
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import json | ||
import sys | ||
from geojson2osm import geojson2osm | ||
|
||
|
||
def main() -> None: | ||
# Load your GeoJSON data | ||
input = sys.argv[1] | ||
geojson_data = json.load(open(input)) | ||
|
||
# Convert the GeoJSON data to OSM XML format | ||
osm_xml = geojson2osm(geojson_data) | ||
|
||
# Save the OSM XML data to a file | ||
output = sys.argv[2] | ||
with open(output, 'w') as output_file: | ||
output_file.write(osm_xml) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |