traffic/algorithms/navigation.py
def closest_point(
        self, points: Union[List["PointMixin"], "PointMixin"]
    ) -> pd.Series:
        """Selects the closest point of the trajectory with respect to
        a point or list of points.

        The pd.Series returned by the function is enriched with two fields:
        distance (in meters) and point (containing the name of the closest
        point to the trajectory)

        Example usage:

        .. code:: python

            >>> item = belevingsvlucht.between(
            ...     "2018-05-30 16:00", "2018-05-30 17:00"
            ... ).closest_point(  # type: ignore
            ...     [
            ...         airports["EHLE"],  # type: ignore
            ...         airports["EHAM"],  # type: ignore
            ...         navaids["NARAK"],  # type: ignore
            ...     ]
            ... )
            >>> f"{item.point}, {item.distance:.2f}m"
            "Lelystad Airport, 49.11m"

        """
        from ..core.distance import closest_point as cp

        # The following cast secures the typing
        self = cast("Flight", self)

        if not isinstance(points, list):
            points = [points]

        return min(
            (cp(self.data, point) for point in points),
            key=attrgetter("distance"),
        )
Selects the closest point of the trajectory with respect to
        a point or list of points.

        The pd.Series returned by the function is enriched with two fields:
        distance (in meters) and point (containing the name of the closest
        point to the trajectory)

        Example usage:

        .. code:: python

            >>> item = belevingsvlucht.between(
            ...     "2018-05-30 16:00", "2018-05-30 17:00"
            ... ).closest_point(  # type: ignore
            ...     [
            ...         airports["EHLE"],  # type: ignore
            ...         airports["EHAM"],  # type: ignore
            ...         navaids["NARAK"],  # type: ignore
            ...     ]
            ... )
            >>> f"{item.point}, {item.distance:.2f}m"
            "Lelystad Airport, 49.11m"

        
Selects the closest point of the trajectory with respect to
a point or list of points.

The pd.Series returned by the function is enriched with two fields:
distance (in meters) and point (containing the name of the closest
point to the trajectory)

Example usage.

: python


Selects the closest point of the trajectory with respect to a point or list of points . The pd . Series returned by the function is enriched with two fields : distance ( in meters ) and point ( containing the name of the closest point to the trajectory ) Example usage . : python
def closest_point(
        self, points: Union[List["PointMixin"], "PointMixin"]
    ) -> pd.Series:
        from ..core.distance import closest_point as cp
        self = cast("Flight", self)
        if not isinstance(points, list):
            points = [points]
        return min(
            (cp(self.data, point) for point in points),
            key=attrgetter("distance"),
        )
def closest_point ( self , points : Union [ List [ "PointMixin" ] , "PointMixin" ] ) -> pd . Series : from . . core . distance import closest_point as cp self = cast ( "Flight" , self ) if not isinstance ( points , list ) : points = [ points ] return min ( ( cp ( self . data , point ) for point in points ) , key = attrgetter ( "distance" ) , )
Selects the closest point of the trajectory with respect to
a point or list of points.
Selects the closest point of the trajectory with respect to a point or list of points .
"""Selects the closest point of the trajectory with respect to
        a point or list of points.

        The pd.Series returned by the function is enriched with two fields:
        distance (in meters) and point (containing the name of the closest
        point to the trajectory)

        Example usage:

        .. code:: python

            >>> item = belevingsvlucht.between(
            ...     "2018-05-30 16:00", "2018-05-30 17:00"
            ... ).closest_point(  # type: ignore
            ...     [
            ...         airports["EHLE"],  # type: ignore
            ...         airports["EHAM"],  # type: ignore
            ...         navaids["NARAK"],  # type: ignore
            ...     ]
            ... )
            >>> f"{item.point}, {item.distance:.2f}m"
            "Lelystad Airport, 49.11m"

        """ # The following cast secures the typing
self
points
Union[List["PointMixin"], "PointMixin"]