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