{"id":202,"date":"2013-08-22T12:57:52","date_gmt":"2013-08-22T00:57:52","guid":{"rendered":"http:\/\/www.herbert.org.nz\/?p=202"},"modified":"2014-01-14T08:22:05","modified_gmt":"2014-01-13T20:22:05","slug":"syncing-the-nz-aip-into-air-nav-pro","status":"publish","type":"post","link":"https:\/\/www.herbert.org.nz\/?p=202","title":{"rendered":"Syncing the NZ AIP into Air Nav Pro"},"content":{"rendered":"<p>So I wanted to be lazy and not worry about manually updating the aerodrome charts in <a href=\"http:\/\/www.dixdouze.com\/xample\/index.php\/airnavigation\" title=\"Air Nav Pro\" target=\"_blank\">Air Nav Pro<\/a>.<br \/>\nSince there doesn&#8217;t seem to be an API in the NZAIP (www.aip.net.nz) I hacked together a python script to scrape the data and download all the plates. I&#8217;ve excluded downloading any IFR plates (using a crude word filter) since I&#8217;m only interested in VFR. If you want the IFR plates as well, just make the IFR_Keywords list an empty list in getaip.py:<br \/>\n<code>IFR_Keywords = []<\/code><\/p>\n<p>I&#8217;m running OS X 10.8 so if you want to run these scripts on windows you&#8217;ll need to install python at the very least and also rsync.<\/p>\n<p>First I create a list of aerodrome objects and attach a list of assets to each aerodrome object. Each asset is essentially a linked pdf from the AIP web site. Then I create my required directory structure &#8211; directory name is the aerodrome ICAO code (for Air Nav Pro) and change the pdf file name to match the required naming convention (must start with ICAO code of aerodrome).<br \/>\nI essentially download all plates every time, since I don&#8217;t know which ones have changed. <\/p>\n<p>The two python files need to be in the same directory. You can download all the plates just by running `python getaip.py`<br \/>\nThis will create a directory named &#8216;aip&#8217; in the same directory as the getaip.py script.<\/p>\n<p>You need to mount the web dav server from Air Nav Pro.<\/p>\n<p>Once this is done, then I just use rsync (with the &#8211;checksum and &#8211;delete) flags to update the plates &#8211; the script outputs a sample rsync command. Simple!! <\/p>\n<p><a href=\"http:\/\/www.herbert.org.nz\/wp-content\/uploads\/2013\/08\/Archive1.zip\">Download the Python Files<\/a> (Updated to support the Disclaimer page)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>So I wanted to be lazy and not worry about manually updating the aerodrome charts in Air Nav Pro. Since there doesn&#8217;t seem to be an API in the NZAIP (www.aip.net.nz) I hacked together a python script to scrape the &hellip; <a href=\"https:\/\/www.herbert.org.nz\/?p=202\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-202","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.herbert.org.nz\/index.php?rest_route=\/wp\/v2\/posts\/202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.herbert.org.nz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.herbert.org.nz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.herbert.org.nz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.herbert.org.nz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=202"}],"version-history":[{"count":8,"href":"https:\/\/www.herbert.org.nz\/index.php?rest_route=\/wp\/v2\/posts\/202\/revisions"}],"predecessor-version":[{"id":213,"href":"https:\/\/www.herbert.org.nz\/index.php?rest_route=\/wp\/v2\/posts\/202\/revisions\/213"}],"wp:attachment":[{"href":"https:\/\/www.herbert.org.nz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.herbert.org.nz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.herbert.org.nz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}