# VMT_BlankShoreline

## PURPOSE

This function is not implemented currently.

## SYNOPSIS

function VMT_BlankShoreline(X,Y,Map)

## DESCRIPTION

     This function is not implemented currently.

     Effectivly clips a contour plot to a shoreline boundary by overlaying a
     patch to block out land.  Requires the mapping toolbox.  X is the UTM
     easting vector of the data extent, Y is the northing vector, and Map is
     the MAP data structure for the shoreline file.

## CROSS-REFERENCE INFORMATION

This function calls:

This function is called by:

## SOURCE CODE

    0001 function VMT_BlankShoreline(X,Y,Map)
    0002 % This function is not implemented currently.
    0003 %
    0004 % Effectivly clips a contour plot to a shoreline boundary by overlaying a
    0005 % patch to block out land.  Requires the mapping toolbox.  X is the UTM
    0006 % easting vector of the data extent, Y is the northing vector, and Map is
    0007 % the MAP data structure for the shoreline file.
    0008
    0009 %P.R. Jackson, 4-13-09
    0010
    0011 %Define the map polygon
    0012
    0013 x2 = [min(X) min(X) max(X) max(X) min(X)];
    0014 y2 = [min(Y) max(Y) max(Y) min(Y) min(Y)];
    0015
    0016
    0017 %Define the shoreline polygons
    0018
    0019 brks = find(Map.UTMe == -9999);  %Assumes shoreline is doen first followed by -9999 breaks to signal islands (interior polygons)
    0020
    0021 for i = 1:length(brks)+1
    0022     if i == 1
    0023         ll = 1;
    0024         if ~isempty(brks)
    0025             ul = brks(i)-1;
    0026         else
    0027             ul = length(Map.UTMe);
    0028         end
    0029         indx =ll:ul;
    0030     elseif i == length(brks)+1
    0031         ll = brks(i-1)+1;
    0032         ul = length(Map.UTMe);
    0033         indx =ll:ul;
    0034     elseif i > 1 & i < length(brks)+1
    0035         ll = brks(i-1)+1;
    0036         ul = brks(i)-1;
    0037         indx =ll:ul;
    0038     end
    0039
    0040     x1 = Map.UTMe(indx);
    0041     y1 = Map.UTMn(indx);
    0042
    0043     %Ensure both are CW polygons (external contours)
    0044
    0045     if ~ispolycw(x1,y1)
    0046         [x1,y1] = poly2cw(x1,y1);
    0047     end
    0048
    0049     if ~ispolycw(x2, y2)
    0050         [x2,y2] = poly2cw(x2, y2);
    0051     end
    0052
    0053
    0054     if i == 1;
    0055         %Find the exclusion overlap
    0056         [x3, y3] = polybool('xor', x1, y1, x2, y2);
    0057     else
    0058         %Find the intersection for islands
    0059         [x3, y3] = polybool('intersection', x1, y1, x2, y2);
    0060     end
    0061
    0062     figure(gcf); hold on
    0063
    0064     [f, v] = poly2fv(x3, y3);
    0065     patch('Faces', f,'Vertices', v, 'FaceColor', [0.8,0.733,0.533],'EdgeColor', 'none'); hold on
    0066
    0067     %plot(x1, y1,'Color',[0.706 0.706 0.573],'LineWidth',1); hold on
    0068     %plot(x2, y2,'m-'); hold on
    0069
    0070     xlim([min(x2) max(x2)])
    0071     ylim([min(y2) max(y2)])
    0072
    0073 end
    0074
    0075
    0076 xlabel('UTM Easting (m)')
    0077 ylabel('UTM Northing (m)')
    0078 set(gca,'DataAspectRatio',[1 1 1],'PlotBoxAspectRatio',[1 1 1])