From 13f39070de6725f65ba716982aa09f2f1b949d68 Mon Sep 17 00:00:00 2001 From: Kevin Nowaczyk Date: Thu, 4 Apr 2024 14:32:53 -0400 Subject: [PATCH] Create __main__.py --- geojson2osm/__main__.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 geojson2osm/__main__.py diff --git a/geojson2osm/__main__.py b/geojson2osm/__main__.py new file mode 100644 index 0000000..dfa0cc1 --- /dev/null +++ b/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()