earthkit.geo.distance.GeoKDTree

class earthkit.geo.distance.GeoKDTree(lats, lons)
max_distance_arc
nearest_point(ref_points, figure=IFS_SPHERE)

Find the index of the nearest point to all ref_points.

Parameters:
  • ref_points (pair of array-like) – Latitude and longitude coordinates of the reference point (degrees)

  • figure (geo.figure.Figure, optional) – Figure of the spheroid the returned distances are computed on (default: geo.figure.IFS_SPHERE)

Returns:

  • ndarray – Indices of the nearest points to ref_points.

  • ndarray – The distance (m) between the ref_points and the corresponding nearest point in points. Computed on the surface of the spheroid defined by figure.

tree