skytracker.storage.queries.state.LatestBatchMapQuery#

class skytracker.storage.queries.state.LatestBatchMapQuery(limit: int = 0, lat_min: float | None = None, lat_max: float | None = None, lon_min: float | None = None, lon_max: float | None = None)#

Bases: TableQuery[MapState]

Query to select the latest aircraft simple map states (with optional bounding box)

Properties

allows_cache

fields

Methods

__init__

Initialize query with optional arguments

from_cache

Filter a cached list of states using stored settings

from_server

Query a list of states from server database

parse_table_row

Parse raw table data into a simple map state

__init__(limit: int = 0, lat_min: float | None = None, lat_max: float | None = None, lon_min: float | None = None, lon_max: float | None = None) None#

Initialize query with optional arguments

Parameters:
  • limit (int, optional) – maximum number of states to get (0=all). Defaults to 0.

  • lat_min (float, optional) – minimum latitude. Defaults to None.

  • lat_max (float, optional) – maximum latitude. Defaults to None.

  • lon_min (float, optional) – minimum longitude. Defaults to None.

  • lon_max (float, optional) – maximum longitude. Defaults to None.

async from_cache(states: list[State]) list[MapState]#

Filter a cached list of states using stored settings

Parameters:

states (list[State]) – cached list of states

Returns:

filtered list of simple map states

Return type:

list[MapState]

async from_server(table: str, db: DatabaseManager) list[MapState]#

Query a list of states from server database

Parameters:
  • table (str) – name of database table

  • db (DatabaseManager) – database manager instance

Returns:

selected list of simple map states

Return type:

list[MapState]

parse_table_row(raw_entry: tuple) MapState#

Parse raw table data into a simple map state

Parameters:

raw_entry (tuple) – raw table data

Returns:

corresponding simple map state

Return type:

SimpleMapState