Method search_by_predicate( predicate_fn) Returns: All airports that match the specified name, case-insensitive (an empty list if no airports match) Parameter: apt_name ( str) – The name of the airport you want to query Returns: The airport with the specified ID, or None if no matching airport exists in this collection. Parameter: apt_id ( str) – The X-Plane ID of the airport you want to query Note that these IDs may or may not correspond to the airports’ ICAO identifiers.Ī generator containing the names of all airports in the collection from_file ( os.PathLike): Path to the file from which this was readĪ generator containing the X-Plane IDs of all airports in the collection.apt_dat_file_text ( str): The contents of an apt.dat (or ICAO.dat) file.Static method from_file_text( apt_dat_file_text, from_file) -> AptDat xplane_version (int): The version of the apt.dat spec used by the airports in this collection.Parses X-Plane’s gigantic apt.dat files, which may have data on tens of thousands of airports. AptDat.AptDatĪ container class for Airport objects. Tools for reading, inspecting, and manipulating X-Plane’s airport (apt.dat) files. More sample code is available in the doctests in the gateway module docs below. items (): print ( ' \t ' + key + ':', value ) Downloaded the recommended scenery pack for an airport from the Gateway from xplane_airports.gateway import scenery_pack, GatewayApt ksea_recommended_pack = scenery_pack ( 'KSEA' ) """:type ksea_recommended_pack: GatewayApt""" print ( "KSEA downloaded from the Gateway begins:" ) print ( ksea_recommended_pack. head ()) Getting metadata on airports from the Gateway from xplane_airports.gateway import airports all_apts = airports () print ( "There are %d airports on the X-Plane Scenery Gateway" % len ( all_apts )) print ( "KSEA has the following metadata on the Gateway:" ) for key, value in all_apts. is_dir (), f " airports found in your default apt.dat \n " ) ksea = default_xplane_apt_dat """:type ksea: Airport""" print ( "KSEA's airport data on disk begins:" ) print ( ksea. Sample code Parsing the default apt.dat file in your local X-Plane installation from xplane_airports.AptDat import AptDat, Airport from pathlib import Path xplane_installation = Path ( input ( "Path to your X-Plane installation: " )) assert xplane_installation. If you're migrating from a pre-4.0 version of the library, see the Migration notes section below. Xplane_airports requires Python 3.6 or newer. ![]() recommended_scenery_packs(): A generator equivalent to calling scenery_pack() to download the recommended scenery pack for every airport (or only a preselected list of airports, at your discretion).Includes both the apt.dat data and DSF, where applicable. scenery_pack(): Downloads either the recommended pack for the specified airport, or the scenery pack with the specified int ID.Unlike scenery_pack(), though, this does not include actual apt.dat or DSF data. airport(): Queries the Gateway for information about the specified airport itself, as well as metadata on all scenery packs submitted for it.airports(): Queries for metadata on all 35,000+ airports on the Gateway.The gateway module: Used to interact with the X-Plane Scenery Gateway to get information about what airports are available, and to download individual scenery packs contributed by the community.The Airport class: Represents an individual airport from an apt.dat file. ![]() The AptDat class itself: A parser for X-Plane's airport data files (which may contain more than 35,000 airports) a collection of Airport objects. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |