geokdtree.cpp

KD-Tree implementation for efficient nearest neighbor search

class ClosestPointResult:
ClosestPointResult(*args, **kwargs)
point

(self) -> list[float]

The closest point

distance

(self) -> float

The squared distance to the closest point

class ClosestIdxResult:
ClosestIdxResult(*args, **kwargs)
idx

(self) -> int

The index of the closest point

distance

(self) -> float

The squared distance to the closest point

class KDTree:
KDTree()

__init__(self, points: collections.abc.Sequence[collections.abc.Sequence[float]]) -> None

Build a KD-Tree from a list of points

def closest_point(unknown):

closest_point(self, point: collections.abc.Sequence[float]) -> tuple

Find the closest point to the given point

class GeoKDTree:
GeoKDTree()

__init__(self, points: collections.abc.Sequence[tuple[float, float]]) -> None

Build a geographic KD-Tree from a list of (latitude, longitude) pairs

def closest_idx(unknown):

closest_idx(self, point: tuple[float, float]) -> int

Find the index of the closest point to the given (lat, lon) pair

def closest_point(unknown):

closest_point(self, point: tuple[float, float]) -> tuple[float, float]

Find the closest point (lat, lon) to the given (lat, lon) pair

lat_lon_idx_to_xyz_idx = <nanobind.nb_func object>
squared_distance = <nanobind.nb_func object>
squared_distance_3d = <nanobind.nb_func object>
lat_lon_idx_to_xyz_idx = <nanobind.nb_func object>