Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing an OSM XML file #264

Merged
merged 1 commit into from
Jul 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions osm_fieldwork/osmfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def __init__(
self.start = -1
# path = xlsforms_path.replace("xlsforms", "")
self.convert = Convert()
self.data = dict()
self.data = list()

def __del__(self):
"""Close the OSM XML file automatically."""
Expand Down Expand Up @@ -154,7 +154,7 @@ def createWay(
if "version" not in way["attrs"]:
attrs["version"] = 1
else:
attrs["version"] = way["attrs"]["version"] + 1
attrs["version"] = way["attrs"]["version"]
attrs["timestamp"] = datetime.now().strftime("%Y-%m-%dT%TZ")
# If the resulting file is publicly accessible without authentication, The GDPR applies
# and the identifying fields should not be included
Expand Down Expand Up @@ -399,7 +399,7 @@ def loadFile(
tags[node["tag"]["@k"]] = node["tag"]["@v"].strip()
# continue
node = {"attrs": attrs, "tags": tags}
self.data[node["attrs"]["id"]] = node
self.data.append(node)
return self.data

def dump(self):
Expand Down
Loading