skytracker.storage.queries.state.NearbyQuery#
- class skytracker.storage.queries.state.NearbyQuery(lat: float, lon: float, radius: float = 50.0, limit: int = 0)#
Bases:
TableQuery[State]Query to select aircraft within a radius from a specified point
Properties
allows_cacheMethods
Initialize query with parameters
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__(lat: float, lon: float, radius: float = 50.0, limit: int = 0) None#
Initialize query with parameters
- Parameters:
lat (float) – latitude of point
lon (float) – longitude of point
radius (float, optional) – radius from specified points [km]. Defaults to 50.0 km.
limit (int, optional) – maximum number of states to get (0=all). Defaults to 0 (all).
- 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]