Ignore:
Timestamp:
02/04/11 14:43:13 (14 years ago)
Author:
jschierm
Message:

kml: Converted all utilities to use lat/long fields in model rather than x/y, converting if necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk/src/m/kml/kml_unsh_edges.m

    r7132 r7342  
    1111%
    1212%  and the optional input is:
     13%    latsgn        (numeric, +1/-1 for north/south latitude)
    1314%    alt           (numeric, altitude for polygons, default 10000)
    1415%    prtplt        (char, 'off'/'no' for partition edge plot)
     
    4041    if ischar(varargin{iarg})
    4142        if ~isempty(strmatch(varargin{iarg},...
    42                 {'alt','prtplt'},...
     43                {'latsgn','alt','prtplt'},...
    4344                'exact'))
    4445            eval([varargin{iarg} '=varargin{iarg+1};']);
     
    5152    end
    5253    iarg=iarg+2;
     54end
     55
     56if isempty(md.lat)  || ((numel(md.lat) == 1)  && isnan(md.lat)) || ...
     57   isempty(md.long) || ((numel(md.long) == 1) && isnan(md.long))
     58    if     ~exist('latsgn')
     59        error(['Missing ''latsgn'' parameter to calculate missing lat/long data.']);
     60    elseif (abs(latsgn) ~= 1)
     61        error(['Incorrect latsgn=' num2str(latsgn) ' parameter to calculate missing lat/long data.']);
     62    else
     63        display('Converting x/y data to lat/long data.');
     64        [md.lat,md.long]=xy2ll(md.x,md.y,latsgn);
     65    end
    5366end
    5467
     
    91104
    92105        for j=1:2
    93             [lat,long]=xy2ll(md.x(edgeuns(i,j)),md.y(edgeuns(i,j)),-1);
    94             kline.coords(j,:)=[long lat alt];
     106            kline.coords(j,:)=[md.long(edgeuns(i,j)) md.lat(edgeuns(i,j)) alt];
    95107        end
    96108
Note: See TracChangeset for help on using the changeset viewer.