diff --git a/rdoopy/utils.py b/rdoopy/utils.py index d6bc0d3..331f3da 100644 --- a/rdoopy/utils.py +++ b/rdoopy/utils.py @@ -124,15 +124,22 @@ class Utils: # filtrage des tags description = "" for tag in overpass_query_fields.keys(): - if overpass_query_fields[tag]["export_json"] == "Oui": - if tag in element["tags"]: - if overpass_query_fields[tag]["FR"] != "": - description = ( - description + overpass_query_fields[tag]["FR"] + " : " - ) + if ( + overpass_query_fields[tag]["export_json"] == "Oui" + and tag in element["tags"] + and overpass_query_fields[tag]["FR"] != "" + ): + description = ( + description + + overpass_query_fields[tag]["FR"] + + " : " + + str(element["tags"][tag]) + + "\n" + ) - description = description + str(element["tags"][tag]) + "\n" - export_json["elements"][index_line]["tags"] = {"description": description} + export_json["elements"][index_line]["tags"] = { + "description": description[:-1] + } index_line = index_line + 1