Skip to content

Commit

Permalink
Added delete shoreline functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
mitchharley committed Feb 1, 2021
1 parent 9d57ee4 commit bb3cf69
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions GUI/CSPGdeleteShoreline.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function CSPGdeleteShoreline(handles)

CSPloadPaths
data = get(handles.oblq_image,'UserData');
data_plan = get(handles.plan_image,'UserData');
fileparts = CSPparseFilename(data.fname);
site = fileparts.site;

%First check that a shoreline exists
if isempty(data_plan.sl)||~isfield(data_plan,'sl')
warning('No shoreline exists to save!')
else
button = questdlg('Are you sure you want to delete this shoreline from the database?','Delete Shoreline?','Yes','No','No');
switch button
case 'Yes'
savedir = [shoreline_path filesep fileparts.site filesep fileparts.year filesep];
savefname = strrep(data.fname,'snap','shoreline');
savefname = strrep(savefname,'timex','shoreline');
savefname = strrep(savefname,'.jpg','.mat');
delete(fullfile(savedir,savefname))
disp('Shoreline deleted from DB!')
end
end

0 comments on commit bb3cf69

Please sign in to comment.