Skip to content

Commit

Permalink
fix: Add AS geometry to make parsing the results cleaner, fix duplica…
Browse files Browse the repository at this point in the history
…te columns in SELECT (#25)
  • Loading branch information
rsavoye authored Jul 25, 2024
1 parent 4980052 commit 8b4ea6e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions osm_rawdata/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,12 +322,14 @@ def createSQL(
for table in config.config["tables"]:
select = "SELECT "
if allgeom:
select += "ST_AsText(geom)"
select += "ST_AsText(geom) AS geometry"
else:
select += "ST_AsText(ST_Centroid(geom))"
select += "ST_AsText(ST_Centroid(geom)) AS geometry"
select += ", osm_id, version, "
for entry in config.config["select"][table]:
for k1, v1 in entry.items():
if k1 == "osm_id" or k1 == "version":
continue
select += f"tags->>'{k1}', "
select = select[:-2]

Expand Down

0 comments on commit 8b4ea6e

Please sign in to comment.