kopia lustrzana https://github.com/openstreetmap-polska/aed-mapa
added ability to specify path where to save geojson file
rodzic
e2131bebc1
commit
11c4154c44
|
@ -1,5 +1,6 @@
|
||||||
import requests
|
import requests
|
||||||
import json
|
import json
|
||||||
|
import sys
|
||||||
|
|
||||||
|
|
||||||
def geojson_point_feature(lat: float, lon: float, properties: dict) -> dict:
|
def geojson_point_feature(lat: float, lon: float, properties: dict) -> dict:
|
||||||
|
@ -63,5 +64,7 @@ for element in elements:
|
||||||
geojson_point_feature(lat=latitude, lon=longitude, properties=tags)
|
geojson_point_feature(lat=latitude, lon=longitude, properties=tags)
|
||||||
)
|
)
|
||||||
|
|
||||||
with open(file='src/aed_poland.geojson', mode='w', encoding='utf-8') as f:
|
file_path = sys.argv[1] if len(sys.argv) == 2 else 'src/aed_poland.geojson'
|
||||||
|
|
||||||
|
with open(file=file_path, mode='w', encoding='utf-8') as f:
|
||||||
json.dump(geojson, f, allow_nan=False)
|
json.dump(geojson, f, allow_nan=False)
|
||||||
|
|
Ładowanie…
Reference in New Issue