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)
- 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:
- geojson()
Returns the GeoJSON representation of the shape as a Dict. The transformation is delegated to shapely
mapping
method.
- 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:
- 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
- count(value, /)
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)
Return first index of value.
Raises ValueError if the value is not present.
Bases:
NavaidTuple
,PointMixin
Alias for field number 4
Return number of occurrences of value.
Alias for field number 7
Alias for field number 5
Return first index of value.
Raises ValueError if the value is not present.
Alias for field number 2
A tuple for latitude and longitude, in degrees, in this order.
A tuple for latitude and longitude, in degrees, in this order.
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:
Alias for field number 3
Alias for field number 6
Alias for field number 0
Alias for field number 1
Bases:
NamedTuple
Alias for field number 4
Return number of occurrences of value.
Alias for field number 7
Alias for field number 5
Return first index of value.
Raises ValueError if the value is not present.
Alias for field number 2
Alias for field number 3
Alias for field number 6
Alias for field number 0
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 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:
- geojson()
Returns the GeoJSON representation of the shape as a Dict. The transformation is delegated to shapely
mapping
method.
- 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.
- 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