Convert X-Plane airport data to GIS-friendly formats like GeoJSON or ESRI Shapefile.
Project description
X-Plane apt.dat convert
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.dat
file. - 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
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
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("./aiport.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_airport_convert import ParsedAirport
recommended_pack = scenery_pack(airport_id)
apt = recommended_pack.apt
p_apt = ParsedAirport(apt)
p_apt.export("./aiport.shp", driver="GeoJSON")
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for xplane_apt_convert-0.5.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f96c33458eb26bcf1c179d644e77797aaebac9b25a854f159c4ca814b35a01ea |
|
MD5 | 6bac5dbd32fa5d72f32919c0a8fddd02 |
|
BLAKE2b-256 | b13e02da43f236cd858dab7276c644c2ae9a54fb282c157aba883f026b981d3c |