function label = checkCoords(lat, lon)
    % Load coastlines data
    load coastlines

    if ~isnan(lat)
	

      % Create a world map
      figure;
      worldmap([min(lat)-1 max(lat)+1], ...
               [min(lon)-1 max(lon)+1]);

      % Plot coastlines
      plotm(coastlat, coastlon, 'k');

      % Check if point is over land or water
      isOverLand = inpolygon(lon, lat, coastlon, coastlat);

      % Assign label (0 for over land, 1 for over water)
      label = double(~isOverLand);

      % Close the figure
      close(gcf);
    else
      label = 1;      
    end 


end









