Monday 7 January 2019

aviation_postgis_db1: tables

NOTE: The aviation_postgis_db1 is spatial database for training and educational purposes only: that means that is rather used to learn and practice how to use Python, GIS software and PostGIS to parse, create, maintain and visualize aviation data that to perform real work, at least at this stage of develpment cycle.
The aviation_postgis_db1 is spatial database to keep aviation data that can be obtained from various online sources such as: eAIP portals, FAA website with data (DOF, NASR). Content of databse is in limited scope: that means that some selected attributes are used to model aviation world. Selection is based on what information can be found in aeronautical publications (eAIP, FAA Digitial Obstacle File ) and etc.

Country table:

CREATE TABLE country (
 rec_id serial,
 ctry_icao_code char(2) PRIMARY KEY,
 ctry_name varchar(100) NOT NULL
);


Airport table:

CREATE TABLE airport (
 rec_id serial PRIMARY KEY,
 ctry_icao_code char(2) NOT NULL REFERENCES country,
 apt_icao_code char(4) NOT NULL UNIQUE,
 apt_name varchar(100) NOT NULL,
 apt_city varchar(100), 
 arp_lat_src varchar(20),
 arp_lon_src varchar(20),
 arp_elev float,
 arp_elev_uom varchar(10),
 mag_var_value float,
 mag_var_year date,
 mag_var_annual_change_dd float,
 arp_location geography(POINT, 4326)
);

You might ask: Whay some of the columns don't have constraints 'NOT NULL' such as arp_elev?

Waypoint table:


CREATE TABLE waypoint (
 rec_id serial PRIMARY KEY,
 ctry_icao_code char(2) NOT NULL REFERENCES country,
 wpt_ident varchar(5),
 wpt_type varchar(30),
 lat_src varchar(20),
 lon_src varchar(20),
 wpt_location geography(POINT, 4326)
);

No comments:

Post a Comment