A non-transitory computer-readable medium comprising instructions that, when executed by one or more processors, cause the one or more processors to perform operations comprising:
- receiving, by an application executing on a mobile device, a plurality of geographic coordinates, each corresponding to a location of a point of interest located within a geographic region;
- receiving, by the application while the mobile device is disposed in a vehicle during a drive, measurements from one or more sensors disposed in the vehicle during the drive;
- determining, by the application at a first time during the drive, a first location of the vehicle within the geographic region at the first time based on the measurements;
- generating, by the application from the plurality of geographic coordinates, a subset of the plurality of geographic coordinates that are within a predefined proximity of the first location;
- detecting, by the application at a second time during the drive, that a deceleration rate of the vehicle exceeded a predefined deceleration rate during a time period leading up to the second time based on the measurements collected by the one or more sensors;
- determining, by the application, a second location of the vehicle within the geographic region during the time period based on the measurements;
- generating, by the application, a plurality of distance measurements, each corresponding to a distance between the second location and a respective geographic coordinate of the subset of geographic coordinates;
- comparing, by the application, a shortest distance measurement of the plurality of distance measurements to a predefined threshold alerting distance to determine whether the shortest distance measurement is greater than or equal to the predefined threshold alerting distance;
- and
- causing, by the application, a physical interface of the mobile device to output an indication of hard braking to a user of the mobile device during the drive in response to detecting that the deceleration rate of the vehicle exceeded the predefined deceleration rate during the time period and determining that the shortest distance measurement is greater than or equal to the predefined threshold alerting distance.