Skip to content

Commit

Permalink
Merge pull request #30 from bwdrop/master
Browse files Browse the repository at this point in the history
convert from DMSRational to Decimal Degree Lat Long
  • Loading branch information
hMatoba authored Sep 5, 2017
2 parents 538e6e8 + 6acaff1 commit c7b89de
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions piexif.js
Original file line number Diff line number Diff line change
Expand Up @@ -2455,6 +2455,15 @@ SOFTWARE.
var sec = Math.round(secFloat * 100);

return [[deg, 1], [min, 1], [sec, 100]];
},

dmsRationalToDeg:function (dmsArray, ref) {
var sign = (ref === 'S' || ref === 'W') ? -1.0 : 1.0;
var deg = sign * dmsArray[0][0] / dmsArray[0][1] +
dmsArray[1][0] / dmsArray[1][1] / 60.0 +
dmsArray[2][0] / dmsArray[2][1] / 3600.0;

return deg;
}
};

Expand Down

0 comments on commit c7b89de

Please sign in to comment.