Open hunterowens opened 5 years ago
You can see how we implemented this in the newest trigger-based process here: https://github.com/CityofSantaMonica/mds-provider-services/blob/master/db/trips/process_trip_routes.sql#L20
We break the process into two steps on trip
insert:
routes
, including the sorting of points by time for the linecc @RMK0110
@ian-r-rose This looks to be resolved with L59 of https://github.com/CityofSantaMonica/mds-provider-services/blob/master/db/trips/process_trip_routes.sql#L59 using:
st_makeline(array_agg(geopoint order by timepoint)) as route_line,
Is there anything else needed? - RMK0110
@RMK0110 That function is not called in our Postgres instance. You should find our version of the same function under "functions" in pgadmin, with name "process_route"
some debugging with @thekaveman points out that we might not be guaranteed that the order of points in /routes in timestamp aware. Add an order by to the trigger and rerun