forked from Olav63/outils_OSM
encodage
This commit is contained in:
parent
37273e4953
commit
1c0421f87d
@ -88,7 +88,9 @@ class Utils:
|
||||
def save_as_json(self, export_json, nom_req):
|
||||
"""Enregistrement du JSON"""
|
||||
|
||||
json_file = open(self.dossier_resultats + nom_req + ".json", "w")
|
||||
json_file = open(
|
||||
self.dossier_resultats + nom_req + ".json", "w", encoding="utf-8"
|
||||
)
|
||||
json_file.write(json.dumps(export_json))
|
||||
json_file.close()
|
||||
|
||||
@ -167,7 +169,9 @@ class Utils:
|
||||
url = self.geo_api_url + "/reverse/csv/"
|
||||
|
||||
# création du fichier à envoyer à l'API
|
||||
with open("tmp_geocodage.csv", "w", newline="") as tmp_csv_file:
|
||||
with open(
|
||||
"tmp_geocodage.csv", "w", newline="", encoding="utf-8"
|
||||
) as tmp_csv_file:
|
||||
csv_writer = csv.writer(tmp_csv_file)
|
||||
csv_writer.writerow(["lat", "lon"])
|
||||
|
||||
|
7
rdoo.py
7
rdoo.py
@ -18,7 +18,7 @@
|
||||
|
||||
|
||||
"""
|
||||
Module principal :
|
||||
Module principal :
|
||||
- récupération de données par appel à Overpass
|
||||
- géocodage inverse
|
||||
- export des données en JSON pour utilisation avec umap
|
||||
@ -117,7 +117,10 @@ def main():
|
||||
logging.basicConfig(
|
||||
format="%(asctime)s [%(levelname)s] %(message)s",
|
||||
level=getattr(logging, args.log_level.upper()),
|
||||
handlers=[logging.FileHandler("rdoo.log"), logging.StreamHandler(sys.stdout)],
|
||||
handlers=[
|
||||
logging.FileHandler("rdoo.log", encoding="utf-8"),
|
||||
logging.StreamHandler(sys.stdout),
|
||||
],
|
||||
)
|
||||
|
||||
utils = Utils(OVERPASS_URL, GEO_API_URL, args.dossier_resultats)
|
||||
|
Loading…
Reference in New Issue
Block a user