function getPath(
  start_int_lat_lng,
  goal_int_lat_lng,
  start_lat_lng,
  goal_lat_lng,
  sparse = false,
) {
  let start_coord = encodeLatLng(start_int_lat_lng),
    end_coord = encodeLatLng(goal_int_lat_lng),
    encoded_path = this.pathfinder.find(start_coord, end_coord),
    path = [];

  if (
    encoded_path.length > 0 &&
    decodeCoordString(encoded_path[0].id).distanceTo(start_int_lat_lng) >
      decodeCoordString(encoded_path[0].id).distanceTo(goal_int_lat_lng)
  ) {
    encoded_path = encoded_path.reverse();
  }

  if (sparse === true && encoded_path.length >= 2) {
    let sparse_path = [],
      recent_street = null,
      current_street = null;

    for (let i = 0; i <= encoded_path.length - 2; i++) {
      current_street =
        this.streets.graph.getLink(
          encoded_path[i].id,
          encoded_path[i + 1].id,
        ) ||
        this.streets.graph.getLink(encoded_path[i + 1].id, encoded_path[i].id);

      if (
        recent_street === null ||
        current_street.data.place.id !== recent_street.data.place.id
      ) {
        let decoded_coords = decodeCoordString(
          encoded_path[i].id,
          current_street.data.place,
        );
        sparse_path.push(decoded_coords);
      }

      //If the last place on the path to the goal is labeled with a different street id than the goal,
      //add it to the sparse path.
      if (i === encoded_path.length - 2) {
        let decoded_coords = decodeCoordString(
          encoded_path[i + 1].id,
          current_street.data.place,
        );
        sparse_path.push(decoded_coords);
      }
    }

    path = sparse_path;
  } else {
    path = encoded_path.map((point) => decodeCoordString(point.id, 0));
  }

  path.unshift(start_lat_lng);
  path.push(goal_lat_lng);

  //If the goal point lies before the first intersection of the goal street, then the 2nd to last point in the
  //path will have the previous street's id attached to it. If the goal lies on a different street, make
  //sure the 2nd to last point (the street path intersection point before the goal) has the same street id as the goal.
  if (path[path.length - 2].new_place.id !== goal_lat_lng.new_place.id) {
    path[path.length - 2].new_place = goal_lat_lng.new_place;
  }

  //If the second [to last] point--namely the intersection closest to the start [goal]--is further from the third
  //[to last] point than the goal, and all three points are on the same street, remove the second [to last] point.
  if (path.length >= 3) {
    checkStartExcess.call(this, path);
    checkEndExcess.call(this, path);
  }

  return path;
}
Get a path between two points on a graph.
@memberof Agentmap
@instance
@private

@param start_int_lat_lng {LatLng} - The coordinates of the nearest intersection on the same street at the start_lat_lng.
@param goal_int_lat_lng {LatLng} - The coordinates of the nearest intersection on the same street as the goal_lat_lng.
@param start_lat_lng {LatLng} - The coordinates of the point on the street from which the agent will be traveling.
@param goal_lat_lng {LatLng} - The coordinates of the point on the street to which the agent should travel.
@param {Boolean} [sparse=false] - Whether to exclude intersections between the first and last along a street-specific path (which are superfluous for extracting the necessary sub-street).
@return {Array<Array<number>>} - An array of points along the graph, leading from the start to the end.