Skip to content

Commit

Permalink
Cleanup of additional queries and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Erutis committed Jul 12, 2024
1 parent 0e1dcff commit 08f7d02
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,8 @@ def get(request):
# TODO: Currently hard-coded to get a single trajectory
q = select(Trajectory, func.ST_AsText(Trajectory.geom).label("geom")).where(
Trajectory.id == 2
) # select
q = text(
"SELECT ST_AsText(geom), feed_item_id FROM gps.trajectory WHERE id = 2"
) # text
)
q = text("SELECT ST_AsText(geom), feed_item_id FROM gps.trajectory WHERE id = 2")

with session as s:
trajs = s.execute(q).scalars().one_or_none()
Expand Down Expand Up @@ -65,7 +63,6 @@ def post(request):
def parse_data(data):
data = json.loads(data)
feed_item_id = data["feed_item_id"]
del data["feed_item_id"]

data = data["gps_data"]

Expand Down
3 changes: 2 additions & 1 deletion app/generate_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ def create_sample_linestring(area):
else:
geom_type = "LINESTRINGZM"

# Remove trailing comma at end of string
linestring = linestring[:-1]
print(f"HERE'S MY LINESTRING BETCH: {linestring}")

return linestring, geom_type


Expand Down

0 comments on commit 08f7d02

Please sign in to comment.