Skip to content

Commit

Permalink
fix: Fix writing nodes with no tags, ie... what the way references, a…
Browse files Browse the repository at this point in the history
…nd only write the note for ways (#290)
  • Loading branch information
rsavoye authored Aug 27, 2024
1 parent 12890c0 commit c52ad79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions osm_fieldwork/osmfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ def createWay(
newkey = escape(key)
newval = escape(str(value))
osm += f"\n <tag k='{newkey}' v='{newval}'/>"
if modified:
osm += '\n <tag k="note" v="Do not upload this without validation!"/>'
osm += "\n"

osm += " </way>\n"

return osm
Expand Down Expand Up @@ -300,8 +301,6 @@ def createNode(
newkey = escape(key)
newval = escape(str(value))
osm += f"\n <tag k='{newkey}' v='{newval}'/>"
if modified and key != "note":
osm += '\n <tag k="note" v="Do not upload this without validation!"/>'
osm += "\n </node>\n"
else:
osm += "/>"
Expand Down Expand Up @@ -401,7 +400,8 @@ def loadFile(
tags[tag["@k"]] = tag["@v"].strip()
# continue
else:
tags[node["tag"]["@k"]] = node["tag"]["@v"].strip()
if len(node["tags"]) > 0:
tags[node["tags"]["@k"]] = node["tags"]["@v"].strip()
# continue
way = {"attrs": attrs, "refs": refs, "tags": tags}
self.data.append(way)
Expand Down

0 comments on commit c52ad79

Please sign in to comment.