A simple Python-based FAA DAT to GeoJSON Converter for use with vNAS.
If you would like to test your conversions prior to loading them into vNAS Data Admin, GeoJSON.io is a great tool.
The DAT files that I was provided assume that coordinates are N Lat and W Lon, so the W coordinates are positive. This will not work for facilities at/near the antimeridian until I can see how that case is handled in DAT files from that area.
Python3.8 or Later (Tested with Python 3.9.13)
Only imports are Argparse, CSV, Math, and OS, so it should run on a standard Python implementation.
To process files for a single facility:
- Place the DAT files in the
dat_source
directory. - Run the following command:
python3 convert.py [--radius X (default 140)]
To process multiple facilities at once:
- Create folders for each facility in the
dat_source
directory. - Place the DAT files for each facility in their respective facility folders.
Note: The script will use the file names as the export name (e.g./dat_source/IAD/Base.dat
will be saved as/output/IAD_Base.geojson
) - Run the following command:
python3 convert.py [--radius X (default 140)]
The optional --radius X
argument is provided because the DAT files include everything that is also shown in the PDF accompanying the DAT file, to include the border and text at the bottom left and right. This border is generally around 150NM from the center point (point of tangency) declared in the file, and there is a radial line showing MAG versus TRUE that extends inside of the border, necessitating a radius smaller than the border itself. The radius may be smaller for smaller TRACONS or Towers, so the default of 140 can be overridden by passing --radius X
, where XX
is an integer representing the NM from the center of the map.
Example: python3 convert.py --radius 50
If you have a set of files where you wish to provide per-file overrides, the --filelist
argument is available to facilitate that. Please follow these instructions carefully:
- Run the script with the
--filelist
flag:python3 convert.py --filelist
- Find the FileList.csv file in the
output
folder. - Open the FileList.csv in a spreadsheet program (Excel, Numbers, etc.), or better, a text editor if you are familiar enough with raw CSV.
Note: Do not alter the headers, or the data in the first column (Source). - Provide override data:
- Optional: Range must be an integer or blank.
- Optional: OutputFileName must be a string or blank.
- Optional: CenterPointLat and CenterPointLon must both be present as decimal Lat/Lons, and the Lon must be positive.
Note: The FAA format assumes west lons are positive in the DAT files.
- Save the override data in the FileList.csv.
- Run the script with the
--readfile
flag:python3 convert.py --readfile
Note: The script will try to make sense of the values as best that it can. If the program editing the CSV adds odd formatting, it could cause odd results. If files are missing from the export, or ranges are not being set to the override values, it is likely because it did not understand the data in the field (data unable to be parsed into an int or float gets silently ignored at the moment).
Want to contribute? Check out the Open Issues, fork, and open a Pull Request.
Additional contributors will be listed here.
This is licensed under GPL 3.0.