function airways = UR_gen_airways(roads,launch_sites,land_sites)
% UR_gen_airways - given road network and launch/land sites, build airways
% On input:
%     roads (struct): describes road structure
%       .vertexes (nx2 array): 2D vertexes of road network
%       .edges (kx2 array): edges of road network (vertex pairs)
%     launch_sites (kx1 vector): launch site indexes (into raod vertexes)
%     land_sites (px1 vector): land site indexes (into raod vertexes)
% On output:
%     airways (airways data structure): describes airways
%       .corridors (qx9 array): corridor parameters
%          [x1 y1 z1 x2 y2 z2 zone cor_ver1 cor_ver2 rd_ver1 rd_ver2]
%       .cor_vertexes (mx3 array): corridor vertexes
%       .cor_edges (fx2 array): corridor edegs
%       .launch_indexes (hx1 vector): launch indexes (into road vertexes)
%       .land_indexes (rx1 vector): land indexes (into road vertexes)
%       .vertexes (ux2 array): road vertexes
%       .edges (wx2 array): road edges
% Call:
%     aw = UR_gen_airways(roads,sites1,sites2);
% Author:
%     T. Henderson
%     UU
%     Summer 2019
%

global g_z_upper g_z_lower g_z_circle g_z_launch g_z_land 

airways = roads;
num_vertexes = length(airways.vertexes(:,1));

airways.launch_vertexes = launch_sites;
airways.land_vertexes = land_sites;

airways = UR_gen_corridors(airways);
%airways = UR_gen_slots(airways);
vertexes = airways.vertexes;
vertexes(:,3) = g_z_circle;
airways.vertexes = vertexes;
