ALPR (Automated License Plate Reader) data are often used in law enforcement, but it can also be applied to analyze the vehicles users’ travel behaviors. Here we use spark to extract trip records from ALPR data.
ALPR data contains vehicle ID, timestamp and transect ID which indicates the place where the vehicle was detected. As shown in Figure 1, the time gap between two records could be used to discern whether two records are involved in the same trip. To avoid splitting one trip into two, here we chose a relatively big threshold. If the time gap between two consecutive ALPR records is bigger than 60 min, they are considered from two trips.
First, create two classes named LicenseRecord and TripRecord. One instance of LicenseRecord consists of one’s ID and all his license records, and instances of TripRecord are our outputs.
Figure 2 shows the trip recognition result of one individual. Notice that some regular patterns appear in his trip records. And by defining a new function to compare the difference between trip records. One can use a process similar to the above to tell different kinds of trips and understand more things about human travel behaviors.