Calculating locations
(PostgreSQL + PostGIS)
length: ~ 4 km
Based on current time calculate fraction of time covered and st_lineinterpolatepoint
length: ~ 3.5 km, total time: 2 minutes
Cool!
(but with intermediate stops this bus might never be on time)
A to B: 1.8 km, B to A: 1.7 km
A to B: 30 secs, B to A: 90 secs
But how are passangers supposed to get on and off?
(add impedance to traveltime at stops)
Adding acceleration/deceleration to transit location calculation. See eoy#2 (in Estonian)
accelerate / decelarate: 8 secs, stop 3 + 3 secs
Red: interpolate whole trip. Blue: interpolate using stops. Green: interpolate using stops and impeded time