function ret=rect_in_cv_hull(rect,ref)
    if class(ref.LaA)=="string"
        LaA=str2num(ref.LaA);
        LoA=str2num(ref.LoA);
        LaB=str2num(ref.LaB);
        LoB=str2num(ref.LoB);
    else
        LaA=ref.LaA;
        LoA=ref.LoA;
        LaB=ref.LaB;
        LoB=ref.LoB;
    end        
    p=[[LaA,LaB(end:-1:1)]',[LoA,LoB(end:-1:1)]'];
    try
        cv=convhull(p(:,1),p(:,2));
        ret=inpolygon(mean(rect.LatitudeData),mean(rect.LongitudeData),p(cv,1),p(cv,2));
    catch
        a=1;
    end
end