traffic/algorithms/navigation.py
def on_runway(self, airport: Union[str, "Airport"]) -> Optional["Flight"]:
        """Returns the longest segment of trajectory which perfectly matches
        a runway at given airport.

        .. code:: python

            >>> landing = belevingsvlucht.last(minutes=30).on_runway("EHAM")
            >>> landing.mean("altitude")
            -26.0

            >>> takeoff = belevingsvlucht.first(minutes=30).on_runway("EHAM")
            >>> takeoff.mean("altitude")
            437.27272727272725

        """

        return max(
            self.aligned_on_runway(airport),
            key=attrgetter("duration"),
            default=None,
        )
Returns the longest segment of trajectory which perfectly matches
        a runway at given airport.

        .. code:: python

            >>> landing = belevingsvlucht.last(minutes=30).on_runway("EHAM")
            >>> landing.mean("altitude")
            -26.0

            >>> takeoff = belevingsvlucht.first(minutes=30).on_runway("EHAM")
            >>> takeoff.mean("altitude")
            437.27272727272725

        
Returns the longest segment of trajectory which perfectly matches
a runway at given airport.

: python




Returns the longest segment of trajectory which perfectly matches a runway at given airport . : python
def on_runway(self, airport: Union[str, "Airport"]) -> Optional["Flight"]:
        return max(
            self.aligned_on_runway(airport),
            key=attrgetter("duration"),
            default=None,
        )
def on_runway ( self , airport : Union [ str , "Airport" ] ) -> Optional [ "Flight" ] : return max ( self . aligned_on_runway ( airport ) , key = attrgetter ( "duration" ) , default = None , )
Returns the longest segment of trajectory which perfectly matches
a runway at given airport.
Returns the longest segment of trajectory which perfectly matches a runway at given airport .
"""Returns the longest segment of trajectory which perfectly matches
        a runway at given airport.

        .. code:: python

            >>> landing = belevingsvlucht.last(minutes=30).on_runway("EHAM")
            >>> landing.mean("altitude")
            -26.0

            >>> takeoff = belevingsvlucht.first(minutes=30).on_runway("EHAM")
            >>> takeoff.mean("altitude")
            437.27272727272725

        """
self
airport
Union[str, "Airport"]