How to generate data for airspace
Main problem with the data generation are places when airspaces from different files (countries) overlap. It is expesive to hold all airspaces in memory.
Data used comes from openAIP. Visit openAIP.net and contribute to better aviation data, free for everyone to use and share. www.openaip.net
This new method requires pre-computed meta data about the source file.
- source - OpenAIP airspace source files
- lists - list of AIR files that will be generated for each source file
- lookup - inverted lists directory: list of source files for each AIR file
- data - generated AIR files for SkyDrop
- dist - bundled zip files
- agl_tiles.list - contain list of agl data file, it is used to exclude airpsaces over water
This is how to install the minimum required packets on a debian system to create airspace files
- apt-get install -y python3 python3-pip watch && \
- pip3 install matplotlib shapely lxml
The data generation now need additional steps, if you want to use multiple files as sources. This can be skipped and generate datafiles for only single source file, like in step 3.
Create file list for every source file.
./convert.py -l source/openaip_airspace_slovakia_sk.aipwill create list file for this airspace lists are required for final airspace packing as border data files will be shared for more than one country they are also used for creating lookup lists Generaly this method is not very intense on the CPU, you can run it in paralel. See
Create lookup data.
./create_lookup.pyto invert the lists data Thees files will be later used for loading additional airspaces when generating border data
Generate data file.
./convert.py source/openaip_airspace_slovakia_sk.aipWill generate data for entered single airspace file. The convert script will look for files in lookup directory. If the file exist it will be used to check if the AIR file needs to be generated for this airspace (skiping Quickcheck for emptyness) and also if there is a need to load another airspace.
Bundle airspace data to zip
./create_zip.py lists/openaip_airspace_slovakia_sk.aip.listto create zip file of the data for the airspace in dist directory
Few notes on how we handle airspaces, since we do not want to edit the files, because of possible updates.
- Tiles over water will not be generated. Conversion will skip any tile not in
agl_tiles.listif the file exists.
- Tiles under latitude -60 will not be generated.
- Airspaces classes will be changed based on the its name prefix (eg. if airspace named "TMA Bratislava" is class C, it will be changed to class TMA)
- Airspaces classes that have
const.pywill be skipped
- Airspaces without class will go into OTH class
- Airspaces that starts higher than 32767ft / 9987m (0x7FFF) will be skipped
- Airspaces that have same top and bottom will be skipped.