utm.js 473 B

123456789101112131415161718
  1. var D2R = 0.01745329251994329577;
  2. var tmerc = require('./tmerc');
  3. exports.dependsOn = 'tmerc';
  4. exports.init = function() {
  5. if (!this.zone) {
  6. return;
  7. }
  8. this.lat0 = 0;
  9. this.long0 = ((6 * Math.abs(this.zone)) - 183) * D2R;
  10. this.x0 = 500000;
  11. this.y0 = this.utmSouth ? 10000000 : 0;
  12. this.k0 = 0.9996;
  13. tmerc.init.apply(this);
  14. this.forward = tmerc.forward;
  15. this.inverse = tmerc.inverse;
  16. };
  17. exports.names = ["Universal Transverse Mercator System", "utm"];