skytracker.storage.queries.state.LatestBatchQuery#
- class skytracker.storage.queries.state.LatestBatchQuery(limit: int = 0, lat_min: float | None = None, lat_max: float | None = None, lon_min: float | None = None, lon_max: float | None = None, fields: list[str] = None)#
Bases:
TableQuery[State]Query to select the latest aircraft states (with optional bounding box)
Properties
allows_cacheMethods
Initialize query with optional arguments
Filter a cached list of states using stored settings
Query a list of states from server database
Parse raw table data into a 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, fields: list[str] = 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.
fields (list[str], optional) – names of fields in flattened table. Defaults to None.
- async from_cache(states: list[State]) list[State]#
Filter a cached list of states using stored settings
- async from_server(table: str, db: DatabaseManager) list[State]#
Query a list of states from server database
- Parameters:
table (str) – name of database table
db (DatabaseManager) – database manager instance
- Returns:
selected list of states
- Return type:
list[State]