# Towards Moving Objects Behavior Analysis: Region Speed Limit Rate Measure
## 3 Results and Discussion  
The experiments were carried out with public data of taxi trips from Porto (Portugal) and its surrounding areas [23]. Each data packet corresponds to a completed trip (a taxi trajectory). These taxis operate through a taxi dispatch center, using mobile data terminals installed in the vehicles. Each data packet of a taxi trajectory includes (among other data):  
* TRIP_ID: trip identifier. * TAXI_ID: taxi id. * TIMESTAMP: time when the trip began. * POLYLINE: list of coordinates [longitude, latitude]. A pair of consecutive coordinates corresponds to 15 s of a trip. The last coordinate corresponds to the trip's destination, while the first one represents its start. * MISISING_DATA: type of the data packet. MISISING_DATA may take two values: \(\circ\)  
FALSE: if there are no missing coordinates. TRUE: otherwise. We considered 1048576 trips from 3 August 2013 to 31 August 2013 (28 days), each trajectory had on average 10 coordinates (CPs). The POLYLINE of a trip looks similar to this: [[\(-8.613567\), \(41.146875\)], [\(-8.613549\), \(41.146749\)], [\(-8.613675\), \(41.145957\)], [\(-8.612604\), \(41.145966\)], \(\ldots\), [\(-8.648334\), \(41.158017\)], [\(-8.648451\), \(41.15799\)], [\(-8.648523\), \(41.157981\)]. In Figure 7, we show this trajectory (we used this tool [[https://geojson.io](https://geojson.io)]([https://geojson.io](https://geojson.io)), accessed on 30 November 2022). The region of interest, Porto, was segmented into sixteen cells numbered from 1 to 16, see Figure 8. In Figure 9, we detailed cell 6 with its coordinates (note that in Figure 9, in the \"coordinates\" array, the last coordinate is equal to the first one). To calculate the  
Figure 7: Example of a trajectory taken from the dataset. cell dimensions (km), we used the tool [[https://www.omnicalculator.com/other/latitude-longitude-distance](https://www.omnicalculator.com/other/latitude-longitude-distance)]([https://www.omnicalculator.com/other/latitude-longitude-distance](https://www.omnicalculator.com/other/latitude-longitude-distance)), accessed on 30 November 2022. One side of the cell measured 5.787 km and the other 6.721 km. As the cell is not a square (it is a rectangle), the inside function of our algorithm was modified in such a way that it verifies the spatial inclusion of a point in a rectangle. We also divided the day into twelve mutually exclusive consecutive temporal segments: (00:00, 02:00], (02:00, 04:00],..., (22:00, 00:00]. Thus, we have 12 spatiotemporal scenarios. We processed the data, stored in CSV files, with Jupyter Notebook. Before applying our algorithm for computing the speed limit rate, we cleaned the data: we removed repeated data packets and data packets with: (i) the same taxi in different positions at the same time, (ii) missing coordinates, and (iii) excessive speed between two consecutive coordinates  
Figure 8: Porto segmented into sixteen cells of the grid. Figure 9: Cell 6. (greater than 200 km/h). In addition, we only considered cells of a spatiotemporal scenario with more than 10 trajectories. Note that cells 3 and 4 are located entirely in the ocean; therefore, there are no trajectories passing through these cells. To compare the results of our speed limit rate measure, we also conducted experiments with the SPI (speed performance index) [19; 24], which is an index to measure the traffic state level of a road. SPI = 100*(_Vavg/Vmax_), where _Vavg_ is the average speed in a cell and _Vmax_ is the maximum permitted speed in the cell. With this index, the traffic state level can be classified as follows: [0, 25] heavy, [25; 50] mild, [50; 75] smooth, and [75; 100] very smooth. We conducted the following experiments. * **First**: considering the 12 spatiotemporal scenarios and the 14 cells (excluding cells 3 and 4), we ran our algorithm for all the 28 days with _MaxSpeed_ 50 km/h and 40 km/h. * **Second**: from the results of the first experiment, we chose five cells: four of them were the cells with more trajectories, and the other was the one with less trajectories.