Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update resample.m
  • Loading branch information
qsly09 committed Jul 26, 2018
1 parent feeed5b commit f7d2b6e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions @GRIDobj/resample.m
@@ -1,4 +1,4 @@
function DEMr = resample(DEM,target,method,swapzone)
function DEMr = resample(DEM,target,method,swapzone,varargin)

%RESAMPLE change spatial resolution of a GRIDobj
%
Expand Down Expand Up @@ -46,7 +46,7 @@
% Date: 8. August, 2015

% check input arguments
narginchk(2,4)
% narginchk(2,6)
validateattributes(target,{'double' 'GRIDobj'},{'scalar'})
if nargin == 2;
method = 'bilinear';
Expand Down Expand Up @@ -80,14 +80,22 @@
T = maketform('affine',[1 0 0; 0 1 0; 0 0 1]);

% Fillvalues

if isinteger(DEM.Z)
fillval = 0;
elseif islogical(DEM.Z)
fillval = 0;
else
fillval = nan;
end


p = inputParser;
p.FunctionName = 'Paras';
% optional
% default values.
addParameter(p,'fillval',fillval);
parse(p,varargin{:});
fillval = p.Results.fillval;

if isa(target,'GRIDobj')
% the target is another GRIDobj
Expand Down Expand Up @@ -162,9 +170,3 @@

end
end






0 comments on commit f7d2b6e

Please sign in to comment.