Airports¶
Airport lookup and selection.
Provides geographic search, filtering by proximity, country, type, and runway requirements using the OurAirports global database.
Data source¶
OurAirports (https://ourairports.com), maintained by David Megginson. CSV data retrieved from https://github.com/davidmegginson/ourairports-data. Licensed under the Public Domain (CC0).
- class Airport[source]¶
Bases:
objectAn airport looked up by ICAO code from the OurAirports dataset.
Lazily initializes airport data on first instantiation. Properties provide access to location, elevation, and runway information.
- Parameters:
icao (str) – ICAO code of the airport (e.g., “KJFK”).
- Raises:
ValueError – If the ICAO code is not found in the dataset.
- property longitude¶
Longitude of the airport.
- property latitude¶
Latitude of the airport.
- property geometry¶
Shapely Point geometry of the airport.
- property icao_code¶
ICAO code of the airport.
- property iata_code¶
IATA code of the airport.
- property name¶
Name of the airport.
- property country¶
ISO country code of the airport.
- property municipality¶
Municipality of the airport.
- property elevation¶
Elevation of the airport in meters. Returns None if not available.
- property elevation_ft¶
Elevation of the airport in feet. Returns None if not available.
- property runways: DataFrame¶
Runway details for this airport as a DataFrame.
- initialize_data(countries=None, min_runway_length=None, runway_surface=None, airport_types=None, cache_dir=None, refresh=False)[source]¶
Initialize airport and runway data with filtering options.
- Parameters:
countries (
Optional[List[str]]) – ISO country codes to filter airports by.min_runway_length (
int|None) – Minimum runway length in feet.runway_surface (
Union[str,List[str],None]) – Runway surface type(s) to filter by.airport_types (
Optional[List[str]]) – Airport types to include (default: large, medium, small).cache_dir (
Union[str,Path,None]) – Directory to store downloaded data files. Defaults to ~/.cache/hyplan/.refresh (
bool) – If True, re-download data files even if they already exist.
- Return type:
- find_nearest_airports(lat, lon, n=5)[source]¶
Find the N nearest airports to a given latitude and longitude.
- airports_within_radius(lat, lon, radius, unit='kilometers', return_details=False)[source]¶
Find all airports within a specified radius of a given point.
- Parameters:
- Return type:
- Returns:
List of ICAO codes, or a GeoDataFrame if return_details is True.
- get_longest_runway(icao)[source]¶
Return the length in feet of the longest runway at the given airport.