function flag = isOverWater(latitude, longitude)
    % Load GSHHS data
    f = gshhs('gshhs_f.b');
    
    % Initialize flag as 0 (assumes location is over water)
    flag = 0;

    % Get lon and lat data
    lon = [f(:).Lon];
    lat = [f(:).Lat];

    % Check if the location is over land
    if any(inpolygon(longitude, latitude, lon, lat))
        flag = 1;
    end
end




















