Wednesday, 21 November 2018

spatial database - Detecting patterns in vehicle GPS data




I need to analyze data uploaded from vehicle GPS devices to detect travel patterns and then attempt to learn about the normal travel patterns for that vehicle so that predictions can be made about maintenance, refueling etc. Some vehicles are domestic (exhibiting normal home->work->home travel patterns) and some are commercial with scheduled routing. I have loaded the GPS lats and longs to a database, and then constructed an ST_LineString with the data points for each vehicle (approx 1k points per vehicle per day). Vehicles will never have identical travel patterns (GPS accuracy, irregular ping times etc) and the patterns will be visible as subsets of pings - for example a one hour commute between point A (home) and point B (work) between 8am and 9.30am each morning, mon-fri.


Now the difficult part - I am considering the options. I have to write this in a database procedural language using the usual toolbox of procedures, cursors, iteration etc. I could use Python if it is helpful - I'm a database guy trying to think laterally and spatially.


A travel pattern could be identified by



(i) a similar sequence of points that can differ by a tolerance (say +/- 300 meters)


(ii) parking locations - if a car is parked at the same location for 8 hours a day


(iii) temporal- the vehicle starts at trip at 0830 every day, +/- 10 minutes.


I am planning to write a procedure that checks for each of these patterns for each point (or set of n points) by comparing it with all other points (or set of points) by iterating through the pings for each day in sequence. The easiest use case is to find recurrences of a vehicle parked at the same place each day. Detecting similar movement patterns is more complex. Can anyone suggest a technique for this?


Thanks!




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...