Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 22, 2024
1 parent 96cd40b commit 6c325d3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions osm_rawdata/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -476,23 +476,23 @@ def queryLocal(
# print(f"{item}")
tags = dict()
geom = wkt.loads(item[0])
#tags["id"] = item[1]
# tags["id"] = item[1]
tags["version"] = item[2]
if query.find(" refs ") > 0:
tags["refs"] = str(item[len(item) - 1])
# breakpoint()
tags["refs"] = str(item[len(item) - 1])
# breakpoint()
i = 3
# Figure out the tags from the SELECT part of the query
keys = query.replace(',', '').replace("tags->>", '').replace("'", '')
keys = query.replace(",", "").replace("tags->>", "").replace("'", "")
end = keys.find("FROM")
res = keys[:end].split(" ")
# This should be the geometry
geom = wkt.loads(item[0])
for i in range(2, len(item)):
# print(f"{res[i]} = {item[i - 1]}")
if item[i-1] is None:
if item[i - 1] is None:
continue
tags[res[i]] = item[i-1]
tags[res[i]] = item[i - 1]
features.append(Feature(geometry=geom, properties=tags))
return FeatureCollection(features)

Expand Down

0 comments on commit 6c325d3

Please sign in to comment.