function [ref,hc2]=get_primary(res)
    hc2=[];
    ref=[];
    for idx=1:size(res,1)
        LaA=str2num(res.LaA(idx));
        LoA=str2num(res.LoA(idx));
        LaB=str2num(res.LaB(idx));
        LoB=str2num(res.LoB(idx));
        lat=str2num(res.lat(idx));
        lon=str2num(res.lon(idx));
        yaw=str2num(res.yaw(idx));
        perc=str2num(res.perc(idx));
        altitude=str2num(res.altitude(idx));
        range=res.range(idx);
        hull=str2num(res.hull(idx));
        rota=str2num(res.rota(idx));
        cv=str2num(res.hull(idx));
        La=[LaA,LaB(end:-1:1)];
        Lo=[LoA,LoB(end:-1:1)];
        Lidx=1:2*length(LaA);
        figure(1);
        hold on;
        %hc2_=geoplot([La,La(1)]',[Lo,Lo(1)]','x-');
        points=[La',Lo'];       
        points=points(cv,:);
        cv=convhull(points(:,1),points(:,2));
        hc2_=geoplot(points(cv,1),points(cv,2),'k-');
        hc2_.Visible="off";
        hc2=[hc2,hc2_];
        ref=[ref,...
            struct("lat",lat,...
                   "lon",lon,...
                   "yaw",yaw,...
                   "LaA",LaA,...
                   "LoA",LoA,...
                   "LaB",LaB,...
                   "LoB",LoB,...
                   "altitude",altitude,...
                   "range",range,...
                   "latc",res.latc(idx),...
                   "lonc",res.lonc(idx),...
                   "yawc",res.yawc(idx),...
                   "path",res.path(idx),...
                   "id",res.id(idx),...
                   "rota",rota,...
                   "perc",perc,...
                   "cv",cv)];
    end
    hold off;
end