proj4 2.19.10 → 2.20.1-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/Gruntfile.js +2 -1
  2. package/README.md +2 -0
  3. package/bower.json +1 -1
  4. package/changelog.md +2 -0
  5. package/component.json +1 -1
  6. package/dist/lib/common/adjust_lon.d.ts +1 -1
  7. package/dist/lib/defs.d.ts +2 -0
  8. package/dist/lib/projections/eqearth.d.ts +2 -0
  9. package/dist/lib/projections/moll.d.ts +7 -1
  10. package/dist/lib/projections/ob_tran.d.ts +78 -0
  11. package/dist/proj4-src.js +708 -338
  12. package/dist/proj4.js +1 -1
  13. package/lib/common/adjust_lon.js +4 -1
  14. package/lib/defs.js +8 -0
  15. package/lib/global.js +2 -0
  16. package/lib/includedProjections.js +3 -1
  17. package/lib/projString.js +4 -0
  18. package/lib/projections/aea.js +2 -2
  19. package/lib/projections/aeqd.js +6 -6
  20. package/lib/projections/bonne.js +4 -4
  21. package/lib/projections/cass.js +2 -2
  22. package/lib/projections/cea.js +3 -3
  23. package/lib/projections/eqc.js +2 -2
  24. package/lib/projections/eqdc.js +3 -3
  25. package/lib/projections/eqearth.js +4 -2
  26. package/lib/projections/equi.js +2 -2
  27. package/lib/projections/etmerc.js +2 -2
  28. package/lib/projections/gnom.js +2 -2
  29. package/lib/projections/krovak.js +1 -1
  30. package/lib/projections/laea.js +2 -2
  31. package/lib/projections/lcc.js +2 -2
  32. package/lib/projections/merc.js +3 -3
  33. package/lib/projections/mill.js +2 -2
  34. package/lib/projections/moll.js +10 -3
  35. package/lib/projections/ob_tran.js +347 -0
  36. package/lib/projections/omerc.js +2 -2
  37. package/lib/projections/ortho.js +4 -4
  38. package/lib/projections/poly.js +5 -5
  39. package/lib/projections/robin.js +2 -2
  40. package/lib/projections/sinu.js +3 -3
  41. package/lib/projections/stere.js +6 -6
  42. package/lib/projections/sterea.js +2 -2
  43. package/lib/projections/tmerc.js +3 -3
  44. package/lib/projections/vandg.js +2 -2
  45. package/package.json +1 -1
  46. package/projs.js +2 -0
package/dist/proj4-src.js CHANGED
@@ -13,6 +13,8 @@
13
13
  defs('EPSG:' + (32600 + i), '+proj=utm +zone=' + i + ' +datum=WGS84 +units=m');
14
14
  defs('EPSG:' + (32700 + i), '+proj=utm +zone=' + i + ' +south +datum=WGS84 +units=m');
15
15
  }
16
+ defs('EPSG:5041', '+title=WGS 84 / UPS North (E,N) +proj=stere +lat_0=90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m');
17
+ defs('EPSG:5042', '+title=WGS 84 / UPS South (E,N) +proj=stere +lat_0=-90 +lon_0=0 +k=0.994 +x_0=2000000 +y_0=2000000 +datum=WGS84 +units=m');
16
18
 
17
19
  defs.WGS84 = defs['EPSG:4326'];
18
20
  defs['EPSG:3785'] = defs['EPSG:3857']; // maintain backward compat, official code is 3857
@@ -230,6 +232,9 @@
230
232
  },
231
233
  approx: function () {
232
234
  self.approx = true;
235
+ },
236
+ over: function () {
237
+ self.over = true;
233
238
  }
234
239
  };
235
240
  for (paramName in paramObj) {
@@ -248,6 +253,7 @@
248
253
  if (typeof self.datumCode === 'string' && self.datumCode !== 'WGS84') {
249
254
  self.datumCode = self.datumCode.toLowerCase();
250
255
  }
256
+ self['projStr'] = defData;
251
257
  return self;
252
258
  }
253
259
 
@@ -1499,6 +1505,8 @@
1499
1505
  * @property {boolean} [sphere]
1500
1506
  * @property {number} [rectified_grid_angle]
1501
1507
  * @property {boolean} [approx]
1508
+ * @property {boolean} [over]
1509
+ * @property {string} [projStr]
1502
1510
  * @property {<T extends import('./core').TemplateCoordinates>(coordinates: T, enforceAxis?: boolean) => T} inverse
1503
1511
  * @property {<T extends import('./core').TemplateCoordinates>(coordinates: T, enforceAxis?: boolean) => T} forward
1504
1512
  */
@@ -1535,8 +1543,14 @@
1535
1543
  } else {
1536
1544
  defs[/** @type {string} */ (name)] = wkt(arguments[1]);
1537
1545
  }
1546
+ } else if (def && typeof def === 'object' && !('projName' in def)) {
1547
+ // PROJJSON
1548
+ defs[/** @type {string} */ (name)] = wkt(arguments[1]);
1538
1549
  } else {
1539
1550
  defs[/** @type {string} */ (name)] = def;
1551
+ if (!def) {
1552
+ delete defs[/** @type {string} */ (name)];
1553
+ }
1540
1554
  }
1541
1555
  } else if (arguments.length === 1) {
1542
1556
  if (Array.isArray(name)) {
@@ -1649,7 +1663,10 @@
1649
1663
  return x < 0 ? -1 : 1;
1650
1664
  }
1651
1665
 
1652
- function adjust_lon (x) {
1666
+ function adjust_lon (x, skipAdjust) {
1667
+ if (skipAdjust) {
1668
+ return x;
1669
+ }
1653
1670
  return (Math.abs(x) <= SPI) ? x : (x - (sign(x) * TWO_PI));
1654
1671
  }
1655
1672
 
@@ -1684,7 +1701,7 @@
1684
1701
  */
1685
1702
 
1686
1703
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
1687
- function init$x() {
1704
+ function init$y() {
1688
1705
  var con = this.b / this.a;
1689
1706
  this.es = 1 - con * con;
1690
1707
  if (!('x0' in this)) {
@@ -1714,7 +1731,7 @@
1714
1731
  /* Mercator forward equations--mapping lat,long to x,y
1715
1732
  -------------------------------------------------- */
1716
1733
 
1717
- function forward$v(p) {
1734
+ function forward$w(p) {
1718
1735
  var lon = p.x;
1719
1736
  var lat = p.y;
1720
1737
  // convert to radians
@@ -1727,12 +1744,12 @@
1727
1744
  return null;
1728
1745
  } else {
1729
1746
  if (this.sphere) {
1730
- x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
1747
+ x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0, this.over);
1731
1748
  y = this.y0 + this.a * this.k0 * Math.log(Math.tan(FORTPI + 0.5 * lat));
1732
1749
  } else {
1733
1750
  var sinphi = Math.sin(lat);
1734
1751
  var ts = tsfnz(this.e, lat, sinphi);
1735
- x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0);
1752
+ x = this.x0 + this.a * this.k0 * adjust_lon(lon - this.long0, this.over);
1736
1753
  y = this.y0 - this.a * this.k0 * Math.log(ts);
1737
1754
  }
1738
1755
  p.x = x;
@@ -1743,7 +1760,7 @@
1743
1760
 
1744
1761
  /* Mercator inverse equations--mapping x,y to lat/long
1745
1762
  -------------------------------------------------- */
1746
- function inverse$v(p) {
1763
+ function inverse$w(p) {
1747
1764
  var x = p.x - this.x0;
1748
1765
  var y = p.y - this.y0;
1749
1766
  var lon, lat;
@@ -1757,39 +1774,39 @@
1757
1774
  return null;
1758
1775
  }
1759
1776
  }
1760
- lon = adjust_lon(this.long0 + x / (this.a * this.k0));
1777
+ lon = adjust_lon(this.long0 + x / (this.a * this.k0), this.over);
1761
1778
 
1762
1779
  p.x = lon;
1763
1780
  p.y = lat;
1764
1781
  return p;
1765
1782
  }
1766
1783
 
1767
- var names$x = ['Mercator', 'Popular Visualisation Pseudo Mercator', 'Mercator_1SP', 'Mercator_Auxiliary_Sphere', 'Mercator_Variant_A', 'merc'];
1784
+ var names$y = ['Mercator', 'Popular Visualisation Pseudo Mercator', 'Mercator_1SP', 'Mercator_Auxiliary_Sphere', 'Mercator_Variant_A', 'merc'];
1768
1785
  var merc = {
1769
- init: init$x,
1770
- forward: forward$v,
1771
- inverse: inverse$v,
1772
- names: names$x
1786
+ init: init$y,
1787
+ forward: forward$w,
1788
+ inverse: inverse$w,
1789
+ names: names$y
1773
1790
  };
1774
1791
 
1775
- function init$w() {
1792
+ function init$x() {
1776
1793
  // no-op for longlat
1777
1794
  }
1778
1795
 
1779
1796
  function identity(pt) {
1780
1797
  return pt;
1781
1798
  }
1782
- var names$w = ['longlat', 'identity'];
1799
+ var names$x = ['longlat', 'identity'];
1783
1800
  var longlat = {
1784
- init: init$w,
1801
+ init: init$x,
1785
1802
  forward: identity,
1786
1803
  inverse: identity,
1787
- names: names$w
1804
+ names: names$x
1788
1805
  };
1789
1806
 
1790
1807
  /** @type {Array<Partial<import('./Proj').default>>} */
1791
1808
  var projs = [merc, longlat];
1792
- var names$v = {};
1809
+ var names$w = {};
1793
1810
  var projStore = [];
1794
1811
 
1795
1812
  /**
@@ -1804,7 +1821,7 @@
1804
1821
  }
1805
1822
  projStore[len] = proj;
1806
1823
  proj.names.forEach(function (n) {
1807
- names$v[n.toLowerCase()] = len;
1824
+ names$w[n.toLowerCase()] = len;
1808
1825
  });
1809
1826
  return this;
1810
1827
  }
@@ -1823,12 +1840,12 @@
1823
1840
  return false;
1824
1841
  }
1825
1842
  var n = name.toLowerCase();
1826
- if (typeof names$v[n] !== 'undefined' && projStore[names$v[n]]) {
1827
- return projStore[names$v[n]];
1843
+ if (typeof names$w[n] !== 'undefined' && projStore[names$w[n]]) {
1844
+ return projStore[names$w[n]];
1828
1845
  }
1829
1846
  n = getNormalizedProjName(n);
1830
- if (n in names$v && projStore[names$v[n]]) {
1831
- return projStore[names$v[n]];
1847
+ if (n in names$w && projStore[names$w[n]]) {
1848
+ return projStore[names$w[n]];
1832
1849
  }
1833
1850
  }
1834
1851
 
@@ -4706,8 +4723,8 @@
4706
4723
  var V = 86; // V
4707
4724
  var Z = 90; // Z
4708
4725
  var mgrs = {
4709
- forward: forward$u,
4710
- inverse: inverse$u,
4726
+ forward: forward$v,
4727
+ inverse: inverse$v,
4711
4728
  toPoint: toPoint
4712
4729
  };
4713
4730
  /**
@@ -4719,7 +4736,7 @@
4719
4736
  * 100 m, 2 for 1000 m or 1 for 10000 m). Optional, default is 5.
4720
4737
  * @return {string} the MGRS string for the given location and accuracy.
4721
4738
  */
4722
- function forward$u(ll, accuracy) {
4739
+ function forward$v(ll, accuracy) {
4723
4740
  accuracy = accuracy || 5; // default accuracy 1m
4724
4741
  return encode(LLtoUTM({
4725
4742
  lat: ll[1],
@@ -4734,7 +4751,7 @@
4734
4751
  * (longitude) and top (latitude) values in WGS84, representing the
4735
4752
  * bounding box for the provided MGRS reference.
4736
4753
  */
4737
- function inverse$u(mgrs) {
4754
+ function inverse$v(mgrs) {
4738
4755
  var bbox = UTMtoLL(decode(mgrs.toUpperCase()));
4739
4756
  if (bbox.lat && bbox.lon) {
4740
4757
  return [bbox.lon, bbox.lat, bbox.lon, bbox.lat];
@@ -5452,7 +5469,7 @@
5452
5469
  return new Point(toPoint(mgrsStr));
5453
5470
  };
5454
5471
  Point.prototype.toMGRS = function (accuracy) {
5455
- return forward$u([this.x, this.y], accuracy);
5472
+ return forward$v([this.x, this.y], accuracy);
5456
5473
  };
5457
5474
 
5458
5475
  var C00 = 1;
@@ -5518,7 +5535,7 @@
5518
5535
  */
5519
5536
 
5520
5537
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
5521
- function init$v() {
5538
+ function init$w() {
5522
5539
  this.x0 = this.x0 !== undefined ? this.x0 : 0;
5523
5540
  this.y0 = this.y0 !== undefined ? this.y0 : 0;
5524
5541
  this.long0 = this.long0 !== undefined ? this.long0 : 0;
@@ -5534,11 +5551,11 @@
5534
5551
  Transverse Mercator Forward - long/lat to x/y
5535
5552
  long/lat in radians
5536
5553
  */
5537
- function forward$t(p) {
5554
+ function forward$u(p) {
5538
5555
  var lon = p.x;
5539
5556
  var lat = p.y;
5540
5557
 
5541
- var delta_lon = adjust_lon(lon - this.long0);
5558
+ var delta_lon = adjust_lon(lon - this.long0, this.over);
5542
5559
  var con;
5543
5560
  var x, y;
5544
5561
  var sin_phi = Math.sin(lat);
@@ -5605,7 +5622,7 @@
5605
5622
  /**
5606
5623
  Transverse Mercator Inverse - x/y to long/lat
5607
5624
  */
5608
- function inverse$t(p) {
5625
+ function inverse$u(p) {
5609
5626
  var con, phi;
5610
5627
  var lat, lon;
5611
5628
  var x = (p.x - this.x0) * (1 / this.a);
@@ -5626,7 +5643,7 @@
5626
5643
  if ((g === 0) && (h === 0)) {
5627
5644
  lon = 0;
5628
5645
  } else {
5629
- lon = adjust_lon(Math.atan2(g, h) + this.long0);
5646
+ lon = adjust_lon(Math.atan2(g, h) + this.long0, this.over);
5630
5647
  }
5631
5648
  } else { // ellipsoidal form
5632
5649
  con = this.ml0 + y / this.k0;
@@ -5653,7 +5670,7 @@
5653
5670
  lon = adjust_lon(this.long0 + (d * (1
5654
5671
  - ds / 6 * (1 + 2 * t + c
5655
5672
  - ds / 20 * (5 + 28 * t + 24 * ts + 8 * c * t + 6 * c
5656
- - ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi));
5673
+ - ds / 42 * (61 + 662 * t + 1320 * ts + 720 * ts * t)))) / cos_phi), this.over);
5657
5674
  } else {
5658
5675
  lat = HALF_PI * sign(y);
5659
5676
  lon = 0;
@@ -5666,12 +5683,12 @@
5666
5683
  return p;
5667
5684
  }
5668
5685
 
5669
- var names$u = ['Fast_Transverse_Mercator', 'Fast Transverse Mercator'];
5686
+ var names$v = ['Fast_Transverse_Mercator', 'Fast Transverse Mercator'];
5670
5687
  var tmerc = {
5671
- init: init$v,
5672
- forward: forward$t,
5673
- inverse: inverse$t,
5674
- names: names$u
5688
+ init: init$w,
5689
+ forward: forward$u,
5690
+ inverse: inverse$u,
5691
+ names: names$v
5675
5692
  };
5676
5693
 
5677
5694
  function sinh (x) {
@@ -5787,7 +5804,7 @@
5787
5804
  */
5788
5805
 
5789
5806
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
5790
- function init$u() {
5807
+ function init$v() {
5791
5808
  if (!this.approx && (isNaN(this.es) || this.es <= 0)) {
5792
5809
  throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');
5793
5810
  }
@@ -5864,8 +5881,8 @@
5864
5881
  this.Zb = -this.Qn * (Z + clens(this.gtu, 2 * Z));
5865
5882
  }
5866
5883
 
5867
- function forward$s(p) {
5868
- var Ce = adjust_lon(p.x - this.long0);
5884
+ function forward$t(p) {
5885
+ var Ce = adjust_lon(p.x - this.long0, this.over);
5869
5886
  var Cn = p.y;
5870
5887
 
5871
5888
  Cn = gatg(this.cbg, Cn);
@@ -5900,7 +5917,7 @@
5900
5917
  return p;
5901
5918
  }
5902
5919
 
5903
- function inverse$s(p) {
5920
+ function inverse$t(p) {
5904
5921
  var Ce = (p.x - this.x0) * (1 / this.a);
5905
5922
  var Cn = (p.y - this.y0) * (1 / this.a);
5906
5923
 
@@ -5925,7 +5942,7 @@
5925
5942
  Cn = Math.atan2(sin_Cn * cos_Ce, hypot(sin_Ce, cos_Ce * cos_Cn));
5926
5943
  Ce = Math.atan2(sin_Ce, cos_Ce * cos_Cn);
5927
5944
 
5928
- lon = adjust_lon(Ce + this.long0);
5945
+ lon = adjust_lon(Ce + this.long0, this.over);
5929
5946
  lat = gatg(this.cgb, Cn);
5930
5947
  } else {
5931
5948
  lon = Infinity;
@@ -5938,12 +5955,12 @@
5938
5955
  return p;
5939
5956
  }
5940
5957
 
5941
- var names$t = ['Extended_Transverse_Mercator', 'Extended Transverse Mercator', 'etmerc', 'Transverse_Mercator', 'Transverse Mercator', 'Gauss Kruger', 'Gauss_Kruger', 'tmerc'];
5958
+ var names$u = ['Extended_Transverse_Mercator', 'Extended Transverse Mercator', 'etmerc', 'Transverse_Mercator', 'Transverse Mercator', 'Gauss Kruger', 'Gauss_Kruger', 'tmerc'];
5942
5959
  var etmerc = {
5943
- init: init$u,
5944
- forward: forward$s,
5945
- inverse: inverse$s,
5946
- names: names$t
5960
+ init: init$v,
5961
+ forward: forward$t,
5962
+ inverse: inverse$t,
5963
+ names: names$u
5947
5964
  };
5948
5965
 
5949
5966
  function adjust_zone (zone, lon) {
@@ -5962,7 +5979,7 @@
5962
5979
  var dependsOn = 'etmerc';
5963
5980
 
5964
5981
  /** @this {import('../defs.js').ProjectionDefinition} */
5965
- function init$t() {
5982
+ function init$u() {
5966
5983
  var zone = adjust_zone(this.zone, this.long0);
5967
5984
  if (zone === undefined) {
5968
5985
  throw new Error('unknown utm zone');
@@ -5978,10 +5995,10 @@
5978
5995
  this.inverse = etmerc.inverse;
5979
5996
  }
5980
5997
 
5981
- var names$s = ['Universal Transverse Mercator System', 'utm'];
5998
+ var names$t = ['Universal Transverse Mercator System', 'utm'];
5982
5999
  var utm = {
5983
- init: init$t,
5984
- names: names$s,
6000
+ init: init$u,
6001
+ names: names$t,
5985
6002
  dependsOn: dependsOn
5986
6003
  };
5987
6004
 
@@ -6003,7 +6020,7 @@
6003
6020
  */
6004
6021
 
6005
6022
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
6006
- function init$s() {
6023
+ function init$t() {
6007
6024
  var sphi = Math.sin(this.lat0);
6008
6025
  var cphi = Math.cos(this.lat0);
6009
6026
  cphi *= cphi;
@@ -6014,7 +6031,7 @@
6014
6031
  this.K = Math.tan(0.5 * this.phic0 + FORTPI) / (Math.pow(Math.tan(0.5 * this.lat0 + FORTPI), this.C) * srat(this.e * sphi, this.ratexp));
6015
6032
  }
6016
6033
 
6017
- function forward$r(p) {
6034
+ function forward$s(p) {
6018
6035
  var lon = p.x;
6019
6036
  var lat = p.y;
6020
6037
 
@@ -6023,7 +6040,7 @@
6023
6040
  return p;
6024
6041
  }
6025
6042
 
6026
- function inverse$r(p) {
6043
+ function inverse$s(p) {
6027
6044
  var DEL_TOL = 1e-14;
6028
6045
  var lon = p.x / this.C;
6029
6046
  var lat = p.y;
@@ -6044,9 +6061,9 @@
6044
6061
  return p;
6045
6062
  }
6046
6063
  var gauss = {
6047
- init: init$s,
6048
- forward: forward$r,
6049
- inverse: inverse$r};
6064
+ init: init$t,
6065
+ forward: forward$s,
6066
+ inverse: inverse$s};
6050
6067
 
6051
6068
  /**
6052
6069
  * @typedef {Object} LocalThis
@@ -6058,7 +6075,7 @@
6058
6075
  */
6059
6076
 
6060
6077
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
6061
- function init$r() {
6078
+ function init$s() {
6062
6079
  gauss.init.apply(this);
6063
6080
  if (!this.rc) {
6064
6081
  return;
@@ -6071,9 +6088,9 @@
6071
6088
  }
6072
6089
  }
6073
6090
 
6074
- function forward$q(p) {
6091
+ function forward$r(p) {
6075
6092
  var sinc, cosc, cosl, k;
6076
- p.x = adjust_lon(p.x - this.long0);
6093
+ p.x = adjust_lon(p.x - this.long0, this.over);
6077
6094
  gauss.forward.apply(this, [p]);
6078
6095
  sinc = Math.sin(p.y);
6079
6096
  cosc = Math.cos(p.y);
@@ -6086,7 +6103,7 @@
6086
6103
  return p;
6087
6104
  }
6088
6105
 
6089
- function inverse$q(p) {
6106
+ function inverse$r(p) {
6090
6107
  var sinc, cosc, lon, lat, rho;
6091
6108
  p.x = (p.x - this.x0) / this.a;
6092
6109
  p.y = (p.y - this.y0) / this.a;
@@ -6107,16 +6124,16 @@
6107
6124
  p.x = lon;
6108
6125
  p.y = lat;
6109
6126
  gauss.inverse.apply(this, [p]);
6110
- p.x = adjust_lon(p.x + this.long0);
6127
+ p.x = adjust_lon(p.x + this.long0, this.over);
6111
6128
  return p;
6112
6129
  }
6113
6130
 
6114
- var names$r = ['Stereographic_North_Pole', 'Oblique_Stereographic', 'sterea', 'Oblique Stereographic Alternative', 'Double_Stereographic'];
6131
+ var names$s = ['Stereographic_North_Pole', 'Oblique_Stereographic', 'sterea', 'Oblique Stereographic Alternative', 'Double_Stereographic'];
6115
6132
  var sterea = {
6116
- init: init$r,
6117
- forward: forward$q,
6118
- inverse: inverse$q,
6119
- names: names$r
6133
+ init: init$s,
6134
+ forward: forward$r,
6135
+ inverse: inverse$r,
6136
+ names: names$s
6120
6137
  };
6121
6138
 
6122
6139
  /**
@@ -6138,7 +6155,7 @@
6138
6155
  }
6139
6156
 
6140
6157
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
6141
- function init$q() {
6158
+ function init$r() {
6142
6159
  // setting default parameters
6143
6160
  this.x0 = this.x0 || 0;
6144
6161
  this.y0 = this.y0 || 0;
@@ -6177,13 +6194,13 @@
6177
6194
  }
6178
6195
 
6179
6196
  // Stereographic forward equations--mapping lat,long to x,y
6180
- function forward$p(p) {
6197
+ function forward$q(p) {
6181
6198
  var lon = p.x;
6182
6199
  var lat = p.y;
6183
6200
  var sinlat = Math.sin(lat);
6184
6201
  var coslat = Math.cos(lat);
6185
6202
  var A, X, sinX, cosX, ts, rh;
6186
- var dlon = adjust_lon(lon - this.long0);
6203
+ var dlon = adjust_lon(lon - this.long0, this.over);
6187
6204
 
6188
6205
  if (Math.abs(Math.abs(lon - this.long0) - Math.PI) <= EPSLN && Math.abs(lat + this.lat0) <= EPSLN) {
6189
6206
  // case of the origine point
@@ -6227,7 +6244,7 @@
6227
6244
  }
6228
6245
 
6229
6246
  //* Stereographic inverse equations--mapping x,y to lat/long
6230
- function inverse$p(p) {
6247
+ function inverse$q(p) {
6231
6248
  p.x -= this.x0;
6232
6249
  p.y -= this.y0;
6233
6250
  var lon, lat, ts, ce, Chi;
@@ -6244,12 +6261,12 @@
6244
6261
  lat = Math.asin(Math.cos(c) * this.sinlat0 + p.y * Math.sin(c) * this.coslat0 / rh);
6245
6262
  if (Math.abs(this.coslat0) < EPSLN) {
6246
6263
  if (this.lat0 > 0) {
6247
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
6264
+ lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y), this.over);
6248
6265
  } else {
6249
- lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
6266
+ lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y), this.over);
6250
6267
  }
6251
6268
  } else {
6252
- lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)));
6269
+ lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(c), rh * this.coslat0 * Math.cos(c) - p.y * this.sinlat0 * Math.sin(c)), this.over);
6253
6270
  }
6254
6271
  p.x = lon;
6255
6272
  p.y = lat;
@@ -6268,7 +6285,7 @@
6268
6285
  p.y *= this.con;
6269
6286
  ts = rh * this.cons / (2 * this.a * this.k0);
6270
6287
  lat = this.con * phi2z(this.e, ts);
6271
- lon = this.con * adjust_lon(this.con * this.long0 + Math.atan2(p.x, -1 * p.y));
6288
+ lon = this.con * adjust_lon(this.con * this.long0 + Math.atan2(p.x, -1 * p.y), this.over);
6272
6289
  } else {
6273
6290
  ce = 2 * Math.atan(rh * this.cosX0 / (2 * this.a * this.k0 * this.ms1));
6274
6291
  lon = this.long0;
@@ -6276,7 +6293,7 @@
6276
6293
  Chi = this.X0;
6277
6294
  } else {
6278
6295
  Chi = Math.asin(Math.cos(ce) * this.sinX0 + p.y * Math.sin(ce) * this.cosX0 / rh);
6279
- lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)));
6296
+ lon = adjust_lon(this.long0 + Math.atan2(p.x * Math.sin(ce), rh * this.cosX0 * Math.cos(ce) - p.y * this.sinX0 * Math.sin(ce)), this.over);
6280
6297
  }
6281
6298
  lat = -1 * phi2z(this.e, Math.tan(0.5 * (HALF_PI + Chi)));
6282
6299
  }
@@ -6288,12 +6305,12 @@
6288
6305
  return p;
6289
6306
  }
6290
6307
 
6291
- var names$q = ['stere', 'Stereographic_South_Pole', 'Polar_Stereographic_variant_A', 'Polar_Stereographic_variant_B', 'Polar_Stereographic'];
6308
+ var names$r = ['stere', 'Stereographic_South_Pole', 'Polar_Stereographic_variant_A', 'Polar_Stereographic_variant_B', 'Polar_Stereographic'];
6292
6309
  var stere = {
6293
- init: init$q,
6294
- forward: forward$p,
6295
- inverse: inverse$p,
6296
- names: names$q,
6310
+ init: init$r,
6311
+ forward: forward$q,
6312
+ inverse: inverse$q,
6313
+ names: names$r,
6297
6314
  ssfn_: ssfn_
6298
6315
  };
6299
6316
 
@@ -6315,7 +6332,7 @@
6315
6332
  */
6316
6333
 
6317
6334
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
6318
- function init$p() {
6335
+ function init$q() {
6319
6336
  var phy0 = this.lat0;
6320
6337
  this.lambda0 = this.long0;
6321
6338
  var sinPhy0 = Math.sin(phy0);
@@ -6333,7 +6350,7 @@
6333
6350
  this.K = k1 - this.alpha * k2 + this.alpha * e / 2 * k3;
6334
6351
  }
6335
6352
 
6336
- function forward$o(p) {
6353
+ function forward$p(p) {
6337
6354
  var Sa1 = Math.log(Math.tan(Math.PI / 4 - p.y / 2));
6338
6355
  var Sa2 = this.e / 2 * Math.log((1 + this.e * Math.sin(p.y)) / (1 - this.e * Math.sin(p.y)));
6339
6356
  var S = -this.alpha * (Sa1 + Sa2) + this.K;
@@ -6354,7 +6371,7 @@
6354
6371
  return p;
6355
6372
  }
6356
6373
 
6357
- function inverse$o(p) {
6374
+ function inverse$p(p) {
6358
6375
  var Y = p.x - this.x0;
6359
6376
  var X = p.y - this.y0;
6360
6377
 
@@ -6386,12 +6403,12 @@
6386
6403
  return p;
6387
6404
  }
6388
6405
 
6389
- var names$p = ['somerc'];
6406
+ var names$q = ['somerc'];
6390
6407
  var somerc = {
6391
- init: init$p,
6392
- forward: forward$o,
6393
- inverse: inverse$o,
6394
- names: names$p
6408
+ init: init$q,
6409
+ forward: forward$p,
6410
+ inverse: inverse$p,
6411
+ names: names$q
6395
6412
  };
6396
6413
 
6397
6414
  /**
@@ -6430,7 +6447,7 @@
6430
6447
  * Initialize the Oblique Mercator projection
6431
6448
  * @this {import('../defs.js').ProjectionDefinition & LocalThis}
6432
6449
  */
6433
- function init$o() {
6450
+ function init$p() {
6434
6451
  var con, com, cosph0, D, F, H, L, sinph0, p, J, gamma = 0,
6435
6452
  gamma0, lamc = 0, lam1 = 0, lam2 = 0, phi1 = 0, phi2 = 0, alpha_c = 0;
6436
6453
 
@@ -6528,8 +6545,8 @@
6528
6545
  lam2 += TWO_PI;
6529
6546
  }
6530
6547
 
6531
- this.lam0 = adjust_lon(0.5 * (lam1 + lam2) - Math.atan(J * Math.tan(0.5 * this.B * (lam1 - lam2)) / p) / this.B);
6532
- gamma0 = Math.atan(2 * Math.sin(this.B * adjust_lon(lam1 - this.lam0)) / (F - 1 / F));
6548
+ this.lam0 = adjust_lon(0.5 * (lam1 + lam2) - Math.atan(J * Math.tan(0.5 * this.B * (lam1 - lam2)) / p) / this.B, this.over);
6549
+ gamma0 = Math.atan(2 * Math.sin(this.B * adjust_lon(lam1 - this.lam0, this.over)) / (F - 1 / F));
6533
6550
  gamma = alpha_c = Math.asin(D * Math.sin(gamma0));
6534
6551
  }
6535
6552
 
@@ -6559,7 +6576,7 @@
6559
6576
 
6560
6577
  /* Oblique Mercator forward equations--mapping lat,long to x,y
6561
6578
  ---------------------------------------------------------- */
6562
- function forward$n(p) {
6579
+ function forward$o(p) {
6563
6580
  var coords = {};
6564
6581
  var S, T, U, V, W, temp, u, v;
6565
6582
  p.x = p.x - this.lam0;
@@ -6605,7 +6622,7 @@
6605
6622
  return coords;
6606
6623
  }
6607
6624
 
6608
- function inverse$n(p) {
6625
+ function inverse$o(p) {
6609
6626
  var u, v, Qp, Sp, Tp, Vp, Up;
6610
6627
  var coords = {};
6611
6628
 
@@ -6645,12 +6662,12 @@
6645
6662
  return coords;
6646
6663
  }
6647
6664
 
6648
- var names$o = ['Hotine_Oblique_Mercator', 'Hotine Oblique Mercator', 'Hotine_Oblique_Mercator_variant_A', 'Hotine_Oblique_Mercator_Variant_B', 'Hotine_Oblique_Mercator_Azimuth_Natural_Origin', 'Hotine_Oblique_Mercator_Two_Point_Natural_Origin', 'Hotine_Oblique_Mercator_Azimuth_Center', 'Oblique_Mercator', 'omerc'];
6665
+ var names$p = ['Hotine_Oblique_Mercator', 'Hotine Oblique Mercator', 'Hotine_Oblique_Mercator_variant_A', 'Hotine_Oblique_Mercator_Variant_B', 'Hotine_Oblique_Mercator_Azimuth_Natural_Origin', 'Hotine_Oblique_Mercator_Two_Point_Natural_Origin', 'Hotine_Oblique_Mercator_Azimuth_Center', 'Oblique_Mercator', 'omerc'];
6649
6666
  var omerc = {
6650
- init: init$o,
6651
- forward: forward$n,
6652
- inverse: inverse$n,
6653
- names: names$o
6667
+ init: init$p,
6668
+ forward: forward$o,
6669
+ inverse: inverse$o,
6670
+ names: names$p
6654
6671
  };
6655
6672
 
6656
6673
  /**
@@ -6662,7 +6679,7 @@
6662
6679
  */
6663
6680
 
6664
6681
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
6665
- function init$n() {
6682
+ function init$o() {
6666
6683
  // double lat0; /* the reference latitude */
6667
6684
  // double long0; /* the reference longitude */
6668
6685
  // double lat1; /* first standard parallel */
@@ -6722,7 +6739,7 @@
6722
6739
 
6723
6740
  // Lambert Conformal conic forward equations--mapping lat,long to x,y
6724
6741
  // -----------------------------------------------------------------
6725
- function forward$m(p) {
6742
+ function forward$n(p) {
6726
6743
  var lon = p.x;
6727
6744
  var lat = p.y;
6728
6745
 
@@ -6743,7 +6760,7 @@
6743
6760
  }
6744
6761
  rh1 = 0;
6745
6762
  }
6746
- var theta = this.ns * adjust_lon(lon - this.long0);
6763
+ var theta = this.ns * adjust_lon(lon - this.long0, this.over);
6747
6764
  p.x = this.k0 * (rh1 * Math.sin(theta)) + this.x0;
6748
6765
  p.y = this.k0 * (this.rh - rh1 * Math.cos(theta)) + this.y0;
6749
6766
 
@@ -6752,7 +6769,7 @@
6752
6769
 
6753
6770
  // Lambert Conformal Conic inverse equations--mapping x,y to lat/long
6754
6771
  // -----------------------------------------------------------------
6755
- function inverse$m(p) {
6772
+ function inverse$n(p) {
6756
6773
  var rh1, con, ts;
6757
6774
  var lat, lon;
6758
6775
  var x = (p.x - this.x0) / this.k0;
@@ -6778,14 +6795,14 @@
6778
6795
  } else {
6779
6796
  lat = -HALF_PI;
6780
6797
  }
6781
- lon = adjust_lon(theta / this.ns + this.long0);
6798
+ lon = adjust_lon(theta / this.ns + this.long0, this.over);
6782
6799
 
6783
6800
  p.x = lon;
6784
6801
  p.y = lat;
6785
6802
  return p;
6786
6803
  }
6787
6804
 
6788
- var names$n = [
6805
+ var names$o = [
6789
6806
  'Lambert Tangential Conformal Conic Projection',
6790
6807
  'Lambert_Conformal_Conic',
6791
6808
  'Lambert_Conformal_Conic_1SP',
@@ -6796,13 +6813,13 @@
6796
6813
  ];
6797
6814
 
6798
6815
  var lcc = {
6799
- init: init$n,
6800
- forward: forward$m,
6801
- inverse: inverse$m,
6802
- names: names$n
6816
+ init: init$o,
6817
+ forward: forward$n,
6818
+ inverse: inverse$n,
6819
+ names: names$o
6803
6820
  };
6804
6821
 
6805
- function init$m() {
6822
+ function init$n() {
6806
6823
  this.a = 6377397.155;
6807
6824
  this.es = 0.006674372230614;
6808
6825
  this.e = Math.sqrt(this.es);
@@ -6837,11 +6854,11 @@
6837
6854
  /* ellipsoid */
6838
6855
  /* calculate xy from lat/lon */
6839
6856
  /* Constants, identical to inverse transform function */
6840
- function forward$l(p) {
6857
+ function forward$m(p) {
6841
6858
  var gfi, u, deltav, s, d, eps, ro;
6842
6859
  var lon = p.x;
6843
6860
  var lat = p.y;
6844
- var delta_lon = adjust_lon(lon - this.long0);
6861
+ var delta_lon = adjust_lon(lon - this.long0, this.over);
6845
6862
  /* Transformation */
6846
6863
  gfi = Math.pow(((1 + this.e * Math.sin(lat)) / (1 - this.e * Math.sin(lat))), (this.alfa * this.e / 2));
6847
6864
  u = 2 * (Math.atan(this.k * Math.pow(Math.tan(lat / 2 + this.s45), this.alfa) / gfi) - this.s45);
@@ -6861,7 +6878,7 @@
6861
6878
  }
6862
6879
 
6863
6880
  /* calculate lat/lon from xy */
6864
- function inverse$l(p) {
6881
+ function inverse$m(p) {
6865
6882
  var u, deltav, s, d, eps, ro, fi1;
6866
6883
  var ok;
6867
6884
 
@@ -6899,12 +6916,12 @@
6899
6916
  return (p);
6900
6917
  }
6901
6918
 
6902
- var names$m = ['Krovak', 'krovak'];
6919
+ var names$n = ['Krovak', 'krovak'];
6903
6920
  var krovak = {
6904
- init: init$m,
6905
- forward: forward$l,
6906
- inverse: inverse$l,
6907
- names: names$m
6921
+ init: init$n,
6922
+ forward: forward$m,
6923
+ inverse: inverse$m,
6924
+ names: names$n
6908
6925
  };
6909
6926
 
6910
6927
  function mlfn (e0, e1, e2, e3, phi) {
@@ -6964,7 +6981,7 @@
6964
6981
  */
6965
6982
 
6966
6983
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
6967
- function init$l() {
6984
+ function init$m() {
6968
6985
  if (!this.sphere) {
6969
6986
  this.e0 = e0fn(this.es);
6970
6987
  this.e1 = e1fn(this.es);
@@ -6976,13 +6993,13 @@
6976
6993
 
6977
6994
  /* Cassini forward equations--mapping lat,long to x,y
6978
6995
  ----------------------------------------------------------------------- */
6979
- function forward$k(p) {
6996
+ function forward$l(p) {
6980
6997
  /* Forward equations
6981
6998
  ----------------- */
6982
6999
  var x, y;
6983
7000
  var lam = p.x;
6984
7001
  var phi = p.y;
6985
- lam = adjust_lon(lam - this.long0);
7002
+ lam = adjust_lon(lam - this.long0, this.over);
6986
7003
 
6987
7004
  if (this.sphere) {
6988
7005
  x = this.a * Math.asin(Math.cos(phi) * Math.sin(lam));
@@ -7009,7 +7026,7 @@
7009
7026
 
7010
7027
  /* Inverse equations
7011
7028
  ----------------- */
7012
- function inverse$k(p) {
7029
+ function inverse$l(p) {
7013
7030
  p.x -= this.x0;
7014
7031
  p.y -= this.y0;
7015
7032
  var x = p.x / this.a;
@@ -7042,17 +7059,17 @@
7042
7059
  lam = dl * (1 - dsq * (tl1 / 3 + (1 + 3 * tl1) * tl1 * dsq / 15)) / Math.cos(phi1);
7043
7060
  }
7044
7061
 
7045
- p.x = adjust_lon(lam + this.long0);
7062
+ p.x = adjust_lon(lam + this.long0, this.over);
7046
7063
  p.y = adjust_lat(phi);
7047
7064
  return p;
7048
7065
  }
7049
7066
 
7050
- var names$l = ['Cassini', 'Cassini_Soldner', 'cass'];
7067
+ var names$m = ['Cassini', 'Cassini_Soldner', 'cass'];
7051
7068
  var cass = {
7052
- init: init$l,
7053
- forward: forward$k,
7054
- inverse: inverse$k,
7055
- names: names$l
7069
+ init: init$m,
7070
+ forward: forward$l,
7071
+ inverse: inverse$l,
7072
+ names: names$m
7056
7073
  };
7057
7074
 
7058
7075
  function qsfnz (eccent, sinphi) {
@@ -7098,7 +7115,7 @@
7098
7115
  * Initialize the Lambert Azimuthal Equal Area projection
7099
7116
  * @this {import('../defs.js').ProjectionDefinition & LocalThis}
7100
7117
  */
7101
- function init$k() {
7118
+ function init$l() {
7102
7119
  var t = Math.abs(this.lat0);
7103
7120
  if (Math.abs(t - HALF_PI) < EPSLN) {
7104
7121
  this.mode = this.lat0 < 0 ? S_POLE : N_POLE;
@@ -7146,14 +7163,14 @@
7146
7163
 
7147
7164
  /* Lambert Azimuthal Equal Area forward equations--mapping lat,long to x,y
7148
7165
  ----------------------------------------------------------------------- */
7149
- function forward$j(p) {
7166
+ function forward$k(p) {
7150
7167
  /* Forward equations
7151
7168
  ----------------- */
7152
7169
  var x, y, coslam, sinlam, sinphi, q, sinb, cosb, b, cosphi;
7153
7170
  var lam = p.x;
7154
7171
  var phi = p.y;
7155
7172
 
7156
- lam = adjust_lon(lam - this.long0);
7173
+ lam = adjust_lon(lam - this.long0, this.over);
7157
7174
  if (this.sphere) {
7158
7175
  sinphi = Math.sin(phi);
7159
7176
  cosphi = Math.cos(phi);
@@ -7239,7 +7256,7 @@
7239
7256
 
7240
7257
  /* Inverse equations
7241
7258
  ----------------- */
7242
- function inverse$j(p) {
7259
+ function inverse$k(p) {
7243
7260
  p.x -= this.x0;
7244
7261
  p.y -= this.y0;
7245
7262
  var x = p.x / this.a;
@@ -7321,7 +7338,7 @@
7321
7338
  phi = authlat(Math.asin(ab), this.apa);
7322
7339
  }
7323
7340
 
7324
- p.x = adjust_lon(this.long0 + lam);
7341
+ p.x = adjust_lon(this.long0 + lam, this.over);
7325
7342
  p.y = phi;
7326
7343
  return p;
7327
7344
  }
@@ -7354,12 +7371,12 @@
7354
7371
  return (beta + APA[0] * Math.sin(t) + APA[1] * Math.sin(t + t) + APA[2] * Math.sin(t + t + t));
7355
7372
  }
7356
7373
 
7357
- var names$k = ['Lambert Azimuthal Equal Area', 'Lambert_Azimuthal_Equal_Area', 'laea'];
7374
+ var names$l = ['Lambert Azimuthal Equal Area', 'Lambert_Azimuthal_Equal_Area', 'laea'];
7358
7375
  var laea = {
7359
- init: init$k,
7360
- forward: forward$j,
7361
- inverse: inverse$j,
7362
- names: names$k,
7376
+ init: init$l,
7377
+ forward: forward$k,
7378
+ inverse: inverse$k,
7379
+ names: names$l,
7363
7380
  S_POLE: S_POLE,
7364
7381
  N_POLE: N_POLE,
7365
7382
  EQUIT: EQUIT,
@@ -7397,7 +7414,7 @@
7397
7414
  */
7398
7415
 
7399
7416
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
7400
- function init$j() {
7417
+ function init$k() {
7401
7418
  if (Math.abs(this.lat1 + this.lat2) < EPSLN) {
7402
7419
  return;
7403
7420
  }
@@ -7435,7 +7452,7 @@
7435
7452
  /* Albers Conical Equal Area forward equations--mapping lat,long to x,y
7436
7453
  ------------------------------------------------------------------- */
7437
7454
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
7438
- function forward$i(p) {
7455
+ function forward$j(p) {
7439
7456
  var lon = p.x;
7440
7457
  var lat = p.y;
7441
7458
 
@@ -7444,7 +7461,7 @@
7444
7461
 
7445
7462
  var qs = qsfnz(this.e3, this.sin_phi);
7446
7463
  var rh1 = this.a * Math.sqrt(this.c - this.ns0 * qs) / this.ns0;
7447
- var theta = this.ns0 * adjust_lon(lon - this.long0);
7464
+ var theta = this.ns0 * adjust_lon(lon - this.long0, this.over);
7448
7465
  var x = rh1 * Math.sin(theta) + this.x0;
7449
7466
  var y = this.rh - rh1 * Math.cos(theta) + this.y0;
7450
7467
 
@@ -7453,7 +7470,7 @@
7453
7470
  return p;
7454
7471
  }
7455
7472
 
7456
- function inverse$i(p) {
7473
+ function inverse$j(p) {
7457
7474
  var rh1, qs, con, theta, lon, lat;
7458
7475
 
7459
7476
  p.x -= this.x0;
@@ -7477,7 +7494,7 @@
7477
7494
  lat = this.phi1z(this.e3, qs);
7478
7495
  }
7479
7496
 
7480
- lon = adjust_lon(theta / this.ns0 + this.long0);
7497
+ lon = adjust_lon(theta / this.ns0 + this.long0, this.over);
7481
7498
  p.x = lon;
7482
7499
  p.y = lat;
7483
7500
  return p;
@@ -7508,12 +7525,12 @@
7508
7525
  return null;
7509
7526
  }
7510
7527
 
7511
- var names$j = ['Albers_Conic_Equal_Area', 'Albers_Equal_Area', 'Albers', 'aea'];
7528
+ var names$k = ['Albers_Conic_Equal_Area', 'Albers_Equal_Area', 'Albers', 'aea'];
7512
7529
  var aea = {
7513
- init: init$j,
7514
- forward: forward$i,
7515
- inverse: inverse$i,
7516
- names: names$j,
7530
+ init: init$k,
7531
+ forward: forward$j,
7532
+ inverse: inverse$j,
7533
+ names: names$k,
7517
7534
  phi1z: phi1z
7518
7535
  };
7519
7536
 
@@ -7532,7 +7549,7 @@
7532
7549
  Accessed: 12th November 2009
7533
7550
  @this {import('../defs.js').ProjectionDefinition & LocalThis}
7534
7551
  */
7535
- function init$i() {
7552
+ function init$j() {
7536
7553
  /* Place parameters in static storage for common use
7537
7554
  ------------------------------------------------- */
7538
7555
  this.sin_p14 = Math.sin(this.lat0);
@@ -7544,7 +7561,7 @@
7544
7561
 
7545
7562
  /* Gnomonic forward equations--mapping lat,long to x,y
7546
7563
  --------------------------------------------------- */
7547
- function forward$h(p) {
7564
+ function forward$i(p) {
7548
7565
  var sinphi, cosphi; /* sin and cos value */
7549
7566
  var dlon; /* delta longitude value */
7550
7567
  var coslon; /* cos of longitude */
@@ -7555,7 +7572,7 @@
7555
7572
  var lat = p.y;
7556
7573
  /* Forward equations
7557
7574
  ----------------- */
7558
- dlon = adjust_lon(lon - this.long0);
7575
+ dlon = adjust_lon(lon - this.long0, this.over);
7559
7576
 
7560
7577
  sinphi = Math.sin(lat);
7561
7578
  cosphi = Math.cos(lat);
@@ -7582,7 +7599,7 @@
7582
7599
  return p;
7583
7600
  }
7584
7601
 
7585
- function inverse$h(p) {
7602
+ function inverse$i(p) {
7586
7603
  var rh; /* Rho */
7587
7604
  var sinc, cosc;
7588
7605
  var c;
@@ -7603,7 +7620,7 @@
7603
7620
 
7604
7621
  lat = asinz(cosc * this.sin_p14 + (p.y * sinc * this.cos_p14) / rh);
7605
7622
  lon = Math.atan2(p.x * sinc, rh * this.cos_p14 * cosc - p.y * this.sin_p14 * sinc);
7606
- lon = adjust_lon(this.long0 + lon);
7623
+ lon = adjust_lon(this.long0 + lon, this.over);
7607
7624
  } else {
7608
7625
  lat = this.phic0;
7609
7626
  lon = 0;
@@ -7614,12 +7631,12 @@
7614
7631
  return p;
7615
7632
  }
7616
7633
 
7617
- var names$i = ['gnom'];
7634
+ var names$j = ['gnom'];
7618
7635
  var gnom = {
7619
- init: init$i,
7620
- forward: forward$h,
7621
- inverse: inverse$h,
7622
- names: names$i
7636
+ init: init$j,
7637
+ forward: forward$i,
7638
+ inverse: inverse$i,
7639
+ names: names$j
7623
7640
  };
7624
7641
 
7625
7642
  function iqsfnz (eccent, q) {
@@ -7664,7 +7681,7 @@
7664
7681
  USGS Open File Report 90-284and Release 4 Interim Reports (2003)
7665
7682
  @this {import('../defs.js').ProjectionDefinition & LocalThis}
7666
7683
  */
7667
- function init$h() {
7684
+ function init$i() {
7668
7685
  // no-op
7669
7686
  if (!this.sphere) {
7670
7687
  this.k0 = msfnz(this.e, Math.sin(this.lat_ts), Math.cos(this.lat_ts));
@@ -7673,13 +7690,13 @@
7673
7690
 
7674
7691
  /* Cylindrical Equal Area forward equations--mapping lat,long to x,y
7675
7692
  ------------------------------------------------------------ */
7676
- function forward$g(p) {
7693
+ function forward$h(p) {
7677
7694
  var lon = p.x;
7678
7695
  var lat = p.y;
7679
7696
  var x, y;
7680
7697
  /* Forward equations
7681
7698
  ----------------- */
7682
- var dlon = adjust_lon(lon - this.long0);
7699
+ var dlon = adjust_lon(lon - this.long0, this.over);
7683
7700
  if (this.sphere) {
7684
7701
  x = this.x0 + this.a * dlon * Math.cos(this.lat_ts);
7685
7702
  y = this.y0 + this.a * Math.sin(lat) / Math.cos(this.lat_ts);
@@ -7696,17 +7713,17 @@
7696
7713
 
7697
7714
  /* Cylindrical Equal Area inverse equations--mapping x,y to lat/long
7698
7715
  ------------------------------------------------------------ */
7699
- function inverse$g(p) {
7716
+ function inverse$h(p) {
7700
7717
  p.x -= this.x0;
7701
7718
  p.y -= this.y0;
7702
7719
  var lon, lat;
7703
7720
 
7704
7721
  if (this.sphere) {
7705
- lon = adjust_lon(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts));
7722
+ lon = adjust_lon(this.long0 + (p.x / this.a) / Math.cos(this.lat_ts), this.over);
7706
7723
  lat = Math.asin((p.y / this.a) * Math.cos(this.lat_ts));
7707
7724
  } else {
7708
7725
  lat = iqsfnz(this.e, 2 * p.y * this.k0 / this.a);
7709
- lon = adjust_lon(this.long0 + p.x / (this.a * this.k0));
7726
+ lon = adjust_lon(this.long0 + p.x / (this.a * this.k0), this.over);
7710
7727
  }
7711
7728
 
7712
7729
  p.x = lon;
@@ -7714,15 +7731,15 @@
7714
7731
  return p;
7715
7732
  }
7716
7733
 
7717
- var names$h = ['cea'];
7734
+ var names$i = ['cea'];
7718
7735
  var cea = {
7719
- init: init$h,
7720
- forward: forward$g,
7721
- inverse: inverse$g,
7722
- names: names$h
7736
+ init: init$i,
7737
+ forward: forward$h,
7738
+ inverse: inverse$h,
7739
+ names: names$i
7723
7740
  };
7724
7741
 
7725
- function init$g() {
7742
+ function init$h() {
7726
7743
  this.x0 = this.x0 || 0;
7727
7744
  this.y0 = this.y0 || 0;
7728
7745
  this.lat0 = this.lat0 || 0;
@@ -7735,11 +7752,11 @@
7735
7752
 
7736
7753
  // forward equations--mapping lat,long to x,y
7737
7754
  // -----------------------------------------------------------------
7738
- function forward$f(p) {
7755
+ function forward$g(p) {
7739
7756
  var lon = p.x;
7740
7757
  var lat = p.y;
7741
7758
 
7742
- var dlon = adjust_lon(lon - this.long0);
7759
+ var dlon = adjust_lon(lon - this.long0, this.over);
7743
7760
  var dlat = adjust_lat(lat - this.lat0);
7744
7761
  p.x = this.x0 + (this.a * dlon * this.rc);
7745
7762
  p.y = this.y0 + (this.a * dlat);
@@ -7748,21 +7765,21 @@
7748
7765
 
7749
7766
  // inverse equations--mapping x,y to lat/long
7750
7767
  // -----------------------------------------------------------------
7751
- function inverse$f(p) {
7768
+ function inverse$g(p) {
7752
7769
  var x = p.x;
7753
7770
  var y = p.y;
7754
7771
 
7755
- p.x = adjust_lon(this.long0 + ((x - this.x0) / (this.a * this.rc)));
7772
+ p.x = adjust_lon(this.long0 + ((x - this.x0) / (this.a * this.rc)), this.over);
7756
7773
  p.y = adjust_lat(this.lat0 + ((y - this.y0) / (this.a)));
7757
7774
  return p;
7758
7775
  }
7759
7776
 
7760
- var names$g = ['Equirectangular', 'Equidistant_Cylindrical', 'Equidistant_Cylindrical_Spherical', 'eqc'];
7777
+ var names$h = ['Equirectangular', 'Equidistant_Cylindrical', 'Equidistant_Cylindrical_Spherical', 'eqc'];
7761
7778
  var eqc = {
7762
- init: init$g,
7763
- forward: forward$f,
7764
- inverse: inverse$f,
7765
- names: names$g
7779
+ init: init$h,
7780
+ forward: forward$g,
7781
+ inverse: inverse$g,
7782
+ names: names$h
7766
7783
  };
7767
7784
 
7768
7785
  /**
@@ -7780,7 +7797,7 @@
7780
7797
  var MAX_ITER$1 = 20;
7781
7798
 
7782
7799
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
7783
- function init$f() {
7800
+ function init$g() {
7784
7801
  /* Place parameters in static storage for common use
7785
7802
  ------------------------------------------------- */
7786
7803
  this.temp = this.b / this.a;
@@ -7795,11 +7812,11 @@
7795
7812
 
7796
7813
  /* Polyconic forward equations--mapping lat,long to x,y
7797
7814
  --------------------------------------------------- */
7798
- function forward$e(p) {
7815
+ function forward$f(p) {
7799
7816
  var lon = p.x;
7800
7817
  var lat = p.y;
7801
7818
  var x, y, el;
7802
- var dlon = adjust_lon(lon - this.long0);
7819
+ var dlon = adjust_lon(lon - this.long0, this.over);
7803
7820
  el = dlon * Math.sin(lat);
7804
7821
  if (this.sphere) {
7805
7822
  if (Math.abs(lat) <= EPSLN) {
@@ -7826,7 +7843,7 @@
7826
7843
 
7827
7844
  /* Inverse equations
7828
7845
  ----------------- */
7829
- function inverse$e(p) {
7846
+ function inverse$f(p) {
7830
7847
  var lon, lat, x, y, i;
7831
7848
  var al, bl;
7832
7849
  var phi, dphi;
@@ -7835,7 +7852,7 @@
7835
7852
 
7836
7853
  if (this.sphere) {
7837
7854
  if (Math.abs(y + this.a * this.lat0) <= EPSLN) {
7838
- lon = adjust_lon(x / this.a + this.long0);
7855
+ lon = adjust_lon(x / this.a + this.long0, this.over);
7839
7856
  lat = 0;
7840
7857
  } else {
7841
7858
  al = this.lat0 + y / this.a;
@@ -7851,12 +7868,12 @@
7851
7868
  break;
7852
7869
  }
7853
7870
  }
7854
- lon = adjust_lon(this.long0 + (Math.asin(x * Math.tan(phi) / this.a)) / Math.sin(lat));
7871
+ lon = adjust_lon(this.long0 + (Math.asin(x * Math.tan(phi) / this.a)) / Math.sin(lat), this.over);
7855
7872
  }
7856
7873
  } else {
7857
7874
  if (Math.abs(y + this.ml0) <= EPSLN) {
7858
7875
  lat = 0;
7859
- lon = adjust_lon(this.long0 + x / this.a);
7876
+ lon = adjust_lon(this.long0 + x / this.a, this.over);
7860
7877
  } else {
7861
7878
  al = (this.ml0 + y) / this.a;
7862
7879
  bl = x * x / this.a / this.a + al * al;
@@ -7879,7 +7896,7 @@
7879
7896
 
7880
7897
  // lat=phi4z(this.e,this.e0,this.e1,this.e2,this.e3,al,bl,0,0);
7881
7898
  cl = Math.sqrt(1 - this.es * Math.pow(Math.sin(lat), 2)) * Math.tan(lat);
7882
- lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat));
7899
+ lon = adjust_lon(this.long0 + Math.asin(x * cl / this.a) / Math.sin(lat), this.over);
7883
7900
  }
7884
7901
  }
7885
7902
 
@@ -7888,15 +7905,15 @@
7888
7905
  return p;
7889
7906
  }
7890
7907
 
7891
- var names$f = ['Polyconic', 'American_Polyconic', 'poly'];
7908
+ var names$g = ['Polyconic', 'American_Polyconic', 'poly'];
7892
7909
  var poly = {
7893
- init: init$f,
7894
- forward: forward$e,
7895
- inverse: inverse$e,
7896
- names: names$f
7910
+ init: init$g,
7911
+ forward: forward$f,
7912
+ inverse: inverse$f,
7913
+ names: names$g
7897
7914
  };
7898
7915
 
7899
- function init$e() {
7916
+ function init$f() {
7900
7917
  this.A = [];
7901
7918
  this.A[1] = 0.6399175073;
7902
7919
  this.A[2] = -0.1358797613;
@@ -7955,7 +7972,7 @@
7955
7972
  New Zealand Map Grid Forward - long/lat to x/y
7956
7973
  long/lat in radians
7957
7974
  */
7958
- function forward$d(p) {
7975
+ function forward$e(p) {
7959
7976
  var n;
7960
7977
  var lon = p.x;
7961
7978
  var lat = p.y;
@@ -8006,7 +8023,7 @@
8006
8023
  /**
8007
8024
  New Zealand Map Grid Inverse - x/y to long/lat
8008
8025
  */
8009
- function inverse$d(p) {
8026
+ function inverse$e(p) {
8010
8027
  var n;
8011
8028
  var x = p.x;
8012
8029
  var y = p.y;
@@ -8097,12 +8114,12 @@
8097
8114
  return p;
8098
8115
  }
8099
8116
 
8100
- var names$e = ['New_Zealand_Map_Grid', 'nzmg'];
8117
+ var names$f = ['New_Zealand_Map_Grid', 'nzmg'];
8101
8118
  var nzmg = {
8102
- init: init$e,
8103
- forward: forward$d,
8104
- inverse: inverse$d,
8105
- names: names$e
8119
+ init: init$f,
8120
+ forward: forward$e,
8121
+ inverse: inverse$e,
8122
+ names: names$f
8106
8123
  };
8107
8124
 
8108
8125
  /*
@@ -8113,18 +8130,18 @@
8113
8130
 
8114
8131
  /* Initialize the Miller Cylindrical projection
8115
8132
  ------------------------------------------- */
8116
- function init$d() {
8133
+ function init$e() {
8117
8134
  // no-op
8118
8135
  }
8119
8136
 
8120
8137
  /* Miller Cylindrical forward equations--mapping lat,long to x,y
8121
8138
  ------------------------------------------------------------ */
8122
- function forward$c(p) {
8139
+ function forward$d(p) {
8123
8140
  var lon = p.x;
8124
8141
  var lat = p.y;
8125
8142
  /* Forward equations
8126
8143
  ----------------- */
8127
- var dlon = adjust_lon(lon - this.long0);
8144
+ var dlon = adjust_lon(lon - this.long0, this.over);
8128
8145
  var x = this.x0 + this.a * dlon;
8129
8146
  var y = this.y0 + this.a * Math.log(Math.tan((Math.PI / 4) + (lat / 2.5))) * 1.25;
8130
8147
 
@@ -8135,11 +8152,11 @@
8135
8152
 
8136
8153
  /* Miller Cylindrical inverse equations--mapping x,y to lat/long
8137
8154
  ------------------------------------------------------------ */
8138
- function inverse$c(p) {
8155
+ function inverse$d(p) {
8139
8156
  p.x -= this.x0;
8140
8157
  p.y -= this.y0;
8141
8158
 
8142
- var lon = adjust_lon(this.long0 + p.x / this.a);
8159
+ var lon = adjust_lon(this.long0 + p.x / this.a, this.over);
8143
8160
  var lat = 2.5 * (Math.atan(Math.exp(0.8 * p.y / this.a)) - Math.PI / 4);
8144
8161
 
8145
8162
  p.x = lon;
@@ -8147,12 +8164,12 @@
8147
8164
  return p;
8148
8165
  }
8149
8166
 
8150
- var names$d = ['Miller_Cylindrical', 'mill'];
8167
+ var names$e = ['Miller_Cylindrical', 'mill'];
8151
8168
  var mill = {
8152
- init: init$d,
8153
- forward: forward$c,
8154
- inverse: inverse$c,
8155
- names: names$d
8169
+ init: init$e,
8170
+ forward: forward$d,
8171
+ inverse: inverse$d,
8172
+ names: names$e
8156
8173
  };
8157
8174
 
8158
8175
  var MAX_ITER = 20;
@@ -8168,7 +8185,7 @@
8168
8185
  */
8169
8186
 
8170
8187
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
8171
- function init$c() {
8188
+ function init$d() {
8172
8189
  /* Place parameters in static storage for common use
8173
8190
  ------------------------------------------------- */
8174
8191
 
@@ -8185,13 +8202,13 @@
8185
8202
 
8186
8203
  /* Sinusoidal forward equations--mapping lat,long to x,y
8187
8204
  ----------------------------------------------------- */
8188
- function forward$b(p) {
8205
+ function forward$c(p) {
8189
8206
  var x, y;
8190
8207
  var lon = p.x;
8191
8208
  var lat = p.y;
8192
8209
  /* Forward equations
8193
8210
  ----------------- */
8194
- lon = adjust_lon(lon - this.long0);
8211
+ lon = adjust_lon(lon - this.long0, this.over);
8195
8212
 
8196
8213
  if (this.sphere) {
8197
8214
  if (!this.m) {
@@ -8220,7 +8237,7 @@
8220
8237
  return p;
8221
8238
  }
8222
8239
 
8223
- function inverse$b(p) {
8240
+ function inverse$c(p) {
8224
8241
  var lat, temp, lon, s;
8225
8242
 
8226
8243
  p.x -= this.x0;
@@ -8236,7 +8253,7 @@
8236
8253
  } else if (this.n !== 1) {
8237
8254
  lat = asinz(Math.sin(lat) / this.n);
8238
8255
  }
8239
- lon = adjust_lon(lon + this.long0);
8256
+ lon = adjust_lon(lon + this.long0, this.over);
8240
8257
  lat = adjust_lat(lat);
8241
8258
  } else {
8242
8259
  lat = pj_inv_mlfn(p.y / this.a, this.es, this.en);
@@ -8245,7 +8262,7 @@
8245
8262
  s = Math.sin(lat);
8246
8263
  temp = this.long0 + p.x * Math.sqrt(1 - this.es * s * s) / (this.a * Math.cos(lat));
8247
8264
  // temp = this.long0 + p.x / (this.a * Math.cos(lat));
8248
- lon = adjust_lon(temp);
8265
+ lon = adjust_lon(temp, this.over);
8249
8266
  } else if ((s - EPSLN) < HALF_PI) {
8250
8267
  lon = this.long0;
8251
8268
  }
@@ -8255,24 +8272,30 @@
8255
8272
  return p;
8256
8273
  }
8257
8274
 
8258
- var names$c = ['Sinusoidal', 'sinu'];
8275
+ var names$d = ['Sinusoidal', 'sinu'];
8259
8276
  var sinu = {
8260
- init: init$c,
8261
- forward: forward$b,
8262
- inverse: inverse$b,
8263
- names: names$c
8277
+ init: init$d,
8278
+ forward: forward$c,
8279
+ inverse: inverse$c,
8280
+ names: names$d
8264
8281
  };
8265
8282
 
8266
- function init$b() {}
8283
+ /** @this {import('../defs.js').ProjectionDefinition} */
8284
+ function init$c() {
8285
+ this.x0 = this.x0 !== undefined ? this.x0 : 0;
8286
+ this.y0 = this.y0 !== undefined ? this.y0 : 0;
8287
+ this.long0 = this.long0 !== undefined ? this.long0 : 0;
8288
+ }
8289
+
8267
8290
  /* Mollweide forward equations--mapping lat,long to x,y
8268
8291
  ---------------------------------------------------- */
8269
- function forward$a(p) {
8292
+ function forward$b(p) {
8270
8293
  /* Forward equations
8271
8294
  ----------------- */
8272
8295
  var lon = p.x;
8273
8296
  var lat = p.y;
8274
8297
 
8275
- var delta_lon = adjust_lon(lon - this.long0);
8298
+ var delta_lon = adjust_lon(lon - this.long0, this.over);
8276
8299
  var theta = lat;
8277
8300
  var con = Math.PI * Math.sin(lat);
8278
8301
 
@@ -8301,7 +8324,7 @@
8301
8324
  return p;
8302
8325
  }
8303
8326
 
8304
- function inverse$a(p) {
8327
+ function inverse$b(p) {
8305
8328
  var theta;
8306
8329
  var arg;
8307
8330
 
@@ -8318,7 +8341,7 @@
8318
8341
  arg = 0.999999999999;
8319
8342
  }
8320
8343
  theta = Math.asin(arg);
8321
- var lon = adjust_lon(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta))));
8344
+ var lon = adjust_lon(this.long0 + (p.x / (0.900316316158 * this.a * Math.cos(theta))), this.over);
8322
8345
  if (lon < (-Math.PI)) {
8323
8346
  lon = -Math.PI;
8324
8347
  }
@@ -8336,12 +8359,12 @@
8336
8359
  return p;
8337
8360
  }
8338
8361
 
8339
- var names$b = ['Mollweide', 'moll'];
8362
+ var names$c = ['Mollweide', 'moll'];
8340
8363
  var moll = {
8341
- init: init$b,
8342
- forward: forward$a,
8343
- inverse: inverse$a,
8344
- names: names$b
8364
+ init: init$c,
8365
+ forward: forward$b,
8366
+ inverse: inverse$b,
8367
+ names: names$c
8345
8368
  };
8346
8369
 
8347
8370
  /**
@@ -8366,7 +8389,7 @@
8366
8389
  */
8367
8390
 
8368
8391
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
8369
- function init$a() {
8392
+ function init$b() {
8370
8393
  /* Place parameters in static storage for common use
8371
8394
  ------------------------------------------------- */
8372
8395
  // Standard Parallels cannot be equal and on opposite sides of the equator
@@ -8404,7 +8427,7 @@
8404
8427
 
8405
8428
  /* Equidistant Conic forward equations--mapping lat,long to x,y
8406
8429
  ----------------------------------------------------------- */
8407
- function forward$9(p) {
8430
+ function forward$a(p) {
8408
8431
  var lon = p.x;
8409
8432
  var lat = p.y;
8410
8433
  var rh1;
@@ -8417,7 +8440,7 @@
8417
8440
  var ml = mlfn(this.e0, this.e1, this.e2, this.e3, lat);
8418
8441
  rh1 = this.a * (this.g - ml);
8419
8442
  }
8420
- var theta = this.ns * adjust_lon(lon - this.long0);
8443
+ var theta = this.ns * adjust_lon(lon - this.long0, this.over);
8421
8444
  var x = this.x0 + rh1 * Math.sin(theta);
8422
8445
  var y = this.y0 + this.rh - rh1 * Math.cos(theta);
8423
8446
  p.x = x;
@@ -8427,7 +8450,7 @@
8427
8450
 
8428
8451
  /* Inverse equations
8429
8452
  ----------------- */
8430
- function inverse$9(p) {
8453
+ function inverse$a(p) {
8431
8454
  p.x -= this.x0;
8432
8455
  p.y = this.rh - p.y + this.y0;
8433
8456
  var con, rh1, lat, lon;
@@ -8444,7 +8467,7 @@
8444
8467
  }
8445
8468
 
8446
8469
  if (this.sphere) {
8447
- lon = adjust_lon(this.long0 + theta / this.ns);
8470
+ lon = adjust_lon(this.long0 + theta / this.ns, this.over);
8448
8471
  lat = adjust_lat(this.g - rh1 / this.a);
8449
8472
  p.x = lon;
8450
8473
  p.y = lat;
@@ -8452,19 +8475,19 @@
8452
8475
  } else {
8453
8476
  var ml = this.g - rh1 / this.a;
8454
8477
  lat = imlfn(ml, this.e0, this.e1, this.e2, this.e3);
8455
- lon = adjust_lon(this.long0 + theta / this.ns);
8478
+ lon = adjust_lon(this.long0 + theta / this.ns, this.over);
8456
8479
  p.x = lon;
8457
8480
  p.y = lat;
8458
8481
  return p;
8459
8482
  }
8460
8483
  }
8461
8484
 
8462
- var names$a = ['Equidistant_Conic', 'eqdc'];
8485
+ var names$b = ['Equidistant_Conic', 'eqdc'];
8463
8486
  var eqdc = {
8464
- init: init$a,
8465
- forward: forward$9,
8466
- inverse: inverse$9,
8467
- names: names$a
8487
+ init: init$b,
8488
+ forward: forward$a,
8489
+ inverse: inverse$a,
8490
+ names: names$b
8468
8491
  };
8469
8492
 
8470
8493
  /**
@@ -8476,18 +8499,18 @@
8476
8499
  * Initialize the Van Der Grinten projection
8477
8500
  * @this {import('../defs.js').ProjectionDefinition & LocalThis}
8478
8501
  */
8479
- function init$9() {
8502
+ function init$a() {
8480
8503
  // this.R = 6370997; //Radius of earth
8481
8504
  this.R = this.a;
8482
8505
  }
8483
8506
 
8484
- function forward$8(p) {
8507
+ function forward$9(p) {
8485
8508
  var lon = p.x;
8486
8509
  var lat = p.y;
8487
8510
 
8488
8511
  /* Forward equations
8489
8512
  ----------------- */
8490
- var dlon = adjust_lon(lon - this.long0);
8513
+ var dlon = adjust_lon(lon - this.long0, this.over);
8491
8514
  var x, y;
8492
8515
 
8493
8516
  if (Math.abs(lat) <= EPSLN) {
@@ -8535,7 +8558,7 @@
8535
8558
 
8536
8559
  /* Van Der Grinten inverse equations--mapping x,y to lat/long
8537
8560
  --------------------------------------------------------- */
8538
- function inverse$8(p) {
8561
+ function inverse$9(p) {
8539
8562
  var lon, lat;
8540
8563
  var xx, yy, xys, c1, c2, c3;
8541
8564
  var a1;
@@ -8576,7 +8599,7 @@
8576
8599
  if (Math.abs(xx) < EPSLN) {
8577
8600
  lon = this.long0;
8578
8601
  } else {
8579
- lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx);
8602
+ lon = adjust_lon(this.long0 + Math.PI * (xys - 1 + Math.sqrt(1 + 2 * (xx * xx - yy * yy) + xys * xys)) / 2 / xx, this.over);
8580
8603
  }
8581
8604
 
8582
8605
  p.x = lon;
@@ -8584,12 +8607,12 @@
8584
8607
  return p;
8585
8608
  }
8586
8609
 
8587
- var names$9 = ['Van_der_Grinten_I', 'VanDerGrinten', 'Van_der_Grinten', 'vandg'];
8610
+ var names$a = ['Van_der_Grinten_I', 'VanDerGrinten', 'Van_der_Grinten', 'vandg'];
8588
8611
  var vandg = {
8589
- init: init$9,
8590
- forward: forward$8,
8591
- inverse: inverse$8,
8592
- names: names$9
8612
+ init: init$a,
8613
+ forward: forward$9,
8614
+ inverse: inverse$9,
8615
+ names: names$a
8593
8616
  };
8594
8617
 
8595
8618
  /**
@@ -8726,19 +8749,19 @@
8726
8749
  */
8727
8750
 
8728
8751
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
8729
- function init$8() {
8752
+ function init$9() {
8730
8753
  this.sin_p12 = Math.sin(this.lat0);
8731
8754
  this.cos_p12 = Math.cos(this.lat0);
8732
8755
  // flattening for ellipsoid
8733
8756
  this.f = this.es / (1 + Math.sqrt(1 - this.es));
8734
8757
  }
8735
8758
 
8736
- function forward$7(p) {
8759
+ function forward$8(p) {
8737
8760
  var lon = p.x;
8738
8761
  var lat = p.y;
8739
8762
  var sinphi = Math.sin(p.y);
8740
8763
  var cosphi = Math.cos(p.y);
8741
- var dlon = adjust_lon(lon - this.long0);
8764
+ var dlon = adjust_lon(lon - this.long0, this.over);
8742
8765
  var e0, e1, e2, e3, Mlp, Ml, c, kp, cos_c, vars, azi1;
8743
8766
  if (this.sphere) {
8744
8767
  if (Math.abs(this.sin_p12 - 1) <= EPSLN) {
@@ -8794,7 +8817,7 @@
8794
8817
  }
8795
8818
  }
8796
8819
 
8797
- function inverse$7(p) {
8820
+ function inverse$8(p) {
8798
8821
  p.x -= this.x0;
8799
8822
  p.y -= this.y0;
8800
8823
  var rh, z, sinz, cosz, lon, lat, con, e0, e1, e2, e3, Mlp, M, azi1, s12, vars;
@@ -8816,12 +8839,12 @@
8816
8839
  con = Math.abs(this.lat0) - HALF_PI;
8817
8840
  if (Math.abs(con) <= EPSLN) {
8818
8841
  if (this.lat0 >= 0) {
8819
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
8842
+ lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y), this.over);
8820
8843
  } else {
8821
- lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
8844
+ lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y), this.over);
8822
8845
  }
8823
8846
  } else {
8824
- lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz));
8847
+ lon = adjust_lon(this.long0 + Math.atan2(p.x * sinz, rh * this.cos_p12 * cosz - p.y * this.sin_p12 * sinz), this.over);
8825
8848
  }
8826
8849
  }
8827
8850
 
@@ -8839,7 +8862,7 @@
8839
8862
  rh = Math.sqrt(p.x * p.x + p.y * p.y);
8840
8863
  M = Mlp - rh;
8841
8864
  lat = imlfn(M / this.a, e0, e1, e2, e3);
8842
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y));
8865
+ lon = adjust_lon(this.long0 + Math.atan2(p.x, -1 * p.y), this.over);
8843
8866
  p.x = lon;
8844
8867
  p.y = lat;
8845
8868
  return p;
@@ -8850,7 +8873,7 @@
8850
8873
  M = rh - Mlp;
8851
8874
 
8852
8875
  lat = imlfn(M / this.a, e0, e1, e2, e3);
8853
- lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y));
8876
+ lon = adjust_lon(this.long0 + Math.atan2(p.x, p.y), this.over);
8854
8877
  p.x = lon;
8855
8878
  p.y = lat;
8856
8879
  return p;
@@ -8867,12 +8890,12 @@
8867
8890
  }
8868
8891
  }
8869
8892
 
8870
- var names$8 = ['Azimuthal_Equidistant', 'aeqd'];
8893
+ var names$9 = ['Azimuthal_Equidistant', 'aeqd'];
8871
8894
  var aeqd = {
8872
- init: init$8,
8873
- forward: forward$7,
8874
- inverse: inverse$7,
8875
- names: names$8
8895
+ init: init$9,
8896
+ forward: forward$8,
8897
+ inverse: inverse$8,
8898
+ names: names$9
8876
8899
  };
8877
8900
 
8878
8901
  /**
@@ -8882,7 +8905,7 @@
8882
8905
  */
8883
8906
 
8884
8907
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
8885
- function init$7() {
8908
+ function init$8() {
8886
8909
  // double temp; /* temporary variable */
8887
8910
 
8888
8911
  /* Place parameters in static storage for common use
@@ -8893,7 +8916,7 @@
8893
8916
 
8894
8917
  /* Orthographic forward equations--mapping lat,long to x,y
8895
8918
  --------------------------------------------------- */
8896
- function forward$6(p) {
8919
+ function forward$7(p) {
8897
8920
  var sinphi, cosphi; /* sin and cos value */
8898
8921
  var dlon; /* delta longitude value */
8899
8922
  var coslon; /* cos of longitude */
@@ -8903,7 +8926,7 @@
8903
8926
  var lat = p.y;
8904
8927
  /* Forward equations
8905
8928
  ----------------- */
8906
- dlon = adjust_lon(lon - this.long0);
8929
+ dlon = adjust_lon(lon - this.long0, this.over);
8907
8930
 
8908
8931
  sinphi = Math.sin(lat);
8909
8932
  cosphi = Math.cos(lat);
@@ -8920,7 +8943,7 @@
8920
8943
  return p;
8921
8944
  }
8922
8945
 
8923
- function inverse$6(p) {
8946
+ function inverse$7(p) {
8924
8947
  var rh; /* height above ellipsoid */
8925
8948
  var z; /* angle */
8926
8949
  var sinz, cosz; /* sin of z and cos of z */
@@ -8947,26 +8970,26 @@
8947
8970
  con = Math.abs(this.lat0) - HALF_PI;
8948
8971
  if (Math.abs(con) <= EPSLN) {
8949
8972
  if (this.lat0 >= 0) {
8950
- lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y));
8973
+ lon = adjust_lon(this.long0 + Math.atan2(p.x, -p.y), this.over);
8951
8974
  } else {
8952
- lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y));
8975
+ lon = adjust_lon(this.long0 - Math.atan2(-p.x, p.y), this.over);
8953
8976
  }
8954
8977
  p.x = lon;
8955
8978
  p.y = lat;
8956
8979
  return p;
8957
8980
  }
8958
- lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz));
8981
+ lon = adjust_lon(this.long0 + Math.atan2((p.x * sinz), rh * this.cos_p14 * cosz - p.y * this.sin_p14 * sinz), this.over);
8959
8982
  p.x = lon;
8960
8983
  p.y = lat;
8961
8984
  return p;
8962
8985
  }
8963
8986
 
8964
- var names$7 = ['ortho'];
8987
+ var names$8 = ['ortho'];
8965
8988
  var ortho = {
8966
- init: init$7,
8967
- forward: forward$6,
8968
- inverse: inverse$6,
8969
- names: names$7
8989
+ init: init$8,
8990
+ forward: forward$7,
8991
+ inverse: inverse$7,
8992
+ names: names$8
8970
8993
  };
8971
8994
 
8972
8995
  // QSC projection rewritten from the original PROJ4
@@ -9001,7 +9024,7 @@
9001
9024
  };
9002
9025
 
9003
9026
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
9004
- function init$6() {
9027
+ function init$7() {
9005
9028
  this.x0 = this.x0 || 0;
9006
9029
  this.y0 = this.y0 || 0;
9007
9030
  this.lat0 = this.lat0 || 0;
@@ -9032,7 +9055,7 @@
9032
9055
 
9033
9056
  // QSC forward equations--mapping lat,long to x,y
9034
9057
  // -----------------------------------------------------------------
9035
- function forward$5(p) {
9058
+ function forward$6(p) {
9036
9059
  var xy = { x: 0, y: 0 };
9037
9060
  var lat, lon;
9038
9061
  var theta, phi;
@@ -9155,7 +9178,7 @@
9155
9178
 
9156
9179
  // QSC inverse equations--mapping x,y to lat/long
9157
9180
  // -----------------------------------------------------------------
9158
- function inverse$5(p) {
9181
+ function inverse$6(p) {
9159
9182
  var lp = { lam: 0, phi: 0 };
9160
9183
  var mu, nu, cosmu, tannu;
9161
9184
  var tantheta, theta, cosphi, phi;
@@ -9338,12 +9361,12 @@
9338
9361
  return slon;
9339
9362
  }
9340
9363
 
9341
- var names$6 = ['Quadrilateralized Spherical Cube', 'Quadrilateralized_Spherical_Cube', 'qsc'];
9364
+ var names$7 = ['Quadrilateralized Spherical Cube', 'Quadrilateralized_Spherical_Cube', 'qsc'];
9342
9365
  var qsc = {
9343
- init: init$6,
9344
- forward: forward$5,
9345
- inverse: inverse$5,
9346
- names: names$6
9366
+ init: init$7,
9367
+ forward: forward$6,
9368
+ inverse: inverse$6,
9369
+ names: names$7
9347
9370
  };
9348
9371
 
9349
9372
  // Robinson projection
@@ -9421,7 +9444,7 @@
9421
9444
  return x;
9422
9445
  }
9423
9446
 
9424
- function init$5() {
9447
+ function init$6() {
9425
9448
  this.x0 = this.x0 || 0;
9426
9449
  this.y0 = this.y0 || 0;
9427
9450
  this.long0 = this.long0 || 0;
@@ -9429,8 +9452,8 @@
9429
9452
  this.title = this.title || 'Robinson';
9430
9453
  }
9431
9454
 
9432
- function forward$4(ll) {
9433
- var lon = adjust_lon(ll.x - this.long0);
9455
+ function forward$5(ll) {
9456
+ var lon = adjust_lon(ll.x - this.long0, this.over);
9434
9457
 
9435
9458
  var dphi = Math.abs(ll.y);
9436
9459
  var i = Math.floor(dphi * C1);
@@ -9453,7 +9476,7 @@
9453
9476
  return xy;
9454
9477
  }
9455
9478
 
9456
- function inverse$4(xy) {
9479
+ function inverse$5(xy) {
9457
9480
  var ll = {
9458
9481
  x: (xy.x - this.x0) / (this.a * FXC),
9459
9482
  y: Math.abs(xy.y - this.y0) / (this.a * FYC)
@@ -9494,38 +9517,38 @@
9494
9517
  }
9495
9518
  }
9496
9519
 
9497
- ll.x = adjust_lon(ll.x + this.long0);
9520
+ ll.x = adjust_lon(ll.x + this.long0, this.over);
9498
9521
  return ll;
9499
9522
  }
9500
9523
 
9501
- var names$5 = ['Robinson', 'robin'];
9524
+ var names$6 = ['Robinson', 'robin'];
9502
9525
  var robin = {
9503
- init: init$5,
9504
- forward: forward$4,
9505
- inverse: inverse$4,
9506
- names: names$5
9526
+ init: init$6,
9527
+ forward: forward$5,
9528
+ inverse: inverse$5,
9529
+ names: names$6
9507
9530
  };
9508
9531
 
9509
- function init$4() {
9532
+ function init$5() {
9510
9533
  this.name = 'geocent';
9511
9534
  }
9512
9535
 
9513
- function forward$3(p) {
9536
+ function forward$4(p) {
9514
9537
  var point = geodeticToGeocentric(p, this.es, this.a);
9515
9538
  return point;
9516
9539
  }
9517
9540
 
9518
- function inverse$3(p) {
9541
+ function inverse$4(p) {
9519
9542
  var point = geocentricToGeodetic(p, this.es, this.a, this.b);
9520
9543
  return point;
9521
9544
  }
9522
9545
 
9523
- var names$4 = ['Geocentric', 'geocentric', 'geocent', 'Geocent'];
9546
+ var names$5 = ['Geocentric', 'geocentric', 'geocent', 'Geocent'];
9524
9547
  var geocent = {
9525
- init: init$4,
9526
- forward: forward$3,
9527
- inverse: inverse$3,
9528
- names: names$4
9548
+ init: init$5,
9549
+ forward: forward$4,
9550
+ inverse: inverse$4,
9551
+ names: names$5
9529
9552
  };
9530
9553
 
9531
9554
  /**
@@ -9564,7 +9587,7 @@
9564
9587
  };
9565
9588
 
9566
9589
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
9567
- function init$3() {
9590
+ function init$4() {
9568
9591
  Object.keys(params).forEach(function (p) {
9569
9592
  if (typeof this[p] === 'undefined') {
9570
9593
  this[p] = params[p].def;
@@ -9608,7 +9631,7 @@
9608
9631
  this.sw = Math.sin(omega);
9609
9632
  }
9610
9633
 
9611
- function forward$2(p) {
9634
+ function forward$3(p) {
9612
9635
  p.x -= this.long0;
9613
9636
  var sinphi = Math.sin(p.y);
9614
9637
  var cosphi = Math.cos(p.y);
@@ -9658,7 +9681,7 @@
9658
9681
  return p;
9659
9682
  }
9660
9683
 
9661
- function inverse$2(p) {
9684
+ function inverse$3(p) {
9662
9685
  p.x /= this.a;
9663
9686
  p.y /= this.a;
9664
9687
  var r = { x: p.x, y: p.y };
@@ -9707,12 +9730,12 @@
9707
9730
  return p;
9708
9731
  }
9709
9732
 
9710
- var names$3 = ['Tilted_Perspective', 'tpers'];
9733
+ var names$4 = ['Tilted_Perspective', 'tpers'];
9711
9734
  var tpers = {
9712
- init: init$3,
9713
- forward: forward$2,
9714
- inverse: inverse$2,
9715
- names: names$3
9735
+ init: init$4,
9736
+ forward: forward$3,
9737
+ inverse: inverse$3,
9738
+ names: names$4
9716
9739
  };
9717
9740
 
9718
9741
  /**
@@ -9731,7 +9754,7 @@
9731
9754
  */
9732
9755
 
9733
9756
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
9734
- function init$2() {
9757
+ function init$3() {
9735
9758
  this.flip_axis = (this.sweep === 'x' ? 1 : 0);
9736
9759
  this.h = Number(this.h);
9737
9760
  this.radius_g_1 = this.h / this.a;
@@ -9765,7 +9788,7 @@
9765
9788
  }
9766
9789
  }
9767
9790
 
9768
- function forward$1(p) {
9791
+ function forward$2(p) {
9769
9792
  var lon = p.x;
9770
9793
  var lat = p.y;
9771
9794
  var tmp, v_x, v_y, v_z;
@@ -9813,7 +9836,7 @@
9813
9836
  return p;
9814
9837
  }
9815
9838
 
9816
- function inverse$1(p) {
9839
+ function inverse$2(p) {
9817
9840
  var v_x = -1;
9818
9841
  var v_y = 0.0;
9819
9842
  var v_z = 0.0;
@@ -9880,12 +9903,12 @@
9880
9903
  return p;
9881
9904
  }
9882
9905
 
9883
- var names$2 = ['Geostationary Satellite View', 'Geostationary_Satellite', 'geos'];
9906
+ var names$3 = ['Geostationary Satellite View', 'Geostationary_Satellite', 'geos'];
9884
9907
  var geos = {
9885
- init: init$2,
9886
- forward: forward$1,
9887
- inverse: inverse$1,
9888
- names: names$2
9908
+ init: init$3,
9909
+ forward: forward$2,
9910
+ inverse: inverse$2,
9911
+ names: names$3
9889
9912
  };
9890
9913
 
9891
9914
  /**
@@ -9924,13 +9947,15 @@
9924
9947
  A4 = 0.003796,
9925
9948
  M = Math.sqrt(3) / 2.0;
9926
9949
 
9927
- function init$1() {
9950
+ function init$2() {
9928
9951
  this.es = 0;
9929
9952
  this.long0 = this.long0 !== undefined ? this.long0 : 0;
9953
+ this.x0 = this.x0 !== undefined ? this.x0 : 0;
9954
+ this.y0 = this.y0 !== undefined ? this.y0 : 0;
9930
9955
  }
9931
9956
 
9932
- function forward(p) {
9933
- var lam = adjust_lon(p.x - this.long0);
9957
+ function forward$1(p) {
9958
+ var lam = adjust_lon(p.x - this.long0, this.over);
9934
9959
  var phi = p.y;
9935
9960
  var paramLat = Math.asin(M * Math.sin(phi)),
9936
9961
  paramLatSq = paramLat * paramLat,
@@ -9944,7 +9969,7 @@
9944
9969
  return p;
9945
9970
  }
9946
9971
 
9947
- function inverse(p) {
9972
+ function inverse$1(p) {
9948
9973
  p.x = (p.x - this.x0) / this.a;
9949
9974
  p.y = (p.y - this.y0) / this.a;
9950
9975
 
@@ -9969,16 +9994,16 @@
9969
9994
  / Math.cos(paramLat);
9970
9995
  p.y = Math.asin(Math.sin(paramLat) / M);
9971
9996
 
9972
- p.x = adjust_lon(p.x + this.long0);
9997
+ p.x = adjust_lon(p.x + this.long0, this.over);
9973
9998
  return p;
9974
9999
  }
9975
10000
 
9976
- var names$1 = ['eqearth', 'Equal Earth', 'Equal_Earth'];
10001
+ var names$2 = ['eqearth', 'Equal Earth', 'Equal_Earth'];
9977
10002
  var eqearth = {
9978
- init: init$1,
9979
- forward: forward,
9980
- inverse: inverse,
9981
- names: names$1
10003
+ init: init$2,
10004
+ forward: forward$1,
10005
+ inverse: inverse$1,
10006
+ names: names$2
9982
10007
  };
9983
10008
 
9984
10009
  /**
@@ -9994,7 +10019,7 @@
9994
10019
  var EPS10 = 1e-10;
9995
10020
 
9996
10021
  /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
9997
- function init() {
10022
+ function init$1() {
9998
10023
  var c;
9999
10024
 
10000
10025
  this.phi1 = this.lat1;
@@ -10020,7 +10045,7 @@
10020
10045
  }
10021
10046
 
10022
10047
  function e_fwd(p) {
10023
- var lam = adjust_lon(p.x - (this.long0 || 0));
10048
+ var lam = adjust_lon(p.x - (this.long0 || 0), this.over);
10024
10049
  var phi = p.y;
10025
10050
  var rh, E, c;
10026
10051
  rh = this.am1 + this.m1 - pj_mlfn(phi, E = Math.sin(phi), c = Math.cos(phi), this.en);
@@ -10048,13 +10073,13 @@
10048
10073
  } else {
10049
10074
  throw new Error();
10050
10075
  }
10051
- p.x = adjust_lon(lam + (this.long0 || 0));
10076
+ p.x = adjust_lon(lam + (this.long0 || 0), this.over);
10052
10077
  p.y = adjust_lat(phi);
10053
10078
  return p;
10054
10079
  }
10055
10080
 
10056
10081
  function s_fwd(p) {
10057
- var lam = adjust_lon(p.x - (this.long0 || 0));
10082
+ var lam = adjust_lon(p.x - (this.long0 || 0), this.over);
10058
10083
  var phi = p.y;
10059
10084
  var E, rh;
10060
10085
  rh = this.cphi1 + this.phi1 - phi;
@@ -10085,14 +10110,358 @@
10085
10110
  } else {
10086
10111
  lam = rh * Math.atan2(p.x, p.y) / Math.cos(phi);
10087
10112
  }
10088
- p.x = adjust_lon(lam + (this.long0 || 0));
10113
+ p.x = adjust_lon(lam + (this.long0 || 0), this.over);
10089
10114
  p.y = adjust_lat(phi);
10090
10115
  return p;
10091
10116
  }
10092
10117
 
10093
- var names = ['bonne', 'Bonne (Werner lat_1=90)'];
10118
+ var names$1 = ['bonne', 'Bonne (Werner lat_1=90)'];
10094
10119
  var bonne = {
10120
+ init: init$1,
10121
+ names: names$1
10122
+ };
10123
+
10124
+ /**
10125
+ Original projection implementation:
10126
+ https://github.com/OSGeo/PROJ/blob/46c47e9adf6376ae06afabe5d24a0016a05ced82/src/projections/ob_tran.cpp
10127
+
10128
+ Documentation:
10129
+ https://proj.org/operations/projections/ob_tran.html
10130
+
10131
+ References/Formulas:
10132
+ https://pubs.usgs.gov/pp/1395/report.pdf
10133
+
10134
+ Examples:
10135
+ +proj=ob_tran +o_proj=moll +o_lat_p=45 +o_lon_p=-90
10136
+ +proj=ob_tran +o_proj=moll +o_lat_p=45 +o_lon_p=-90 +lon_0=60
10137
+ +proj=ob_tran +o_proj=moll +o_lat_p=45 +o_lon_p=-90 +lon_0=-90
10138
+ */
10139
+
10140
+ const projectionType = {
10141
+ OBLIQUE: {
10142
+ forward: forwardOblique,
10143
+ inverse: inverseOblique
10144
+ },
10145
+ TRANSVERSE: {
10146
+ forward: forwardTransverse,
10147
+ inverse: inverseTransverse
10148
+ }
10149
+ };
10150
+
10151
+ /**
10152
+ * @typedef {Object} LocalThis
10153
+ * @property {number} lamp
10154
+ * @property {number} cphip
10155
+ * @property {number} sphip
10156
+ * @property {Object} projectionType
10157
+ * @property {string | undefined} o_proj
10158
+ * @property {string | undefined} o_lon_p
10159
+ * @property {string | undefined} o_lat_p
10160
+ * @property {string | undefined} o_alpha
10161
+ * @property {string | undefined} o_lon_c
10162
+ * @property {string | undefined} o_lat_c
10163
+ * @property {string | undefined} o_lon_1
10164
+ * @property {string | undefined} o_lat_1
10165
+ * @property {string | undefined} o_lon_2
10166
+ * @property {string | undefined} o_lat_2
10167
+ * @property {number | undefined} oLongP
10168
+ * @property {number | undefined} oLatP
10169
+ * @property {number | undefined} oAlpha
10170
+ * @property {number | undefined} oLongC
10171
+ * @property {number | undefined} oLatC
10172
+ * @property {number | undefined} oLong1
10173
+ * @property {number | undefined} oLat1
10174
+ * @property {number | undefined} oLong2
10175
+ * @property {number | undefined} oLat2
10176
+ * @property {import('..').Converter} obliqueProjection
10177
+ *
10178
+ */
10179
+
10180
+ /**
10181
+ * Parameters can be from the following sets:
10182
+ * New pole --> o_lat_p, o_lon_p
10183
+ * Rotate about point --> o_alpha, o_lon_c, o_lat_c
10184
+ * New equator points --> lon_1, lat_1, lon_2, lat_2
10185
+ *
10186
+ * Per the original source code, the parameter sets are
10187
+ * checked in the order of the object below.
10188
+ */
10189
+ const paramSets = {
10190
+ ROTATE: {
10191
+ o_alpha: 'oAlpha',
10192
+ o_lon_c: 'oLongC',
10193
+ o_lat_c: 'oLatC'
10194
+ },
10195
+ NEW_POLE: {
10196
+ o_lat_p: 'oLatP',
10197
+ o_lon_p: 'oLongP'
10198
+ },
10199
+ NEW_EQUATOR: {
10200
+ o_lon_1: 'oLong1',
10201
+ o_lat_1: 'oLat1',
10202
+ o_lon_2: 'oLong2',
10203
+ o_lat_2: 'oLat2'
10204
+ }
10205
+ };
10206
+
10207
+ /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
10208
+ function init() {
10209
+ this.x0 = this.x0 || 0;
10210
+ this.y0 = this.y0 || 0;
10211
+ this.long0 = this.long0 || 0;
10212
+ this.title = this.title || 'General Oblique Transformation';
10213
+
10214
+ /** Verify required parameters exist */
10215
+ if (!this.o_proj) {
10216
+ throw new Error('Missing parameter: o_proj');
10217
+ }
10218
+
10219
+ if (this.o_proj === `ob_tran`) {
10220
+ throw new Error('Invalid value for o_proj: ' + this.o_proj);
10221
+ }
10222
+
10223
+ const newProjStr = this.projStr.replace('+proj=ob_tran', '').replace('+o_proj=', '+proj=').trim();
10224
+
10225
+ /** @type {import('../defs.js').ProjectionDefinition} */
10226
+ const oProj = Projection(newProjStr);
10227
+ if (!oProj) {
10228
+ throw new Error('Invalid parameter: o_proj. Unknown projection ' + this.o_proj);
10229
+ }
10230
+ oProj.long0 = 0; // we handle long0 before/after forward/inverse
10231
+ this.obliqueProjection = oProj;
10232
+
10233
+ let matchedSet;
10234
+ const paramSetsKeys = Object.keys(paramSets);
10235
+
10236
+ /**
10237
+ * parse strings, convert to radians, throw on NaN
10238
+ * @param {string} name
10239
+ * @returns {number | undefined}
10240
+ */
10241
+ const parseParam = (name) => {
10242
+ if (typeof this[name] === `undefined`) {
10243
+ return undefined;
10244
+ }
10245
+ const val = parseFloat(this[name]) * D2R$1;
10246
+ if (isNaN(val)) {
10247
+ throw new Error('Invalid value for ' + name + ': ' + this[name]);
10248
+ }
10249
+ return val;
10250
+ };
10251
+
10252
+ for (let i = 0; i < paramSetsKeys.length; i++) {
10253
+ const setKey = paramSetsKeys[i];
10254
+ const set = paramSets[setKey];
10255
+ const params = Object.entries(set);
10256
+ const setHasParams = params.some(
10257
+ ([p]) => typeof this[p] !== 'undefined'
10258
+ );
10259
+ if (!setHasParams) {
10260
+ continue;
10261
+ }
10262
+ matchedSet = set;
10263
+ for (let ii = 0; ii < params.length; ii++) {
10264
+ const [inputParam, param] = params[ii];
10265
+ const val = parseParam(inputParam);
10266
+ if (typeof val === 'undefined') {
10267
+ throw new Error('Missing parameter: ' + inputParam + '.');
10268
+ }
10269
+ this[param] = val;
10270
+ }
10271
+ break;
10272
+ }
10273
+
10274
+ if (!matchedSet) {
10275
+ throw new Error('No valid parameters provided for ob_tran projection.');
10276
+ }
10277
+
10278
+ const { lamp, phip } = createRotation(this, matchedSet);
10279
+ this.lamp = lamp;
10280
+
10281
+ if (Math.abs(phip) > EPSLN) {
10282
+ this.cphip = Math.cos(phip);
10283
+ this.sphip = Math.sin(phip);
10284
+ this.projectionType = projectionType.OBLIQUE;
10285
+ } else {
10286
+ this.projectionType = projectionType.TRANSVERSE;
10287
+ }
10288
+ }
10289
+
10290
+ // ob_tran forward equations--mapping (lat,long) to (x,y)
10291
+ // transverse (90 degrees from normal orientation) - forwardTransverse
10292
+ // or oblique (arbitrary angle) used based on parameters - forwardOblique
10293
+ // -----------------------------------------------------------------
10294
+ /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
10295
+ function forward(p) {
10296
+ return this.projectionType.forward(this, p);
10297
+ }
10298
+
10299
+ // inverse equations--mapping (x,y) to (lat,long)
10300
+ // transverse: inverseTransverse
10301
+ // oblique: inverseOblique
10302
+ // -----------------------------------------------------------------
10303
+ /** @this {import('../defs.js').ProjectionDefinition & LocalThis} */
10304
+ function inverse(p) {
10305
+ return this.projectionType.inverse(this, p);
10306
+ }
10307
+
10308
+ /**
10309
+ * @param {import('../defs.js').ProjectionDefinition & LocalThis} params - Initialized projection definition
10310
+ * @param {Object} how - Transformation method
10311
+ * @returns {{phip: number, lamp: number}}
10312
+ */
10313
+ function createRotation(params, how) {
10314
+ let phip, lamp;
10315
+ if (how === paramSets.ROTATE) {
10316
+ let lamc = params.oLongC;
10317
+ let phic = params.oLatC;
10318
+ let alpha = params.oAlpha;
10319
+ if (Math.abs(Math.abs(phic) - HALF_PI) <= EPSLN) {
10320
+ throw new Error('Invalid value for o_lat_c: ' + params.o_lat_c + ' should be < 90°');
10321
+ }
10322
+ lamp = lamc + Math.atan2(-1 * Math.cos(alpha), -1 * Math.sin(alpha) * Math.sin(phic));
10323
+ phip = Math.asin(Math.cos(phic) * Math.sin(alpha));
10324
+ } else if (how === paramSets.NEW_POLE) {
10325
+ lamp = params.oLongP;
10326
+ phip = params.oLatP;
10327
+ } else {
10328
+ let lam1 = params.oLong1;
10329
+ let phi1 = params.oLat1;
10330
+ let lam2 = params.oLong2;
10331
+ let phi2 = params.oLat2;
10332
+ let con = Math.abs(phi1);
10333
+
10334
+ if (Math.abs(phi1) > HALF_PI - EPSLN) {
10335
+ throw new Error('Invalid value for o_lat_1: ' + params.o_lat_1 + ' should be < 90°');
10336
+ }
10337
+
10338
+ if (Math.abs(phi2) > HALF_PI - EPSLN) {
10339
+ throw new Error('Invalid value for o_lat_2: ' + params.o_lat_2 + ' should be < 90°');
10340
+ }
10341
+
10342
+ if (Math.abs(phi1 - phi2) < EPSLN) {
10343
+ throw new Error('Invalid value for o_lat_1 and o_lat_2: o_lat_1 should be different from o_lat_2');
10344
+ }
10345
+ if (con < EPSLN) {
10346
+ throw new Error('Invalid value for o_lat_1: o_lat_1 should be different from zero');
10347
+ }
10348
+
10349
+ lamp = Math.atan2(
10350
+ (Math.cos(phi1) * Math.sin(phi2) * Math.cos(lam1))
10351
+ - (Math.sin(phi1) * Math.cos(phi2) * Math.cos(lam2)),
10352
+ (Math.sin(phi1) * Math.cos(phi2) * Math.sin(lam2))
10353
+ - (Math.cos(phi1) * Math.sin(phi2) * Math.sin(lam1))
10354
+ );
10355
+
10356
+ phip = Math.atan(-1 * Math.cos(lamp - lam1) / Math.tan(phi1));
10357
+ }
10358
+
10359
+ return { lamp, phip };
10360
+ }
10361
+
10362
+ /**
10363
+ * Forward (lng, lat) to (x, y) for oblique case
10364
+ * @param {import('../defs.js').ProjectionDefinition & LocalThis} self
10365
+ * @param {{x: number, y: number}} lp - lambda, phi
10366
+ */
10367
+ function forwardOblique(self, lp) {
10368
+ let { x: lam, y: phi } = lp;
10369
+ lam += self.long0;
10370
+ const coslam = Math.cos(lam);
10371
+ const sinphi = Math.sin(phi);
10372
+ const cosphi = Math.cos(phi);
10373
+
10374
+ lp.x = adjust_lon(
10375
+ Math.atan2(
10376
+ cosphi * Math.sin(lam),
10377
+ (self.sphip * cosphi * coslam) + (self.cphip * sinphi)
10378
+ ) + self.lamp
10379
+ );
10380
+ lp.y = Math.asin(
10381
+ (self.sphip * sinphi) - (self.cphip * cosphi * coslam)
10382
+ );
10383
+
10384
+ return self.obliqueProjection.forward(lp);
10385
+ }
10386
+
10387
+ /**
10388
+ * Forward (lng, lat) to (x, y) for transverse case
10389
+ * @param {import('../defs.js').ProjectionDefinition & LocalThis} self
10390
+ * @param {{x: number, y: number}} lp - lambda, phi
10391
+ */
10392
+ function forwardTransverse(self, lp) {
10393
+ let { x: lam, y: phi } = lp;
10394
+ lam += self.long0;
10395
+ const cosphi = Math.cos(phi);
10396
+ const coslam = Math.cos(lam);
10397
+ lp.x = adjust_lon(
10398
+ Math.atan2(
10399
+ cosphi * Math.sin(lam),
10400
+ Math.sin(phi)
10401
+ ) + self.lamp
10402
+ );
10403
+ lp.y = Math.asin(-1 * cosphi * coslam);
10404
+
10405
+ return self.obliqueProjection.forward(lp);
10406
+ }
10407
+
10408
+ /**
10409
+ * Inverse (x, y) to (lng, lat) for oblique case
10410
+ * @param {import('../defs.js').ProjectionDefinition & LocalThis} self
10411
+ * @param {{x: number, y: number}} lp - lambda, phi
10412
+ */
10413
+ function inverseOblique(self, lp) {
10414
+ const innerLp = self.obliqueProjection.inverse(lp);
10415
+ let { x: lam, y: phi } = innerLp;
10416
+
10417
+ if (lam < Number.MAX_VALUE) {
10418
+ lam -= self.lamp;
10419
+ const coslam = Math.cos(lam);
10420
+ const sinphi = Math.sin(phi);
10421
+ const cosphi = Math.cos(phi);
10422
+ lp.x = Math.atan2(
10423
+ cosphi * Math.sin(lam),
10424
+ (self.sphip * cosphi * coslam) - (self.cphip * sinphi)
10425
+ );
10426
+ lp.y = Math.asin(
10427
+ (self.sphip * sinphi) + (self.cphip * cosphi * coslam)
10428
+ );
10429
+ }
10430
+
10431
+ lp.x = adjust_lon(lp.x + self.long0);
10432
+ return lp;
10433
+ }
10434
+
10435
+ /**
10436
+ * Inverse (x, y) to (lng, lat) for transverse case
10437
+ * @param {import('../defs.js').ProjectionDefinition & LocalThis} self
10438
+ * @param {{x: number, y: number}} lp - lambda, phi
10439
+ */
10440
+ function inverseTransverse(self, lp) {
10441
+ const innerLp = self.obliqueProjection.inverse(lp);
10442
+ let { x: lam, y: phi } = innerLp;
10443
+
10444
+ if (lam < Number.MAX_VALUE) {
10445
+ const cosphi = Math.cos(phi);
10446
+ lam -= self.lamp;
10447
+ lp.x = Math.atan2(
10448
+ cosphi * Math.sin(lam),
10449
+ -1 * Math.sin(phi)
10450
+ );
10451
+ lp.y = Math.asin(
10452
+ cosphi * Math.cos(lam)
10453
+ );
10454
+ }
10455
+
10456
+ lp.x = adjust_lon(lp.x + self.long0);
10457
+ return lp;
10458
+ }
10459
+
10460
+ var names = ['General Oblique Transformation', 'General_Oblique_Transformation', 'ob_tran'];
10461
+ var ob_tran = {
10095
10462
  init: init,
10463
+ forward: forward,
10464
+ inverse: inverse,
10096
10465
  names: names
10097
10466
  };
10098
10467
 
@@ -10128,6 +10497,7 @@
10128
10497
  proj4.Proj.projections.add(geos);
10129
10498
  proj4.Proj.projections.add(eqearth);
10130
10499
  proj4.Proj.projections.add(bonne);
10500
+ proj4.Proj.projections.add(ob_tran);
10131
10501
  }
10132
10502
 
10133
10503
  /**
@@ -10159,7 +10529,7 @@
10159
10529
  nadgrid,
10160
10530
  transform,
10161
10531
  mgrs,
10162
- version: '2.19.10'
10532
+ version: '2.20.1-alpha'
10163
10533
  });
10164
10534
  includedProjections(proj4);
10165
10535