I have GPX trails of vehicles/bikes of a particular city. Meaning, lat/lon, timestamp of bike trails from where a particular bike started and ended at different hours of the day. I have sets of these trails for different bikes roaming around the city.

Now, I want to know if it is possible with PostGIS+pgRouting+any other combination to know how much time it takes to go from point A to point B in a particular range of hours by using the data I already have. Assume I have enough data for the city in terms of bike trails.

I do not want to use OSM data. But, if it is required, I am fine with using it.

Sample data:

BikeID, Lat, Lon, timeStamp

  • I don't think you even need pgRouting. You can use the 2nd example from ST_MakeLine, feed that to ST_Distance, and then divide by end timeStamp - start timeStamp, group by each bikeID. Happy to help with the SQL, if that is the approach that you are looking for? – John Powell Jun 30 '15 at 11:06
  • @john: Maybe I didn't frame the question correctly. What I want is given this historical data, for any point to other point, I want time it takes to travel. Sort of ETA for a route. I will need route- edges and how much it takes for the edge. – Spiralarchitect Jun 30 '15 at 12:06
  • So, what you say is, if I have a new set of start and end points to predict time, I will use them to make line, distance etc? If those points are available in my data, it will match the route? Sorry, I am new to PostGIS. – Spiralarchitect Jun 30 '15 at 12:15
  • Sorry, no, what I was suggesting will allow you to calculate a route for any given edge or an entire journey for any given bike ID. But, to find the time for some arbitrary route using multiple edges from different routes on different days, then, yes, you would need to feed all the edges (calcutlated as I suggested) into pgrouting. – John Powell Jun 30 '15 at 12:19
  • If you don't mind, can you rewrite entire steps as an answer? Thank you. – Spiralarchitect Jun 30 '15 at 12:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.