Skip to content

Commit

Permalink
fix: double wrapped db.execute statement in text()
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Feb 26, 2024
1 parent 1c7dd68 commit 759cb0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/backend/app/db/postgis_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@ async def geojson_to_flatgeobuf(
)

# Run the SQL
result = db.execute(text(sql), {"geojson": json.dumps(geojson)})
log.warning(json.dumps(geojson))

result = db.execute(sql, {"geojson": json.dumps(geojson)})
# Get a memoryview object, then extract to Bytes
flatgeobuf = result.first()

Expand Down Expand Up @@ -438,11 +440,9 @@ def is_valid_coordinate(coord):

if (input_geojson_type := input_geojson.get("type")) == "FeatureCollection":
features = input_geojson.get("features", [])
log.warning(features[-1])
coordinates = (
features[-1].get("geometry", {}).get("coordinates", []) if features else []
)
log.warning(coordinates)
elif input_geojson_type == "Feature":
coordinates = input_geojson.get("geometry", {}).get("coordinates", [])
else:
Expand Down

0 comments on commit 759cb0e

Please sign in to comment.