traffic.core.structure

class traffic.core.structure.Airport(altitude: float, country: str, iata: str, icao: str, latitude: float, longitude: float, name: str)

Bases: FormatMixin, HBoxMixin, AirportNamedTuple, PointMixin, ShapelyMixin

altitude: float

Alias for field number 0

property area: float

Returns the area of the shape, in square meters. The shape is projected to an equivalent local projection before computing a value.

property bounds: tuple[float, float, float, float]

Returns the bounds of the (bounding box of the) shape. Bounds are given in the following order in the origin crs: (west, south, east, north)

property centroid: Point

Returns the centroid of the shape as a shapely Point.

count(value, /)

Return number of occurrences of value.

country: str

Alias for field number 1

property extent: tuple[float, float, float, float]

Returns the extent of the (bounding box of the) shape.

Note

When plotting with Matplotlib and Cartopy, the extent property is convenient in the following use case:

>>> ax.set_extent(obj.extent)
Returns:

Extent is given in the following order in the origin crs: (west, east, south, north)

geoencode(footprint=True, runways=True, labels=True, **kwargs)

Returns an altair encoding of the shape to be composed in an interactive visualization. Specific plot features, such as line widths, can be passed with the kwargs argument. See documentation.

Return type:

LayerChart

geojson()

Returns the GeoJSON representation of the shape as a Dict. The transformation is delegated to shapely mapping method.

Return type:

dict[str, Any] | list[dict[str, Any]]

iata: str

Alias for field number 2

icao: str

Alias for field number 3

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

latitude: float

Alias for field number 4

property latlon: tuple[float, float]

A tuple for latitude and longitude, in degrees, in this order.

property latlon_dict: LatLonDict

A tuple for latitude and longitude, in degrees, in this order.

leaflet(**kwargs)

Returns a Leaflet layer to be directly added to a Map.

The elements passed as kwargs as passed as is to the Marker constructor.

Return type:

GeoData

longitude: float

Alias for field number 5

name: str

Alias for field number 6

project_shape(projection=None)

Returns a projected representation of the shape.

Parameters:

projection (None | pyproj.Proj | ‘crs.Projection) – By default (None), an equivalent projection is applied. Equivalent projections locally respect areas, which is convenient for the area attribute.

Return type:

base.BaseGeometry

property runways: RunwayAirport | None

Get runway information associated with the airport.

>>> airports['EHAM'].runways
  latitude   longitude   bearing   name
 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  52.3       4.783       41.36     04
  52.31      4.803       221.4     22
  52.29      4.734       57.93     06
  52.3       4.778       238       24
  52.32      4.746       86.65     09
  52.32      4.797       266.7     27
  52.33      4.74        183       18C
  52.3       4.737       2.997     36C
  52.32      4.78        183       18L
  52.29      4.777       3.002     36R
... (2 more entries)
class traffic.core.structure.AirportNamedTuple(altitude, country, iata, icao, latitude, longitude, name)

Bases: NamedTuple

altitude: float

Alias for field number 0

count(value, /)

Return number of occurrences of value.

country: str

Alias for field number 1

iata: str

Alias for field number 2

icao: str

Alias for field number 3

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

latitude: float

Alias for field number 4

longitude: float

Alias for field number 5

name: str

Alias for field number 6

class traffic.core.structure.Navaid(name: str, type: str, latitude: float, longitude: float, altitude: float, frequency: float | None, magnetic_variation: float | None, description: str | None)

Bases: NavaidTuple, PointMixin

altitude: float

Alias for field number 4

count(value, /)

Return number of occurrences of value.

description: Optional[str]

Alias for field number 7

frequency: Optional[float]

Alias for field number 5

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

latitude: float

Alias for field number 2

property latlon: tuple[float, float]

A tuple for latitude and longitude, in degrees, in this order.

property latlon_dict: LatLonDict

A tuple for latitude and longitude, in degrees, in this order.

leaflet(**kwargs)

Returns a Leaflet layer to be directly added to a Map.

The elements passed as kwargs as passed as is to the Marker constructor.

Return type:

Marker

longitude: float

Alias for field number 3

magnetic_variation: Optional[float]

Alias for field number 6

name: str

Alias for field number 0

type: str

Alias for field number 1

class traffic.core.structure.NavaidTuple(name, type, latitude, longitude, altitude, frequency, magnetic_variation, description)

Bases: NamedTuple

altitude: float

Alias for field number 4

count(value, /)

Return number of occurrences of value.

description: Optional[str]

Alias for field number 7

frequency: Optional[float]

Alias for field number 5

index(value, start=0, stop=9223372036854775807, /)

Return first index of value.

Raises ValueError if the value is not present.

latitude: float

Alias for field number 2

longitude: float

Alias for field number 3

magnetic_variation: Optional[float]

Alias for field number 6

name: str

Alias for field number 0

type: str

Alias for field number 1

class traffic.core.structure.Route(name, navaids)

Bases: HBoxMixin, ShapelyMixin

property area: float

Returns the area of the shape, in square meters. The shape is projected to an equivalent local projection before computing a value.

property bounds: tuple[float, float, float, float]

Returns the bounds of the (bounding box of the) shape. Bounds are given in the following order in the origin crs: (west, south, east, north)

property centroid: Point

Returns the centroid of the shape as a shapely Point.

property extent: tuple[float, float, float, float]

Returns the extent of the (bounding box of the) shape.

Note

When plotting with Matplotlib and Cartopy, the extent property is convenient in the following use case:

>>> ax.set_extent(obj.extent)
Returns:

Extent is given in the following order in the origin crs: (west, east, south, north)

geoencode(**kwargs)

Returns an altair encoding of the shape to be composed in an interactive visualization. Specific plot features, such as line widths, can be passed with the kwargs argument. See documentation.

Return type:

LayerChart | Chart

geojson()

Returns the GeoJSON representation of the shape as a Dict. The transformation is delegated to shapely mapping method.

Return type:

dict[str, Any] | list[dict[str, Any]]

leaflet(**kwargs)

Returns a Leaflet layer to be directly added to a Map.

The elements passed as kwargs as passed as is to the PolyLine constructor.

Return type:

Optional[Polyline]

project_shape(projection=None)

Returns a projected representation of the shape.

Parameters:

projection (None | pyproj.Proj | ‘crs.Projection) – By default (None), an equivalent projection is applied. Equivalent projections locally respect areas, which is convenient for the area attribute.

Return type:

base.BaseGeometry