function checkStartExcess(path) {
  let start_street = this.streets.getLayer(path[0].new_place.id),
    second_street_id = path[1].new_place.id,
    start_second_intersections = start_street.intersections[second_street_id],
    second_is_intersection =
      typeof start_second_intersections === "undefined"
        ? false
        : start_second_intersections.some(
            (intersection) =>
              intersection[0].lat === path[1].lat &&
              intersection[0].lng === path[1].lng,
          ),
    third_street_id = path[2].new_place.id,
    start_third_intersections = start_street.intersections[third_street_id],
    third_is_intersection =
      typeof start_third_intersections === "undefined"
        ? false
        : start_third_intersections.some(
            (intersection) =>
              intersection[0].lat === path[2].lat &&
              intersection[0].lng === path[2].lng,
          );

  if (
    (second_is_intersection || second_street_id === path[0].new_place.id) &&
    (third_is_intersection || third_street_id === path[0].new_place.id)
  ) {
    if (path[2].distanceTo(path[0]) < path[2].distanceTo(path[1])) {
      path.splice(1, 1);
    }
  }
}
If the first two points after the start point share the same street as the start point, and the
third point is closer to the first (start) point than it is to the second point, remove the
second point, as it's a superfluous detour.<br/><br/>

Typically happens when the start point's nearest intersection is beyond it on the street,
and so the path would have an agent travel from the start, then to the intersection,
then backwards to the third point.
@private

@param {Array<LatLng>} path - An array of LatLngs representing a path for an agent to travel along.