d3-geo-projection 2.7.0 → 2.9.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/README.md +4 -5
- package/bin/geograticule +1 -2
- package/dist/d3-geo-projection.js +126 -88
- package/dist/d3-geo-projection.min.js +2 -2
- package/package.json +3 -2
- package/src/airy.js +4 -4
- package/src/aitoff.js +1 -1
- package/src/armadillo.js +2 -1
- package/src/august.js +1 -1
- package/src/baker.js +1 -1
- package/src/berghaus.js +1 -1
- package/src/bertin.js +11 -10
- package/src/boggs.js +2 -2
- package/src/bonne.js +3 -3
- package/src/bottomley.js +1 -1
- package/src/bromley.js +2 -2
- package/src/chamberlin.js +5 -2
- package/src/collignon.js +1 -1
- package/src/craig.js +2 -2
- package/src/craster.js +1 -1
- package/src/cylindricalEqualArea.js +2 -2
- package/src/cylindricalStereographic.js +2 -2
- package/src/eckert1.js +1 -1
- package/src/eckert2.js +1 -1
- package/src/eckert3.js +1 -1
- package/src/eckert4.js +1 -1
- package/src/eckert5.js +1 -1
- package/src/eckert6.js +1 -1
- package/src/eisenlohr.js +2 -2
- package/src/elliptic.js +1 -1
- package/src/fahey.js +1 -1
- package/src/foucaut.js +1 -1
- package/src/foucautSinusoidal.js +2 -2
- package/src/gilbert.js +1 -1
- package/src/gingery.js +1 -1
- package/src/ginzburg4.js +1 -1
- package/src/ginzburg5.js +1 -1
- package/src/ginzburg6.js +2 -2
- package/src/ginzburg8.js +1 -1
- package/src/ginzburg9.js +1 -1
- package/src/ginzburgPolyconic.js +1 -1
- package/src/gringorten.js +2 -2
- package/src/guyou.js +3 -3
- package/src/hammer.js +1 -1
- package/src/hammerRetroazimuthal.js +1 -1
- package/src/healpix.js +5 -4
- package/src/hill.js +1 -1
- package/src/homolosine.js +4 -4
- package/src/hyperelliptical.js +2 -2
- package/src/index.js +1 -2
- package/src/interrupted/boggs.js +2 -2
- package/src/interrupted/homolosine.js +2 -2
- package/src/interrupted/index.js +16 -13
- package/src/interrupted/mollweide.js +2 -2
- package/src/interrupted/mollweideHemispheres.js +2 -2
- package/src/interrupted/quarticAuthalic.js +2 -2
- package/src/interrupted/sinuMollweide.js +4 -3
- package/src/interrupted/sinusoidal.js +2 -2
- package/src/kavrayskiy7.js +1 -1
- package/src/lagrange.js +1 -1
- package/src/larrivee.js +2 -2
- package/src/laskowski.js +1 -1
- package/src/littrow.js +1 -1
- package/src/loximuthal.js +2 -2
- package/src/miller.js +1 -1
- package/src/modifiedStereographic.js +4 -3
- package/src/mollweide.js +1 -1
- package/src/mtFlatPolarParabolic.js +1 -1
- package/src/mtFlatPolarQuartic.js +1 -1
- package/src/mtFlatPolarSinusoidal.js +1 -1
- package/src/naturalEarth2.js +1 -1
- package/src/nellHammer.js +1 -1
- package/src/newton.js +50 -2
- package/src/nicolosi.js +1 -1
- package/src/parallel1.js +1 -1
- package/src/patterson.js +1 -1
- package/src/polyconic.js +2 -2
- package/src/polyhedral/butterfly.js +3 -3
- package/src/polyhedral/collignon.js +4 -4
- package/src/polyhedral/cube.js +1 -1
- package/src/polyhedral/index.js +2 -2
- package/src/polyhedral/matrix.js +1 -1
- package/src/polyhedral/waterman.js +3 -3
- package/src/project/index.js +3 -3
- package/src/quincuncial/gringorten.js +2 -2
- package/src/quincuncial/index.js +1 -1
- package/src/quincuncial/peirce.js +2 -2
- package/src/rectangularPolyconic.js +2 -2
- package/src/robinson.js +1 -1
- package/src/satellite.js +1 -1
- package/src/sinuMollweide.js +2 -2
- package/src/sinusoidal.js +1 -1
- package/src/square.js +1 -1
- package/src/times.js +1 -1
- package/src/twoPoint.js +1 -1
- package/src/twoPointAzimuthal.js +2 -2
- package/src/twoPointEquidistant.js +2 -2
- package/src/vanDerGrinten.js +1 -1
- package/src/vanDerGrinten2.js +1 -1
- package/src/vanDerGrinten3.js +1 -1
- package/src/vanDerGrinten4.js +1 -1
- package/src/wagner.js +12 -3
- package/src/wagner4.js +2 -2
- package/src/wagner6.js +1 -1
- package/src/wagner7.js +1 -1
- package/src/wiechel.js +1 -1
- package/src/winkel3.js +2 -2
package/README.md
CHANGED
|
@@ -543,13 +543,13 @@ A [modified stereographic](#geoModifiedStereographic) projection for the conterm
|
|
|
543
543
|
|
|
544
544
|
A [modified stereographic](#geoModifiedStereographic) projection for the United States including Alaska and Hawaii. Typically clipped to the geographic extent [[-180°, 15°], [-50°, 75°]].
|
|
545
545
|
|
|
546
|
-
<a href="#geoModifiedStereographicMiller" name="geoModifiedStereographicMiller">#</a> d3.<b>geoModifiedStereographicMiller</b>() · [Source](https://github.com/d3/d3-geo-projection/blob/master/src/modifiedStereographic.js)
|
|
546
|
+
<a href="#geoModifiedStereographicMiller" name="geoModifiedStereographicMiller">#</a> d3.<b>geoModifiedStereographicMiller</b>() · [Source](https://github.com/d3/d3-geo-projection/blob/master/src/modifiedStereographic.js), [Examples](https://observablehq.com/@d3/miller-oblated-stereographic)
|
|
547
547
|
|
|
548
548
|
[<img src="https://raw.githubusercontent.com/d3/d3-geo-projection/master/img/modifiedStereographicMiller.png" width="480" height="250">](https://www.jasondavies.com/maps/modified-stereographic/miller/)
|
|
549
549
|
|
|
550
550
|
A [modified stereographic](#geoModifiedStereographic) projection for Europe and Africa. Typically clipped to the geographic extent [[-40°, -40°], [80°, 80°]].
|
|
551
551
|
|
|
552
|
-
<a href="#geoModifiedStereographicLee" name="geoModifiedStereographicLee">#</a> d3.<b>geoModifiedStereographicLee</b>() · [Source](https://github.com/d3/d3-geo-projection/blob/master/src/modifiedStereographic.js)
|
|
552
|
+
<a href="#geoModifiedStereographicLee" name="geoModifiedStereographicLee">#</a> d3.<b>geoModifiedStereographicLee</b>() · [Source](https://github.com/d3/d3-geo-projection/blob/master/src/modifiedStereographic.js), [Examples](https://observablehq.com/@d3/lee-oblated-stereographic)
|
|
553
553
|
|
|
554
554
|
[<img src="https://raw.githubusercontent.com/d3/d3-geo-projection/master/img/modifiedStereographicLee.png" width="480" height="250">](https://www.jasondavies.com/maps/modified-stereographic/lee/)
|
|
555
555
|
|
|
@@ -663,7 +663,7 @@ Defaults to 0°.
|
|
|
663
663
|
|
|
664
664
|
<a href="#satellite_distance" name="satellite_distance">#</a> <i>satellite</i>.<b>distance</b>([<i>distance</i>])
|
|
665
665
|
|
|
666
|
-
Distance from the center of the sphere to the point of view, as a proportion of the sphere’s radius; defaults to 2.0. The recommended maximum [clip angle](https://github.com/d3/d3-geo/blob/master/README.md#projection_clipAngle) for a given *distance* is acos(1 / *distance*) converted to degrees. If [tilt](#satellite_tilt) is also applied, then more conservative clipping may be necessary. For exact clipping, the in-development geographic projection pipeline is needed; see the [satellite
|
|
666
|
+
Distance from the center of the sphere to the point of view, as a proportion of the sphere’s radius; defaults to 2.0. The recommended maximum [clip angle](https://github.com/d3/d3-geo/blob/master/README.md#projection_clipAngle) for a given *distance* is acos(1 / *distance*) converted to degrees. If [tilt](#satellite_tilt) is also applied, then more conservative clipping may be necessary. For exact clipping, the in-development geographic projection pipeline is needed; see the [satellite explorer](https://observablehq.com/@d3/satellite-explorer).
|
|
667
667
|
|
|
668
668
|
<a href="#geoSinusoidal" name="geoSinusoidal">#</a> d3.<b>geoSinusoidal</b>() · [Source](https://github.com/d3/d3-geo-projection/blob/master/src/sinusoidal.js), [Examples](https://observablehq.com/@d3/sinusoidal)
|
|
669
669
|
<br><a href="#geoSinusoidalRaw" name="geoSinusoidalRaw">#</a> d3.<b>geoSinusoidalRaw</b>
|
|
@@ -788,7 +788,6 @@ The Wagner IV projection, also known as Putniṇš P2´.
|
|
|
788
788
|
The Wagner VI projection.
|
|
789
789
|
|
|
790
790
|
<a href="#geoWagner7" name="geoWagner7">#</a> d3.<b>geoWagner7</b>() · [Source](https://github.com/d3/d3-geo-projection/blob/master/src/wagner7.js), [Examples](ttps://observablehq.com/@d3/wagner-vii)
|
|
791
|
-
<br><a href="#geoWagner7Raw" name="geoWagner7Raw">#</a> d3.<b>geoWagner7Raw</b>
|
|
792
791
|
|
|
793
792
|
[<img src="https://raw.githubusercontent.com/d3/d3-geo-projection/master/img/wagner7.png" width="480" height="250">](https://observablehq.com/@d3/wagner-vii)
|
|
794
793
|
|
|
@@ -839,7 +838,7 @@ If *lobes* is specified, sets the new array of hemilobes and returns this projec
|
|
|
839
838
|
|
|
840
839
|
[<img src="https://raw.githubusercontent.com/d3/d3-geo-projection/master/img/interruptedHomolosine.png" width="480" height="250">](https://observablehq.com/@d3/interrupted-goode-homolosine)
|
|
841
840
|
|
|
842
|
-
Goode’s interrupted [homolosine projection](#geoHomolosine). Its [ocean-centric aspect](https://
|
|
841
|
+
Goode’s interrupted [homolosine projection](#geoHomolosine). Its [ocean-centric aspect](https://observablehq.com/@d3/interrupted-homolosine-oceans) is also well-known.
|
|
843
842
|
|
|
844
843
|
<a href="#geoInterruptedSinusoidal" name="geoInterruptedSinusoidal">#</a> d3.<b>geoInterruptedSinusoidal</b>() · [Source](https://github.com/d3/d3-geo-projection/blob/master/src/interrupted/sinusoidal.js), [Examples](https://observablehq.com/@d3/interrupted-sinusoidal)
|
|
845
844
|
|
package/bin/geograticule
CHANGED
|
@@ -15,7 +15,7 @@ commander
|
|
|
15
15
|
.option("--step <value>", "the major and minor step", parseStep)
|
|
16
16
|
.option("--step-minor <value>", "the minor step; defaults to " + graticule.stepMinor(), parseStep)
|
|
17
17
|
.option("--step-major <value>", "the major step; defaults to " + graticule.stepMajor(), parseStep)
|
|
18
|
-
.option("--precision <value>", "the precision; defaults to " + graticule.precision(), graticule.precision
|
|
18
|
+
.option("--precision <value>", "the precision; defaults to " + graticule.precision(), graticule.precision)
|
|
19
19
|
.parse(process.argv);
|
|
20
20
|
|
|
21
21
|
if (commander.args.length !== 0) {
|
|
@@ -37,7 +37,6 @@ if (commander.extentMinor != null) graticule.extentMinor(commander.extentMinor);
|
|
|
37
37
|
if (commander.extentMajor != null) graticule.extentMajor(commander.extentMajor);
|
|
38
38
|
if (commander.stepMinor != null) graticule.stepMinor(commander.stepMinor);
|
|
39
39
|
if (commander.stepMajor != null) graticule.stepMajor(commander.stepMajor);
|
|
40
|
-
if (commander.precision != null) graticule.precision(commander.precision);
|
|
41
40
|
|
|
42
41
|
var writer = write(commander.out);
|
|
43
42
|
writer.write(JSON.stringify(graticule()) + "\n");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// https://d3js.org/d3-geo-projection/ v2.
|
|
1
|
+
// https://d3js.org/d3-geo-projection/ v2.9.0 Copyright 2020 Mike Bostock
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-geo'), require('d3-array')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'd3-geo', 'd3-array'], factory) :
|
|
@@ -91,9 +91,9 @@ function airyRaw(beta) {
|
|
|
91
91
|
var z_2 = z / 2,
|
|
92
92
|
cosz_2 = cos(z_2),
|
|
93
93
|
sinz_2 = sin(z_2),
|
|
94
|
-
tanz_2 =
|
|
95
|
-
lnsecz_2 = log(
|
|
96
|
-
z -= delta = (2 / tanz_2 * lnsecz_2 - b * tanz_2 - r) / (-lnsecz_2 / (sinz_2 * sinz_2) + 1 - b / (2 * cosz_2 * cosz_2));
|
|
94
|
+
tanz_2 = sinz_2 / cosz_2,
|
|
95
|
+
lnsecz_2 = -log(abs(cosz_2));
|
|
96
|
+
z -= delta = (2 / tanz_2 * lnsecz_2 - b * tanz_2 - r) / (-lnsecz_2 / (sinz_2 * sinz_2) + 1 - b / (2 * cosz_2 * cosz_2)) * (cosz_2 < 0 ? 0.7 : 1);
|
|
97
97
|
} while (abs(delta) > epsilon && --i > 0);
|
|
98
98
|
var sinz = sin(z);
|
|
99
99
|
return [atan2(x * sinz, r * cos(z)), asin(y * sinz / r)];
|
|
@@ -194,6 +194,7 @@ function armadilloRaw(phi0) {
|
|
|
194
194
|
denominator = dxdPhi * dydLambda - dydPhi * dxdLambda,
|
|
195
195
|
dLambda = (fy * dxdPhi - fx * dydPhi) / denominator / 2,
|
|
196
196
|
dPhi = (fx * dydLambda - fy * dxdLambda) / denominator;
|
|
197
|
+
if (abs(dPhi) > 2) dPhi /= 2;
|
|
197
198
|
lambda -= dLambda, phi -= dPhi;
|
|
198
199
|
} while ((abs(dLambda) > epsilon || abs(dPhi) > epsilon) && --i > 0);
|
|
199
200
|
return sPhi0 * phi > -atan2(cos(lambda), tanPhi0) - 1e-3 ? [lambda * 2, phi] : null;
|
|
@@ -425,13 +426,76 @@ function hammer() {
|
|
|
425
426
|
.scale(169.529);
|
|
426
427
|
}
|
|
427
428
|
|
|
429
|
+
// Approximate Newton-Raphson
|
|
430
|
+
// Solve f(x) = y, start from x
|
|
431
|
+
function solve(f, y, x) {
|
|
432
|
+
var steps = 100, delta, f0, f1;
|
|
433
|
+
x = x === undefined ? 0 : +x;
|
|
434
|
+
y = +y;
|
|
435
|
+
do {
|
|
436
|
+
f0 = f(x);
|
|
437
|
+
f1 = f(x + epsilon);
|
|
438
|
+
if (f0 === f1) f1 = f0 + epsilon;
|
|
439
|
+
x -= delta = (-1 * epsilon * (f0 - y)) / (f0 - f1);
|
|
440
|
+
} while (steps-- > 0 && abs(delta) > epsilon);
|
|
441
|
+
return steps < 0 ? NaN : x;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
// Approximate Newton-Raphson in 2D
|
|
445
|
+
// Solve f(a,b) = [x,y]
|
|
446
|
+
function solve2d(f, MAX_ITERATIONS, eps) {
|
|
447
|
+
if (MAX_ITERATIONS === undefined) MAX_ITERATIONS = 40;
|
|
448
|
+
if (eps === undefined) eps = epsilon2;
|
|
449
|
+
return function(x, y, a, b) {
|
|
450
|
+
var err2, da, db;
|
|
451
|
+
a = a === undefined ? 0 : +a;
|
|
452
|
+
b = b === undefined ? 0 : +b;
|
|
453
|
+
for (var i = 0; i < MAX_ITERATIONS; i++) {
|
|
454
|
+
var p = f(a, b),
|
|
455
|
+
// diffs
|
|
456
|
+
tx = p[0] - x,
|
|
457
|
+
ty = p[1] - y;
|
|
458
|
+
if (abs(tx) < eps && abs(ty) < eps) break; // we're there!
|
|
459
|
+
|
|
460
|
+
// backtrack if we overshot
|
|
461
|
+
var h = tx * tx + ty * ty;
|
|
462
|
+
if (h > err2) {
|
|
463
|
+
a -= da /= 2;
|
|
464
|
+
b -= db /= 2;
|
|
465
|
+
continue;
|
|
466
|
+
}
|
|
467
|
+
err2 = h;
|
|
468
|
+
|
|
469
|
+
// partial derivatives
|
|
470
|
+
var ea = (a > 0 ? -1 : 1) * eps,
|
|
471
|
+
eb = (b > 0 ? -1 : 1) * eps,
|
|
472
|
+
pa = f(a + ea, b),
|
|
473
|
+
pb = f(a, b + eb),
|
|
474
|
+
dxa = (pa[0] - p[0]) / ea,
|
|
475
|
+
dya = (pa[1] - p[1]) / ea,
|
|
476
|
+
dxb = (pb[0] - p[0]) / eb,
|
|
477
|
+
dyb = (pb[1] - p[1]) / eb,
|
|
478
|
+
// determinant
|
|
479
|
+
D = dyb * dxa - dya * dxb,
|
|
480
|
+
// newton step — or half-step for small D
|
|
481
|
+
l = (abs(D) < 0.5 ? 0.5 : 1) / D;
|
|
482
|
+
da = (ty * dxb - tx * dyb) * l;
|
|
483
|
+
db = (tx * dya - ty * dxa) * l;
|
|
484
|
+
a += da;
|
|
485
|
+
b += db;
|
|
486
|
+
if (abs(da) < eps && abs(db) < eps) break; // we're crawling
|
|
487
|
+
}
|
|
488
|
+
return [a, b];
|
|
489
|
+
};
|
|
490
|
+
}
|
|
491
|
+
|
|
428
492
|
// Bertin 1953 as a modified Briesemeister
|
|
429
493
|
// https://bl.ocks.org/Fil/5b9ee9636dfb6ffa53443c9006beb642
|
|
430
494
|
function bertin1953Raw() {
|
|
431
495
|
var hammer$$1 = hammerRaw(1.68, 2),
|
|
432
496
|
fu = 1.4, k = 12;
|
|
433
497
|
|
|
434
|
-
|
|
498
|
+
function forward(lambda, phi) {
|
|
435
499
|
|
|
436
500
|
if (lambda + phi < -fu) {
|
|
437
501
|
var u = (lambda - phi + 1.6) * (lambda + phi + fu) / 8;
|
|
@@ -451,16 +515,16 @@ function bertin1953Raw() {
|
|
|
451
515
|
}
|
|
452
516
|
|
|
453
517
|
return r;
|
|
454
|
-
}
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
forward.invert = solve2d(forward);
|
|
521
|
+
return forward;
|
|
455
522
|
}
|
|
456
523
|
|
|
457
524
|
function bertin() {
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
delete p.rotate;
|
|
462
|
-
|
|
463
|
-
return p
|
|
525
|
+
// this projection should not be rotated
|
|
526
|
+
return d3Geo.geoProjection(bertin1953Raw())
|
|
527
|
+
.rotate([-16.5, -42])
|
|
464
528
|
.scale(176.57)
|
|
465
529
|
.center([7.93, 0.09]);
|
|
466
530
|
}
|
|
@@ -707,7 +771,9 @@ function chamberlin(p0, p1, p2) { // TODO order matters!
|
|
|
707
771
|
var c = d3Geo.geoCentroid({type: "MultiPoint", coordinates: [p0, p1, p2]}),
|
|
708
772
|
R = [-c[0], -c[1]],
|
|
709
773
|
r = d3Geo.geoRotation(R),
|
|
710
|
-
|
|
774
|
+
f = chamberlinRaw(pointRadians(r(p0)), pointRadians(r(p1)), pointRadians(r(p2)));
|
|
775
|
+
f.invert = solve2d(f);
|
|
776
|
+
var p = d3Geo.geoProjection(f).rotate(R),
|
|
711
777
|
center = p.center;
|
|
712
778
|
|
|
713
779
|
delete p.rotate;
|
|
@@ -1053,21 +1119,6 @@ function foucaut() {
|
|
|
1053
1119
|
.scale(135.264);
|
|
1054
1120
|
}
|
|
1055
1121
|
|
|
1056
|
-
// Newton-Raphson
|
|
1057
|
-
// Solve f(x) = y, start from x
|
|
1058
|
-
function solve(f, y, x) {
|
|
1059
|
-
var steps = 100, delta, f0, f1;
|
|
1060
|
-
x = x === undefined ? 0 : +x;
|
|
1061
|
-
y = +y;
|
|
1062
|
-
do {
|
|
1063
|
-
f0 = f(x);
|
|
1064
|
-
f1 = f(x + epsilon);
|
|
1065
|
-
if (f0 === f1) f1 = f0 + epsilon;
|
|
1066
|
-
x -= delta = (-1 * epsilon * (f0 - y)) / (f0 - f1);
|
|
1067
|
-
} while (steps-- > 0 && abs(delta) > epsilon);
|
|
1068
|
-
return steps < 0 ? NaN : x;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
1122
|
function foucautSinusoidalRaw(alpha) {
|
|
1072
1123
|
var beta = 1 - alpha,
|
|
1073
1124
|
equatorial = raw(pi, 0)[0] - raw(-pi, 0)[0],
|
|
@@ -1874,7 +1925,8 @@ function hammerRetroazimuthal() {
|
|
|
1874
1925
|
.clipAngle(180 - 1e-3);
|
|
1875
1926
|
}
|
|
1876
1927
|
|
|
1877
|
-
var
|
|
1928
|
+
var K = 3,
|
|
1929
|
+
healpixParallel = asin(1 - 1 / K) * degrees,
|
|
1878
1930
|
healpixLambert = cylindricalEqualAreaRaw(0);
|
|
1879
1931
|
|
|
1880
1932
|
function healpixRaw(H) {
|
|
@@ -2383,7 +2435,7 @@ function interpolateSphere(lobes) {
|
|
|
2383
2435
|
};
|
|
2384
2436
|
}
|
|
2385
2437
|
|
|
2386
|
-
function interrupt(project, lobes) {
|
|
2438
|
+
function interrupt(project, lobes, inverse) {
|
|
2387
2439
|
var sphere, bounds;
|
|
2388
2440
|
|
|
2389
2441
|
function forward(lambda, phi) {
|
|
@@ -2394,18 +2446,21 @@ function interrupt(project, lobes) {
|
|
|
2394
2446
|
return p;
|
|
2395
2447
|
}
|
|
2396
2448
|
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
var
|
|
2402
|
-
|
|
2403
|
-
var
|
|
2404
|
-
|
|
2405
|
-
|
|
2449
|
+
if (inverse) {
|
|
2450
|
+
forward.invert = inverse(forward);
|
|
2451
|
+
} else if (project.invert) {
|
|
2452
|
+
forward.invert = function(x, y) {
|
|
2453
|
+
var bound = bounds[+(y < 0)], lobe = lobes[+(y < 0)];
|
|
2454
|
+
for (var i = 0, n = bound.length; i < n; ++i) {
|
|
2455
|
+
var b = bound[i];
|
|
2456
|
+
if (b[0][0] <= x && x < b[1][0] && b[0][1] <= y && y < b[1][1]) {
|
|
2457
|
+
var p = project.invert(x - project(lobe[i][1][0], 0)[0], y);
|
|
2458
|
+
p[0] += lobe[i][1][0];
|
|
2459
|
+
return pointEqual(forward(p[0], p[1]), [x, y]) ? p : null;
|
|
2460
|
+
}
|
|
2406
2461
|
}
|
|
2407
|
-
}
|
|
2408
|
-
}
|
|
2462
|
+
};
|
|
2463
|
+
}
|
|
2409
2464
|
|
|
2410
2465
|
var p = d3Geo.geoProjection(forward),
|
|
2411
2466
|
stream_ = p.stream;
|
|
@@ -2531,7 +2586,7 @@ var lobes$4 = [[ // northern hemisphere
|
|
|
2531
2586
|
]];
|
|
2532
2587
|
|
|
2533
2588
|
function sinuMollweide$1() {
|
|
2534
|
-
return interrupt(sinuMollweideRaw, lobes$4)
|
|
2589
|
+
return interrupt(sinuMollweideRaw, lobes$4, solve2d)
|
|
2535
2590
|
.rotate([-20, -55])
|
|
2536
2591
|
.scale(164.263)
|
|
2537
2592
|
.center([0, -5.4036]);
|
|
@@ -2638,7 +2693,7 @@ larriveeRaw.invert = function(x, y) {
|
|
|
2638
2693
|
f1 = phi / (cosPhi_2 * cosLambda_6) - y0,
|
|
2639
2694
|
df0dPhi = sqrtcosPhi ? -0.25 * lambda * sinPhi / sqrtcosPhi : 0,
|
|
2640
2695
|
df0dLambda = 0.5 * (1 + sqrtcosPhi),
|
|
2641
|
-
df1dPhi = (1 +0.5 * phi * sinPhi_2 / cosPhi_2) / (cosPhi_2 * cosLambda_6),
|
|
2696
|
+
df1dPhi = (1 + 0.5 * phi * sinPhi_2 / cosPhi_2) / (cosPhi_2 * cosLambda_6),
|
|
2642
2697
|
df1dLambda = (phi / cosPhi_2) * (sinLambda_6 / 6) / (cosLambda_6 * cosLambda_6),
|
|
2643
2698
|
denom = df0dPhi * df1dLambda - df1dPhi * df0dLambda,
|
|
2644
2699
|
dPhi = (f0 * df1dLambda - f1 * df0dLambda) / denom,
|
|
@@ -2834,9 +2889,10 @@ var alaska = [[0.9972523, 0], [0.0052513, -0.0041175], [0.0074606, 0.0048125], [
|
|
|
2834
2889
|
|
|
2835
2890
|
function modifiedStereographicAlaska() {
|
|
2836
2891
|
return modifiedStereographic(alaska, [152, -64])
|
|
2837
|
-
.scale(
|
|
2892
|
+
.scale(1400)
|
|
2838
2893
|
.center([-160.908, 62.4864])
|
|
2839
|
-
.clipAngle(
|
|
2894
|
+
.clipAngle(30)
|
|
2895
|
+
.angle(7.8);
|
|
2840
2896
|
}
|
|
2841
2897
|
|
|
2842
2898
|
function modifiedStereographicGs48() {
|
|
@@ -3149,7 +3205,7 @@ polyconicRaw.invert = function(x, y) {
|
|
|
3149
3205
|
} while (abs(delta) > epsilon && --i > 0);
|
|
3150
3206
|
tanPhi = tan(phi);
|
|
3151
3207
|
return [
|
|
3152
|
-
(abs(y) < abs(phi + 1 / tanPhi) ? asin(x * tanPhi) : sign(x) * (acos(abs(x * tanPhi)) + halfPi)) / sin(phi),
|
|
3208
|
+
(abs(y) < abs(phi + 1 / tanPhi) ? asin(x * tanPhi) : sign(y) * sign(x) * (acos(abs(x * tanPhi)) + halfPi)) / sin(phi),
|
|
3153
3209
|
phi
|
|
3154
3210
|
];
|
|
3155
3211
|
};
|
|
@@ -3915,7 +3971,7 @@ function rectangularPolyconic() {
|
|
|
3915
3971
|
.scale(131.215);
|
|
3916
3972
|
}
|
|
3917
3973
|
|
|
3918
|
-
var K = [
|
|
3974
|
+
var K$1 = [
|
|
3919
3975
|
[0.9986, -0.062],
|
|
3920
3976
|
[1.0000, 0.0000],
|
|
3921
3977
|
[0.9986, 0.0620],
|
|
@@ -3938,7 +3994,7 @@ var K = [
|
|
|
3938
3994
|
[0.5322, 1.0000]
|
|
3939
3995
|
];
|
|
3940
3996
|
|
|
3941
|
-
K.forEach(function(d) {
|
|
3997
|
+
K$1.forEach(function(d) {
|
|
3942
3998
|
d[1] *= 1.0144;
|
|
3943
3999
|
});
|
|
3944
4000
|
|
|
@@ -3946,11 +4002,11 @@ function robinsonRaw(lambda, phi) {
|
|
|
3946
4002
|
var i = min(18, abs(phi) * 36 / pi),
|
|
3947
4003
|
i0 = floor(i),
|
|
3948
4004
|
di = i - i0,
|
|
3949
|
-
ax = (k = K[i0])[0],
|
|
4005
|
+
ax = (k = K$1[i0])[0],
|
|
3950
4006
|
ay = k[1],
|
|
3951
|
-
bx = (k = K[++i0])[0],
|
|
4007
|
+
bx = (k = K$1[++i0])[0],
|
|
3952
4008
|
by = k[1],
|
|
3953
|
-
cx = (k = K[min(19, ++i0)])[0],
|
|
4009
|
+
cx = (k = K$1[min(19, ++i0)])[0],
|
|
3954
4010
|
cy = k[1],
|
|
3955
4011
|
k;
|
|
3956
4012
|
return [
|
|
@@ -3965,9 +4021,9 @@ robinsonRaw.invert = function(x, y) {
|
|
|
3965
4021
|
i = min(18, abs(phi / 5)),
|
|
3966
4022
|
i0 = max(0, floor(i));
|
|
3967
4023
|
do {
|
|
3968
|
-
var ay = K[i0][1],
|
|
3969
|
-
by = K[i0 + 1][1],
|
|
3970
|
-
cy = K[min(19, i0 + 2)][1],
|
|
4024
|
+
var ay = K$1[i0][1],
|
|
4025
|
+
by = K$1[i0 + 1][1],
|
|
4026
|
+
cy = K$1[min(19, i0 + 2)][1],
|
|
3971
4027
|
u = cy - ay,
|
|
3972
4028
|
v = cy - 2 * by + ay,
|
|
3973
4029
|
t = 2 * (abs(yy) - by) / u,
|
|
@@ -3980,17 +4036,17 @@ robinsonRaw.invert = function(x, y) {
|
|
|
3980
4036
|
i = min(18, abs(phi) / 5);
|
|
3981
4037
|
i0 = floor(i);
|
|
3982
4038
|
di = i - i0;
|
|
3983
|
-
ay = K[i0][1];
|
|
3984
|
-
by = K[i0 + 1][1];
|
|
3985
|
-
cy = K[min(19, i0 + 2)][1];
|
|
4039
|
+
ay = K$1[i0][1];
|
|
4040
|
+
by = K$1[i0 + 1][1];
|
|
4041
|
+
cy = K$1[min(19, i0 + 2)][1];
|
|
3986
4042
|
phi -= (delta = (y >= 0 ? halfPi : -halfPi) * (by + di * (cy - ay) / 2 + di * di * (cy - 2 * by + ay) / 2) - y) * degrees;
|
|
3987
4043
|
} while (abs(delta) > epsilon2 && --j > 0);
|
|
3988
4044
|
break;
|
|
3989
4045
|
}
|
|
3990
4046
|
} while (--i0 >= 0);
|
|
3991
|
-
var ax = K[i0][0],
|
|
3992
|
-
bx = K[i0 + 1][0],
|
|
3993
|
-
cx = K[min(19, i0 + 2)][0];
|
|
4047
|
+
var ax = K$1[i0][0],
|
|
4048
|
+
bx = K$1[i0 + 1][0],
|
|
4049
|
+
cx = K$1[min(19, i0 + 2)][0];
|
|
3994
4050
|
return [
|
|
3995
4051
|
x / (bx + di * (cx - ax) / 2 + di * di * (cx - 2 * bx + ax) / 2),
|
|
3996
4052
|
phi * radians
|
|
@@ -4656,6 +4712,15 @@ function wagner() {
|
|
|
4656
4712
|
.scale(163.775);
|
|
4657
4713
|
}
|
|
4658
4714
|
|
|
4715
|
+
function wagner7() {
|
|
4716
|
+
return wagner()
|
|
4717
|
+
.poleline(65)
|
|
4718
|
+
.parallels(60)
|
|
4719
|
+
.inflation(0)
|
|
4720
|
+
.ratio(200)
|
|
4721
|
+
.scale(172.633);
|
|
4722
|
+
}
|
|
4723
|
+
|
|
4659
4724
|
var A = 4 * pi + 3 * sqrt(3),
|
|
4660
4725
|
B = 2 * sqrt(2 * pi * sqrt(3) / A);
|
|
4661
4726
|
|
|
@@ -4679,32 +4744,6 @@ function wagner6() {
|
|
|
4679
4744
|
.scale(152.63);
|
|
4680
4745
|
}
|
|
4681
4746
|
|
|
4682
|
-
function wagner7Raw(lambda, phi) {
|
|
4683
|
-
var s = 0.90631 * sin(phi),
|
|
4684
|
-
c0 = sqrt(1 - s * s),
|
|
4685
|
-
c1 = sqrt(2 / (1 + c0 * cos(lambda /= 3)));
|
|
4686
|
-
return [
|
|
4687
|
-
2.66723 * c0 * c1 * sin(lambda),
|
|
4688
|
-
1.24104 * s * c1
|
|
4689
|
-
];
|
|
4690
|
-
}
|
|
4691
|
-
|
|
4692
|
-
wagner7Raw.invert = function(x, y) {
|
|
4693
|
-
var t1 = x / 2.66723,
|
|
4694
|
-
t2 = y / 1.24104,
|
|
4695
|
-
p = sqrt(t1 * t1 + t2 * t2),
|
|
4696
|
-
c = 2 * asin(p / 2);
|
|
4697
|
-
return [
|
|
4698
|
-
3 * atan2(x * tan(c), 2.66723 * p),
|
|
4699
|
-
p && asin(y * sin(c) / (1.24104 * 0.90631 * p))
|
|
4700
|
-
];
|
|
4701
|
-
};
|
|
4702
|
-
|
|
4703
|
-
function wagner7() {
|
|
4704
|
-
return d3Geo.geoProjection(wagner7Raw)
|
|
4705
|
-
.scale(172.632);
|
|
4706
|
-
}
|
|
4707
|
-
|
|
4708
4747
|
function wiechelRaw(lambda, phi) {
|
|
4709
4748
|
var cosPhi = cos(phi),
|
|
4710
4749
|
sinPhi = cos(lambda) * cosPhi,
|
|
@@ -4952,13 +4991,12 @@ exports.geoVanDerGrinten3Raw = vanDerGrinten3Raw;
|
|
|
4952
4991
|
exports.geoVanDerGrinten4 = vanDerGrinten4;
|
|
4953
4992
|
exports.geoVanDerGrinten4Raw = vanDerGrinten4Raw;
|
|
4954
4993
|
exports.geoWagner = wagner;
|
|
4994
|
+
exports.geoWagner7 = wagner7;
|
|
4955
4995
|
exports.geoWagnerRaw = wagnerRaw;
|
|
4956
4996
|
exports.geoWagner4 = wagner4;
|
|
4957
4997
|
exports.geoWagner4Raw = wagner4Raw;
|
|
4958
4998
|
exports.geoWagner6 = wagner6;
|
|
4959
4999
|
exports.geoWagner6Raw = wagner6Raw;
|
|
4960
|
-
exports.geoWagner7 = wagner7;
|
|
4961
|
-
exports.geoWagner7Raw = wagner7Raw;
|
|
4962
5000
|
exports.geoWiechel = wiechel;
|
|
4963
5001
|
exports.geoWiechelRaw = wiechelRaw;
|
|
4964
5002
|
exports.geoWinkel3 = winkel3;
|