forked from Olav63/outils_OSM
extraction de la méthode de sauvegarde ods
This commit is contained in:
parent
ab4af80601
commit
e84075e017
@ -221,8 +221,10 @@ def executer_requete_et_exporter_resultats(nom_req, critere, aire_de_recherche,
|
|||||||
|
|
||||||
# ===========================================
|
# ===========================================
|
||||||
|
|
||||||
print("Sauvegarde résultats format ODS")
|
sauvegarde_ods(overpass_query_fields, data, nom_req)
|
||||||
|
|
||||||
|
|
||||||
|
def sauvegarde_ods(overpass_query_fields, data, nom_req):
|
||||||
ODSdataSheet = OrderedDict()
|
ODSdataSheet = OrderedDict()
|
||||||
|
|
||||||
ODSdata = []
|
ODSdata = []
|
||||||
@ -231,7 +233,6 @@ def executer_requete_et_exporter_resultats(nom_req, critere, aire_de_recherche,
|
|||||||
|
|
||||||
index_line = 2
|
index_line = 2
|
||||||
|
|
||||||
|
|
||||||
for element in data["elements"]:
|
for element in data["elements"]:
|
||||||
|
|
||||||
line = []
|
line = []
|
||||||
@ -240,7 +241,7 @@ def executer_requete_et_exporter_resultats(nom_req, critere, aire_de_recherche,
|
|||||||
|
|
||||||
# if (element["type"] == "node") :
|
# if (element["type"] == "node") :
|
||||||
for field in overpass_query_fields.keys():
|
for field in overpass_query_fields.keys():
|
||||||
if (field in element["tags"]) :
|
if field in element["tags"]:
|
||||||
if field == "capacity":
|
if field == "capacity":
|
||||||
val = element["tags"][field]
|
val = element["tags"][field]
|
||||||
line.append(int(val) if val.isdigit() else val)
|
line.append(int(val) if val.isdigit() else val)
|
||||||
@ -257,6 +258,7 @@ def executer_requete_et_exporter_resultats(nom_req, critere, aire_de_recherche,
|
|||||||
|
|
||||||
save_data(dossier_sauvegarde + nom_req + ".ods", ODSdataSheet)
|
save_data(dossier_sauvegarde + nom_req + ".ods", ODSdataSheet)
|
||||||
|
|
||||||
|
print("Sauvegarde résultats format ODS pour " + nom_req)
|
||||||
|
|
||||||
|
|
||||||
for req in requetes.reqs :
|
for req in requetes.reqs :
|
||||||
|
Loading…
Reference in New Issue
Block a user