X-Plane apt.dat convert
xplane_apt_convert is a Python package and CLI application allowing to convert X-Plane airport data to GIS-friendly formats like GeoJSON or ESRI Shapefile.
Input
X-Plane apt.dat files are used as input.
Two input modes exist:
- Load a local
apt.datfile. - Automatically download airport-specific files from the X-Plane Scenery Gateway.
Note: Only tested with apt.dat files version 1100.
Output
The following output formats are supported:
| Format | Extension |
|---|---|
| ESRI Shapefile | .shp |
| FlatGeobuf | .fgb |
| GeoJSON | .geojson |
| GeoJSON lines (GeoJSONSeq) | .geojsonl |
| GeoPackage (GPKG) | .gpkg |
| GML | .gml |
| OGR_GMT | .gmt |
| SQLite | .sqlite |
Supported Features
The following airport features are supported:
- Windsocks (row code
19) - Ground signs (row code
20) - Runways (row code
100) - Pavement areas (taxiway and aprons) (header row code
110) - Ground markings (linear features) (header row code
120) - Airport boundary (header row code
130) - Aircraft startup locations (parking and gates) (row code
1300) - Airport metadata (row code
1302)
Installation
The xplane_apt_convert Python package can be installed using pip:
pip install xplane_apt_convert
Python 3.10 and above
When using Python 3.10 and above, you might encounter the following error during the installation of the bezier dependency:
The BEZIER_INSTALL_PREFIX environment variable must be set.
To solve it, you can install the pure Python version of the bezier package by running:
BEZIER_NO_EXTENSION=true pip install bezier --no-binary=bezier
And then try installing xplane_apt_convert again.
See dhermes/bezier/issues/283 for more details about this issue.
CLI Basic Usage
Convert an airport in a local apt.dat file to GeoJSON:
python -m xplane_apt_convert -a LEBL -i ./apt.dat -o ./out/ -d GeoJSON
Convert multiple airports:
python -m xplane_apt_convert -a LEBL,LEGE,LERS,LELL -i ./apt.dat -o ./out/ -d GeoJSON
Download the recommended airport data files from the X-Plane Scenery Gateway and convert them:
python -m xplane_apt_convert -a LEBL,LEGE,LERS,LELL -g -o ./out/ -d GeoJSON
Other output file formats are available using the -d option, for example GeoJSON, ESRI Shapefile, or GPKG.
For information about all available options run the command using --help.
Python Basic Usage
Convert an airport in a local apt.dat file to GeoJSON:
from xplane_airports.AptDat import AptDat
from xplane_apt_convert import ParsedAirport
input_file = "./apt.dat"
airport_id = "LEBL"
with open(input_file, "r") as f:
apt_dat = AptDat.from_file_text(f.read(), input_file)
apt = apt_dat.search_by_id(airport_id)
p_apt = ParsedAirport(apt)
p_apt.export("./airport.geojson")
Download an airport from the X-Plane Scenery Gateway and convert it to ESRI Shapefile:
from xplane_airports.gateway import scenery_pack
from xplane_apt_convert import ParsedAirport
airport_id = "LEBL"
recommended_pack = scenery_pack(airport_id)
apt = recommended_pack.apt
p_apt = ParsedAirport(apt)
p_apt.export("./airport.shp", driver="ESRI Shapefile")
See the function's docstring for more information on all the allowed arguments.
License
This software is licensed under the terms of the MIT License.
Metadata
Release files for xplane-apt-convert 0.5.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xplane_apt_convert-0.5.7.tar.gz | 15.8 kB | Without provenance | Details for xplane_apt_convert-0.5.7.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| xplane_apt_convert-0.5.7-py3-none-any.whl | Python 3 | none | any | Details for xplane_apt_convert-0.5.7-py3-none-any.whl |
Total release size: 31.5 kB
Release files / xplane_apt_convert-0.5.7.tar.gz
| Download URL | xplane_apt_convert-0.5.7.tar.gz |
|---|---|
| Size | 15.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5ac1de961e9f54525eef040cf5320758d8ef631758491acd41c84be80a5d75f9
|
|
BLAKE2b-256 checksum How to use checksums |
c9a761811c6c0d35f261257e6007993248e94eeb9f77cc8d87a89cceb7d81e33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / xplane_apt_convert-0.5.7-py3-none-any.whl
| Download URL | xplane_apt_convert-0.5.7-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0476e8c7010d301fb33567e1b499509d193999b205d24b9b044b730d334fa75
|
|
BLAKE2b-256 checksum How to use checksums |
5ff2867054e954f23cab2ad8240c1c348f74a8de118134d526ef83f7edd07fdd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Security for xplane-apt-convert 0.5.7
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.