Saturday 9 February 2019

Populate aviation_postgis_db with data from NASR files (1)

28 Day NASR Subscription data is a very good  source to start a series of post related to populating aviation_postgis_db database.  
In the post Parsing FAA NASR data: NATFIX file  I show the way of extracting data from NATFIX file into database. Our sample aviation database has limited scope, so we are not going to  retrieve all kind of information that can be found in NASR files, but only part of them. If you get familiar with files descriptions (refer to https://www.faa.gov/air_traffic/flight_info/aeronav/aero_data/NASR_Subscription_2019-02-28/, section 'The layout data for the Legacy (TXT) formats...) you will notice that basically data is arranged into fixed-length records for each airport, navigation aid and etc. The numbers of records can be variable, in case of Airport and Other Landing Facilities (APT file), in order to contain information about all runways related to given airport or aditional information. A 'record' is a line of text file, which  has 'fields' described by length, start location and justyfi - left or right. If there are various of record types in given file, each record starts with record type identifier. So, if we know at what  position the attribute we are interested in is, we are able to get it and assign to appropriate airport, navigation aid and so on.


After this introduction, which perhaps should take place in the first post related to NASR data, we are able to start writing Python script that will extract information from files and insert it into spatial database. But before I will show code snippets, following general assumptions have to be made:

No comments:

Post a Comment