Rank: 211830 based on 0 downloads (last 30 days) and 0 file submitted
photo

Jesse Angle

E-mail

Personal Profile:

 

Watch this Author's files

 

Comments and Ratings by Jesse Angle
Updated File Comments Rating
25 May 2012 geotiffwrite Write a 2D or 3D array to a single or multi-band GeoTIFF file Author: Jimmy Shen

In order to make this code fully support the ModelTransformationTag the following changes are necessary:

line 873: comment out
error('ModelPixelScale is required...');

as this isn't necessarily a true statement and will cause problems when trying to use only the ModelTransformationTag.

line 1213 - 1214:
fwrite(fid, gifd.ModelPixelScaleTag,'double'); and
fwrite(fid, gifd.ModelTiePointTag, 'double');

should be surrounded by
if isfield(gifd,'Model...Tag')

end

statements for when these tags are not being used as is the case with ModelTransformationTag.

Finally, add in the code that actually writes the ModelTransformationTag portion (previously missing). Mine looks like this:

if isfield(gifd,'ModelPixelScaleTag')
fwrite(fid,gifd.ModelPixelScaleTag,'double');
end
if isfield(gifd,'ModelTiePointTag')
fwrite(fid,gifd.ModelTiePointTag,'double');
end
if isfield(gifd,'ModelTransformationTag')
fwrite(fid,gifd.ModelTransformationTag,'double')
end

That being said, great work Jimmy getting this put together and thank you for your efforts.

Contact us