## 5 Use Case
#### Step 2: Filtering Erroneous or Irrelevant GPS Readings  
The records in the PT table, the PR record described previously, store the vehicle positions; however, the GPS receptor does not always provide a reliable reading, which is why it is necessary to filter the PR records that contain erroneous or unreliable readings. The detection of unreliable GPS readings is based on the use of fields 7 and 8 of the PR record. Field 7 has a length of 1 byte and can take the following values:  
* 0 2D reading: Only the latitude and longitude are provided, and the elevation reading is not provided. * 1 3D reading: The latitude, longitude and elevation are provided. * 2 2D reading in a differential GPS configuration (DGPS). * 3 3D reading in a differential GPS configuration (DGPS). * 6 DR.
* 8 Degraded DR.
* 9 Unknown source. Field 8 informs us about the age of the reading provided:  
* 0 Reading unavailable. * 1 Old reading: obtained more than 10 s ago. * 2 Recent reading: obtained less than 10 s ago. Figure 2: Aerial view of the geographic area of the route being studied. The green tags represent vehicle position readings with a velocity of zero. The orange markings represent the centroids of the groups of readings with a velocity of zero. The yellow icons represent scheduled bus stops of the route. Because the GPS system is not differential, filtering of GPS readings is performed by eliminating all the readings that do not include values 1 and 2 in fields 7 and 8, respectively. In addition to the samples discarded for being invalid or unreliable, irrelevant readings will also be eliminated to solve the problem. As the problem lies in identifying the points at which the vehicles systematically stop, the samples associated with positions at which the vehicle was moving are eliminated, _i.e._, readings that have a velocity not equal to zero (fields 5 and 6). Once these readings are eliminated, the resulting set of vehicle positions with zero velocity is called the Z-set. In the route being studied, applying this filter to the set of readings obtained in step 1 yields a Z-set of approximately 70,000 reliable position readings that indicate that the vehicle had a velocity of zero. When placing these readings on an aerial photograph of the geographic area containing the route being studied, one can see that the majority of the readings are grouped. These groups are associated with the locations of scheduled stops and the locations of unscheduled stops, the latter being points SP, and the objective of the method described is to identify them (Figure 2). When interpreting this graphical representation, we must note that a conventional non-differential GPS unit provides readings with a maximum margin of error of 100 m and that the stops in the transportation network have varying lengths. For the case of the route being studied, the average length of stops is 15 m.  
**Step 3: Classification of the Points**  
The identification method is based on the following hypothesis: \"If we consider the set of reliable and relevant readings of the problem, that is, the Z-set, the readings obtained for points where the vehicle systematically stops will have a high frequency compared with those of points at which the vehicle stops sporadically. In addition, the readings obtained at points of systematic stops must be grouped, with the number of groups being equal to the number of existing systematic stops along the route\". In accordance with the previous hypothesis, if we were to calculate the frequency histogram of the Z-set, we would observe the following behavior: there will be a high frequency of readings at the points of the route at which the vehicle stops systematically (PP-set and SP-set), whereas the readings associated with the positions around points at which the stop is not systematic will occur at a lower frequency. In addition, the readings in the Z-set will tend to form concentrated clusters when the vehicle is at one of the stops scheduled along the route.