Created
June 17, 2023 11:31
-
-
Save joaofig/0bf754b5c1bcdd29b0bd903cedfafe59 to your computer and use it in GitHub Desktop.
Loads the GPS trajectory points from the database.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def load_trajectory_points(traj_id): | |
| db = EVedDb() | |
| sql = f""" | |
| select distinct | |
| s.latitude as lat | |
| , s.longitude as lon | |
| , min(s.time_stamp) / 1000 as time | |
| from signal s | |
| inner join trajectory t on s.vehicle_id = t.vehicle_id and s.trip_id = t.trip_id | |
| where t.traj_id = ? | |
| group by s.latitude, s.longitude | |
| order by s.time_stamp; | |
| """ | |
| return db.query_df(sql, [traj_id]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment