Skip to content

Commit

Permalink
Create __main__.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Beakerboy committed Apr 4, 2024
1 parent df17f53 commit 13f3907
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions geojson2osm/__main__.py
@@ -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()

0 comments on commit 13f3907

Please sign in to comment.