VMT_OverlayDOQQ

PURPOSE ^

Prompts the user for a geotiff DOQQ (USGS) and overlays the aerial image

SYNOPSIS ^

function [guiprefs,log_text] = VMT_OverlayDOQQ(guiprefs,varargin)

DESCRIPTION ^

 Prompts the user for a geotiff DOQQ (USGS) and overlays the aerial image
 in the plan view vector plot.  User can select multiple files. 

 Currently only supports a geotiff in UTM corrdinates (USGS DOQQ for
 example) as the image is not projected and is plotted as XY data.  

 Added save path functionality (PRJ, 6-23-10)

 P.R. Jackson, USGS 6-14-10
 Last modified: F.L. Engel, USGS, 7/25/2013

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function [guiprefs,log_text] = VMT_OverlayDOQQ(guiprefs,varargin)
0002 % Prompts the user for a geotiff DOQQ (USGS) and overlays the aerial image
0003 % in the plan view vector plot.  User can select multiple files.
0004 %
0005 % Currently only supports a geotiff in UTM corrdinates (USGS DOQQ for
0006 % example) as the image is not projected and is plotted as XY data.
0007 %
0008 % Added save path functionality (PRJ, 6-23-10)
0009 %
0010 % P.R. Jackson, USGS 6-14-10
0011 % Last modified: F.L. Engel, USGS, 7/25/2013
0012 
0013 
0014 if ~isempty(varargin)
0015     skip_ui = varargin{1};
0016 else
0017     skip_ui = false;
0018 end
0019 
0020 % See if PLOT 1 exists already, if not, make the figure
0021 fig_planview_handle = findobj(0,'name','Plan View Map');
0022 if ~isempty(fig_planview_handle) &&  ishandle(fig_planview_handle)
0023     figure(fig_planview_handle);
0024 else
0025     fig_planview_handle = figure('name','Plan View Map'); clf
0026     %set(gca,'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1])
0027 end
0028 
0029 if ~skip_ui
0030     if exist('guiprefs','var') && isfield(guiprefs,'aerial_path')
0031         if iscell(guiprefs.aerial_file)
0032             [guiprefs.aerial_file,guiprefs.aerial_path] = uigetfile(...
0033                 {'*.tif;*.shp;*.asc;*.grd;*.ddf','All Background Files'; '*.*','All Files'},...
0034                 'Select Background File(s)',...
0035                 'Multiselect', 'on',...
0036                 fullfile(guiprefs.aerial_path,guiprefs.aerial_file{1}));
0037         else
0038             [guiprefs.aerial_file,guiprefs.aerial_path] = uigetfile(...
0039                 {'*.tif;*.shp;*.asc;*.grd;*.ddf','All Background Files'; '*.*','All Files'},...
0040                 'Select Background File(s)',...
0041                 'Multiselect', 'on',...
0042                 fullfile(guiprefs.aerial_path,guiprefs.aerial_file));
0043         end
0044     else
0045         [guiprefs.aerial_file,guiprefs.aerial_path] = uigetfile(...
0046             {'*.tif;*.shp;*.asc;*.grd;*.ddf','All Background Files'; '*.*','All Files'},...
0047             'Select Background File(s)',...
0048             'Multiselect', 'on',...
0049             pwd);
0050     end
0051 end
0052 
0053 if ischar(guiprefs.aerial_file) % User did not hit cancel, 1 file selected
0054     
0055     hdlmap = mapshow(fullfile(guiprefs.aerial_path,guiprefs.aerial_file)); hold on
0056     uistack(hdlmap,'bottom')
0057     log_text = vertcat({'Adding background image:'},guiprefs.aerial_file);
0058     set(gca,'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1])
0059     axis image on
0060 elseif iscell(guiprefs.aerial_file) % User did not hit cancel, multiple files selected
0061     
0062     for i = 1:length(guiprefs.aerial_file);
0063         hdlmap = mapshow(fullfile(guiprefs.aerial_path,guiprefs.aerial_file{i})); hold on
0064         uistack(hdlmap,'bottom')
0065         log_text = vertcat({'Adding background image:'},guiprefs.aerial_file{i});
0066     end
0067     set(gca,'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1])
0068     axis image on
0069 end
0070 
0071 
0072 % Format the ticks for UTM and allow zooming and panning
0073 ticks_format('%6.0f','%8.0f'); %formats the ticks for UTM
0074 hdlzm = zoom;
0075 set(hdlzm,'ActionPostCallback',@mypostcallback_zoom);
0076 set(hdlzm,'Enable','on');
0077 hdlpn = pan;
0078 set(hdlpn,'ActionPostCallback',@mypostcallback_pan);
0079 set(hdlpn,'Enable','on');
0080 
0081 
0082 %% Embedded functions
0083 function mypostcallback_zoom(obj,evd)
0084 ticks_format('%6.0f','%8.0f'); %formats the ticks for UTM (when zooming)
0085 
0086 function mypostcallback_pan(obj,evd)
0087 ticks_format('%6.0f','%8.0f'); %formats the ticks for UTM (when panning)
0088 
0089     
0090     
0091     
0092

Generated on Thu 21-Aug-2014 10:40:31 by m2html © 2005