New Zealand Airspace

New Zealand airspace charts are available from the AIP Shop. These are designed for GA and often don't match the requirements for gliding.

There are digital charts available also. Either from the AIP shop, although these seem to come and go, or from various commercial organizations with moving map displays etc. These are also designed for GA and may not suit glider use.

The official definitions for airspace are published by NZ CAA in the Air Navigation Register at AIP New Zealand. These definitions are provided in PDF documents and the format is not clearly defined.

Gliding

Most glide computers used in gliders accept airspace data in the format developed by Tim Newport-Peace. This format is often called AIR and is described below.

Tim Newport-Peace AIR format


Workflow

Download latest PDF from AIP New Zealand.

Extract data from PDF and convert to JSON using Tabula. Tabula consistently drops the last line of tables so the scan box on each page must be adjusted to include the last line. Extract using the Lattice method and export as JSON(data).

Process with Perl progam. This takes the JSON data from Tabula and generates a seperate AIR file for each piece of airspace.

Some tidy up may be required. A few definitions have multiple headers so use 'grep INCLUDE *.air | uniq -d' to find those and manually remove the duplicates.

JSON to AIR conversion


These AIR files can now be combined into one file for use with a glide computer.

The AIR format was supported by GDAL, so it can be converted to any other supported format, e.g. GeoJSON, or used with QGIS for custom maps etc. This was dropped from the mainstream after GDAL version to 3.3.

To get the driver for AIR (GDAL calls it SUA) format, get the old drivers from github and build them from source. On Debian I needed to install the libgdal-dev package in addition to gdal-bin for this to work.

On GDAL 3.7.2 this fails. I needed to avoid all the extra drivers except the SUA driver. This required unpacking the drivers, going into the src directory and editing CMakeLists.txt, extradriver.h, and entrypoint.cpp to remove all reference to the unwanted drivers, leaving just the SUA driver.

CMakeLists.txt


extradrivers.h


entrypoint.cpp


After making these changes, I followed the normal instructions to build and install the extra driver.

Once that's done you can use ogr2ogr to convert the airspace file to geojson.

convert.sh


To clean up the geojson, add an effective date field and clean up the 'crs' definition which is no longer used by geojson.