code: def bounding_box_from(points, i, i1, thr):
      
      pi = points[i]
      pi1 = points[i1]
  
      min_lat = min(pi.lat, pi1.lat)
      min_lon = min(pi.lon, pi1.lon)
      max_lat = max(pi.lat, pi1.lat)
      max_lon = max(pi.lon, pi1.lon)
  
      return min_lat-thr, min_lon-thr, max_lat+thr, max_lon+thr
docs: Creates bounding box for a line segment
  
      Args:
          points (:obj:`list` of :obj:`Point`)
          i (int): Line segment start, index in points array
          i1 (int): Line segment end, index in points array
      Returns:
          (float, float, float, float): with bounding box min x, min y, max x and max y