d3-geo-projection
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -1,3 +0,3 @@ | ||
// https://d3js.org/d3-geo-projection/ Version 1.1.0. Copyright 2016 Mike Bostock. | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("d3-geo"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-geo","d3-array"],r):r(n.d3=n.d3||{},n.d3,n.d3)}(this,function(n,r,e){"use strict";function t(n){return n?n/Math.sin(n):1}function o(n){return n>1?Ur:n<-1?-Ur:Math.asin(n)}function i(n){return n>1?0:n<-1?Or:Math.acos(n)}function u(n){return n>0?Math.sqrt(n):0}function a(n){return n=Br(2*n),(n-1)/(n+1)}function c(n){return(Br(n)-Br(-n))/2}function f(n){return(Br(n)+Br(-n))/2}function l(n){return Hr(n+u(n*n+1))}function v(n){return Hr(n+u(n*n-1))}function g(n){function r(n,r){var e=xr(n),o=xr(r),i=Qr(r),u=o*e,a=-((1-u?Hr((1+u)/2)/(1-u):-.5)+t/(1+u));return[a*o*Qr(n),a*i]}var e=Nr(n/2),t=2*Hr(xr(n/2))/(e*e);return r.invert=function(r,e){var i,a=u(r*r+e*e),c=-n/2,f=50;if(!a)return[0,0];do{var l=c/2,v=xr(l),g=Qr(l),s=Nr(l),h=Hr(1/v);c-=i=(2/s*h-t*s-a)/(-h/(g*g)+1-t/(2*v*v))}while(zr(i)>_r&&--f>0);var p=Qr(c);return[Fr(r*p,a*xr(c)),o(e*p/a)]},r}function s(n,r){var e=xr(r),o=t(i(e*xr(n/=2)));return[2*e*Qr(n)*o,Qr(r)*o]}function h(n){function r(n,r){var a=xr(r),c=xr(n/=2);return[(1+a)*Qr(n),(o*r>-Fr(c,i)-.001?0:10*-o)+u+Qr(r)*t-(1+a)*e*c]}var e=Qr(n),t=xr(n),o=n>=0?1:-1,i=Nr(o*n),u=(1+e-t)/2;return r.invert=function(n,r){var a=0,c=0,f=50;do{var l=xr(a),v=Qr(a),g=xr(c),s=Qr(c),h=1+g,p=h*v-n,d=u+s*t-h*e*l-r,w=h*l/2,P=-v*s,m=e*h*v/2,y=t*g+e*l*s,R=P*m-y*w,j=(d*P-p*y)/R/2,M=(p*m-d*w)/R;a-=j,c-=M}while((zr(j)>_r||zr(M)>_r)&&--f>0);return o*c>-Fr(xr(a),i)-.001?[2*a,c]:null},r}function p(n,r){var e=Nr(r/2),t=u(1-e*e),o=1+t*xr(n/=2),i=Qr(n)*t/o,a=e/o,c=i*i,f=a*a;return[4/3*i*(3+c-3*f),4/3*a*(3+3*c-f)]}function d(n,r){var e=zr(r);return e<Jr?[n,Hr(Nr(Jr+r/2))]:[n*xr(e)*(2*Yr-1/Qr(e)),Vr(r)*(2*Yr*(e-Jr)-Hr(Nr(e/2)))]}function w(n){function e(n,e){var i=r.geoAzimuthalEquidistantRaw(n,e);if(zr(n)>Ur){var a=Fr(i[1],i[0]),c=u(i[0]*i[0]+i[1]*i[1]),f=t*Dr((a-Ur)/t)+Ur,l=Fr(Qr(a-=f),2-xr(a));a=f+o(Or/c*Qr(l))-l,i[0]=c*xr(a),i[1]=c*Qr(a)}return i}var t=2*Or/n;return e.invert=function(n,e){var o=u(n*n+e*e);if(o>Ur){var a=Fr(e,n),c=t*Dr((a-Ur)/t)+Ur,f=a>c?-1:1,l=o*xr(c-a),v=1/Nr(f*i((l-Or)/u(Or*(Or-2*l)+o*o)));a=c+2*qr((v+f*u(v*v-3))/3),n=o*xr(a),e=o*Qr(a)}return r.geoAzimuthalEquidistantRaw.invert(n,e)},e}function P(n,r){var e,t=n*Qr(r),o=30;do r-=e=(r+Qr(r)-t)/(1+xr(r));while(zr(e)>_r&&--o>0);return r/2}function m(n,r,e){function t(t,o){return[n*t*xr(o=P(e,o)),r*Qr(o)]}return t.invert=function(t,i){return i=o(i/r),[t/(n*xr(i)),o((2*i+Qr(2*i))/e)]},t}function y(n,r){var e=P(Or,r);return[ge*n/(1/xr(r)+se/xr(e)),(r+Yr*Qr(e))/ge]}function R(n,r){return[n*xr(r),r]}function j(n){function r(r,t){var o=e+n-t,i=o?r*xr(t)/o:o;return[o*Qr(i),e-o*xr(i)]}if(!n)return R;var e=1/Nr(n);return r.invert=function(r,t){var o=u(r*r+(t=e-t)*t),i=e+n-o;return[o/xr(i)*Fr(r,t),i]},r}function M(n){function r(r,e){var t=Ur-e,o=t?r*n*Qr(t)/t:t;return[t*Qr(o)/n,Ur-t*xr(o)]}return r.invert=function(r,e){var t=r*n,o=Ur-e,i=u(t*t+o*o),a=Fr(t,o);return[(i?i/Qr(i):1)*a/n,Ur-i]},r}function E(n,r,e,t,a,c){var f,l=xr(c);if(zr(n)>1||zr(c)>1)f=i(e*a+r*t*l);else{var v=Qr(n/2),g=Qr(c/2);f=2*o(u(v*v+r*t*g*g))}return zr(f)>_r?[f,Fr(t*Qr(c),r*a-e*t*l)]:[0,0]}function A(n,r,e){return i((n*n+r*r-e*e)/(2*n*r))}function b(n){return n-2*Or*Lr((n+Or)/(2*Or))}function S(n,r,e){function t(n,r){var e,t=Qr(r),o=xr(r),u=new Array(3);for(e=0;e<3;++e){var a=i[e];if(u[e]=E(r-a[1],a[3],a[2],o,t,n-a[0]),!u[e][0])return a.point;u[e][1]=b(u[e][1]-a.v[1])}var c=v.slice();for(e=0;e<3;++e){var g=2==e?0:e+1,s=A(i[e].v[0],u[e][0],u[g][0]);u[e][1]<0&&(s=-s),e?1==e?(s=f-s,c[0]-=u[e][0]*xr(s),c[1]-=u[e][0]*Qr(s)):(s=l-s,c[0]+=u[e][0]*xr(s),c[1]+=u[e][0]*Qr(s)):(c[0]+=u[e][0]*xr(s),c[1]-=u[e][0]*Qr(s))}return c[0]/=3,c[1]/=3,c}for(var o,i=[[n[0],n[1],Qr(n[1]),xr(n[1])],[r[0],r[1],Qr(r[1]),xr(r[1])],[e[0],e[1],Qr(e[1]),xr(e[1])]],u=i[2],a=0;a<3;++a,u=o)o=i[a],u.v=E(o[1]-u[1],u[3],u[2],o[3],o[2],o[0]-u[0]),u.point=[0,0];var c=A(i[0].v[0],i[2].v[0],i[1].v[0]),f=A(i[0].v[0],i[1].v[0],i[2].v[0]),l=Or-c;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var v=[i[2].point[0]=i[0].point[0]+i[2].v[0]*xr(c),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*Qr(c))];return t}function k(n){return n[0]*=re,n[1]*=re,n}function G(){return C([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function C(n,e,t){var o=r.geoCentroid({type:"MultiPoint",coordinates:[n,e,t]}),i=[-o[0],-o[1]],u=r.geoRotation(i),a=r.geoProjection(S(k(u(n)),k(u(e)),k(u(t)))).rotate(i),c=a.center;return delete a.rotate,a.center=function(n){return arguments.length?c(u(n)):u.invert(c())},a.clipAngle(90)}function z(n,r){var e=u(1-Qr(r));return[2/Zr*n*e,Zr*(1-e)]}function q(n){function r(n,r){return[n,(n?n/Qr(n):1)*(Qr(r)*xr(n)-e*xr(r))]}var e=Nr(n);return r.invert=e?function(n,r){n&&(r*=Qr(n)/n);var t=xr(n);return[n,2*Fr(u(t*t+e*e-r*r)-t,e-r)]}:function(n,r){return[n,o(n?r*Nr(n)/n:r)]},r}function F(n,r){return[Me*n*(2*xr(2*r/3)-1)/Zr,Me*Zr*Qr(r/3)]}function x(n){function r(n,r){return[n*e,Qr(r)/e]}var e=xr(n);return r.invert=function(n,r){return[n/e,o(r*e)]},r}function B(n){function r(n,r){return[n*e,(1+e)*Nr(r/2)]}var e=xr(n);return r.invert=function(n,r){return[n/e,2*qr(r/(1+e))]},r}function L(n,r){var e=u(8/(3*Or));return[e*n*(1-zr(r)/Or),e*r]}function H(n,r){var e=u(4-3*Qr(zr(r)));return[2/u(6*Or)*n*e,Vr(r)*u(2*Or/3)*(2-e)]}function I(n,r){var e=u(Or*(4+Or));return[2/e*n*(1+u(1-4*r*r/(Or*Or))),4/e*r]}function W(n,r){var e=(2+Ur)*Qr(r);r/=2;for(var t=0,o=1/0;t<10&&zr(o)>_r;t++){var i=xr(r);r-=o=(r+Qr(r)*(i+2)-e)/(2*i*(1+i))}return[2/u(Or*(4+Or))*n*(1+xr(r)),2*u(Or/(4+Or))*Qr(r)]}function T(n,r){return[n*(1+xr(r))/u(2+Or),2*r/u(2+Or)]}function D(n,r){for(var e=(1+Ur)*Qr(r),t=0,o=1/0;t<10&&zr(o)>_r;t++)r-=o=(r+Qr(r)-e)/(1+xr(r));return e=u(2+Or),[n*(1+xr(r))/e,2*r/e]}function V(n,r){var e=Qr(n/=2),t=xr(n),o=u(xr(r)),i=xr(r/=2),a=Qr(r)/(i+Yr*t*o),c=u(2/(1+a*a)),f=u((Yr*i+(t+e)*o)/(Yr*i+(t-e)*o));return[Fe*(c*(f-1/f)-2*Hr(f)),Fe*(c*a*(f+1/f)-2*qr(a))]}function Q(n,r){var e=Nr(r/2);return[n*Be*u(1-e*e),(1+Be)*e]}function N(n,r){var e=r/2,t=xr(e);return[2*n/Zr*xr(r)*t*t,Zr*Nr(e)]}function _(n){return[n[0]/2,o(Nr(n[1]/2*re))*ne]}function K(n){return[2*n[0],2*qr(Qr(n[1]*re))*ne]}function O(n,e){function t(e,t){var a=r.geoAzimuthalEquidistantRaw(e,t),c=a[0],f=a[1],l=c*c+f*f;if(l>i){var v=u(l),g=Fr(f,c),s=o*Dr(g/o),h=g-s,p=n*xr(h),d=(n*Qr(h)-h*Qr(p))/(Ur-p),w=U(h,d),P=(Or-n)/J(w,p,Or);c=v;var m,y=50;do c-=m=(n+J(w,p,c)*P-v)/(w(c)*P);while(zr(m)>_r&&--y>0);f=h*Qr(c),c<Ur&&(f-=d*(c-Ur));var R=Qr(s),j=xr(s);a[0]=c*j-f*R,a[1]=c*R+f*j}return a}var o=2*Or/e,i=n*n;return t.invert=function(e,t){var a=e*e+t*t;if(a>i){var c=u(a),f=Fr(t,e),l=o*Dr(f/o),v=f-l;e=c*xr(v),t=c*Qr(v);for(var g=e-Ur,s=Qr(e),h=t/s,p=e<Ur?1/0:0,d=10;;){var w=n*Qr(h),P=n*xr(h),m=Qr(P),y=Ur-P,R=(w-h*m)/y,j=U(h,R);if(zr(p)<Kr||!--d)break;h-=p=(h*s-R*g-t)/(s-2*g*(y*(P+h*w*xr(P)-m)-w*(w-h*m))/(y*y))}c=n+J(j,P,e)*(Or-n)/J(j,P,Or),f=l+h,e=c*xr(f),t=c*Qr(f)}return r.geoAzimuthalEquidistantRaw.invert(e,t)},t}function U(n,r){return function(e){var t=n*xr(e);return e<Ur&&(t-=r),u(1+t*t)}}function J(n,r,e){for(var t=50,o=(e-r)/t,i=n(r)+n(e),u=1,a=r;u<t;++u)i+=2*n(a+=o);return.5*i*o}function X(n,r){var e=n*n,t=r*r;return[n*(1-.162388*t)*(.87-952426e-9*e*e),r*(1+t/12)]}function Y(n,r){var e=Vr(n),t=Vr(r),i=xr(r),u=xr(n)*i,a=Qr(n)*i,c=Qr(t*r);n=zr(Fr(a,c)),r=o(u),zr(n-Ur)>_r&&(n%=Ur);var f=Z(n>Or/4?Ur-n:n,r);return n>Or/4&&(c=f[0],f[0]=-f[1],f[1]=-c),f[0]*=e,f[1]*=-t,f}function Z(n,r){if(r===Ur)return[0,0];var e,t,i=Qr(r),a=i*i,c=a*a,f=1+c,l=1+3*c,v=1-c,g=o(1/u(f)),s=v+a*f*g,h=(1-i)/s,p=u(h),d=h*f,w=u(d),P=p*v;if(0===n)return[0,-(P+a*w)];var m,y=xr(r),R=1/y,j=2*i*y,M=(-3*a+g*l)*j,E=(-s*y-(1-i)*M)/(s*s),A=.5*E/p,b=v*A-2*a*p*j,S=a*f*E+h*l*j,k=-R*j,G=-R*S,C=-2*R*b,z=4*n/Or;if(n>.222*Or||r<Or/4&&n>.175*Or){if(e=(P+a*u(d*(1+c)-P*P))/(1+c),n>Or/4)return[e,e];var q=e,F=.5*e;e=.5*(F+q),t=50;do{var x=u(d-e*e),B=e*(C+k*x)+G*o(e/w)-z;if(!B)break;B<0?F=e:q=e,e=.5*(F+q)}while(zr(q-F)>_r&&--t>0)}else{e=_r,t=25;do{var L=e*e,H=u(d-L),I=C+k*H,W=e*I+G*o(e/w)-z,T=I+(G-k*L)/H;e-=m=H?W/T:0}while(zr(m)>_r&&--t>0)}return[e,-P-a*u(d-e*e)]}function $(n,r){for(var e=0,t=1,i=.5,a=50;;){var c=i*i,f=u(i),l=o(1/u(1+c)),v=1-c+i*(1+c)*l,g=(1-f)/v,s=u(g),h=g*(1+c),p=s*(1-c),d=h-n*n,w=u(d),P=r+p+i*w;if(zr(t-e)<Kr||0===--a||0===P)break;P>0?e=i:t=i,i=.5*(e+t)}if(!a)return null;var m=o(f),y=xr(m),R=1/y,j=2*f*y,M=(-3*i+l*(1+3*c))*j,E=(-v*y-(1-f)*M)/(v*v),A=.5*E/s,b=(1-c)*A-2*i*s*j,S=-2*R*b,k=-R*j,G=-R*(i*(1+c)*E+g*(1+3*c)*j);return[Or/4*(n*(S+k*w)+G*o(n/u(h))),m]}function nn(n,r,e){var t,o,i;return n?(t=rn(n,e),r?(o=rn(r,1-e),i=o[1]*o[1]+e*t[0]*t[0]*o[0]*o[0],[[t[0]*o[2]/i,t[1]*t[2]*o[0]*o[1]/i],[t[1]*o[1]/i,-t[0]*t[2]*o[0]*o[2]/i],[t[2]*o[1]*o[2]/i,-e*t[0]*t[1]*o[0]/i]]):[[t[0],0],[t[1],0],[t[2],0]]):(o=rn(r,1-e),[[0,o[0]/o[1]],[1/o[1],0],[o[2]/o[1],0]])}function rn(n,r){var e,t,i,l,v;if(r<_r)return l=Qr(n),t=xr(n),e=r*(n-l*t)/4,[l-e*t,t+e*l,1-r*l*l/2,n-e];if(r>=1-_r)return e=(1-r)/4,t=f(n),l=a(n),i=1/t,v=t*c(n),[l+e*(v-n)/(t*t),i-e*l*i*(v-n),i+e*l*i*(v+n),2*qr(Br(n))-Ur+e*(v-n)/t];var g=[1,0,0,0,0,0,0,0,0],s=[u(r),0,0,0,0,0,0,0,0],h=0;for(t=u(1-r),v=1;zr(s[h]/g[h])>_r&&h<8;)e=g[h++],s[h]=(e-t)/2,g[h]=(e+t)/2,t=u(e*t),v*=2;i=v*g[h]*n;do l=s[h]*Qr(t=i)/g[h],i=(o(l)+i)/2;while(--h);return[Qr(i),l=xr(i),l/xr(i-t),i]}function en(n,r,e){var t=zr(n),o=zr(r),i=c(o);if(t){var a=1/Qr(t),f=1/(Nr(t)*Nr(t)),l=-(f+e*(i*i*a*a)-1+e),v=(e-1)*f,g=(-l+u(l*l-4*v))/2;return[tn(qr(1/u(g)),e)*Vr(n),tn(qr(u((g/f-1)/e)),1-e)*Vr(r)]}return[0,tn(qr(i),1-e)*Vr(r)]}function tn(n,r){if(!r)return n;if(1===r)return Hr(Nr(n/2+Jr));for(var e=1,t=u(1-r),o=u(r),i=0;zr(o)>_r;i++){if(n%Or){var a=qr(t*Nr(n)/e);a<0&&(a+=Or),n+=a+~~(n/Or)*Or}else n+=n;o=(e+t)/2,t=u(e*t),o=((e=o)-t)/2}return n/(Tr(2,i)*e)}function on(n,r){var e=(Yr-1)/(Yr+1),t=u(1-e*e),o=tn(Ur,t*t),i=-1,a=Hr(Nr(Or/4+zr(r)/2)),c=Br(i*a)/u(e),f=un(c*xr(i*n),c*Qr(i*n)),l=en(f[0],f[1],t*t);return[-l[1],(r>=0?1:-1)*(.5*o-l[0])]}function un(n,r){var e=n*n,t=r+1,o=1-e-r*r;return[.5*((n>=0?Ur:-Ur)-Fr(o,2*n)),-.25*Hr(o*o+4*e)+.5*Hr(t*t+e)]}function an(n,r){var e=r[0]*r[0]+r[1]*r[1];return[(n[0]*r[0]+n[1]*r[1])/e,(n[1]*r[0]-n[0]*r[1])/e]}function cn(n,e){function t(t,o){var i=r.geoAzimuthalEqualAreaRaw(t/e,o);return i[0]*=n,i}return arguments.length<2&&(e=n),1===e?r.geoAzimuthalEqualAreaRaw:e===1/0?fn:(t.invert=function(t,o){var i=r.geoAzimuthalEqualAreaRaw.invert(t/n,o);return i[0]*=e,i},t)}function fn(n,r){return[n*xr(r)/xr(r/=2),2*Qr(r)]}function ln(n){function r(n,r){var u=o(n,r);n=u[0],r=u[1];var a=Qr(r),c=xr(r),f=xr(n),l=i(e*a+t*c*f),v=Qr(l),g=zr(v)>_r?l/v:1;return[g*t*Qr(n),(zr(n)>Ur?g:-g)*(e*c-t*a*f)]}var e=Qr(n),t=xr(n),o=vn(n);return o.invert=vn(-n),r.invert=function(n,r){var t=u(n*n+r*r),i=-Qr(t),a=xr(t),c=t*a,f=-r*i,l=t*e,v=u(c*c+f*f-l*l),g=Fr(c*l+f*v,f*l-c*v),s=(t>Ur?-1:1)*Fr(n*i,t*xr(g)*a+r*Qr(g)*i);return o.invert(s,g)},r}function vn(n){var r=Qr(n),e=xr(n);return function(n,t){var i=xr(t),u=xr(n)*i,a=Qr(n)*i,c=Qr(t);return[Fr(a,u*e-c*r),o(c*e+u*r)]}}function gn(n){function r(r,l){var v,g=zr(l);if(g>e){var s=Wr(n-1,Ir(0,Lr((r+Or)/a)));r+=Or*(n-1)/n-s*a,v=z(r,g),v[0]=v[0]*$r/t-$r*(n-1)/(2*n)+s*$r/n,v[1]=o+4*(v[1]-i)*u/$r,l<0&&(v[1]=-v[1])}else v=et(r,l);return v[0]*=c,v[1]/=f,v}var e=rt*re,t=z(Or,e)[0]-z(-Or,e)[0],o=et(0,e)[1],i=z(0,e)[1],u=Zr-i,a=$r/n,c=4/$r,f=o+u*u*4/$r;return r.invert=function(r,e){r/=c,e*=f;var l=zr(e);if(l>o){var v=Wr(n-1,Ir(0,Lr((r+Or)/a)));r=(r+Or*(n-1)/n-v*a)*t/$r;var g=z.invert(r,.25*(l-o)*$r/u+i);return g[0]-=Or*(n-1)/n-v*a,e<0&&(g[1]=-g[1]),g}return et.invert(r,e)},r}function sn(n){return{type:"Polygon",coordinates:[e.range(-180,180+n/2,n).map(function(n,r){return[n,1&r?90-1e-6:rt]}).concat(e.range(180,-180-n/2,-n).map(function(n,r){return[n,1&r?-90+1e-6:-rt]}))]}}function hn(n){function r(r,o){var i,a,s=1-Qr(o);if(s&&s<2){var h,p=Ur-o,d=25;do{var w=Qr(p),P=xr(p),m=c+Fr(w,t-P),y=1+g-2*t*P;p-=h=(p-v*c-t*w+y*m-.5*s*e)/(2*t*w*m)}while(zr(h)>Kr&&--d>0);i=f*u(y),a=r*m/Or}else i=f*(n+s),a=r*c/Or;return[i*Qr(a),l-i*xr(a)]}var e,t=1+n,a=Qr(1/t),c=o(a),f=2*u(Or/(e=Or+4*c*t)),l=.5*f*(t+u(n*(2+n))),v=n*n,g=t*t;return r.invert=function(n,r){var a=n*n+(r-=l)*r,s=(1+g-a/(f*f))/(2*t),h=i(s),p=Qr(h),d=c+Fr(p,t-s);return[o(n/u(a))*Or/d,o(1-2*(h-v*c-t*p+(1+g-2*t*s)*d)/e)]},r}function pn(n,r){return r>-it?(n=le(n,r),n[1]+=ut,n):R(n,r)}function dn(n,r){return zr(r)>it?(n=le(n,r),n[1]-=r>0?ut:-ut,n):R(n,r)}function wn(n,r){return zr(n[0]-r[0])<_r&&zr(n[1]-r[1])<_r}function Pn(n,r){for(var e,t,o,i=-1,u=n.length,a=n[0],c=[];++i<u;){e=n[i],t=(e[0]-a[0])/r,o=(e[1]-a[1])/r;for(var f=0;f<r;++f)c.push([a[0]+f*t,a[1]+f*o]);a=e}return c.push(e),c}function mn(n){var r,t,o,i,u,a,c,f=[],l=n[0].length;for(c=0;c<l;++c)r=n[0][c],t=r[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(Pn([[t+_r,o+_r],[t+_r,i-_r],[u-_r,i-_r],[u-_r,a+_r]],30));for(c=n[1].length-1;c>=0;--c)r=n[1][c],t=r[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(Pn([[u-_r,a-_r],[u-_r,i+_r],[t+_r,i+_r],[t+_r,o-_r]],30));return{type:"Polygon",coordinates:[e.merge(f)]}}function yn(n,r){return[3/$r*n*u(Or*Or/3-r*r),r]}function Rn(n){function r(r,e){if(zr(zr(e)-Ur)<_r)return[0,e<0?-2:2];var t=Qr(e),o=Tr((1+t)/(1-t),n/2),i=.5*(o+1/o)+xr(r*=n);return[2*Qr(r)/i,(o-1/o)/i]}return r.invert=function(r,e){var t=zr(e);if(zr(t-2)<_r)return r?null:[0,Vr(e)*Ur];if(t>2)return null;r/=2,e/=2;var i=r*r,u=e*e,a=2*e/(1+i+u);return a=Tr((1+a)/(1-a),1/n),[Fr(2*r,1-i-u)/n,o((a-1)/(a+1))]},r}function jn(n,r){return[n*(1+u(xr(r)))/2,r/(xr(r/2)*xr(n/6))]}function Mn(n,r){var e=n*n,t=r*r;return[n*(.975534+t*(-.119161+e*-.0143059+t*-.0547009)),r*(1.00384+e*(.0802894+t*-.02855+199025e-9*e)+t*(.0998909+t*-.0491032))]}function En(n,r){return[Qr(n)/xr(r),Nr(r)*xr(n)]}function An(n){function r(r,o){var i=o-n,u=zr(i)<_r?r*e:zr(u=Jr+o/2)<_r||zr(zr(u)-Ur)<_r?0:r*i/Hr(Nr(u)/t);return[u,i]}var e=xr(n),t=Nr(Jr+n/2);return r.invert=function(r,o){var i,u=o+n;return[zr(o)<_r?r/e:zr(i=Jr+u/2)<_r||zr(zr(i)-Ur)<_r?0:r*Hr(Nr(i)/t)/o,u]},r}function bn(n,r){return[n,1.25*Hr(Nr(Jr+.4*r))]}function Sn(n){function r(r,t){for(var o,i=xr(t),u=2/(1+i*xr(r)),a=u*i*Qr(r),c=u*Qr(t),f=e,l=n[f],v=l[0],g=l[1];--f>=0;)l=n[f],v=l[0]+a*(o=v)-c*g,g=l[1]+a*g+c*o;return v=a*(o=v)-c*g,g=a*g+c*o,[v,g]}var e=n.length-1;return r.invert=function(r,t){var i=20,a=r,c=t;do{for(var f,l=e,v=n[l],g=v[0],s=v[1],h=0,p=0;--l>=0;)v=n[l],h=g+a*(f=h)-c*p,p=s+a*p+c*f,g=v[0]+a*(f=g)-c*s,s=v[1]+a*s+c*f;h=g+a*(f=h)-c*p,p=s+a*p+c*f,g=a*(f=g)-c*s-r,s=a*s+c*f-t;var d,w,P=h*h+p*p;a-=d=(g*h+s*p)/P,c-=w=(s*h-g*p)/P}while(zr(d)+zr(w)>_r*_r&&--i>0);if(i){var m=u(a*a+c*c),y=2*qr(.5*m),R=Qr(y);return[Fr(a*R,m*xr(y)),m?o(c*R/m):0]}},r}function kn(){return Fn(Ct,[152,-64]).scale(1500).center([-160.908,62.4864]).clipAngle(25)}function Gn(){return Fn(zt,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Cn(){return Fn(qt,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function zn(){return Fn(Ft,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function qn(){return Fn(xt,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Fn(n,e){var t=r.geoProjection(Sn(n)).rotate(e).clipAngle(90),o=r.geoRotation(e),i=t.center;return delete t.rotate,t.center=function(n){return arguments.length?i(o(n)):o.invert(i())},t}function xn(n,r){var e=o(7*Qr(r)/(3*Bt));return[Bt*n*(2*xr(2*e/3)-1)/Lt,9*Qr(e/3)/Lt]}function Bn(n,r){for(var e,t=(1+Xr)*Qr(r),o=r,i=0;i<25&&(o-=e=(Qr(o/2)+Qr(o)-t)/(.5*xr(o/2)+xr(o)),!(zr(e)<_r));i++);return[n*(1+2*xr(o)/xr(o/2))/(3*Yr),2*u(3)*Qr(o/2)/u(2+Yr)]}function Ln(n,r){for(var e,t=u(6/(4+Or)),o=(1+Or/4)*Qr(r),i=r/2,a=0;a<25&&(i-=e=(i/2+Qr(i)-o)/(.5+xr(i)),!(zr(e)<_r));a++);return[t*(.5+xr(i))*n/1.5,t*i]}function Hn(n,r){var e=r*r,t=e*e;return[n*(.8707-.131979*e+t*(-.013791+t*(.003971*e-.001529*t))),r*(1.007226+e*(.015085+t*(-.044475+.028874*e-.005916*t)))]}function In(n,r){return[n*(1+xr(r))/2,2*(r-Nr(r/2))]}function Wn(n,r){var e=r*r;return[n,r*(Vt+e*e*(Qt+e*(Nt+_t*e)))]}function Tn(n,r){if(zr(r)<_r)return[n,0];var e=Nr(r),t=n*Qr(r);return[Qr(t)/e,r+(1-xr(t))/e]}function Dn(n){var r=1/(n[0]*n[4]-n[1]*n[3]);return[r*n[4],-r*n[1],r*(n[1]*n[5]-n[2]*n[4]),-r*n[3],r*n[0],r*(n[2]*n[3]-n[0]*n[5])]}function Vn(n,r){return[n[0]*r[0]+n[1]*r[3],n[0]*r[1]+n[1]*r[4],n[0]*r[2]+n[1]*r[5]+n[2],n[3]*r[0]+n[4]*r[3],n[3]*r[1]+n[4]*r[4],n[3]*r[2]+n[4]*r[5]+n[5]]}function Qn(n,r){return[n[0]-r[0],n[1]-r[1]]}function Nn(n){return u(n[0]*n[0]+n[1]*n[1])}function _n(n,r){return Fr(n[0]*r[1]-n[1]*r[0],n[0]*r[0]+n[1]*r[1])}function Kn(n,e,t){var o,i,u=e.edges,a=u.length,c={type:"MultiPoint",coordinates:e.face},f=e.face.filter(function(n){return 90!==zr(n[1])}),l=r.geoBounds({type:"MultiPoint",coordinates:f}),v=!1,g=-1,s=l[1][0]-l[0][0],h=180===s||360===s?[(l[0][0]+l[1][0])/2,(l[0][1]+l[1][1])/2]:r.geoCentroid(c);if(t)for(;++g<a&&u[g]!==t;);++g;for(var p=0;p<a;++p)i=u[(p+g)%a],Array.isArray(i)?(v||(n.point((o=r.geoInterpolate(i[0],h)(_r))[0],o[1]),v=!0),n.point((o=r.geoInterpolate(i[1],h)(_r))[0],o[1])):(v=!1,i!==t&&Kn(n,i,e))}function On(n,r){return n&&r&&n[0]===r[0]&&n[1]===r[1]}function Un(n,r){for(var e,t,o=n.length,i=null,u=0;u<o;++u){e=n[u];for(var a=r.length;--a>=0;)if(t=r[a],e[0]===t[0]&&e[1]===t[1]){if(i)return[i,e];i=e}}}function Jn(n){for(var r=n.length,e=[],t=n[r-1],o=0;o<r;++o)e.push([t,t=n[o]]);return e}function Xn(n){return n.project.invert||n.children&&n.children.some(Xn)}function Yn(n,r){var e=z(n,r);return[e[0]*oo,e[1]]}function Zn(n,r){for(var e=0,t=n.length,o=0;e<t;++e)o+=n[e]*r[e];return o}function $n(n,r){return[n[1]*r[2]-n[2]*r[1],n[2]*r[0]-n[0]*r[2],n[0]*r[1]-n[1]*r[0]]}function nr(n){return[Fr(n[1],n[0])*ne,o(Ir(-1,Wr(1,n[2])))*ne]}function rr(n){var r=n[0]*re,e=n[1]*re,t=xr(e);return[t*xr(r),t*Qr(r),Qr(e)]}function er(n,r){return{type:"FeatureCollection",features:n.features.map(function(n){return tr(n,r)})}}function tr(n,r){return{type:"Feature",id:n.id,properties:n.properties,geometry:ir(n.geometry,r)}}function or(n,r){return{type:"GeometryCollection",geometries:n.geometries.map(function(n){return ir(n,r)})}}function ir(n,e){if(!n)return null;if("GeometryCollection"===n.type)return or(n,e);var t;switch(n.type){case"Point":t=so;break;case"MultiPoint":t=so;break;case"LineString":t=ho;break;case"MultiLineString":t=ho;break;case"Polygon":t=po;break;case"MultiPolygon":t=po;break;case"Sphere":t=po;break;default:return null}return r.geoStream(n,e(t)),t.result()}function ur(n){function r(r,t){var o=e?Nr(r*e/2)/e:r/2;if(!t)return[2*o,-n];var i=2*qr(o*Qr(t)),u=1/Nr(t);return[Qr(i)*u,t+(1-xr(i))*u-n]}var e=Qr(n);return r.invert=function(r,t){if(zr(t+=n)<_r)return[e?2*qr(e*r/2)/e:r,0];var u,a=r*r+t*t,c=0,f=10;do{var l=Nr(c),v=1/xr(c),g=a-2*t*c+c*c;c-=u=(l*g+2*(c-t))/(2+g*v*v+2*(c-t)*l)}while(zr(u)>_r&&--f>0);var s=r*(l=Nr(c)),h=Nr(zr(t)<zr(c+1/l)?.5*o(s):.5*i(s)+Or/4)/Qr(c);return[e?2*qr(e*h)/e:2*h,c]},r}function ar(n,r){var e,t=Wr(18,36*zr(r)/Or),o=Lr(t),i=t-o,u=(e=Ro[o])[0],a=e[1],c=(e=Ro[++o])[0],f=e[1],l=(e=Ro[Wr(19,++o)])[0],v=e[1];return[n*(c+i*(l-u)/2+i*i*(l-2*c+u)/2),(r>0?Ur:-Ur)*(f+i*(v-a)/2+i*i*(v-2*f+a)/2)]}function cr(n){function r(r,e){var t=xr(e),o=(n-1)/(n-t*xr(r));return[o*t*Qr(r),o*Qr(e)]}return r.invert=function(r,e){var t=r*r+e*e,i=u(t),a=(n-u(1-t*(n+1)/(n-1)))/((n-1)/i+i/(n-1));return[Fr(r*a,i*u(1-a*a)),i?o(e*a/i):0]},r}function fr(n,r){function e(r,e){var u=t(r,e),a=u[1],c=a*i/(n-1)+o;return[u[0]*o/c,a/c]}var t=cr(n);if(!r)return t;var o=xr(r),i=Qr(r);return e.invert=function(r,e){var u=(n-1)/(n-1-e*i);return t.invert(u*r,u*e*o)},e}function lr(n){return Math.floor(n*Ao)/Ao}function vr(n){return n=lr(n),n<=Co?[0,Co]:n>=qo?[0,qo]:[bo,n]}function gr(n,r){for(var e=0,t=n.length;e<t;++e){var o=n[e];o.polygon=n,r.push(o);for(var i=0,u=o.length;i<u;++i){var a=o[i],c=a[0],f=a[1];if(c<=So||c>=Go||f<=zo||f>=Fo){for(var l=i+1;l<u;++l){var v=o[l],g=v[0],s=v[1];if(g>So&&g<Go&&s>zo&&s<Fo)break}if(l===i+1)continue;if(i){var h=o.slice(0,i+1);h.polygon=n,h[h.length-1]=vr(f),r[r.length-1]=h}else r.pop();if(l>=u)break;r.push(o=o.slice(l-1)),o[0]=vr(o[0][1]),o.polygon=n,i=-1,u=o.length}}}n.length=0}function sr(n){var r,e,t,o,i,u,a=n.length,c={},f={};for(r=0;r<a;++r)e=n[r],t=e[0],i=e[e.length-1],t[0]!==i[0]||t[1]!==i[1]?(e.index=r,c[t]=f[i]=e):(e.polygon.push(e),n[r]=null);for(r=0;r<a;++r)if(e=n[r]){if(t=e[0],i=e[e.length-1],o=f[t],u=c[i],delete c[t],delete f[i],t[0]===i[0]&&t[1]===i[1]){e.polygon.push(e);continue}o?(delete f[t],delete c[o[0]],o.pop(),n[o.index]=null,e=o.concat(e),e.polygon=o.polygon,o===u?e.polygon.push(e):(e.index=a++,n.push(c[e[0]]=f[e[e.length-1]]=e))):u?(delete c[i],delete f[u[u.length-1]],e.pop(),e=e.concat(u),e.polygon=u.polygon,e.index=a++,n[u.index]=null,n.push(c[e[0]]=f[e[e.length-1]]=e)):(e.push(e[0]),e.polygon.push(e))}}function hr(n){pr(n.geometry)}function pr(n){if(n){var r,e,t;switch(n.type){case"GeometryCollection":return n.geometries.forEach(pr);case"Polygon":gr(n.coordinates,r=[]);break;case"MultiPolygon":for(r=[],e=-1,t=n.coordinates.length;++e<t;)gr(n.coordinates[e],r);break;default:return}sr(r)}}function dr(n,r){var e=Nr(r/2),t=Qr(Jr*e);return[n*(.74482-.34588*t*t),1.70711*e]}function wr(n){function e(n,e){var o=r.geoGnomonicRaw(n,e);return o[0]*=t,o}var t=xr(n);return e.invert=function(n,e){return r.geoGnomonicRaw.invert(n/t,e)},e}function Pr(){return mr([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function mr(n,r){return Lo(wr,n,r)}function yr(n){function e(r,e){var c=i(xr(e)*xr(r-t)),f=i(xr(e)*xr(r-o)),l=e<0?-1:1;return c*=c,f*=f,[(c-f)/(2*n),l*u(4*a*f-(a-c+f)*(a-c+f))/(2*n)]}if(!(n*=2))return r.geoAzimuthalEquidistantRaw;var t=-n/2,o=-t,a=n*n,c=Nr(o),f=.5/Qr(o);return e.invert=function(n,r){var e,a,l=r*r,v=xr(u(l+(e=n+t)*e)),g=xr(u(l+(e=n+o)*e));return[Fr(a=v-g,e=(v+g)*c),(r<0?-1:1)*i(u(e*e+a*a)*f)]},e}function Rr(){return jr([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function jr(n,r){return Lo(yr,n,r)}function Mr(n,r){if(zr(r)<_r)return[n,0];var e=zr(r/Ur),t=o(e);if(zr(n)<_r||zr(zr(r)-Ur)<_r)return[0,Vr(r)*Or*Nr(t/2)];var i=xr(t),a=zr(Or/n-n/Or)/2,c=a*a,f=i/(e+i-1),l=f*(2/e-1),v=l*l,g=v+c,s=f-v,h=c+f;return[Vr(n)*Or*(a*s+u(c*s*s-g*(f*f-v)))/g,Vr(r)*Or*(l*h-a*u((c+1)*g-h*h))/g]}function Er(n,r){if(zr(r)<_r)return[n,0];var e=zr(r/Ur),t=o(e);if(zr(n)<_r||zr(zr(r)-Ur)<_r)return[0,Vr(r)*Or*Nr(t/2)];var i=xr(t),a=zr(Or/n-n/Or)/2,c=a*a,f=i*(u(1+c)-a*i)/(1+c*e*e);return[Vr(n)*Or*f,Vr(r)*Or*u(1-f*(2*a+f))]}function Ar(n,r){if(zr(r)<_r)return[n,0];var e=r/Ur,t=o(e);if(zr(n)<_r||zr(zr(r)-Ur)<_r)return[0,Or*Nr(t/2)];var i=(Or/n-n/Or)/2,a=e/(1+xr(t));return[Or*(Vr(n)*u(i*i+1-a*a)-i),Or*a]}function br(n,r){if(!r)return[n,0];var e=zr(r);if(!n||e===Ur)return[0,r];var t=e/Ur,o=t*t,i=(8*t-o*(o+2)-5)/(2*o*(t-1)),a=i*i,c=t*i,f=o+a+2*c,l=t+3*i,v=n/Ur,g=v+1/v,s=Vr(zr(n)-Ur)*u(g*g-4),h=s*s,p=f*(o+a*h-1)+(1-o)*(o*(l*l+4*a)+12*c*a+4*a*a),d=(s*(f+a-1)+2*u(p))/(4*f+h);return[Vr(n)*Ur*d,Vr(r)*Ur*u(1+s*zr(d)-d*d)]}function Sr(n,r){return[n*u(1-3*r*r/(Or*Or)),r]}function kr(n,r){var e=.90631*Qr(r),t=u(1-e*e),o=u(2/(1+t*xr(n/=3)));return[2.66723*t*o*Qr(n),1.24104*e*o]}function Gr(n,r){var e=xr(r),t=xr(n)*e,o=1-t,i=xr(n=Fr(Qr(n)*e,-Qr(r))),a=Qr(n);return e=u(1-t*t),[a*e-i*o,-i*e-a*o]}function Cr(n,r){var e=s(n,r);return[(e[0]+n/Ur)/2,(e[1]+r)/2]}var zr=Math.abs,qr=Math.atan,Fr=Math.atan2,xr=Math.cos,Br=Math.exp,Lr=Math.floor,Hr=Math.log,Ir=Math.max,Wr=Math.min,Tr=Math.pow,Dr=Math.round,Vr=Math.sign||function(n){return n>0?1:n<0?-1:0},Qr=Math.sin,Nr=Math.tan,_r=1e-6,Kr=1e-12,Or=Math.PI,Ur=Or/2,Jr=Or/4,Xr=Math.SQRT1_2,Yr=u(2),Zr=u(Or),$r=2*Or,ne=180/Or,re=Or/180,ee=function(){var n=Ur,e=r.geoProjectionMutator(g),t=e(n);return t.radius=function(r){return arguments.length?e(n=r*re):n*ne},t.scale(179.976).clipAngle(147)};s.invert=function(n,r){if(!(n*n+4*r*r>Or*Or+_r)){var e=n,t=r,o=25;do{var a,c=Qr(e),f=Qr(e/2),l=xr(e/2),v=Qr(t),g=xr(t),s=Qr(2*t),h=v*v,p=g*g,d=f*f,w=1-p*l*l,P=w?i(g*l)*u(a=1/w):a=0,m=2*P*g*f-n,y=P*v-r,R=a*(p*d+P*g*l*h),j=a*(.5*c*s-2*P*v*f),M=.25*a*(s*f-P*v*p*c),E=a*(h*l+P*d*g),A=j*M-E*R;if(!A)break;var b=(y*j-m*E)/A,S=(m*M-y*R)/A;e-=b,t-=S}while((zr(b)>_r||zr(S)>_r)&&--o>0);return[e,t]}};var te=function(){return r.geoProjection(s).scale(152.63)},oe=function(){var n=20*re,e=n>=0?1:-1,t=Nr(e*n),o=r.geoProjectionMutator(h),i=o(n),u=i.stream;return i.parallel=function(r){return arguments.length?(t=Nr((e=(n=r*re)>=0?1:-1)*n),o(n)):n*ne},i.stream=function(r){var o=i.rotate(),a=u(r),c=(i.rotate([0,0]),u(r));return i.rotate(o),a.sphere=function(){c.polygonStart(),c.lineStart();for(var r=e*-180;e*r<180;r+=90*e)c.point(r,90*e);for(;e*(r-=n)>=-180;)c.point(r,e*-Fr(xr(r*re/2),t)*ne);c.lineEnd(),c.polygonEnd()},a},i.scale(218.695).center([0,28.0974])};p.invert=function(n,r){if(n*=3/8,r*=3/8,!n&&zr(r)>1)return null;var e=n*n,t=r*r,i=1+e+t,a=u((i-u(i*i-4*r*r))/2),g=o(a)/3,s=a?v(zr(r/a))/3:l(zr(n))/3,h=xr(g),p=f(s),d=p*p-h*h;return[2*Vr(n)*Fr(c(s)*h,.25-d),2*Vr(r)*Fr(p*Qr(g),.25+d)]};var ie=function(){return r.geoProjection(p).scale(66.1603)},ue=u(8),ae=Hr(1+Yr);d.invert=function(n,r){if((t=zr(r))<ae)return[n,2*qr(Br(r))-Ur];var e,t,o=Jr,i=25;do{var u=xr(o/2),a=Nr(o/2);o-=e=(ue*(o-Jr)-Hr(a)-t)/(ue-u*u/(2*a))}while(zr(e)>Kr&&--i>0);return[n/(xr(o)*(ue-1/Qr(o))),Vr(r)*o]};var ce=function(){return r.geoProjection(d).scale(112.314)},fe=function(){var n=5,e=r.geoProjectionMutator(w),t=e(n),i=t.stream,u=.01,a=-xr(u*re),c=Qr(u*re);return t.lobes=function(r){return arguments.length?e(n=+r):n},t.stream=function(r){var e=t.rotate(),f=i(r),l=(t.rotate([0,0]),i(r));return t.rotate(e),f.sphere=function(){l.polygonStart(),l.lineStart();for(var r=0,e=360/n,t=2*Or/n,i=90-180/n,f=Ur;r<n;++r,i-=e,f-=t)l.point(Fr(c*xr(f),a)*ne,o(c*Qr(f))*ne),i<-90?(l.point(-90,-180-i-u),l.point(-90,-180-i+u)):(l.point(90,i+u),l.point(90,i-u));l.lineEnd(),l.polygonEnd()},f},t.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},le=m(Yr/Ur,Yr,Or),ve=function(){return r.geoProjection(le).scale(169.529)},ge=2.00276,se=1.11072;y.invert=function(n,r){var e,t,o=ge*r,i=r<0?-Jr:Jr,u=25;do t=o-Yr*Qr(i),i-=e=(Qr(2*i)+2*i-Or*Qr(t))/(2*xr(2*i)+2+Or*xr(t)*Yr*xr(i));while(zr(e)>_r&&--u>0);return t=o-Yr*Qr(i),[n*(1/xr(t)+se/xr(i))/ge,t]};var he=function(){return r.geoProjection(y).scale(160.857)},pe=function(n){var e=0,t=r.geoProjectionMutator(n),o=t(e);return o.parallel=function(n){return arguments.length?t(e=n*re):e*ne},o};R.invert=function(n,r){return[n/xr(r),r]};var de=function(){return r.geoProjection(R).scale(152.63)},we=function(){return pe(j).scale(123.082).center([0,26.1441]).parallel(45)},Pe=function(){var n=.5,e=r.geoProjectionMutator(M),t=e(n);return t.fraction=function(r){return arguments.length?e(n=+r):n},t.scale(158.837)},me=m(1,4/Or,Or),ye=function(){return r.geoProjection(me).scale(152.63)};z.invert=function(n,r){var e=(e=r/Zr-1)*e;return[e>0?n*u(Or/e)/2:0,o(1-e)]};var Re=function(){return r.geoProjection(z).scale(95.6464).center([0,30])},je=function(){return pe(q).scale(249.828).clipAngle(90)},Me=u(3);F.invert=function(n,r){var e=3*o(r/(Me*Zr));return[Zr*n/(Me*(2*xr(2*e/3)-1)),e]};var Ee=function(){return r.geoProjection(F).scale(156.19)},Ae=function(){return pe(x).parallel(38.58).scale(195.044)},be=function(){return pe(B).scale(124.75)};L.invert=function(n,r){var e=u(8/(3*Or)),t=r/e;return[n/(e*(1-zr(t)/Or)),t]};var Se=function(){return r.geoProjection(L).scale(165.664)};H.invert=function(n,r){var e=2-zr(r)/u(2*Or/3);return[n*u(6*Or)/(2*e),Vr(r)*o((4-e*e)/3)]};var ke=function(){return r.geoProjection(H).scale(165.664)};I.invert=function(n,r){var e=u(Or*(4+Or))/2;return[n*e/(1+u(1-r*r*(4+Or)/(4*Or))),r*e/2]};var Ge=function(){return r.geoProjection(I).scale(180.739)};W.invert=function(n,r){var e=r*u((4+Or)/Or)/2,t=o(e),i=xr(t);return[n/(2/u(Or*(4+Or))*(1+i)),o((t+e*(i+2))/(2+Ur))]};var Ce=function(){return r.geoProjection(W).scale(180.739)};T.invert=function(n,r){var e=u(2+Or),t=r*e/2;return[e*n/(1+xr(t)),t]};var ze=function(){return r.geoProjection(T).scale(173.044)};D.invert=function(n,r){var e=1+Ur,t=u(e/2);return[2*n*t/(1+xr(r*=t)),o((r+Qr(r))/e)]};var qe=function(){return r.geoProjection(D).scale(173.044)},Fe=3+2*Yr;V.invert=function(n,r){if(!(e=p.invert(n/1.2,1.065*r)))return null;var e,t=e[0],o=e[1],i=20;n/=Fe,r/=Fe;do{var a=t/2,c=o/2,f=Qr(a),l=xr(a),v=Qr(c),g=xr(c),s=xr(o),h=u(s),d=v/(g+Yr*l*h),w=d*d,P=u(2/(1+w)),m=Yr*g+(l+f)*h,y=Yr*g+(l-f)*h,R=m/y,j=u(R),M=j-1/j,E=j+1/j,A=P*M-2*Hr(j)-n,b=P*d*E-2*qr(d)-r,S=v&&Xr*h*f*w/v,k=(Yr*l*g+h)/(2*(g+Yr*l*h)*(g+Yr*l*h)*h),G=-.5*d*P*P*P,C=G*S,z=G*k,q=(q=2*g+Yr*h*(l-f))*q*j,F=(Yr*l*g*h+s)/q,x=-(Yr*f*v)/(h*q),B=M*C-2*F/j+P*(F+F/R),L=M*z-2*x/j+P*(x+x/R),H=d*E*C-2*S/(1+w)+P*E*S+P*d*(F-F/R),I=d*E*z-2*k/(1+w)+P*E*k+P*d*(x-x/R),W=L*H-I*B;if(!W)break;var T=(b*L-A*I)/W,D=(A*H-b*B)/W;t-=T,o=Ir(-Ur,Wr(Ur,o-D))}while((zr(T)>_r||zr(D)>_r)&&--i>0);return zr(zr(o)-Ur)<_r?[0,o]:i&&[t,o]};var xe=function(){return r.geoProjection(V).scale(62.5271)},Be=xr(35*re);Q.invert=function(n,r){var e=r/(1+Be);return[n&&n/(Be*u(1-e*e)),2*qr(e)]};var Le=function(){return r.geoProjection(Q).scale(137.152)};N.invert=function(n,r){var e=qr(r/Zr),t=xr(e),o=2*e;return[n*Zr/2/(xr(o)*t*t),o]};var He=function(){return r.geoProjection(N).scale(135.264)},Ie=function(n){function e(n){return i(_(n))}function t(n){e[n]=function(r){return arguments.length?(i[n](r),e):i[n]()}}null==n&&(n=r.geoOrthographic);var i=n(),u=r.geoEquirectangular().scale(ne).precision(0).clipAngle(null).translate([0,0]);return i.invert&&(e.invert=function(n){return K(i.invert(n))}),e.stream=function(n){var r=i.stream(n),e=u.stream({point:function(n,e){r.point(n/2,o(Nr(-e/2*re))*ne)},lineStart:function(){r.lineStart()},lineEnd:function(){r.lineEnd()},polygonStart:function(){r.polygonStart()},polygonEnd:function(){r.polygonEnd()}});return e.sphere=r.sphere,e},e.rotate=function(n){return arguments.length?(u.rotate(n),e):u.rotate()},e.center=function(n){return arguments.length?(i.center(_(n)),e):K(i.center())},t("clipAngle"),t("clipExtent"),t("scale"),t("translate"),t("precision"),e.scale(249.5)},We=function(){var n=6,e=30*re,t=xr(e),i=Qr(e),u=r.geoProjectionMutator(O),a=u(e,n),c=a.stream,f=.01,l=-xr(f*re),v=Qr(f*re);return a.radius=function(r){return arguments.length?(t=xr(e=r*re),i=Qr(e),u(e,n)):e*ne},a.lobes=function(r){return arguments.length?u(e,n=+r):n},a.stream=function(r){var e=a.rotate(),u=c(r),f=(a.rotate([0,0]),c(r));return a.rotate(e),u.sphere=function(){f.polygonStart(),f.lineStart();for(var r=0,e=2*Or/n,u=0;r<n;++r,u-=e)f.point(Fr(v*xr(u),l)*ne,o(v*Qr(u))*ne),f.point(Fr(i*xr(u-e/2),t)*ne,o(i*Qr(u-e/2))*ne);f.lineEnd(),f.polygonEnd()},u},a.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},Te=function(n,r,e,t,i,a,c,f){function l(u,l){if(!l)return[n*u/Or,0];var v=l*l,g=n+v*(r+v*(e+v*t)),s=l*(i-1+v*(a-f+v*c)),h=(g*g+s*s)/(2*s),p=u*o(g/h)/Or;return[h*Qr(p),l*(1+v*f)+h*(1-xr(p))]}return arguments.length<8&&(f=0),l.invert=function(l,v){var g,s,h=Or*l/n,p=v,d=50;do{var w=p*p,P=n+w*(r+w*(e+w*t)),m=p*(i-1+w*(a-f+w*c)),y=P*P+m*m,R=2*m,j=y/R,M=j*j,E=o(P/j)/Or,A=h*E,b=P*P,S=(2*r+w*(4*e+6*w*t))*p,k=i+w*(3*a+5*w*c),G=2*(P*S+m*(k-1)),C=2*(k-1),z=(G*R-y*C)/(R*R),q=xr(A),F=Qr(A),x=j*q,B=j*F,L=h/Or*(1/u(1-b/M))*(S*j-P*z)/M,H=B-l,I=p*(1+w*f)+j-x-v,W=z*F+x*L,T=x*E,D=1+z-(z*q-B*L),V=B*E,Q=W*V-D*T;if(!Q)break;h-=g=(I*W-H*D)/Q,p-=s=(H*V-I*T)/Q}while((zr(g)>_r||zr(s)>_r)&&--d>0);return[h,p]},l},De=Te(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Ve=function(){return r.geoProjection(De).scale(149.995)},Qe=Te(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Ne=function(){return r.geoProjection(Qe).scale(153.93)},_e=Te(5/6*Or,-.62636,-.0344,0,1.3493,-.05524,0,.045),Ke=function(){return r.geoProjection(_e).scale(130.945)};X.invert=function(n,r){var e,t=n,o=r,i=50;do{var u=o*o;o-=e=(o*(1+u/12)-r)/(1+u/4)}while(zr(e)>_r&&--i>0);i=50,n/=1-.162388*u;do{var a=(a=t*t)*a;t-=e=(t*(.87-952426e-9*a)-n)/(.87-.00476213*a)}while(zr(e)>_r&&--i>0);return[t,o]};var Oe=function(){return r.geoProjection(X).scale(131.747)},Ue=Te(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762),Je=function(){return r.geoProjection(Ue).scale(131.087)},Xe=function(n){ | ||
function r(r,t){var o=r>0?-.5:.5,i=n(r+o*Or,t);return i[0]-=o*e,i}var e=n(Ur,0)[0]-n(-Ur,0)[0];return n.invert&&(r.invert=function(r,t){var o=r>0?-.5:.5,i=n.invert(r+o*e,t),u=i[0]-o*Or;return u<-Or?u+=2*Or:u>Or&&(u-=2*Or),i[0]=u,i}),r};Y.invert=function(n,r){var e=Vr(n),t=Vr(r),i=-e*n,u=-t*r,a=u/i<1,c=$(a?u:i,a?i:u),f=c[0],l=c[1],v=xr(l);return a&&(f=-Ur-f),[e*(Fr(Qr(f)*v,-Qr(l))+Or),t*o(xr(f)*v)]};var Ye=function(){return r.geoProjection(Xe(Y)).scale(239.75)};on.invert=function(n,r){var e=(Yr-1)/(Yr+1),t=u(1-e*e),o=tn(Ur,t*t),i=-1,a=nn(.5*o-r,-n,t*t),c=an(a[0],a[1]),f=Fr(c[1],c[0])/i;return[f,2*qr(Br(.5/i*Hr(e*c[0]*c[0]+e*c[1]*c[1])))-Ur]};var Ze=function(){return r.geoProjection(Xe(on)).scale(151.496)};fn.invert=function(n,r){var e=2*o(r/2);return[n*xr(e/2)/xr(e),e]};var $e=function(){var n=2,e=r.geoProjectionMutator(cn),t=e(n);return t.coefficient=function(r){return arguments.length?e(n=+r):n},t.scale(169.529)},nt=function(){var n=0,e=r.geoProjectionMutator(ln),t=e(n),o=t.rotate,i=t.stream,u=r.geoCircle();return t.parallel=function(r){if(!arguments.length)return n*ne;var o=t.rotate();return e(n=r*re).rotate(o)},t.rotate=function(r){return arguments.length?(o.call(t,[r[0],r[1]-n*ne]),u.center([-r[0],-r[1]]),t):(r=o.call(t),r[1]+=n*ne,r)},t.stream=function(n){return n=i(n),n.sphere=function(){n.polygonStart();var r,e=.01,t=u.radius(90-e)().coordinates[0],o=t.length-1,i=-1;for(n.lineStart();++i<o;)n.point((r=t[i])[0],r[1]);for(n.lineEnd(),t=u.radius(90+e)().coordinates[0],o=t.length-1,n.lineStart();--i>=0;)n.point((r=t[i])[0],r[1]);n.lineEnd(),n.polygonEnd()},n},t.scale(79.4187).parallel(45).clipAngle(179.999)},rt=41+48/36+37/3600,et=x(0),tt=function(){var n=4,e=r.geoProjectionMutator(gn),t=e(n),o=t.stream;return t.lobes=function(r){return arguments.length?e(n=+r):n},t.stream=function(e){var i=t.rotate(),u=o(e),a=(t.rotate([0,0]),o(e));return t.rotate(i),u.sphere=function(){r.geoStream(sn(180/n),a)},u},t.scale(239.75)},ot=function(){var n=1,e=r.geoProjectionMutator(hn),t=e(n);return t.ratio=function(r){return arguments.length?e(n=+r):n},t.scale(167.774).center([0,18.67])},it=.7109889596207567,ut=.0528035274542;pn.invert=function(n,r){return r>-it?le.invert(n,r-ut):R.invert(n,r)};var at=function(){return r.geoProjection(pn).rotate([-20,-55]).scale(164.263).center([0,-5.4036])};dn.invert=function(n,r){return zr(r)>it?le.invert(n,r+(r>0?ut:-ut)):R.invert(n,r)};var ct=function(){return r.geoProjection(dn).scale(152.63)},ft=function(n,e){function t(r,t){for(var o=t<0?-1:1,i=e[+(t<0)],u=0,a=i.length-1;u<a&&r>i[u][2][0];++u);var c=n(r-i[u][1][0],t);return c[0]+=n(i[u][1][0],o*t>o*i[u][0][1]?i[u][0][1]:t)[0],c}var o=mn(e);e=e.map(function(n){return n.map(function(n){return[[n[0][0]*re,n[0][1]*re],[n[1][0]*re,n[1][1]*re],[n[2][0]*re,n[2][1]*re]]})});var i=e.map(function(r){return r.map(function(r){var e,t=n(r[0][0],r[0][1])[0],o=n(r[2][0],r[2][1])[0],i=n(r[1][0],r[0][1])[1],u=n(r[1][0],r[1][1])[1];return i>u&&(e=i,i=u,u=e),[[t,i],[o,u]]})}),u=r.geoProjection(t),a=u.stream;return n.invert&&(t.invert=function(r,o){for(var u=i[+(o<0)],a=e[+(o<0)],c=0,f=u.length;c<f;++c){var l=u[c];if(l[0][0]<=r&&r<l[1][0]&&l[0][1]<=o&&o<l[1][1]){var v=n.invert(r-n(a[c][1][0],0)[0],o);return v[0]+=a[c][1][0],wn(t(v[0],v[1]),[r,o])?v:null}}}),u.stream=function(n){var e=u.rotate(),t=a(n),i=(u.rotate([0,0]),a(n));return u.rotate(e),t.sphere=function(){r.geoStream(o,i)},t},u},lt=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],vt=function(){return ft(y,lt).scale(160.857)},gt=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],st=function(){return ft(dn,gt).scale(152.63)},ht=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],pt=function(){return ft(le,ht).scale(169.529)},dt=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],wt=function(){return ft(le,dt).scale(169.529).rotate([20,0])},Pt=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],mt=function(){return ft(pn,Pt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},yt=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]],Rt=function(){return ft(R,yt).scale(152.63).rotate([-20,0])};yn.invert=function(n,r){return[$r/3*n/u(Or*Or/3-r*r),r]};var jt=function(){return r.geoProjection(yn).scale(158.837)},Mt=function(){var n=.5,e=r.geoProjectionMutator(Rn),t=e(n);return t.spacing=function(r){return arguments.length?e(n=+r):n},t.scale(124.75)},Et=Or/Yr;jn.invert=function(n,r){var e=zr(n),t=zr(r),o=_r,a=Ur;t<Et?a*=t/Et:o+=6*i(Et/t);for(var c=0;c<25;c++){var f=Qr(a),l=u(xr(a)),v=Qr(a/2),g=xr(a/2),s=Qr(o/6),h=xr(o/6),p=.5*o*(1+l)-e,d=a/(g*h)-t,w=l?-.25*o*f/l:0,P=.5*(1+l),m=(1+.5*a*v/g)/(g*h),y=a/g*(s/6)/(h*h),R=w*y-m*P,j=(p*y-d*P)/R,M=(d*w-p*m)/R;if(a-=j,o-=M,zr(j)<_r&&zr(M)<_r)break}return[n<0?-o:o,r<0?-a:a]};var At=function(){return r.geoProjection(jn).scale(97.2672)};Mn.invert=function(n,r){var e=Vr(n)*Or,t=r/2,o=50;do{var i=e*e,u=t*t,a=e*t,c=e*(.975534+u*(-.119161+i*-.0143059+u*-.0547009))-n,f=t*(1.00384+i*(.0802894+u*-.02855+199025e-9*i)+u*(.0998909+u*-.0491032))-r,l=.975534-u*(.119161+3*i*.0143059+.0547009*u),v=-a*(.238322+.2188036*u+.0286118*i),g=a*(.1605788+7961e-7*i+-.0571*u),s=1.00384+i*(.0802894+199025e-9*i)+u*(3*(.0998909-.02855*i)-.245516*u),h=v*g-s*l,p=(f*v-c*s)/h,d=(c*g-f*l)/h;e-=p,t-=d}while((zr(p)>_r||zr(d)>_r)&&--o>0);return o&&[e,t]};var bt=function(){return r.geoProjection(Mn).scale(139.98)};En.invert=function(n,r){var e=n*n,t=r*r,a=t+1,c=n?Xr*u((a-u(e*e+2*e*(t-1)+a*a))/e+1):1/u(a);return[o(n*c),Vr(r)*i(c)]};var St=function(){return r.geoProjection(En).scale(144.049).clipAngle(89.999)},kt=function(){return pe(An).parallel(40).scale(158.837)};bn.invert=function(n,r){return[n,2.5*qr(Br(.8*r))-.625*Or]};var Gt=function(){return r.geoProjection(bn).scale(108.318)},Ct=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],zt=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],qt=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],Ft=[[.9245,0],[0,0],[.01943,0]],xt=[[.721316,0],[0,0],[-.00881625,-.00617325]],Bt=u(6),Lt=u(7);xn.invert=function(n,r){var e=3*o(r*Lt/9);return[n*Lt/(Bt*(2*xr(2*e/3)-1)),o(3*Qr(e)*Bt/7)]};var Ht=function(){return r.geoProjection(xn).scale(164.859)};Bn.invert=function(n,r){var e=r*u(2+Yr)/(2*u(3)),t=2*o(e);return[3*Yr*n/(1+2*xr(t)/xr(t/2)),o((e+Qr(t))/(1+Xr))]};var It=function(){return r.geoProjection(Bn).scale(188.209)};Ln.invert=function(n,r){var e=u(6/(4+Or)),t=r/e;return zr(zr(t)-Ur)<_r&&(t=t<0?-Ur:Ur),[1.5*n/(e*(.5+xr(t))),o((t/2+Qr(t))/(1+Or/4))]};var Wt=function(){return r.geoProjection(Ln).scale(166.518)};Hn.invert=function(n,r){var e,t=r,o=25;do{var i=t*t,u=i*i;t-=e=(t*(1.007226+i*(.015085+u*(-.044475+.028874*i-.005916*u)))-r)/(1.007226+i*(.045255+u*(-.311325+.259866*i-.005916*11*u)))}while(zr(e)>_r&&--o>0);return[n/(.8707+(i=t*t)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),t]};var Tt=function(){return r.geoProjection(Hn).scale(175.295)};In.invert=function(n,r){for(var e=r/2,t=0,o=1/0;t<10&&zr(o)>_r;++t){var i=xr(r/2);r-=o=(r-Nr(r/2)-e)/(1-.5/(i*i))}return[2*n/(1+xr(r)),r]};var Dt=function(){return r.geoProjection(In).scale(152.63)},Vt=1.0148,Qt=.23185,Nt=-.14499,_t=.02406,Kt=Vt,Ot=5*Qt,Ut=7*Nt,Jt=9*_t,Xt=1.790857183;Wn.invert=function(n,r){r>Xt?r=Xt:r<-Xt&&(r=-Xt);var e,t=r;do{var o=t*t;t-=e=(t*(Vt+o*o*(Qt+o*(Nt+_t*o)))-r)/(Kt+o*o*(Ot+o*(Ut+Jt*o)))}while(zr(e)>_r);return[n,t]};var Yt=function(){return r.geoProjection(Wn).scale(139.319)};Tn.invert=function(n,r){if(zr(r)<_r)return[n,0];var e,t=n*n+r*r,u=.5*r,a=10;do{var c=Nr(u),f=1/xr(u),l=t-2*r*u+u*u;u-=e=(c*l+2*(u-r))/(2+l*f*f+2*(u-r)*c)}while(zr(e)>_r&&--a>0);return c=Nr(u),[(zr(r)<zr(u+1/c)?o(n*c):Vr(n)*(i(zr(n*c))+Ur))/Qr(u),u]};var Zt=function(){return r.geoProjection(Tn).scale(103.74)},$t=function(n,r){var e=Qn(n[1],n[0]),t=Qn(r[1],r[0]),o=_n(e,t),i=Nn(e)/Nn(t);return Vn([1,0,n[0][0],0,1,n[0][1]],Vn([i,0,0,0,i,0],Vn([xr(o),Qr(o),0,-Qr(o),xr(o),0],[1,0,-r[0][0],0,1,-r[0][1]])))},no=function(n,e,t){function o(n,r){if(n.edges=Jn(n.face),r)if(r.face){var e=n.shared=Un(n.face,r.face),t=$t(e.map(r.project),e.map(n.project));n.transform=r.transform?Vn(r.transform,t):t;for(var i=r.edges,u=0,a=i.length;u<a;++u)On(e[0],i[u][1])&&On(e[1],i[u][0])&&(i[u]=n),On(e[0],i[u][0])&&On(e[1],i[u][1])&&(i[u]=n);for(i=n.edges,u=0,a=i.length;u<a;++u)On(e[0],i[u][0])&&On(e[1],i[u][1])&&(i[u]=r),On(e[0],i[u][1])&&On(e[1],i[u][0])&&(i[u]=r)}else n.transform=r.transform;return n.children&&n.children.forEach(function(r){o(r,n)}),n}function i(n,r){var t,o=e(n,r),i=o.project([n*ne,r*ne]);return(t=o.transform)?[t[0]*i[0]+t[1]*i[1]+t[2],-(t[3]*i[0]+t[4]*i[1]+t[5])]:(i[1]=-i[1],i)}function u(n,r){var e=n.project.invert,t=n.transform,o=r;if(t&&(t=Dn(t),o=[t[0]*o[0]+t[1]*o[1]+t[2],t[3]*o[0]+t[4]*o[1]+t[5]]),e&&n===a(i=e(o)))return i;for(var i,c=n.children,f=0,l=c&&c.length;f<l;++f)if(i=u(c[f],r))return i}function a(n){return e(n[0]*re,n[1]*re)}t=null==t?-Or/6:t,o(n,{transform:[xr(t),Qr(t),0,-Qr(t),xr(t),0]}),Xn(n)&&(i.invert=function(r,e){var t=u(n,[r,-e]);return t&&(t[0]*=re,t[1]*=re,t)});var c=r.geoProjection(i),f=c.stream;return c.stream=function(r){var e=c.rotate(),t=f(r),o=(c.rotate([0,0]),f(r));return c.rotate(e),t.sphere=function(){o.polygonStart(),o.lineStart(),Kn(o,n),o.lineEnd(),o.polygonEnd()},t},c},ro=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],eo=[[0,2,1],[0,3,2],[5,1,2],[5,2,3],[0,1,4],[0,4,3],[5,4,1],[5,3,4]].map(function(n){return n.map(function(n){return ro[n]})}),to=function(n){n=n||function(n){var e=r.geoCentroid({type:"MultiPoint",coordinates:n});return r.geoGnomonic().scale(1).translate([0,0]).rotate([-e[0],-e[1]])};var e=eo.map(function(r){return{face:r,project:n(r)}});return[-1,0,0,1,0,1,4,5].forEach(function(n,r){var t=e[n];t&&(t.children||(t.children=[])).push(e[r])}),no(e[0],function(n,r){return e[n<-Or/2?r<0?6:4:n<0?r<0?2:0:n<Or/2?r<0?3:1:r<0?7:5]}).scale(101.858).center([0,45])},oo=2/u(3);Yn.invert=function(n,r){return z.invert(n/oo,r)};var io=function(n){n=n||function(n){var e=r.geoCentroid({type:"MultiPoint",coordinates:n});return r.geoProjection(Yn).translate([0,0]).scale(1).rotate(e[1]>0?[-e[0],0]:[180-e[0],180])};var e=eo.map(function(r){return{face:r,project:n(r)}});return[-1,0,0,1,0,1,4,5].forEach(function(n,r){var t=e[n];t&&(t.children||(t.children=[])).push(e[r])}),no(e[0],function(n,r){return e[n<-Or/2?r<0?6:4:n<0?r<0?2:0:n<Or/2?r<0?3:1:r<0?7:5]}).scale(121.906).center([0,48.5904])},uo=function(n){function e(n,r){var e=xr(r),t=[e*xr(n),e*Qr(n),Qr(r)],i=n<-Or/2?r<0?6:4:n<0?r<0?2:0:n<Or/2?r<0?3:1:r<0?7:5,a=o[i];return u[Zn(a[0],t)<0?8+3*i:Zn(a[1],t)<0?8+3*i+1:Zn(a[2],t)<0?8+3*i+2:i]}n=n||function(n){var e=6===n.length?r.geoCentroid({type:"MultiPoint",coordinates:n}):n[0];return r.geoGnomonic().scale(1).translate([0,0]).rotate([-e[0],-e[1]])};var t=eo.map(function(n){for(var r,e=n.map(rr),t=e.length,o=e[t-1],i=[],u=0;u<t;++u)r=e[u],i.push(nr([.9486832980505138*o[0]+.31622776601683794*r[0],.9486832980505138*o[1]+.31622776601683794*r[1],.9486832980505138*o[2]+.31622776601683794*r[2]]),nr([.9486832980505138*r[0]+.31622776601683794*o[0],.9486832980505138*r[1]+.31622776601683794*o[1],.9486832980505138*r[2]+.31622776601683794*o[2]])),o=r;return i}),o=[],i=[-1,0,0,1,0,1,4,5];t.forEach(function(n,r){for(var e=eo[r],u=e.length,a=o[r]=[],c=0;c<u;++c)t.push([e[c],n[(2*c+2)%(2*u)],n[(2*c+1)%(2*u)]]),i.push(r),a.push($n(rr(n[(2*c+2)%(2*u)]),rr(n[(2*c+1)%(2*u)])))});var u=t.map(function(r){return{project:n(r),face:r}});return i.forEach(function(n,r){var e=u[n];e&&(e.children||(e.children=[])).push(u[r])}),no(u[0],e).scale(110.625).center([0,45])},ao=function(){},co=function(n){if((r=n.length)<4)return!1;for(var r,e=0,t=n[r-1][1]*n[0][0]-n[r-1][0]*n[0][1];++e<r;)t+=n[e-1][1]*n[e][0]-n[e-1][0]*n[e][1];return t<=0},fo=function(n,r){for(var e=r[0],t=r[1],o=!1,i=0,u=n.length,a=u-1;i<u;a=i++){var c=n[i],f=c[0],l=c[1],v=n[a],g=v[0],s=v[1];l>t^s>t&&e<(g-f)*(t-l)/(s-l)+f&&(o=!o)}return o},lo=function(n,r){var e,t=r.stream;if(!t)throw new Error("invalid projection");switch(n&&n.type){case"Feature":e=tr;break;case"FeatureCollection":e=er;break;default:e=ir}return e(n,t)},vo=[],go=[],so={point:function(n,r){vo.push([n,r])},result:function(){var n=vo.length?vo.length<2?{type:"Point",coordinates:vo[0]}:{type:"MultiPoint",coordinates:vo}:null;return vo=[],n}},ho={lineStart:ao,point:function(n,r){vo.push([n,r])},lineEnd:function(){vo.length&&(go.push(vo),vo=[])},result:function(){var n=go.length?go.length<2?{type:"LineString",coordinates:go[0]}:{type:"MultiLineString",coordinates:go}:null;return go=[],n}},po={polygonStart:ao,lineStart:ao,point:function(n,r){vo.push([n,r])},lineEnd:function(){var n=vo.length;if(n){do vo.push(vo[0].slice());while(++n<4);go.push(vo),vo=[]}},polygonEnd:ao,result:function(){if(!go.length)return null;var n=[],r=[];return go.forEach(function(e){co(e)?n.push([e]):r.push(e)}),r.forEach(function(r){var e=r[0];n.some(function(n){if(fo(n[0],e))return n.push(r),!0})||n.push([r])}),go=[],n.length?n.length>1?{type:"MultiPolygon",coordinates:n}:{type:"Polygon",coordinates:n[0]}:null}},wo=function(n){function e(r,e){var o=zr(r)<Ur,i=n(o?r:r>0?r-Or:r+Or,e),u=(i[0]-i[1])*Xr,a=(i[0]+i[1])*Xr;if(o)return[u,a];var c=t*Xr,f=u>0^a>0?-1:1;return[f*u-Vr(a)*c,f*a-Vr(u)*c]}var t=n(Ur,0)[0]-n(-Ur,0)[0];return n.invert&&(e.invert=function(r,e){var o=(r+e)*Xr,i=(e-r)*Xr,u=zr(o)<.5*t&&zr(i)<.5*t;if(!u){var a=t*Xr,c=o>0^i>0?-1:1,f=-c*(r+(i>0?1:-1)*a),l=-c*(e+(o>0?1:-1)*a);o=(-f-l)*Xr,i=(f-l)*Xr}var v=n.invert(o,i);return u||(v[0]+=o>0?Or:-Or),v}),r.geoProjection(e).rotate([-90,-90,45]).clipAngle(179.999)},Po=function(){return wo(Y).scale(176.423)},mo=function(){return wo(on).scale(111.48)},yo=function(){return pe(ur).scale(131.215)},Ro=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];Ro.forEach(function(n){n[1]*=1.0144}),ar.invert=function(n,r){var e=r/Ur,t=90*e,o=Wr(18,zr(t/5)),i=Ir(0,Lr(o));do{var u=Ro[i][1],a=Ro[i+1][1],c=Ro[Wr(19,i+2)][1],f=c-u,l=c-2*a+u,v=2*(zr(e)-a)/f,g=l/f,s=v*(1-g*v*(1-2*g*v));if(s>=0||1===i){t=(r>=0?5:-5)*(s+o);var h,p=50;do o=Wr(18,zr(t)/5),i=Lr(o),s=o-i,u=Ro[i][1],a=Ro[i+1][1],c=Ro[Wr(19,i+2)][1],t-=(h=(r>=0?Ur:-Ur)*(a+s*(c-u)/2+s*s*(c-2*a+u)/2)-r)*ne;while(zr(h)>Kr&&--p>0);break}}while(--i>=0);var d=Ro[i][0],w=Ro[i+1][0],P=Ro[Wr(19,i+2)][0];return[n/(w+s*(P-d)/2+s*s*(P-2*w+d)/2),t*re]};var jo=function(){return r.geoProjection(ar).scale(152.63)},Mo=function(){var n=2,e=0,t=r.geoProjectionMutator(fr),o=t(n,e);return o.distance=function(r){return arguments.length?t(n=+r,e):n},o.tilt=function(r){return arguments.length?t(n,e=r*re):e*ne},o.scale(432.147).clipAngle(i(1/n)*ne-1e-6)},Eo=1e-4,Ao=1e4,bo=-180,So=bo+Eo,ko=180,Go=ko-Eo,Co=-90,zo=Co+Eo,qo=90,Fo=qo-Eo,xo=function(n){if(n)switch(n.type){case"Feature":hr(n);break;case"FeatureCollection":n.features.forEach(hr);break;default:pr(n)}return n};dr.invert=function(n,r){var e=r/1.70711,t=Qr(Jr*e);return[n/(.74482-.34588*t*t),2*qr(e)]};var Bo=function(){return r.geoProjection(dr).scale(146.153)},Lo=function(n,e,t){var i=r.geoInterpolate(e,t),u=i(.5),a=r.geoRotation([-u[0],-u[1]])(e),c=i.distance/2,f=-o(Qr(a[1]*re)/Qr(c)),l=[-u[0],-u[1],-(a[0]>0?Or-f:f)*ne],v=r.geoProjection(n(c)).rotate(l),g=r.geoRotation(l),s=v.center;return delete v.rotate,v.center=function(n){return arguments.length?s(g(n)):g.invert(s())},v.clipAngle(90)};Mr.invert=function(n,r){if(zr(r)<_r)return[n,0];if(zr(n)<_r)return[0,Ur*Qr(2*qr(r/Or))];var e=(n/=Or)*n,t=(r/=Or)*r,o=e+t,a=o*o,c=-zr(r)*(1+o),f=c-2*t+e,l=-2*c+1+2*t+a,v=t/l+(2*f*f*f/(l*l*l)-9*c*f/(l*l))/27,g=(c-f*f/(3*l))/l,s=2*u(-g/3),h=i(3*v/(g*s))/3;return[Or*(o-1+u(1+2*(e-t)+a))/(2*n),Vr(r)*Or*(-s*xr(h+Or/3)-f/(3*l))]};var Ho=function(){return r.geoProjection(Mr).scale(79.4183)};Er.invert=function(n,r){if(!n)return[0,Ur*Qr(2*qr(r/Or))];var e=zr(n/Or),t=(1-e*e-(r/=Or)*r)/(2*e),o=t*t,i=u(o+1);return[Vr(n)*Or*(i-t),Vr(r)*Ur*Qr(2*Fr(u((1-2*t*e)*(t+i)-e),u(i+t+e)))]};var Io=function(){return r.geoProjection(Er).scale(79.4183)};Ar.invert=function(n,r){if(!r)return[n,0];var e=r/Or,t=(Or*Or*(1-e*e)-n*n)/(2*Or*n);return[n?Or*(Vr(n)*u(t*t+1)-t):0,Ur*Qr(2*qr(e))]};var Wo=function(){return r.geoProjection(Ar).scale(79.4183)};br.invert=function(n,r){var e;if(!n||!r)return[n,r];r/=Or;var t=Vr(n)*n/Ur,o=(t*t-1+4*r*r)/zr(t),i=o*o,a=2*r,c=50;do{var f=a*a,l=(8*a-f*(f+2)-5)/(2*f*(a-1)),v=(3*a-f*a-10)/(2*f*a),g=l*l,s=a*l,h=a+l,p=h*h,d=a+3*l,w=p*(f+g*i-1)+(1-f)*(f*(d*d+4*g)+g*(12*s+4*g)),P=-2*h*(4*s*g+(1-4*f+3*f*f)*(1+v)+g*(-6+14*f-i+(-8+8*f-2*i)*v)+s*(-8+12*f+(-10+10*f-i)*v)),m=u(w),y=o*(p+g-1)+2*m-t*(4*p+i),R=o*(2*l*v+2*h*(1+v))+P/m-8*h*(o*(-1+g+p)+2*m)*(1+v)/(i+4*p);a-=e=y/R}while(e>_r&&--c>0);return[Vr(n)*(u(o*o+4)+o)*Or/4,Ur*a]};var To=function(){return r.geoProjection(br).scale(127.16)},Do=4*Or+3*u(3),Vo=2*u(2*Or*u(3)/Do),Qo=m(Vo*u(3)/Or,Vo,Do/6),No=function(){return r.geoProjection(Qo).scale(176.84)};Sr.invert=function(n,r){return[n/u(1-3*r*r/(Or*Or)),r]};var _o=function(){return r.geoProjection(Sr).scale(152.63)};kr.invert=function(n,r){var e=n/2.66723,t=r/1.24104,i=u(e*e+t*t),a=2*o(i/2);return[3*Fr(n*Nr(a),2.66723*i),i&&o(r*Qr(a)/(1.24104*.90631*i))]};var Ko=function(){return r.geoProjection(kr).scale(172.632)};Gr.invert=function(n,r){var e=(n*n+r*r)/-2,t=u(-e*(2+e)),i=r*e+n*t,a=n*e-r*t,c=u(a*a+i*i);return[Fr(t*i,c*(1+e)),c?-o(t*a/c):0]};var Oo=function(){return r.geoProjection(Gr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)};Cr.invert=function(n,r){var e=n,t=r,o=25;do{var a,c=xr(t),f=Qr(t),l=Qr(2*t),v=f*f,g=c*c,s=Qr(e),h=xr(e/2),p=Qr(e/2),d=p*p,w=1-g*h*h,P=w?i(c*h)*u(a=1/w):a=0,m=.5*(2*P*c*p+e/Ur)-n,y=.5*(P*f+t)-r,R=.5*a*(g*d+P*c*h*v)+.5/Ur,j=a*(s*l/4-P*f*p),M=.125*a*(l*p-P*f*g*s),E=.5*a*(v*h+P*d*c)+.5,A=j*M-E*R,b=(y*j-m*E)/A,S=(m*M-y*R)/A;e-=b,t-=S}while((zr(b)>_r||zr(S)>_r)&&--o>0);return[e,t]};var Uo=function(){return r.geoProjection(Cr).scale(158.837)};n.geoAiry=ee,n.geoAiryRaw=g,n.geoAitoff=te,n.geoAitoffRaw=s,n.geoArmadillo=oe,n.geoArmadilloRaw=h,n.geoAugust=ie,n.geoAugustRaw=p,n.geoBaker=ce,n.geoBakerRaw=d,n.geoBerghaus=fe,n.geoBerghausRaw=w,n.geoBoggs=he,n.geoBoggsRaw=y,n.geoBonne=we,n.geoBonneRaw=j,n.geoBottomley=Pe,n.geoBottomleyRaw=M,n.geoBromley=ye,n.geoBromleyRaw=me,n.geoChamberlin=C,n.geoChamberlinRaw=S,n.geoChamberlinAfrica=G,n.geoCollignon=Re,n.geoCollignonRaw=z,n.geoCraig=je,n.geoCraigRaw=q,n.geoCraster=Ee,n.geoCrasterRaw=F,n.geoCylindricalEqualArea=Ae,n.geoCylindricalEqualAreaRaw=x,n.geoCylindricalStereographic=be,n.geoCylindricalStereographicRaw=B,n.geoEckert1=Se,n.geoEckert1Raw=L,n.geoEckert2=ke,n.geoEckert2Raw=H,n.geoEckert3=Ge,n.geoEckert3Raw=I,n.geoEckert4=Ce,n.geoEckert4Raw=W,n.geoEckert5=ze,n.geoEckert5Raw=T,n.geoEckert6=qe,n.geoEckert6Raw=D,n.geoEisenlohr=xe,n.geoEisenlohrRaw=V,n.geoFahey=Le,n.geoFaheyRaw=Q,n.geoFoucaut=He,n.geoFoucautRaw=N,n.geoGilbert=Ie,n.geoGingery=We,n.geoGingeryRaw=O,n.geoGinzburg4=Ve,n.geoGinzburg4Raw=De,n.geoGinzburg5=Ne,n.geoGinzburg5Raw=Qe,n.geoGinzburg6=Ke,n.geoGinzburg6Raw=_e,n.geoGinzburg8=Oe,n.geoGinzburg8Raw=X,n.geoGinzburg9=Je,n.geoGinzburg9Raw=Ue,n.geoGringorten=Ye,n.geoGringortenRaw=Y,n.geoGuyou=Ze,n.geoGuyouRaw=on,n.geoHammer=$e,n.geoHammerRaw=cn,n.geoHammerRetroazimuthal=nt,n.geoHammerRetroazimuthalRaw=ln,n.geoHealpix=tt,n.geoHealpixRaw=gn,n.geoHill=ot,n.geoHillRaw=hn,n.geoHomolosine=ct,n.geoHomolosineRaw=dn,n.geoInterrupt=ft,n.geoInterruptedBoggs=vt,n.geoInterruptedHomolosine=st,n.geoInterruptedMollweide=pt,n.geoInterruptedMollweideHemispheres=wt,n.geoInterruptedSinuMollweide=mt,n.geoInterruptedSinusoidal=Rt,n.geoKavrayskiy7=jt,n.geoKavrayskiy7Raw=yn,n.geoLagrange=Mt,n.geoLagrangeRaw=Rn,n.geoLarrivee=At,n.geoLarriveeRaw=jn,n.geoLaskowski=bt,n.geoLaskowskiRaw=Mn,n.geoLittrow=St,n.geoLittrowRaw=En,n.geoLoximuthal=kt,n.geoLoximuthalRaw=An,n.geoMiller=Gt,n.geoMillerRaw=bn,n.geoModifiedStereographic=Fn,n.geoModifiedStereographicRaw=Sn,n.geoModifiedStereographicAlaska=kn,n.geoModifiedStereographicGs48=Gn,n.geoModifiedStereographicGs50=Cn,n.geoModifiedStereographicMiller=zn,n.geoModifiedStereographicLee=qn,n.geoMollweide=ve,n.geoMollweideRaw=le,n.geoMtFlatPolarParabolic=Ht,n.geoMtFlatPolarParabolicRaw=xn,n.geoMtFlatPolarQuartic=It,n.geoMtFlatPolarQuarticRaw=Bn,n.geoMtFlatPolarSinusoidal=Wt,n.geoMtFlatPolarSinusoidalRaw=Ln,n.geoNaturalEarth=Tt,n.geoNaturalEarthRaw=Hn,n.geoNellHammer=Dt,n.geoNellHammerRaw=In,n.geoPatterson=Yt,n.geoPattersonRaw=Wn,n.geoPolyconic=Zt,n.geoPolyconicRaw=Tn,n.geoPolyhedral=no,n.geoPolyhedralButterfly=to,n.geoPolyhedralCollignon=io,n.geoPolyhedralWaterman=uo,n.geoProject=lo,n.geoGringortenQuincuncial=Po,n.geoPeirceQuincuncial=mo,n.geoPierceQuincuncial=mo,n.geoQuincuncial=wo,n.geoRectangularPolyconic=yo,n.geoRectangularPolyconicRaw=ur,n.geoRobinson=jo,n.geoRobinsonRaw=ar,n.geoSatellite=Mo,n.geoSatelliteRaw=fr,n.geoSinuMollweide=at,n.geoSinuMollweideRaw=pn,n.geoSinusoidal=de,n.geoSinusoidalRaw=R,n.geoStitch=xo,n.geoTimes=Bo,n.geoTimesRaw=dr,n.geoTwoPointAzimuthal=mr,n.geoTwoPointAzimuthalRaw=wr,n.geoTwoPointAzimuthalUsa=Pr,n.geoTwoPointEquidistant=jr,n.geoTwoPointEquidistantRaw=yr,n.geoTwoPointEquidistantUsa=Rr,n.geoVanDerGrinten=Ho,n.geoVanDerGrintenRaw=Mr,n.geoVanDerGrinten2=Io,n.geoVanDerGrinten2Raw=Er,n.geoVanDerGrinten3=Wo,n.geoVanDerGrinten3Raw=Ar,n.geoVanDerGrinten4=To,n.geoVanDerGrinten4Raw=br,n.geoWagner4=No,n.geoWagner4Raw=Qo,n.geoWagner6=_o,n.geoWagner6Raw=Sr,n.geoWagner7=Ko,n.geoWagner7Raw=kr,n.geoWiechel=Oo,n.geoWiechelRaw=Gr,n.geoWinkel3=Uo,n.geoWinkel3Raw=Cr,Object.defineProperty(n,"__esModule",{value:!0})}); | ||
// https://d3js.org/d3-geo-projection/ Version 1.1.1. Copyright 2016 Mike Bostock. | ||
!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("d3-geo"),require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-geo","d3-array"],r):r(n.d3=n.d3||{},n.d3,n.d3)}(this,function(n,r,e){"use strict";function t(n){return n?n/Math.sin(n):1}function o(n){return n>1?Xr:n<-1?-Xr:Math.asin(n)}function i(n){return n>1?0:n<-1?Jr:Math.acos(n)}function u(n){return n>0?Math.sqrt(n):0}function a(n){return n=Hr(2*n),(n-1)/(n+1)}function c(n){return(Hr(n)-Hr(-n))/2}function f(n){return(Hr(n)+Hr(-n))/2}function l(n){return Wr(n+u(n*n+1))}function v(n){return Wr(n+u(n*n-1))}function g(n){function r(n,r){var e=Br(n),o=Br(r),i=_r(r),u=o*e,a=-((1-u?Wr((1+u)/2)/(1-u):-.5)+t/(1+u));return[a*o*_r(n),a*i]}var e=Kr(n/2),t=2*Wr(Br(n/2))/(e*e);return r.invert=function(r,e){var i,a=u(r*r+e*e),c=-n/2,f=50;if(!a)return[0,0];do{var l=c/2,v=Br(l),g=_r(l),s=Kr(l),h=Wr(1/v);c-=i=(2/s*h-t*s-a)/(-h/(g*g)+1-t/(2*v*v))}while(Lr(i)>Or&&--f>0);var p=_r(c);return[xr(r*p,a*Br(c)),o(e*p/a)]},r}function s(n,r){var e=Br(r),o=t(i(e*Br(n/=2)));return[2*e*_r(n)*o,_r(r)*o]}function h(n){function r(n,r){var a=Br(r),c=Br(n/=2);return[(1+a)*_r(n),(o*r>-xr(c,i)-.001?0:10*-o)+u+_r(r)*t-(1+a)*e*c]}var e=_r(n),t=Br(n),o=n>=0?1:-1,i=Kr(o*n),u=(1+e-t)/2;return r.invert=function(n,r){var a=0,c=0,f=50;do{var l=Br(a),v=_r(a),g=Br(c),s=_r(c),h=1+g,p=h*v-n,d=u+s*t-h*e*l-r,w=h*l/2,P=-v*s,m=e*h*v/2,y=t*g+e*l*s,R=P*m-y*w,j=(d*P-p*y)/R/2,M=(p*m-d*w)/R;a-=j,c-=M}while((Lr(j)>Or||Lr(M)>Or)&&--f>0);return o*c>-xr(Br(a),i)-.001?[2*a,c]:null},r}function p(n,r){var e=Kr(r/2),t=u(1-e*e),o=1+t*Br(n/=2),i=_r(n)*t/o,a=e/o,c=i*i,f=a*a;return[4/3*i*(3+c-3*f),4/3*a*(3+3*c-f)]}function d(n,r){var e=Lr(r);return e<Yr?[n,Wr(Kr(Yr+r/2))]:[n*Br(e)*(2*$r-1/_r(e)),Nr(r)*(2*$r*(e-Yr)-Wr(Kr(e/2)))]}function w(n){function e(n,e){var i=r.geoAzimuthalEquidistantRaw(n,e);if(Lr(n)>Xr){var a=xr(i[1],i[0]),c=u(i[0]*i[0]+i[1]*i[1]),f=t*Qr((a-Xr)/t)+Xr,l=xr(_r(a-=f),2-Br(a));a=f+o(Jr/c*_r(l))-l,i[0]=c*Br(a),i[1]=c*_r(a)}return i}var t=2*Jr/n;return e.invert=function(n,e){var o=u(n*n+e*e);if(o>Xr){var a=xr(e,n),c=t*Qr((a-Xr)/t)+Xr,f=a>c?-1:1,l=o*Br(c-a),v=1/Kr(f*i((l-Jr)/u(Jr*(Jr-2*l)+o*o)));a=c+2*Fr((v+f*u(v*v-3))/3),n=o*Br(a),e=o*_r(a)}return r.geoAzimuthalEquidistantRaw.invert(n,e)},e}function P(n,r){var e,t=n*_r(r),o=30;do r-=e=(r+_r(r)-t)/(1+Br(r));while(Lr(e)>Or&&--o>0);return r/2}function m(n,r,e){function t(t,o){return[n*t*Br(o=P(e,o)),r*_r(o)]}return t.invert=function(t,i){return i=o(i/r),[t/(n*Br(i)),o((2*i+_r(2*i))/e)]},t}function y(n,r){var e=P(Jr,r);return[he*n/(1/Br(r)+pe/Br(e)),(r+$r*_r(e))/he]}function R(n,r){return[n*Br(r),r]}function j(n){function r(r,t){var o=e+n-t,i=o?r*Br(t)/o:o;return[o*_r(i),e-o*Br(i)]}if(!n)return R;var e=1/Kr(n);return r.invert=function(r,t){var o=u(r*r+(t=e-t)*t),i=e+n-o;return[o/Br(i)*xr(r,t),i]},r}function M(n){function r(r,e){var t=Xr-e,o=t?r*n*_r(t)/t:t;return[t*_r(o)/n,Xr-t*Br(o)]}return r.invert=function(r,e){var t=r*n,o=Xr-e,i=u(t*t+o*o),a=xr(t,o);return[(i?i/_r(i):1)*a/n,Xr-i]},r}function E(n,r,e,t,a,c){var f,l=Br(c);if(Lr(n)>1||Lr(c)>1)f=i(e*a+r*t*l);else{var v=_r(n/2),g=_r(c/2);f=2*o(u(v*v+r*t*g*g))}return Lr(f)>Or?[f,xr(t*_r(c),r*a-e*t*l)]:[0,0]}function b(n,r,e){return i((n*n+r*r-e*e)/(2*n*r))}function A(n){return n-2*Jr*Ir((n+Jr)/(2*Jr))}function k(n,r,e){function t(n,r){var e,t=_r(r),o=Br(r),u=new Array(3);for(e=0;e<3;++e){var a=i[e];if(u[e]=E(r-a[1],a[3],a[2],o,t,n-a[0]),!u[e][0])return a.point;u[e][1]=A(u[e][1]-a.v[1])}var c=v.slice();for(e=0;e<3;++e){var g=2==e?0:e+1,s=b(i[e].v[0],u[e][0],u[g][0]);u[e][1]<0&&(s=-s),e?1==e?(s=f-s,c[0]-=u[e][0]*Br(s),c[1]-=u[e][0]*_r(s)):(s=l-s,c[0]+=u[e][0]*Br(s),c[1]+=u[e][0]*_r(s)):(c[0]+=u[e][0]*Br(s),c[1]-=u[e][0]*_r(s))}return c[0]/=3,c[1]/=3,c}for(var o,i=[[n[0],n[1],_r(n[1]),Br(n[1])],[r[0],r[1],_r(r[1]),Br(r[1])],[e[0],e[1],_r(e[1]),Br(e[1])]],u=i[2],a=0;a<3;++a,u=o)o=i[a],u.v=E(o[1]-u[1],u[3],u[2],o[3],o[2],o[0]-u[0]),u.point=[0,0];var c=b(i[0].v[0],i[2].v[0],i[1].v[0]),f=b(i[0].v[0],i[1].v[0],i[2].v[0]),l=Jr-c;i[2].point[1]=0,i[0].point[0]=-(i[1].point[0]=i[0].v[0]/2);var v=[i[2].point[0]=i[0].point[0]+i[2].v[0]*Br(c),2*(i[0].point[1]=i[1].point[1]=i[2].v[0]*_r(c))];return t}function S(n){return n[0]*=te,n[1]*=te,n}function G(){return C([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])}function C(n,e,t){var o=r.geoCentroid({type:"MultiPoint",coordinates:[n,e,t]}),i=[-o[0],-o[1]],u=r.geoRotation(i),a=r.geoProjection(k(S(u(n)),S(u(e)),S(u(t)))).rotate(i),c=a.center;return delete a.rotate,a.center=function(n){return arguments.length?c(u(n)):u.invert(c())},a.clipAngle(90)}function z(n,r){var e=u(1-_r(r));return[2/ne*n*e,ne*(1-e)]}function q(n){function r(n,r){return[n,(n?n/_r(n):1)*(_r(r)*Br(n)-e*Br(r))]}var e=Kr(n);return r.invert=e?function(n,r){n&&(r*=_r(n)/n);var t=Br(n);return[n,2*xr(u(t*t+e*e-r*r)-t,e-r)]}:function(n,r){return[n,o(n?r*Kr(n)/n:r)]},r}function L(n,r){return[be*n*(2*Br(2*r/3)-1)/ne,be*ne*_r(r/3)]}function F(n){function r(n,r){return[n*e,_r(r)/e]}var e=Br(n);return r.invert=function(n,r){return[n/e,o(r*e)]},r}function x(n){function r(n,r){return[n*e,(1+e)*Kr(r/2)]}var e=Br(n);return r.invert=function(n,r){return[n/e,2*Fr(r/(1+e))]},r}function B(n,r){var e=u(8/(3*Jr));return[e*n*(1-Lr(r)/Jr),e*r]}function H(n,r){var e=u(4-3*_r(Lr(r)));return[2/u(6*Jr)*n*e,Nr(r)*u(2*Jr/3)*(2-e)]}function I(n,r){var e=u(Jr*(4+Jr));return[2/e*n*(1+u(1-4*r*r/(Jr*Jr))),4/e*r]}function W(n,r){var e=(2+Xr)*_r(r);r/=2;for(var t=0,o=1/0;t<10&&Lr(o)>Or;t++){var i=Br(r);r-=o=(r+_r(r)*(i+2)-e)/(2*i*(1+i))}return[2/u(Jr*(4+Jr))*n*(1+Br(r)),2*u(Jr/(4+Jr))*_r(r)]}function T(n,r){return[n*(1+Br(r))/u(2+Jr),2*r/u(2+Jr)]}function D(n,r){for(var e=(1+Xr)*_r(r),t=0,o=1/0;t<10&&Lr(o)>Or;t++)r-=o=(r+_r(r)-e)/(1+Br(r));return e=u(2+Jr),[n*(1+Br(r))/e,2*r/e]}function V(n,r){var e=_r(n/=2),t=Br(n),o=u(Br(r)),i=Br(r/=2),a=_r(r)/(i+$r*t*o),c=u(2/(1+a*a)),f=u(($r*i+(t+e)*o)/($r*i+(t-e)*o));return[xe*(c*(f-1/f)-2*Wr(f)),xe*(c*a*(f+1/f)-2*Fr(a))]}function Q(n,r){var e=Kr(r/2);return[n*He*u(1-e*e),(1+He)*e]}function N(n,r){var e=r/2,t=Br(e);return[2*n/ne*Br(r)*t*t,ne*Kr(e)]}function _(n){return[n[0]/2,o(Kr(n[1]/2*te))*ee]}function K(n){return[2*n[0],2*Fr(_r(n[1]*te))*ee]}function O(n,e){function t(e,t){var a=r.geoAzimuthalEquidistantRaw(e,t),c=a[0],f=a[1],l=c*c+f*f;if(l>i){var v=u(l),g=xr(f,c),s=o*Qr(g/o),h=g-s,p=n*Br(h),d=(n*_r(h)-h*_r(p))/(Xr-p),w=U(h,d),P=(Jr-n)/J(w,p,Jr);c=v;var m,y=50;do c-=m=(n+J(w,p,c)*P-v)/(w(c)*P);while(Lr(m)>Or&&--y>0);f=h*_r(c),c<Xr&&(f-=d*(c-Xr));var R=_r(s),j=Br(s);a[0]=c*j-f*R,a[1]=c*R+f*j}return a}var o=2*Jr/e,i=n*n;return t.invert=function(e,t){var a=e*e+t*t;if(a>i){var c=u(a),f=xr(t,e),l=o*Qr(f/o),v=f-l;e=c*Br(v),t=c*_r(v);for(var g=e-Xr,s=_r(e),h=t/s,p=e<Xr?1/0:0,d=10;;){var w=n*_r(h),P=n*Br(h),m=_r(P),y=Xr-P,R=(w-h*m)/y,j=U(h,R);if(Lr(p)<Ur||!--d)break;h-=p=(h*s-R*g-t)/(s-2*g*(y*(P+h*w*Br(P)-m)-w*(w-h*m))/(y*y))}c=n+J(j,P,e)*(Jr-n)/J(j,P,Jr),f=l+h,e=c*Br(f),t=c*_r(f)}return r.geoAzimuthalEquidistantRaw.invert(e,t)},t}function U(n,r){return function(e){var t=n*Br(e);return e<Xr&&(t-=r),u(1+t*t)}}function J(n,r,e){for(var t=50,o=(e-r)/t,i=n(r)+n(e),u=1,a=r;u<t;++u)i+=2*n(a+=o);return.5*i*o}function X(n,r){var e=n*n,t=r*r;return[n*(1-.162388*t)*(.87-952426e-9*e*e),r*(1+t/12)]}function Y(n,r){var e=Nr(n),t=Nr(r),i=Br(r),u=Br(n)*i,a=_r(n)*i,c=_r(t*r);n=Lr(xr(a,c)),r=o(u),Lr(n-Xr)>Or&&(n%=Xr);var f=Z(n>Jr/4?Xr-n:n,r);return n>Jr/4&&(c=f[0],f[0]=-f[1],f[1]=-c),f[0]*=e,f[1]*=-t,f}function Z(n,r){if(r===Xr)return[0,0];var e,t,i=_r(r),a=i*i,c=a*a,f=1+c,l=1+3*c,v=1-c,g=o(1/u(f)),s=v+a*f*g,h=(1-i)/s,p=u(h),d=h*f,w=u(d),P=p*v;if(0===n)return[0,-(P+a*w)];var m,y=Br(r),R=1/y,j=2*i*y,M=(-3*a+g*l)*j,E=(-s*y-(1-i)*M)/(s*s),b=.5*E/p,A=v*b-2*a*p*j,k=a*f*E+h*l*j,S=-R*j,G=-R*k,C=-2*R*A,z=4*n/Jr;if(n>.222*Jr||r<Jr/4&&n>.175*Jr){if(e=(P+a*u(d*(1+c)-P*P))/(1+c),n>Jr/4)return[e,e];var q=e,L=.5*e;e=.5*(L+q),t=50;do{var F=u(d-e*e),x=e*(C+S*F)+G*o(e/w)-z;if(!x)break;x<0?L=e:q=e,e=.5*(L+q)}while(Lr(q-L)>Or&&--t>0)}else{e=Or,t=25;do{var B=e*e,H=u(d-B),I=C+S*H,W=e*I+G*o(e/w)-z,T=I+(G-S*B)/H;e-=m=H?W/T:0}while(Lr(m)>Or&&--t>0)}return[e,-P-a*u(d-e*e)]}function $(n,r){for(var e=0,t=1,i=.5,a=50;;){var c=i*i,f=u(i),l=o(1/u(1+c)),v=1-c+i*(1+c)*l,g=(1-f)/v,s=u(g),h=g*(1+c),p=s*(1-c),d=h-n*n,w=u(d),P=r+p+i*w;if(Lr(t-e)<Ur||0===--a||0===P)break;P>0?e=i:t=i,i=.5*(e+t)}if(!a)return null;var m=o(f),y=Br(m),R=1/y,j=2*f*y,M=(-3*i+l*(1+3*c))*j,E=(-v*y-(1-f)*M)/(v*v),b=.5*E/s,A=(1-c)*b-2*i*s*j,k=-2*R*A,S=-R*j,G=-R*(i*(1+c)*E+g*(1+3*c)*j);return[Jr/4*(n*(k+S*w)+G*o(n/u(h))),m]}function nn(n,r,e){var t,o,i;return n?(t=rn(n,e),r?(o=rn(r,1-e),i=o[1]*o[1]+e*t[0]*t[0]*o[0]*o[0],[[t[0]*o[2]/i,t[1]*t[2]*o[0]*o[1]/i],[t[1]*o[1]/i,-t[0]*t[2]*o[0]*o[2]/i],[t[2]*o[1]*o[2]/i,-e*t[0]*t[1]*o[0]/i]]):[[t[0],0],[t[1],0],[t[2],0]]):(o=rn(r,1-e),[[0,o[0]/o[1]],[1/o[1],0],[o[2]/o[1],0]])}function rn(n,r){var e,t,i,l,v;if(r<Or)return l=_r(n),t=Br(n),e=r*(n-l*t)/4,[l-e*t,t+e*l,1-r*l*l/2,n-e];if(r>=1-Or)return e=(1-r)/4,t=f(n),l=a(n),i=1/t,v=t*c(n),[l+e*(v-n)/(t*t),i-e*l*i*(v-n),i+e*l*i*(v+n),2*Fr(Hr(n))-Xr+e*(v-n)/t];var g=[1,0,0,0,0,0,0,0,0],s=[u(r),0,0,0,0,0,0,0,0],h=0;for(t=u(1-r),v=1;Lr(s[h]/g[h])>Or&&h<8;)e=g[h++],s[h]=(e-t)/2,g[h]=(e+t)/2,t=u(e*t),v*=2;i=v*g[h]*n;do l=s[h]*_r(t=i)/g[h],i=(o(l)+i)/2;while(--h);return[_r(i),l=Br(i),l/Br(i-t),i]}function en(n,r,e){var t=Lr(n),o=Lr(r),i=c(o);if(t){var a=1/_r(t),f=1/(Kr(t)*Kr(t)),l=-(f+e*(i*i*a*a)-1+e),v=(e-1)*f,g=(-l+u(l*l-4*v))/2;return[tn(Fr(1/u(g)),e)*Nr(n),tn(Fr(u((g/f-1)/e)),1-e)*Nr(r)]}return[0,tn(Fr(i),1-e)*Nr(r)]}function tn(n,r){if(!r)return n;if(1===r)return Wr(Kr(n/2+Yr));for(var e=1,t=u(1-r),o=u(r),i=0;Lr(o)>Or;i++){if(n%Jr){var a=Fr(t*Kr(n)/e);a<0&&(a+=Jr),n+=a+~~(n/Jr)*Jr}else n+=n;o=(e+t)/2,t=u(e*t),o=((e=o)-t)/2}return n/(Vr(2,i)*e)}function on(n,r){var e=($r-1)/($r+1),t=u(1-e*e),o=tn(Xr,t*t),i=-1,a=Wr(Kr(Jr/4+Lr(r)/2)),c=Hr(i*a)/u(e),f=un(c*Br(i*n),c*_r(i*n)),l=en(f[0],f[1],t*t);return[-l[1],(r>=0?1:-1)*(.5*o-l[0])]}function un(n,r){var e=n*n,t=r+1,o=1-e-r*r;return[.5*((n>=0?Xr:-Xr)-xr(o,2*n)),-.25*Wr(o*o+4*e)+.5*Wr(t*t+e)]}function an(n,r){var e=r[0]*r[0]+r[1]*r[1];return[(n[0]*r[0]+n[1]*r[1])/e,(n[1]*r[0]-n[0]*r[1])/e]}function cn(n,e){function t(t,o){var i=r.geoAzimuthalEqualAreaRaw(t/e,o);return i[0]*=n,i}return arguments.length<2&&(e=n),1===e?r.geoAzimuthalEqualAreaRaw:e===1/0?fn:(t.invert=function(t,o){var i=r.geoAzimuthalEqualAreaRaw.invert(t/n,o);return i[0]*=e,i},t)}function fn(n,r){return[n*Br(r)/Br(r/=2),2*_r(r)]}function ln(n){function r(n,r){var u=o(n,r);n=u[0],r=u[1];var a=_r(r),c=Br(r),f=Br(n),l=i(e*a+t*c*f),v=_r(l),g=Lr(v)>Or?l/v:1;return[g*t*_r(n),(Lr(n)>Xr?g:-g)*(e*c-t*a*f)]}var e=_r(n),t=Br(n),o=vn(n);return o.invert=vn(-n),r.invert=function(n,r){var t=u(n*n+r*r),i=-_r(t),a=Br(t),c=t*a,f=-r*i,l=t*e,v=u(c*c+f*f-l*l),g=xr(c*l+f*v,f*l-c*v),s=(t>Xr?-1:1)*xr(n*i,t*Br(g)*a+r*_r(g)*i);return o.invert(s,g)},r}function vn(n){var r=_r(n),e=Br(n);return function(n,t){var i=Br(t),u=Br(n)*i,a=_r(n)*i,c=_r(t);return[xr(a,u*e-c*r),o(c*e+u*r)]}}function gn(n){function r(r,l){var v,g=Lr(l);if(g>e){var s=Dr(n-1,Tr(0,Ir((r+Jr)/a)));r+=Jr*(n-1)/n-s*a,v=z(r,g),v[0]=v[0]*re/t-re*(n-1)/(2*n)+s*re/n,v[1]=o+4*(v[1]-i)*u/re,l<0&&(v[1]=-v[1])}else v=ot(r,l);return v[0]*=c,v[1]/=f,v}var e=tt*te,t=z(Jr,e)[0]-z(-Jr,e)[0],o=ot(0,e)[1],i=z(0,e)[1],u=ne-i,a=re/n,c=4/re,f=o+u*u*4/re;return r.invert=function(r,e){r/=c,e*=f;var l=Lr(e);if(l>o){var v=Dr(n-1,Tr(0,Ir((r+Jr)/a)));r=(r+Jr*(n-1)/n-v*a)*t/re;var g=z.invert(r,.25*(l-o)*re/u+i);return g[0]-=Jr*(n-1)/n-v*a,e<0&&(g[1]=-g[1]),g}return ot.invert(r,e)},r}function sn(n){return{type:"Polygon",coordinates:[e.range(-180,180+n/2,n).map(function(n,r){return[n,1&r?90-1e-6:tt]}).concat(e.range(180,-180-n/2,-n).map(function(n,r){return[n,1&r?-90+1e-6:-tt]}))]}}function hn(n){function r(r,o){var i,a,s=1-_r(o);if(s&&s<2){var h,p=Xr-o,d=25;do{var w=_r(p),P=Br(p),m=c+xr(w,t-P),y=1+g-2*t*P;p-=h=(p-v*c-t*w+y*m-.5*s*e)/(2*t*w*m)}while(Lr(h)>Ur&&--d>0);i=f*u(y),a=r*m/Jr}else i=f*(n+s),a=r*c/Jr;return[i*_r(a),l-i*Br(a)]}var e,t=1+n,a=_r(1/t),c=o(a),f=2*u(Jr/(e=Jr+4*c*t)),l=.5*f*(t+u(n*(2+n))),v=n*n,g=t*t;return r.invert=function(n,r){var a=n*n+(r-=l)*r,s=(1+g-a/(f*f))/(2*t),h=i(s),p=_r(h),d=c+xr(p,t-s);return[o(n/u(a))*Jr/d,o(1-2*(h-v*c-t*p+(1+g-2*t*s)*d)/e)]},r}function pn(n,r){return r>-at?(n=ge(n,r),n[1]+=ct,n):R(n,r)}function dn(n,r){return Lr(r)>at?(n=ge(n,r),n[1]-=r>0?ct:-ct,n):R(n,r)}function wn(n,r){return Lr(n[0]-r[0])<Or&&Lr(n[1]-r[1])<Or}function Pn(n,r){for(var e,t,o,i=-1,u=n.length,a=n[0],c=[];++i<u;){e=n[i],t=(e[0]-a[0])/r,o=(e[1]-a[1])/r;for(var f=0;f<r;++f)c.push([a[0]+f*t,a[1]+f*o]);a=e}return c.push(e),c}function mn(n){var r,t,o,i,u,a,c,f=[],l=n[0].length;for(c=0;c<l;++c)r=n[0][c],t=r[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(Pn([[t+Or,o+Or],[t+Or,i-Or],[u-Or,i-Or],[u-Or,a+Or]],30));for(c=n[1].length-1;c>=0;--c)r=n[1][c],t=r[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(Pn([[u-Or,a-Or],[u-Or,i+Or],[t+Or,i+Or],[t+Or,o-Or]],30));return{type:"Polygon",coordinates:[e.merge(f)]}}function yn(n,r){return[3/re*n*u(Jr*Jr/3-r*r),r]}function Rn(n){function r(r,e){if(Lr(Lr(e)-Xr)<Or)return[0,e<0?-2:2];var t=_r(e),o=Vr((1+t)/(1-t),n/2),i=.5*(o+1/o)+Br(r*=n);return[2*_r(r)/i,(o-1/o)/i]}return r.invert=function(r,e){var t=Lr(e);if(Lr(t-2)<Or)return r?null:[0,Nr(e)*Xr];if(t>2)return null;r/=2,e/=2;var i=r*r,u=e*e,a=2*e/(1+i+u);return a=Vr((1+a)/(1-a),1/n),[xr(2*r,1-i-u)/n,o((a-1)/(a+1))]},r}function jn(n,r){return[n*(1+u(Br(r)))/2,r/(Br(r/2)*Br(n/6))]}function Mn(n,r){var e=n*n,t=r*r;return[n*(.975534+t*(-.119161+e*-.0143059+t*-.0547009)),r*(1.00384+e*(.0802894+t*-.02855+199025e-9*e)+t*(.0998909+t*-.0491032))]}function En(n,r){return[_r(n)/Br(r),Kr(r)*Br(n)]}function bn(n){function r(r,o){var i=o-n,u=Lr(i)<Or?r*e:Lr(u=Yr+o/2)<Or||Lr(Lr(u)-Xr)<Or?0:r*i/Wr(Kr(u)/t);return[u,i]}var e=Br(n),t=Kr(Yr+n/2);return r.invert=function(r,o){var i,u=o+n;return[Lr(o)<Or?r/e:Lr(i=Yr+u/2)<Or||Lr(Lr(i)-Xr)<Or?0:r*Wr(Kr(i)/t)/o,u]},r}function An(n,r){return[n,1.25*Wr(Kr(Yr+.4*r))]}function kn(n){function r(r,t){for(var o,i=Br(t),u=2/(1+i*Br(r)),a=u*i*_r(r),c=u*_r(t),f=e,l=n[f],v=l[0],g=l[1];--f>=0;)l=n[f],v=l[0]+a*(o=v)-c*g,g=l[1]+a*g+c*o;return v=a*(o=v)-c*g,g=a*g+c*o,[v,g]}var e=n.length-1;return r.invert=function(r,t){var i=20,a=r,c=t;do{for(var f,l=e,v=n[l],g=v[0],s=v[1],h=0,p=0;--l>=0;)v=n[l],h=g+a*(f=h)-c*p,p=s+a*p+c*f,g=v[0]+a*(f=g)-c*s,s=v[1]+a*s+c*f;h=g+a*(f=h)-c*p,p=s+a*p+c*f,g=a*(f=g)-c*s-r,s=a*s+c*f-t;var d,w,P=h*h+p*p;a-=d=(g*h+s*p)/P,c-=w=(s*h-g*p)/P}while(Lr(d)+Lr(w)>Or*Or&&--i>0);if(i){var m=u(a*a+c*c),y=2*Fr(.5*m),R=_r(y);return[xr(a*R,m*Br(y)),m?o(c*R/m):0]}},r}function Sn(){return Ln(qt,[152,-64]).scale(1500).center([-160.908,62.4864]).clipAngle(25)}function Gn(){return Ln(Lt,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])}function Cn(){return Ln(Ft,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])}function zn(){return Ln(xt,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)}function qn(){return Ln(Bt,[165,10]).scale(250).clipAngle(130).center([-165,-10])}function Ln(n,e){var t=r.geoProjection(kn(n)).rotate(e).clipAngle(90),o=r.geoRotation(e),i=t.center;return delete t.rotate,t.center=function(n){return arguments.length?i(o(n)):o.invert(i())},t}function Fn(n,r){var e=o(7*_r(r)/(3*Ht));return[Ht*n*(2*Br(2*e/3)-1)/It,9*_r(e/3)/It]}function xn(n,r){for(var e,t=(1+Zr)*_r(r),o=r,i=0;i<25&&(o-=e=(_r(o/2)+_r(o)-t)/(.5*Br(o/2)+Br(o)),!(Lr(e)<Or));i++);return[n*(1+2*Br(o)/Br(o/2))/(3*$r),2*u(3)*_r(o/2)/u(2+$r)]}function Bn(n,r){for(var e,t=u(6/(4+Jr)),o=(1+Jr/4)*_r(r),i=r/2,a=0;a<25&&(i-=e=(i/2+_r(i)-o)/(.5+Br(i)),!(Lr(e)<Or));a++);return[t*(.5+Br(i))*n/1.5,t*i]}function Hn(n,r){var e=r*r,t=e*e;return[n*(.8707-.131979*e+t*(-.013791+t*(.003971*e-.001529*t))),r*(1.007226+e*(.015085+t*(-.044475+.028874*e-.005916*t)))]}function In(n,r){return[n*(1+Br(r))/2,2*(r-Kr(r/2))]}function Wn(n,r){var e=r*r;return[n,r*(Nt+e*e*(_t+e*(Kt+Ot*e)))]}function Tn(n,r){if(Lr(r)<Or)return[n,0];var e=Kr(r),t=n*_r(r);return[_r(t)/e,r+(1-Br(t))/e]}function Dn(n){var r=1/(n[0]*n[4]-n[1]*n[3]);return[r*n[4],-r*n[1],r*(n[1]*n[5]-n[2]*n[4]),-r*n[3],r*n[0],r*(n[2]*n[3]-n[0]*n[5])]}function Vn(n,r){return[n[0]*r[0]+n[1]*r[3],n[0]*r[1]+n[1]*r[4],n[0]*r[2]+n[1]*r[5]+n[2],n[3]*r[0]+n[4]*r[3],n[3]*r[1]+n[4]*r[4],n[3]*r[2]+n[4]*r[5]+n[5]]}function Qn(n,r){return[n[0]-r[0],n[1]-r[1]]}function Nn(n){return u(n[0]*n[0]+n[1]*n[1])}function _n(n,r){return xr(n[0]*r[1]-n[1]*r[0],n[0]*r[0]+n[1]*r[1])}function Kn(n,e,t){var o,i,u=e.edges,a=u.length,c={type:"MultiPoint",coordinates:e.face},f=e.face.filter(function(n){return 90!==Lr(n[1])}),l=r.geoBounds({type:"MultiPoint",coordinates:f}),v=!1,g=-1,s=l[1][0]-l[0][0],h=180===s||360===s?[(l[0][0]+l[1][0])/2,(l[0][1]+l[1][1])/2]:r.geoCentroid(c);if(t)for(;++g<a&&u[g]!==t;);++g;for(var p=0;p<a;++p)i=u[(p+g)%a],Array.isArray(i)?(v||(n.point((o=r.geoInterpolate(i[0],h)(Or))[0],o[1]),v=!0),n.point((o=r.geoInterpolate(i[1],h)(Or))[0],o[1])):(v=!1,i!==t&&Kn(n,i,e))}function On(n,r){return n&&r&&n[0]===r[0]&&n[1]===r[1]}function Un(n,r){for(var e,t,o=n.length,i=null,u=0;u<o;++u){e=n[u];for(var a=r.length;--a>=0;)if(t=r[a],e[0]===t[0]&&e[1]===t[1]){if(i)return[i,e];i=e}}}function Jn(n){for(var r=n.length,e=[],t=n[r-1],o=0;o<r;++o)e.push([t,t=n[o]]);return e}function Xn(n){return n.project.invert||n.children&&n.children.some(Xn)}function Yn(n,r){var e=z(n,r);return[e[0]*uo,e[1]]}function Zn(n,r){for(var e=0,t=n.length,o=0;e<t;++e)o+=n[e]*r[e];return o}function $n(n,r){return[n[1]*r[2]-n[2]*r[1],n[2]*r[0]-n[0]*r[2],n[0]*r[1]-n[1]*r[0]]}function nr(n){return[xr(n[1],n[0])*ee,o(Tr(-1,Dr(1,n[2])))*ee]}function rr(n){var r=n[0]*te,e=n[1]*te,t=Br(e);return[t*Br(r),t*_r(r),_r(e)]}function er(n,r){return{type:"FeatureCollection",features:n.features.map(function(n){return tr(n,r)})}}function tr(n,r){return{type:"Feature",id:n.id,properties:n.properties,geometry:ir(n.geometry,r)}}function or(n,r){return{type:"GeometryCollection",geometries:n.geometries.map(function(n){return ir(n,r)})}}function ir(n,e){if(!n)return null;if("GeometryCollection"===n.type)return or(n,e);var t;switch(n.type){case"Point":t=po;break;case"MultiPoint":t=po;break;case"LineString":t=wo;break;case"MultiLineString":t=wo;break;case"Polygon":t=Po;break;case"MultiPolygon":t=Po;break;case"Sphere":t=Po;break;default:return null}return r.geoStream(n,e(t)),t.result()}function ur(n){function r(r,t){var o=e?Kr(r*e/2)/e:r/2;if(!t)return[2*o,-n];var i=2*Fr(o*_r(t)),u=1/Kr(t);return[_r(i)*u,t+(1-Br(i))*u-n]}var e=_r(n);return r.invert=function(r,t){if(Lr(t+=n)<Or)return[e?2*Fr(e*r/2)/e:r,0];var u,a=r*r+t*t,c=0,f=10;do{var l=Kr(c),v=1/Br(c),g=a-2*t*c+c*c;c-=u=(l*g+2*(c-t))/(2+g*v*v+2*(c-t)*l)}while(Lr(u)>Or&&--f>0);var s=r*(l=Kr(c)),h=Kr(Lr(t)<Lr(c+1/l)?.5*o(s):.5*i(s)+Jr/4)/_r(c);return[e?2*Fr(e*h)/e:2*h,c]},r}function ar(n,r){var e,t=Dr(18,36*Lr(r)/Jr),o=Ir(t),i=t-o,u=(e=Mo[o])[0],a=e[1],c=(e=Mo[++o])[0],f=e[1],l=(e=Mo[Dr(19,++o)])[0],v=e[1];return[n*(c+i*(l-u)/2+i*i*(l-2*c+u)/2),(r>0?Xr:-Xr)*(f+i*(v-a)/2+i*i*(v-2*f+a)/2)]}function cr(n){function r(r,e){var t=Br(e),o=(n-1)/(n-t*Br(r));return[o*t*_r(r),o*_r(e)]}return r.invert=function(r,e){var t=r*r+e*e,i=u(t),a=(n-u(1-t*(n+1)/(n-1)))/((n-1)/i+i/(n-1));return[xr(r*a,i*u(1-a*a)),i?o(e*a/i):0]},r}function fr(n,r){function e(r,e){var u=t(r,e),a=u[1],c=a*i/(n-1)+o;return[u[0]*o/c,a/c]}var t=cr(n);if(!r)return t;var o=Br(r),i=_r(r);return e.invert=function(r,e){var u=(n-1)/(n-1-e*i);return t.invert(u*r,u*e*o)},e}function lr(n){return Math.floor(n*ko)/ko}function vr(n){return n===qo||n===Fo?[0,n]:[So,lr(n)]}function gr(n){n[0]<=Go?n[0]=So:n[0]>=zo&&(n[0]=Co),n[1]<=Lo?n[1]=qo:n[1]>=xo&&(n[1]=Fo)}function sr(n){n.forEach(gr)}function hr(n,r){for(var e=0,t=n.length;e<t;++e){var o=n[e];o.polygon=n,r.push(o);for(var i=0,u=o.length;i<u;++i){var a=o[i],c=a[0],f=a[1];if(c<=Go||c>=zo||f<=Lo||f>=xo){gr(a);for(var l=i+1;l<u;++l){var v=o[l],g=v[0],s=v[1];if(g>Go&&g<zo&&s>Lo&&s<xo)break}if(l===i+1)continue;if(i){var h=o.slice(0,i+1);h.polygon=n,h[h.length-1]=vr(f),r[r.length-1]=h}else r.pop();if(l>=u)break;r.push(o=o.slice(l-1)),o[0]=vr(o[0][1]),o.polygon=n,i=-1,u=o.length}}}n.length=0}function pr(n){var r,e,t,o,i,u,a=n.length,c={},f={};for(r=0;r<a;++r)e=n[r],t=e[0],i=e[e.length-1],t[0]!==i[0]||t[1]!==i[1]?(e.index=r,c[t]=f[i]=e):(e.polygon.push(e),n[r]=null);for(r=0;r<a;++r)if(e=n[r]){if(t=e[0],i=e[e.length-1],o=f[t],u=c[i],delete c[t],delete f[i],t[0]===i[0]&&t[1]===i[1]){e.polygon.push(e);continue}o?(delete f[t],delete c[o[0]],o.pop(),n[o.index]=null,e=o.concat(e),e.polygon=o.polygon,o===u?e.polygon.push(e):(e.index=a++,n.push(c[e[0]]=f[e[e.length-1]]=e))):u?(delete c[i],delete f[u[u.length-1]],e.pop(),e=e.concat(u),e.polygon=u.polygon,e.index=a++,n[u.index]=null,n.push(c[e[0]]=f[e[e.length-1]]=e)):(e.push(e[0]),e.polygon.push(e))}}function dr(n){wr(n.geometry)}function wr(n){if(n){var r,e,t;switch(n.type){case"GeometryCollection":return void n.geometries.forEach(wr);case"Point":gr(n.coordinates);break;case"MultiPoint":case"LineString":sr(n.coordinates);break;case"MultiLineString":n.coordinates.forEach(sr);break;case"Polygon":hr(n.coordinates,r=[]);break;case"MultiPolygon":for(r=[],e=-1,t=n.coordinates.length;++e<t;)hr(n.coordinates[e],r);break;default:return}pr(r)}}function Pr(n,r){var e=Kr(r/2),t=_r(Yr*e);return[n*(.74482-.34588*t*t),1.70711*e]}function mr(n){function e(n,e){var o=r.geoGnomonicRaw(n,e);return o[0]*=t,o}var t=Br(n);return e.invert=function(n,e){return r.geoGnomonicRaw.invert(n/t,e)},e}function yr(){return Rr([-158,21.5],[-77,39]).clipAngle(60).scale(400)}function Rr(n,r){return Io(mr,n,r)}function jr(n){function e(r,e){var c=i(Br(e)*Br(r-t)),f=i(Br(e)*Br(r-o)),l=e<0?-1:1;return c*=c,f*=f,[(c-f)/(2*n),l*u(4*a*f-(a-c+f)*(a-c+f))/(2*n)]}if(!(n*=2))return r.geoAzimuthalEquidistantRaw;var t=-n/2,o=-t,a=n*n,c=Kr(o),f=.5/_r(o);return e.invert=function(n,r){var e,a,l=r*r,v=Br(u(l+(e=n+t)*e)),g=Br(u(l+(e=n+o)*e));return[xr(a=v-g,e=(v+g)*c),(r<0?-1:1)*i(u(e*e+a*a)*f)]},e}function Mr(){return Er([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)}function Er(n,r){return Io(jr,n,r)}function br(n,r){if(Lr(r)<Or)return[n,0];var e=Lr(r/Xr),t=o(e);if(Lr(n)<Or||Lr(Lr(r)-Xr)<Or)return[0,Nr(r)*Jr*Kr(t/2)];var i=Br(t),a=Lr(Jr/n-n/Jr)/2,c=a*a,f=i/(e+i-1),l=f*(2/e-1),v=l*l,g=v+c,s=f-v,h=c+f;return[Nr(n)*Jr*(a*s+u(c*s*s-g*(f*f-v)))/g,Nr(r)*Jr*(l*h-a*u((c+1)*g-h*h))/g]}function Ar(n,r){if(Lr(r)<Or)return[n,0];var e=Lr(r/Xr),t=o(e);if(Lr(n)<Or||Lr(Lr(r)-Xr)<Or)return[0,Nr(r)*Jr*Kr(t/2)];var i=Br(t),a=Lr(Jr/n-n/Jr)/2,c=a*a,f=i*(u(1+c)-a*i)/(1+c*e*e);return[Nr(n)*Jr*f,Nr(r)*Jr*u(1-f*(2*a+f))]}function kr(n,r){if(Lr(r)<Or)return[n,0];var e=r/Xr,t=o(e);if(Lr(n)<Or||Lr(Lr(r)-Xr)<Or)return[0,Jr*Kr(t/2)];var i=(Jr/n-n/Jr)/2,a=e/(1+Br(t));return[Jr*(Nr(n)*u(i*i+1-a*a)-i),Jr*a]}function Sr(n,r){if(!r)return[n,0];var e=Lr(r);if(!n||e===Xr)return[0,r];var t=e/Xr,o=t*t,i=(8*t-o*(o+2)-5)/(2*o*(t-1)),a=i*i,c=t*i,f=o+a+2*c,l=t+3*i,v=n/Xr,g=v+1/v,s=Nr(Lr(n)-Xr)*u(g*g-4),h=s*s,p=f*(o+a*h-1)+(1-o)*(o*(l*l+4*a)+12*c*a+4*a*a),d=(s*(f+a-1)+2*u(p))/(4*f+h);return[Nr(n)*Xr*d,Nr(r)*Xr*u(1+s*Lr(d)-d*d)]}function Gr(n,r){return[n*u(1-3*r*r/(Jr*Jr)),r]}function Cr(n,r){var e=.90631*_r(r),t=u(1-e*e),o=u(2/(1+t*Br(n/=3)));return[2.66723*t*o*_r(n),1.24104*e*o]}function zr(n,r){var e=Br(r),t=Br(n)*e,o=1-t,i=Br(n=xr(_r(n)*e,-_r(r))),a=_r(n);return e=u(1-t*t),[a*e-i*o,-i*e-a*o]}function qr(n,r){var e=s(n,r);return[(e[0]+n/Xr)/2,(e[1]+r)/2]}var Lr=Math.abs,Fr=Math.atan,xr=Math.atan2,Br=Math.cos,Hr=Math.exp,Ir=Math.floor,Wr=Math.log,Tr=Math.max,Dr=Math.min,Vr=Math.pow,Qr=Math.round,Nr=Math.sign||function(n){return n>0?1:n<0?-1:0},_r=Math.sin,Kr=Math.tan,Or=1e-6,Ur=1e-12,Jr=Math.PI,Xr=Jr/2,Yr=Jr/4,Zr=Math.SQRT1_2,$r=u(2),ne=u(Jr),re=2*Jr,ee=180/Jr,te=Jr/180,oe=function(){var n=Xr,e=r.geoProjectionMutator(g),t=e(n);return t.radius=function(r){return arguments.length?e(n=r*te):n*ee},t.scale(179.976).clipAngle(147)};s.invert=function(n,r){if(!(n*n+4*r*r>Jr*Jr+Or)){var e=n,t=r,o=25;do{var a,c=_r(e),f=_r(e/2),l=Br(e/2),v=_r(t),g=Br(t),s=_r(2*t),h=v*v,p=g*g,d=f*f,w=1-p*l*l,P=w?i(g*l)*u(a=1/w):a=0,m=2*P*g*f-n,y=P*v-r,R=a*(p*d+P*g*l*h),j=a*(.5*c*s-2*P*v*f),M=.25*a*(s*f-P*v*p*c),E=a*(h*l+P*d*g),b=j*M-E*R;if(!b)break;var A=(y*j-m*E)/b,k=(m*M-y*R)/b;e-=A,t-=k}while((Lr(A)>Or||Lr(k)>Or)&&--o>0);return[e,t]}};var ie=function(){return r.geoProjection(s).scale(152.63)},ue=function(){var n=20*te,e=n>=0?1:-1,t=Kr(e*n),o=r.geoProjectionMutator(h),i=o(n),u=i.stream;return i.parallel=function(r){return arguments.length?(t=Kr((e=(n=r*te)>=0?1:-1)*n),o(n)):n*ee},i.stream=function(r){var o=i.rotate(),a=u(r),c=(i.rotate([0,0]),u(r));return i.rotate(o),a.sphere=function(){c.polygonStart(),c.lineStart();for(var r=e*-180;e*r<180;r+=90*e)c.point(r,90*e);for(;e*(r-=n)>=-180;)c.point(r,e*-xr(Br(r*te/2),t)*ee);c.lineEnd(),c.polygonEnd()},a},i.scale(218.695).center([0,28.0974])};p.invert=function(n,r){if(n*=3/8,r*=3/8,!n&&Lr(r)>1)return null;var e=n*n,t=r*r,i=1+e+t,a=u((i-u(i*i-4*r*r))/2),g=o(a)/3,s=a?v(Lr(r/a))/3:l(Lr(n))/3,h=Br(g),p=f(s),d=p*p-h*h;return[2*Nr(n)*xr(c(s)*h,.25-d),2*Nr(r)*xr(p*_r(g),.25+d)]};var ae=function(){return r.geoProjection(p).scale(66.1603)},ce=u(8),fe=Wr(1+$r);d.invert=function(n,r){if((t=Lr(r))<fe)return[n,2*Fr(Hr(r))-Xr];var e,t,o=Yr,i=25;do{var u=Br(o/2),a=Kr(o/2);o-=e=(ce*(o-Yr)-Wr(a)-t)/(ce-u*u/(2*a))}while(Lr(e)>Ur&&--i>0);return[n/(Br(o)*(ce-1/_r(o))),Nr(r)*o]};var le=function(){return r.geoProjection(d).scale(112.314)},ve=function(){var n=5,e=r.geoProjectionMutator(w),t=e(n),i=t.stream,u=.01,a=-Br(u*te),c=_r(u*te);return t.lobes=function(r){return arguments.length?e(n=+r):n},t.stream=function(r){var e=t.rotate(),f=i(r),l=(t.rotate([0,0]),i(r));return t.rotate(e),f.sphere=function(){l.polygonStart(),l.lineStart();for(var r=0,e=360/n,t=2*Jr/n,i=90-180/n,f=Xr;r<n;++r,i-=e,f-=t)l.point(xr(c*Br(f),a)*ee,o(c*_r(f))*ee),i<-90?(l.point(-90,-180-i-u),l.point(-90,-180-i+u)):(l.point(90,i+u),l.point(90,i-u));l.lineEnd(),l.polygonEnd()},f},t.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},ge=m($r/Xr,$r,Jr),se=function(){return r.geoProjection(ge).scale(169.529)},he=2.00276,pe=1.11072;y.invert=function(n,r){var e,t,o=he*r,i=r<0?-Yr:Yr,u=25;do t=o-$r*_r(i),i-=e=(_r(2*i)+2*i-Jr*_r(t))/(2*Br(2*i)+2+Jr*Br(t)*$r*Br(i));while(Lr(e)>Or&&--u>0);return t=o-$r*_r(i),[n*(1/Br(t)+pe/Br(i))/he,t]};var de=function(){return r.geoProjection(y).scale(160.857)},we=function(n){var e=0,t=r.geoProjectionMutator(n),o=t(e);return o.parallel=function(n){return arguments.length?t(e=n*te):e*ee},o};R.invert=function(n,r){return[n/Br(r),r]};var Pe=function(){return r.geoProjection(R).scale(152.63)},me=function(){return we(j).scale(123.082).center([0,26.1441]).parallel(45)},ye=function(){var n=.5,e=r.geoProjectionMutator(M),t=e(n);return t.fraction=function(r){return arguments.length?e(n=+r):n},t.scale(158.837)},Re=m(1,4/Jr,Jr),je=function(){return r.geoProjection(Re).scale(152.63)};z.invert=function(n,r){var e=(e=r/ne-1)*e;return[e>0?n*u(Jr/e)/2:0,o(1-e)]};var Me=function(){return r.geoProjection(z).scale(95.6464).center([0,30])},Ee=function(){return we(q).scale(249.828).clipAngle(90)},be=u(3);L.invert=function(n,r){var e=3*o(r/(be*ne));return[ne*n/(be*(2*Br(2*e/3)-1)),e]};var Ae=function(){return r.geoProjection(L).scale(156.19)},ke=function(){return we(F).parallel(38.58).scale(195.044)},Se=function(){return we(x).scale(124.75)};B.invert=function(n,r){var e=u(8/(3*Jr)),t=r/e;return[n/(e*(1-Lr(t)/Jr)),t]};var Ge=function(){return r.geoProjection(B).scale(165.664)};H.invert=function(n,r){var e=2-Lr(r)/u(2*Jr/3);return[n*u(6*Jr)/(2*e),Nr(r)*o((4-e*e)/3)]};var Ce=function(){return r.geoProjection(H).scale(165.664)};I.invert=function(n,r){var e=u(Jr*(4+Jr))/2;return[n*e/(1+u(1-r*r*(4+Jr)/(4*Jr))),r*e/2]};var ze=function(){return r.geoProjection(I).scale(180.739)};W.invert=function(n,r){var e=r*u((4+Jr)/Jr)/2,t=o(e),i=Br(t);return[n/(2/u(Jr*(4+Jr))*(1+i)),o((t+e*(i+2))/(2+Xr))]};var qe=function(){return r.geoProjection(W).scale(180.739)};T.invert=function(n,r){var e=u(2+Jr),t=r*e/2;return[e*n/(1+Br(t)),t]};var Le=function(){return r.geoProjection(T).scale(173.044)};D.invert=function(n,r){var e=1+Xr,t=u(e/2);return[2*n*t/(1+Br(r*=t)),o((r+_r(r))/e)]};var Fe=function(){return r.geoProjection(D).scale(173.044)},xe=3+2*$r;V.invert=function(n,r){if(!(e=p.invert(n/1.2,1.065*r)))return null;var e,t=e[0],o=e[1],i=20;n/=xe,r/=xe;do{var a=t/2,c=o/2,f=_r(a),l=Br(a),v=_r(c),g=Br(c),s=Br(o),h=u(s),d=v/(g+$r*l*h),w=d*d,P=u(2/(1+w)),m=$r*g+(l+f)*h,y=$r*g+(l-f)*h,R=m/y,j=u(R),M=j-1/j,E=j+1/j,b=P*M-2*Wr(j)-n,A=P*d*E-2*Fr(d)-r,k=v&&Zr*h*f*w/v,S=($r*l*g+h)/(2*(g+$r*l*h)*(g+$r*l*h)*h),G=-.5*d*P*P*P,C=G*k,z=G*S,q=(q=2*g+$r*h*(l-f))*q*j,L=($r*l*g*h+s)/q,F=-($r*f*v)/(h*q),x=M*C-2*L/j+P*(L+L/R),B=M*z-2*F/j+P*(F+F/R),H=d*E*C-2*k/(1+w)+P*E*k+P*d*(L-L/R),I=d*E*z-2*S/(1+w)+P*E*S+P*d*(F-F/R),W=B*H-I*x;if(!W)break;var T=(A*B-b*I)/W,D=(b*H-A*x)/W;t-=T,o=Tr(-Xr,Dr(Xr,o-D))}while((Lr(T)>Or||Lr(D)>Or)&&--i>0);return Lr(Lr(o)-Xr)<Or?[0,o]:i&&[t,o]};var Be=function(){return r.geoProjection(V).scale(62.5271)},He=Br(35*te);Q.invert=function(n,r){var e=r/(1+He);return[n&&n/(He*u(1-e*e)),2*Fr(e)]};var Ie=function(){return r.geoProjection(Q).scale(137.152)};N.invert=function(n,r){var e=Fr(r/ne),t=Br(e),o=2*e;return[n*ne/2/(Br(o)*t*t),o]};var We=function(){return r.geoProjection(N).scale(135.264)},Te=function(n){function e(n){return i(_(n))}function t(n){e[n]=function(r){return arguments.length?(i[n](r),e):i[n]()}}null==n&&(n=r.geoOrthographic);var i=n(),u=r.geoEquirectangular().scale(ee).precision(0).clipAngle(null).translate([0,0]);return i.invert&&(e.invert=function(n){return K(i.invert(n))}),e.stream=function(n){var r=i.stream(n),e=u.stream({point:function(n,e){r.point(n/2,o(Kr(-e/2*te))*ee)},lineStart:function(){r.lineStart()},lineEnd:function(){r.lineEnd()},polygonStart:function(){r.polygonStart()},polygonEnd:function(){r.polygonEnd()}});return e.sphere=r.sphere,e},e.rotate=function(n){return arguments.length?(u.rotate(n),e):u.rotate()},e.center=function(n){return arguments.length?(i.center(_(n)),e):K(i.center())},t("clipAngle"),t("clipExtent"),t("scale"),t("translate"),t("precision"),e.scale(249.5)},De=function(){var n=6,e=30*te,t=Br(e),i=_r(e),u=r.geoProjectionMutator(O),a=u(e,n),c=a.stream,f=.01,l=-Br(f*te),v=_r(f*te);return a.radius=function(r){return arguments.length?(t=Br(e=r*te),i=_r(e),u(e,n)):e*ee},a.lobes=function(r){return arguments.length?u(e,n=+r):n},a.stream=function(r){var e=a.rotate(),u=c(r),f=(a.rotate([0,0]),c(r));return a.rotate(e),u.sphere=function(){f.polygonStart(),f.lineStart();for(var r=0,e=2*Jr/n,u=0;r<n;++r,u-=e)f.point(xr(v*Br(u),l)*ee,o(v*_r(u))*ee),f.point(xr(i*Br(u-e/2),t)*ee,o(i*_r(u-e/2))*ee);f.lineEnd(),f.polygonEnd()},u},a.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},Ve=function(n,r,e,t,i,a,c,f){function l(u,l){if(!l)return[n*u/Jr,0];var v=l*l,g=n+v*(r+v*(e+v*t)),s=l*(i-1+v*(a-f+v*c)),h=(g*g+s*s)/(2*s),p=u*o(g/h)/Jr;return[h*_r(p),l*(1+v*f)+h*(1-Br(p))]}return arguments.length<8&&(f=0),l.invert=function(l,v){var g,s,h=Jr*l/n,p=v,d=50;do{var w=p*p,P=n+w*(r+w*(e+w*t)),m=p*(i-1+w*(a-f+w*c)),y=P*P+m*m,R=2*m,j=y/R,M=j*j,E=o(P/j)/Jr,b=h*E,A=P*P,k=(2*r+w*(4*e+6*w*t))*p,S=i+w*(3*a+5*w*c),G=2*(P*k+m*(S-1)),C=2*(S-1),z=(G*R-y*C)/(R*R),q=Br(b),L=_r(b),F=j*q,x=j*L,B=h/Jr*(1/u(1-A/M))*(k*j-P*z)/M,H=x-l,I=p*(1+w*f)+j-F-v,W=z*L+F*B,T=F*E,D=1+z-(z*q-x*B),V=x*E,Q=W*V-D*T;if(!Q)break;h-=g=(I*W-H*D)/Q,p-=s=(H*V-I*T)/Q}while((Lr(g)>Or||Lr(s)>Or)&&--d>0);return[h,p]},l},Qe=Ve(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Ne=function(){return r.geoProjection(Qe).scale(149.995)},_e=Ve(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),Ke=function(){return r.geoProjection(_e).scale(153.93)},Oe=Ve(5/6*Jr,-.62636,-.0344,0,1.3493,-.05524,0,.045),Ue=function(){return r.geoProjection(Oe).scale(130.945)};X.invert=function(n,r){var e,t=n,o=r,i=50;do{var u=o*o;o-=e=(o*(1+u/12)-r)/(1+u/4)}while(Lr(e)>Or&&--i>0);i=50,n/=1-.162388*u;do{var a=(a=t*t)*a; | ||
t-=e=(t*(.87-952426e-9*a)-n)/(.87-.00476213*a)}while(Lr(e)>Or&&--i>0);return[t,o]};var Je=function(){return r.geoProjection(X).scale(131.747)},Xe=Ve(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762),Ye=function(){return r.geoProjection(Xe).scale(131.087)},Ze=function(n){function r(r,t){var o=r>0?-.5:.5,i=n(r+o*Jr,t);return i[0]-=o*e,i}var e=n(Xr,0)[0]-n(-Xr,0)[0];return n.invert&&(r.invert=function(r,t){var o=r>0?-.5:.5,i=n.invert(r+o*e,t),u=i[0]-o*Jr;return u<-Jr?u+=2*Jr:u>Jr&&(u-=2*Jr),i[0]=u,i}),r};Y.invert=function(n,r){var e=Nr(n),t=Nr(r),i=-e*n,u=-t*r,a=u/i<1,c=$(a?u:i,a?i:u),f=c[0],l=c[1],v=Br(l);return a&&(f=-Xr-f),[e*(xr(_r(f)*v,-_r(l))+Jr),t*o(Br(f)*v)]};var $e=function(){return r.geoProjection(Ze(Y)).scale(239.75)};on.invert=function(n,r){var e=($r-1)/($r+1),t=u(1-e*e),o=tn(Xr,t*t),i=-1,a=nn(.5*o-r,-n,t*t),c=an(a[0],a[1]),f=xr(c[1],c[0])/i;return[f,2*Fr(Hr(.5/i*Wr(e*c[0]*c[0]+e*c[1]*c[1])))-Xr]};var nt=function(){return r.geoProjection(Ze(on)).scale(151.496)};fn.invert=function(n,r){var e=2*o(r/2);return[n*Br(e/2)/Br(e),e]};var rt=function(){var n=2,e=r.geoProjectionMutator(cn),t=e(n);return t.coefficient=function(r){return arguments.length?e(n=+r):n},t.scale(169.529)},et=function(){var n=0,e=r.geoProjectionMutator(ln),t=e(n),o=t.rotate,i=t.stream,u=r.geoCircle();return t.parallel=function(r){if(!arguments.length)return n*ee;var o=t.rotate();return e(n=r*te).rotate(o)},t.rotate=function(r){return arguments.length?(o.call(t,[r[0],r[1]-n*ee]),u.center([-r[0],-r[1]]),t):(r=o.call(t),r[1]+=n*ee,r)},t.stream=function(n){return n=i(n),n.sphere=function(){n.polygonStart();var r,e=.01,t=u.radius(90-e)().coordinates[0],o=t.length-1,i=-1;for(n.lineStart();++i<o;)n.point((r=t[i])[0],r[1]);for(n.lineEnd(),t=u.radius(90+e)().coordinates[0],o=t.length-1,n.lineStart();--i>=0;)n.point((r=t[i])[0],r[1]);n.lineEnd(),n.polygonEnd()},n},t.scale(79.4187).parallel(45).clipAngle(179.999)},tt=41+48/36+37/3600,ot=F(0),it=function(){var n=4,e=r.geoProjectionMutator(gn),t=e(n),o=t.stream;return t.lobes=function(r){return arguments.length?e(n=+r):n},t.stream=function(e){var i=t.rotate(),u=o(e),a=(t.rotate([0,0]),o(e));return t.rotate(i),u.sphere=function(){r.geoStream(sn(180/n),a)},u},t.scale(239.75)},ut=function(){var n=1,e=r.geoProjectionMutator(hn),t=e(n);return t.ratio=function(r){return arguments.length?e(n=+r):n},t.scale(167.774).center([0,18.67])},at=.7109889596207567,ct=.0528035274542;pn.invert=function(n,r){return r>-at?ge.invert(n,r-ct):R.invert(n,r)};var ft=function(){return r.geoProjection(pn).rotate([-20,-55]).scale(164.263).center([0,-5.4036])};dn.invert=function(n,r){return Lr(r)>at?ge.invert(n,r+(r>0?ct:-ct)):R.invert(n,r)};var lt=function(){return r.geoProjection(dn).scale(152.63)},vt=function(n,e){function t(r,t){for(var o=t<0?-1:1,i=e[+(t<0)],u=0,a=i.length-1;u<a&&r>i[u][2][0];++u);var c=n(r-i[u][1][0],t);return c[0]+=n(i[u][1][0],o*t>o*i[u][0][1]?i[u][0][1]:t)[0],c}var o=mn(e);e=e.map(function(n){return n.map(function(n){return[[n[0][0]*te,n[0][1]*te],[n[1][0]*te,n[1][1]*te],[n[2][0]*te,n[2][1]*te]]})});var i=e.map(function(r){return r.map(function(r){var e,t=n(r[0][0],r[0][1])[0],o=n(r[2][0],r[2][1])[0],i=n(r[1][0],r[0][1])[1],u=n(r[1][0],r[1][1])[1];return i>u&&(e=i,i=u,u=e),[[t,i],[o,u]]})}),u=r.geoProjection(t),a=u.stream;return n.invert&&(t.invert=function(r,o){for(var u=i[+(o<0)],a=e[+(o<0)],c=0,f=u.length;c<f;++c){var l=u[c];if(l[0][0]<=r&&r<l[1][0]&&l[0][1]<=o&&o<l[1][1]){var v=n.invert(r-n(a[c][1][0],0)[0],o);return v[0]+=a[c][1][0],wn(t(v[0],v[1]),[r,o])?v:null}}}),u.stream=function(n){var e=u.rotate(),t=a(n),i=(u.rotate([0,0]),a(n));return u.rotate(e),t.sphere=function(){r.geoStream(o,i)},t},u},gt=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],st=function(){return vt(y,gt).scale(160.857)},ht=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],pt=function(){return vt(dn,ht).scale(152.63)},dt=[[[[-180,0],[-100,90],[-40,0]],[[-40,0],[30,90],[180,0]]],[[[-180,0],[-160,-90],[-100,0]],[[-100,0],[-60,-90],[-20,0]],[[-20,0],[20,-90],[80,0]],[[80,0],[140,-90],[180,0]]]],wt=function(){return vt(ge,dt).scale(169.529)},Pt=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0]]]],mt=function(){return vt(ge,Pt).scale(169.529).rotate([20,0])},yt=[[[[-180,35],[-30,90],[0,35]],[[0,35],[30,90],[180,35]]],[[[-180,-10],[-102,-90],[-65,-10]],[[-65,-10],[5,-90],[77,-10]],[[77,-10],[103,-90],[180,-10]]]],Rt=function(){return vt(pn,yt).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},jt=[[[[-180,0],[-110,90],[-40,0]],[[-40,0],[0,90],[40,0]],[[40,0],[110,90],[180,0]]],[[[-180,0],[-110,-90],[-40,0]],[[-40,0],[0,-90],[40,0]],[[40,0],[110,-90],[180,0]]]],Mt=function(){return vt(R,jt).scale(152.63).rotate([-20,0])};yn.invert=function(n,r){return[re/3*n/u(Jr*Jr/3-r*r),r]};var Et=function(){return r.geoProjection(yn).scale(158.837)},bt=function(){var n=.5,e=r.geoProjectionMutator(Rn),t=e(n);return t.spacing=function(r){return arguments.length?e(n=+r):n},t.scale(124.75)},At=Jr/$r;jn.invert=function(n,r){var e=Lr(n),t=Lr(r),o=Or,a=Xr;t<At?a*=t/At:o+=6*i(At/t);for(var c=0;c<25;c++){var f=_r(a),l=u(Br(a)),v=_r(a/2),g=Br(a/2),s=_r(o/6),h=Br(o/6),p=.5*o*(1+l)-e,d=a/(g*h)-t,w=l?-.25*o*f/l:0,P=.5*(1+l),m=(1+.5*a*v/g)/(g*h),y=a/g*(s/6)/(h*h),R=w*y-m*P,j=(p*y-d*P)/R,M=(d*w-p*m)/R;if(a-=j,o-=M,Lr(j)<Or&&Lr(M)<Or)break}return[n<0?-o:o,r<0?-a:a]};var kt=function(){return r.geoProjection(jn).scale(97.2672)};Mn.invert=function(n,r){var e=Nr(n)*Jr,t=r/2,o=50;do{var i=e*e,u=t*t,a=e*t,c=e*(.975534+u*(-.119161+i*-.0143059+u*-.0547009))-n,f=t*(1.00384+i*(.0802894+u*-.02855+199025e-9*i)+u*(.0998909+u*-.0491032))-r,l=.975534-u*(.119161+3*i*.0143059+.0547009*u),v=-a*(.238322+.2188036*u+.0286118*i),g=a*(.1605788+7961e-7*i+-.0571*u),s=1.00384+i*(.0802894+199025e-9*i)+u*(3*(.0998909-.02855*i)-.245516*u),h=v*g-s*l,p=(f*v-c*s)/h,d=(c*g-f*l)/h;e-=p,t-=d}while((Lr(p)>Or||Lr(d)>Or)&&--o>0);return o&&[e,t]};var St=function(){return r.geoProjection(Mn).scale(139.98)};En.invert=function(n,r){var e=n*n,t=r*r,a=t+1,c=n?Zr*u((a-u(e*e+2*e*(t-1)+a*a))/e+1):1/u(a);return[o(n*c),Nr(r)*i(c)]};var Gt=function(){return r.geoProjection(En).scale(144.049).clipAngle(89.999)},Ct=function(){return we(bn).parallel(40).scale(158.837)};An.invert=function(n,r){return[n,2.5*Fr(Hr(.8*r))-.625*Jr]};var zt=function(){return r.geoProjection(An).scale(108.318)},qt=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],Lt=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],Ft=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],xt=[[.9245,0],[0,0],[.01943,0]],Bt=[[.721316,0],[0,0],[-.00881625,-.00617325]],Ht=u(6),It=u(7);Fn.invert=function(n,r){var e=3*o(r*It/9);return[n*It/(Ht*(2*Br(2*e/3)-1)),o(3*_r(e)*Ht/7)]};var Wt=function(){return r.geoProjection(Fn).scale(164.859)};xn.invert=function(n,r){var e=r*u(2+$r)/(2*u(3)),t=2*o(e);return[3*$r*n/(1+2*Br(t)/Br(t/2)),o((e+_r(t))/(1+Zr))]};var Tt=function(){return r.geoProjection(xn).scale(188.209)};Bn.invert=function(n,r){var e=u(6/(4+Jr)),t=r/e;return Lr(Lr(t)-Xr)<Or&&(t=t<0?-Xr:Xr),[1.5*n/(e*(.5+Br(t))),o((t/2+_r(t))/(1+Jr/4))]};var Dt=function(){return r.geoProjection(Bn).scale(166.518)};Hn.invert=function(n,r){var e,t=r,o=25;do{var i=t*t,u=i*i;t-=e=(t*(1.007226+i*(.015085+u*(-.044475+.028874*i-.005916*u)))-r)/(1.007226+i*(.045255+u*(-.311325+.259866*i-.005916*11*u)))}while(Lr(e)>Or&&--o>0);return[n/(.8707+(i=t*t)*(-.131979+i*(-.013791+i*i*i*(.003971-.001529*i)))),t]};var Vt=function(){return r.geoProjection(Hn).scale(175.295)};In.invert=function(n,r){for(var e=r/2,t=0,o=1/0;t<10&&Lr(o)>Or;++t){var i=Br(r/2);r-=o=(r-Kr(r/2)-e)/(1-.5/(i*i))}return[2*n/(1+Br(r)),r]};var Qt=function(){return r.geoProjection(In).scale(152.63)},Nt=1.0148,_t=.23185,Kt=-.14499,Ot=.02406,Ut=Nt,Jt=5*_t,Xt=7*Kt,Yt=9*Ot,Zt=1.790857183;Wn.invert=function(n,r){r>Zt?r=Zt:r<-Zt&&(r=-Zt);var e,t=r;do{var o=t*t;t-=e=(t*(Nt+o*o*(_t+o*(Kt+Ot*o)))-r)/(Ut+o*o*(Jt+o*(Xt+Yt*o)))}while(Lr(e)>Or);return[n,t]};var $t=function(){return r.geoProjection(Wn).scale(139.319)};Tn.invert=function(n,r){if(Lr(r)<Or)return[n,0];var e,t=n*n+r*r,u=.5*r,a=10;do{var c=Kr(u),f=1/Br(u),l=t-2*r*u+u*u;u-=e=(c*l+2*(u-r))/(2+l*f*f+2*(u-r)*c)}while(Lr(e)>Or&&--a>0);return c=Kr(u),[(Lr(r)<Lr(u+1/c)?o(n*c):Nr(n)*(i(Lr(n*c))+Xr))/_r(u),u]};var no=function(){return r.geoProjection(Tn).scale(103.74)},ro=function(n,r){var e=Qn(n[1],n[0]),t=Qn(r[1],r[0]),o=_n(e,t),i=Nn(e)/Nn(t);return Vn([1,0,n[0][0],0,1,n[0][1]],Vn([i,0,0,0,i,0],Vn([Br(o),_r(o),0,-_r(o),Br(o),0],[1,0,-r[0][0],0,1,-r[0][1]])))},eo=function(n,e,t){function o(n,r){if(n.edges=Jn(n.face),r)if(r.face){var e=n.shared=Un(n.face,r.face),t=ro(e.map(r.project),e.map(n.project));n.transform=r.transform?Vn(r.transform,t):t;for(var i=r.edges,u=0,a=i.length;u<a;++u)On(e[0],i[u][1])&&On(e[1],i[u][0])&&(i[u]=n),On(e[0],i[u][0])&&On(e[1],i[u][1])&&(i[u]=n);for(i=n.edges,u=0,a=i.length;u<a;++u)On(e[0],i[u][0])&&On(e[1],i[u][1])&&(i[u]=r),On(e[0],i[u][1])&&On(e[1],i[u][0])&&(i[u]=r)}else n.transform=r.transform;return n.children&&n.children.forEach(function(r){o(r,n)}),n}function i(n,r){var t,o=e(n,r),i=o.project([n*ee,r*ee]);return(t=o.transform)?[t[0]*i[0]+t[1]*i[1]+t[2],-(t[3]*i[0]+t[4]*i[1]+t[5])]:(i[1]=-i[1],i)}function u(n,r){var e=n.project.invert,t=n.transform,o=r;if(t&&(t=Dn(t),o=[t[0]*o[0]+t[1]*o[1]+t[2],t[3]*o[0]+t[4]*o[1]+t[5]]),e&&n===a(i=e(o)))return i;for(var i,c=n.children,f=0,l=c&&c.length;f<l;++f)if(i=u(c[f],r))return i}function a(n){return e(n[0]*te,n[1]*te)}t=null==t?-Jr/6:t,o(n,{transform:[Br(t),_r(t),0,-_r(t),Br(t),0]}),Xn(n)&&(i.invert=function(r,e){var t=u(n,[r,-e]);return t&&(t[0]*=te,t[1]*=te,t)});var c=r.geoProjection(i),f=c.stream;return c.stream=function(r){var e=c.rotate(),t=f(r),o=(c.rotate([0,0]),f(r));return c.rotate(e),t.sphere=function(){o.polygonStart(),o.lineStart(),Kn(o,n),o.lineEnd(),o.polygonEnd()},t},c},to=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],oo=[[0,2,1],[0,3,2],[5,1,2],[5,2,3],[0,1,4],[0,4,3],[5,4,1],[5,3,4]].map(function(n){return n.map(function(n){return to[n]})}),io=function(n){n=n||function(n){var e=r.geoCentroid({type:"MultiPoint",coordinates:n});return r.geoGnomonic().scale(1).translate([0,0]).rotate([-e[0],-e[1]])};var e=oo.map(function(r){return{face:r,project:n(r)}});return[-1,0,0,1,0,1,4,5].forEach(function(n,r){var t=e[n];t&&(t.children||(t.children=[])).push(e[r])}),eo(e[0],function(n,r){return e[n<-Jr/2?r<0?6:4:n<0?r<0?2:0:n<Jr/2?r<0?3:1:r<0?7:5]}).scale(101.858).center([0,45])},uo=2/u(3);Yn.invert=function(n,r){return z.invert(n/uo,r)};var ao=function(n){n=n||function(n){var e=r.geoCentroid({type:"MultiPoint",coordinates:n});return r.geoProjection(Yn).translate([0,0]).scale(1).rotate(e[1]>0?[-e[0],0]:[180-e[0],180])};var e=oo.map(function(r){return{face:r,project:n(r)}});return[-1,0,0,1,0,1,4,5].forEach(function(n,r){var t=e[n];t&&(t.children||(t.children=[])).push(e[r])}),eo(e[0],function(n,r){return e[n<-Jr/2?r<0?6:4:n<0?r<0?2:0:n<Jr/2?r<0?3:1:r<0?7:5]}).scale(121.906).center([0,48.5904])},co=function(n){function e(n,r){var e=Br(r),t=[e*Br(n),e*_r(n),_r(r)],i=n<-Jr/2?r<0?6:4:n<0?r<0?2:0:n<Jr/2?r<0?3:1:r<0?7:5,a=o[i];return u[Zn(a[0],t)<0?8+3*i:Zn(a[1],t)<0?8+3*i+1:Zn(a[2],t)<0?8+3*i+2:i]}n=n||function(n){var e=6===n.length?r.geoCentroid({type:"MultiPoint",coordinates:n}):n[0];return r.geoGnomonic().scale(1).translate([0,0]).rotate([-e[0],-e[1]])};var t=oo.map(function(n){for(var r,e=n.map(rr),t=e.length,o=e[t-1],i=[],u=0;u<t;++u)r=e[u],i.push(nr([.9486832980505138*o[0]+.31622776601683794*r[0],.9486832980505138*o[1]+.31622776601683794*r[1],.9486832980505138*o[2]+.31622776601683794*r[2]]),nr([.9486832980505138*r[0]+.31622776601683794*o[0],.9486832980505138*r[1]+.31622776601683794*o[1],.9486832980505138*r[2]+.31622776601683794*o[2]])),o=r;return i}),o=[],i=[-1,0,0,1,0,1,4,5];t.forEach(function(n,r){for(var e=oo[r],u=e.length,a=o[r]=[],c=0;c<u;++c)t.push([e[c],n[(2*c+2)%(2*u)],n[(2*c+1)%(2*u)]]),i.push(r),a.push($n(rr(n[(2*c+2)%(2*u)]),rr(n[(2*c+1)%(2*u)])))});var u=t.map(function(r){return{project:n(r),face:r}});return i.forEach(function(n,r){var e=u[n];e&&(e.children||(e.children=[])).push(u[r])}),eo(u[0],e).scale(110.625).center([0,45])},fo=function(){},lo=function(n){if((r=n.length)<4)return!1;for(var r,e=0,t=n[r-1][1]*n[0][0]-n[r-1][0]*n[0][1];++e<r;)t+=n[e-1][1]*n[e][0]-n[e-1][0]*n[e][1];return t<=0},vo=function(n,r){for(var e=r[0],t=r[1],o=!1,i=0,u=n.length,a=u-1;i<u;a=i++){var c=n[i],f=c[0],l=c[1],v=n[a],g=v[0],s=v[1];l>t^s>t&&e<(g-f)*(t-l)/(s-l)+f&&(o=!o)}return o},go=function(n,r){var e,t=r.stream;if(!t)throw new Error("invalid projection");switch(n&&n.type){case"Feature":e=tr;break;case"FeatureCollection":e=er;break;default:e=ir}return e(n,t)},so=[],ho=[],po={point:function(n,r){so.push([n,r])},result:function(){var n=so.length?so.length<2?{type:"Point",coordinates:so[0]}:{type:"MultiPoint",coordinates:so}:null;return so=[],n}},wo={lineStart:fo,point:function(n,r){so.push([n,r])},lineEnd:function(){so.length&&(ho.push(so),so=[])},result:function(){var n=ho.length?ho.length<2?{type:"LineString",coordinates:ho[0]}:{type:"MultiLineString",coordinates:ho}:null;return ho=[],n}},Po={polygonStart:fo,lineStart:fo,point:function(n,r){so.push([n,r])},lineEnd:function(){var n=so.length;if(n){do so.push(so[0].slice());while(++n<4);ho.push(so),so=[]}},polygonEnd:fo,result:function(){if(!ho.length)return null;var n=[],r=[];return ho.forEach(function(e){lo(e)?n.push([e]):r.push(e)}),r.forEach(function(r){var e=r[0];n.some(function(n){if(vo(n[0],e))return n.push(r),!0})||n.push([r])}),ho=[],n.length?n.length>1?{type:"MultiPolygon",coordinates:n}:{type:"Polygon",coordinates:n[0]}:null}},mo=function(n){function e(r,e){var o=Lr(r)<Xr,i=n(o?r:r>0?r-Jr:r+Jr,e),u=(i[0]-i[1])*Zr,a=(i[0]+i[1])*Zr;if(o)return[u,a];var c=t*Zr,f=u>0^a>0?-1:1;return[f*u-Nr(a)*c,f*a-Nr(u)*c]}var t=n(Xr,0)[0]-n(-Xr,0)[0];return n.invert&&(e.invert=function(r,e){var o=(r+e)*Zr,i=(e-r)*Zr,u=Lr(o)<.5*t&&Lr(i)<.5*t;if(!u){var a=t*Zr,c=o>0^i>0?-1:1,f=-c*(r+(i>0?1:-1)*a),l=-c*(e+(o>0?1:-1)*a);o=(-f-l)*Zr,i=(f-l)*Zr}var v=n.invert(o,i);return u||(v[0]+=o>0?Jr:-Jr),v}),r.geoProjection(e).rotate([-90,-90,45]).clipAngle(179.999)},yo=function(){return mo(Y).scale(176.423)},Ro=function(){return mo(on).scale(111.48)},jo=function(){return we(ur).scale(131.215)},Mo=[[.9986,-.062],[1,0],[.9986,.062],[.9954,.124],[.99,.186],[.9822,.248],[.973,.31],[.96,.372],[.9427,.434],[.9216,.4958],[.8962,.5571],[.8679,.6176],[.835,.6769],[.7986,.7346],[.7597,.7903],[.7186,.8435],[.6732,.8936],[.6213,.9394],[.5722,.9761],[.5322,1]];Mo.forEach(function(n){n[1]*=1.0144}),ar.invert=function(n,r){var e=r/Xr,t=90*e,o=Dr(18,Lr(t/5)),i=Tr(0,Ir(o));do{var u=Mo[i][1],a=Mo[i+1][1],c=Mo[Dr(19,i+2)][1],f=c-u,l=c-2*a+u,v=2*(Lr(e)-a)/f,g=l/f,s=v*(1-g*v*(1-2*g*v));if(s>=0||1===i){t=(r>=0?5:-5)*(s+o);var h,p=50;do o=Dr(18,Lr(t)/5),i=Ir(o),s=o-i,u=Mo[i][1],a=Mo[i+1][1],c=Mo[Dr(19,i+2)][1],t-=(h=(r>=0?Xr:-Xr)*(a+s*(c-u)/2+s*s*(c-2*a+u)/2)-r)*ee;while(Lr(h)>Ur&&--p>0);break}}while(--i>=0);var d=Mo[i][0],w=Mo[i+1][0],P=Mo[Dr(19,i+2)][0];return[n/(w+s*(P-d)/2+s*s*(P-2*w+d)/2),t*te]};var Eo=function(){return r.geoProjection(ar).scale(152.63)},bo=function(){var n=2,e=0,t=r.geoProjectionMutator(fr),o=t(n,e);return o.distance=function(r){return arguments.length?t(n=+r,e):n},o.tilt=function(r){return arguments.length?t(n,e=r*te):e*ee},o.scale(432.147).clipAngle(i(1/n)*ee-1e-6)},Ao=1e-4,ko=1e4,So=-180,Go=So+Ao,Co=180,zo=Co-Ao,qo=-90,Lo=qo+Ao,Fo=90,xo=Fo-Ao,Bo=function(n){if(n)switch(n.type){case"Feature":dr(n);break;case"FeatureCollection":n.features.forEach(dr);break;default:wr(n)}return n};Pr.invert=function(n,r){var e=r/1.70711,t=_r(Yr*e);return[n/(.74482-.34588*t*t),2*Fr(e)]};var Ho=function(){return r.geoProjection(Pr).scale(146.153)},Io=function(n,e,t){var i=r.geoInterpolate(e,t),u=i(.5),a=r.geoRotation([-u[0],-u[1]])(e),c=i.distance/2,f=-o(_r(a[1]*te)/_r(c)),l=[-u[0],-u[1],-(a[0]>0?Jr-f:f)*ee],v=r.geoProjection(n(c)).rotate(l),g=r.geoRotation(l),s=v.center;return delete v.rotate,v.center=function(n){return arguments.length?s(g(n)):g.invert(s())},v.clipAngle(90)};br.invert=function(n,r){if(Lr(r)<Or)return[n,0];if(Lr(n)<Or)return[0,Xr*_r(2*Fr(r/Jr))];var e=(n/=Jr)*n,t=(r/=Jr)*r,o=e+t,a=o*o,c=-Lr(r)*(1+o),f=c-2*t+e,l=-2*c+1+2*t+a,v=t/l+(2*f*f*f/(l*l*l)-9*c*f/(l*l))/27,g=(c-f*f/(3*l))/l,s=2*u(-g/3),h=i(3*v/(g*s))/3;return[Jr*(o-1+u(1+2*(e-t)+a))/(2*n),Nr(r)*Jr*(-s*Br(h+Jr/3)-f/(3*l))]};var Wo=function(){return r.geoProjection(br).scale(79.4183)};Ar.invert=function(n,r){if(!n)return[0,Xr*_r(2*Fr(r/Jr))];var e=Lr(n/Jr),t=(1-e*e-(r/=Jr)*r)/(2*e),o=t*t,i=u(o+1);return[Nr(n)*Jr*(i-t),Nr(r)*Xr*_r(2*xr(u((1-2*t*e)*(t+i)-e),u(i+t+e)))]};var To=function(){return r.geoProjection(Ar).scale(79.4183)};kr.invert=function(n,r){if(!r)return[n,0];var e=r/Jr,t=(Jr*Jr*(1-e*e)-n*n)/(2*Jr*n);return[n?Jr*(Nr(n)*u(t*t+1)-t):0,Xr*_r(2*Fr(e))]};var Do=function(){return r.geoProjection(kr).scale(79.4183)};Sr.invert=function(n,r){var e;if(!n||!r)return[n,r];r/=Jr;var t=Nr(n)*n/Xr,o=(t*t-1+4*r*r)/Lr(t),i=o*o,a=2*r,c=50;do{var f=a*a,l=(8*a-f*(f+2)-5)/(2*f*(a-1)),v=(3*a-f*a-10)/(2*f*a),g=l*l,s=a*l,h=a+l,p=h*h,d=a+3*l,w=p*(f+g*i-1)+(1-f)*(f*(d*d+4*g)+g*(12*s+4*g)),P=-2*h*(4*s*g+(1-4*f+3*f*f)*(1+v)+g*(-6+14*f-i+(-8+8*f-2*i)*v)+s*(-8+12*f+(-10+10*f-i)*v)),m=u(w),y=o*(p+g-1)+2*m-t*(4*p+i),R=o*(2*l*v+2*h*(1+v))+P/m-8*h*(o*(-1+g+p)+2*m)*(1+v)/(i+4*p);a-=e=y/R}while(e>Or&&--c>0);return[Nr(n)*(u(o*o+4)+o)*Jr/4,Xr*a]};var Vo=function(){return r.geoProjection(Sr).scale(127.16)},Qo=4*Jr+3*u(3),No=2*u(2*Jr*u(3)/Qo),_o=m(No*u(3)/Jr,No,Qo/6),Ko=function(){return r.geoProjection(_o).scale(176.84)};Gr.invert=function(n,r){return[n/u(1-3*r*r/(Jr*Jr)),r]};var Oo=function(){return r.geoProjection(Gr).scale(152.63)};Cr.invert=function(n,r){var e=n/2.66723,t=r/1.24104,i=u(e*e+t*t),a=2*o(i/2);return[3*xr(n*Kr(a),2.66723*i),i&&o(r*_r(a)/(1.24104*.90631*i))]};var Uo=function(){return r.geoProjection(Cr).scale(172.632)};zr.invert=function(n,r){var e=(n*n+r*r)/-2,t=u(-e*(2+e)),i=r*e+n*t,a=n*e-r*t,c=u(a*a+i*i);return[xr(t*i,c*(1+e)),c?-o(t*a/c):0]};var Jo=function(){return r.geoProjection(zr).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)};qr.invert=function(n,r){var e=n,t=r,o=25;do{var a,c=Br(t),f=_r(t),l=_r(2*t),v=f*f,g=c*c,s=_r(e),h=Br(e/2),p=_r(e/2),d=p*p,w=1-g*h*h,P=w?i(c*h)*u(a=1/w):a=0,m=.5*(2*P*c*p+e/Xr)-n,y=.5*(P*f+t)-r,R=.5*a*(g*d+P*c*h*v)+.5/Xr,j=a*(s*l/4-P*f*p),M=.125*a*(l*p-P*f*g*s),E=.5*a*(v*h+P*d*c)+.5,b=j*M-E*R,A=(y*j-m*E)/b,k=(m*M-y*R)/b;e-=A,t-=k}while((Lr(A)>Or||Lr(k)>Or)&&--o>0);return[e,t]};var Xo=function(){return r.geoProjection(qr).scale(158.837)};n.geoAiry=oe,n.geoAiryRaw=g,n.geoAitoff=ie,n.geoAitoffRaw=s,n.geoArmadillo=ue,n.geoArmadilloRaw=h,n.geoAugust=ae,n.geoAugustRaw=p,n.geoBaker=le,n.geoBakerRaw=d,n.geoBerghaus=ve,n.geoBerghausRaw=w,n.geoBoggs=de,n.geoBoggsRaw=y,n.geoBonne=me,n.geoBonneRaw=j,n.geoBottomley=ye,n.geoBottomleyRaw=M,n.geoBromley=je,n.geoBromleyRaw=Re,n.geoChamberlin=C,n.geoChamberlinRaw=k,n.geoChamberlinAfrica=G,n.geoCollignon=Me,n.geoCollignonRaw=z,n.geoCraig=Ee,n.geoCraigRaw=q,n.geoCraster=Ae,n.geoCrasterRaw=L,n.geoCylindricalEqualArea=ke,n.geoCylindricalEqualAreaRaw=F,n.geoCylindricalStereographic=Se,n.geoCylindricalStereographicRaw=x,n.geoEckert1=Ge,n.geoEckert1Raw=B,n.geoEckert2=Ce,n.geoEckert2Raw=H,n.geoEckert3=ze,n.geoEckert3Raw=I,n.geoEckert4=qe,n.geoEckert4Raw=W,n.geoEckert5=Le,n.geoEckert5Raw=T,n.geoEckert6=Fe,n.geoEckert6Raw=D,n.geoEisenlohr=Be,n.geoEisenlohrRaw=V,n.geoFahey=Ie,n.geoFaheyRaw=Q,n.geoFoucaut=We,n.geoFoucautRaw=N,n.geoGilbert=Te,n.geoGingery=De,n.geoGingeryRaw=O,n.geoGinzburg4=Ne,n.geoGinzburg4Raw=Qe,n.geoGinzburg5=Ke,n.geoGinzburg5Raw=_e,n.geoGinzburg6=Ue,n.geoGinzburg6Raw=Oe,n.geoGinzburg8=Je,n.geoGinzburg8Raw=X,n.geoGinzburg9=Ye,n.geoGinzburg9Raw=Xe,n.geoGringorten=$e,n.geoGringortenRaw=Y,n.geoGuyou=nt,n.geoGuyouRaw=on,n.geoHammer=rt,n.geoHammerRaw=cn,n.geoHammerRetroazimuthal=et,n.geoHammerRetroazimuthalRaw=ln,n.geoHealpix=it,n.geoHealpixRaw=gn,n.geoHill=ut,n.geoHillRaw=hn,n.geoHomolosine=lt,n.geoHomolosineRaw=dn,n.geoInterrupt=vt,n.geoInterruptedBoggs=st,n.geoInterruptedHomolosine=pt,n.geoInterruptedMollweide=wt,n.geoInterruptedMollweideHemispheres=mt,n.geoInterruptedSinuMollweide=Rt,n.geoInterruptedSinusoidal=Mt,n.geoKavrayskiy7=Et,n.geoKavrayskiy7Raw=yn,n.geoLagrange=bt,n.geoLagrangeRaw=Rn,n.geoLarrivee=kt,n.geoLarriveeRaw=jn,n.geoLaskowski=St,n.geoLaskowskiRaw=Mn,n.geoLittrow=Gt,n.geoLittrowRaw=En,n.geoLoximuthal=Ct,n.geoLoximuthalRaw=bn,n.geoMiller=zt,n.geoMillerRaw=An,n.geoModifiedStereographic=Ln,n.geoModifiedStereographicRaw=kn,n.geoModifiedStereographicAlaska=Sn,n.geoModifiedStereographicGs48=Gn,n.geoModifiedStereographicGs50=Cn,n.geoModifiedStereographicMiller=zn,n.geoModifiedStereographicLee=qn,n.geoMollweide=se,n.geoMollweideRaw=ge,n.geoMtFlatPolarParabolic=Wt,n.geoMtFlatPolarParabolicRaw=Fn,n.geoMtFlatPolarQuartic=Tt,n.geoMtFlatPolarQuarticRaw=xn,n.geoMtFlatPolarSinusoidal=Dt,n.geoMtFlatPolarSinusoidalRaw=Bn,n.geoNaturalEarth=Vt,n.geoNaturalEarthRaw=Hn,n.geoNellHammer=Qt,n.geoNellHammerRaw=In,n.geoPatterson=$t,n.geoPattersonRaw=Wn,n.geoPolyconic=no,n.geoPolyconicRaw=Tn,n.geoPolyhedral=eo,n.geoPolyhedralButterfly=io,n.geoPolyhedralCollignon=ao,n.geoPolyhedralWaterman=co,n.geoProject=go,n.geoGringortenQuincuncial=yo,n.geoPeirceQuincuncial=Ro,n.geoPierceQuincuncial=Ro,n.geoQuincuncial=mo,n.geoRectangularPolyconic=jo,n.geoRectangularPolyconicRaw=ur,n.geoRobinson=Eo,n.geoRobinsonRaw=ar,n.geoSatellite=bo,n.geoSatelliteRaw=fr,n.geoSinuMollweide=ft,n.geoSinuMollweideRaw=pn,n.geoSinusoidal=Pe,n.geoSinusoidalRaw=R,n.geoStitch=Bo,n.geoTimes=Ho,n.geoTimesRaw=Pr,n.geoTwoPointAzimuthal=Rr,n.geoTwoPointAzimuthalRaw=mr,n.geoTwoPointAzimuthalUsa=yr,n.geoTwoPointEquidistant=Er,n.geoTwoPointEquidistantRaw=jr,n.geoTwoPointEquidistantUsa=Mr,n.geoVanDerGrinten=Wo,n.geoVanDerGrintenRaw=br,n.geoVanDerGrinten2=To,n.geoVanDerGrinten2Raw=Ar,n.geoVanDerGrinten3=Do,n.geoVanDerGrinten3Raw=kr,n.geoVanDerGrinten4=Vo,n.geoVanDerGrinten4Raw=Sr,n.geoWagner4=Ko,n.geoWagner4Raw=_o,n.geoWagner6=Oo,n.geoWagner6Raw=Gr,n.geoWagner7=Uo,n.geoWagner7Raw=Cr,n.geoWiechel=Jo,n.geoWiechelRaw=zr,n.geoWinkel3=Xo,n.geoWinkel3Raw=qr,Object.defineProperty(n,"__esModule",{value:!0})}); |
{ | ||
"name": "d3-geo-projection", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Extended geographic projections for d3-geo.", | ||
@@ -38,4 +38,4 @@ "keywords": [ | ||
"pretest": "rm -rf build && mkdir build && rollup --banner \"$(preamble)\" -g d3-array:d3,d3-geo:d3 -f umd -n d3 -o build/d3-geo-projection.js -- index.js", | ||
"test": "tape 'test/**/*-test.js' && mkdir -p test/output && test/compare-images && eslint index.js src", | ||
"prepublish": "npm run test && uglifyjs --preamble \"$(preamble)\" build/d3-geo-projection.js -c -m -o build/d3-geo-projection.min.js", | ||
"test": "tape 'test/**/*-test.js' && eslint index.js src", | ||
"prepublish": "npm run test && mkdir -p test/output && test/compare-images && uglifyjs --preamble \"$(preamble)\" build/d3-geo-projection.js -c -m -o build/d3-geo-projection.min.js", | ||
"postpublish": "VERSION=`node -e 'console.log(require(\"./package.json\").version)'`; git push && git push --tags && cd ../d3.github.com && git pull && cp ../d3-geo-projection/build/d3-geo-projection.js d3-geo-projection.v1.js && cp ../d3-geo-projection/build/d3-geo-projection.min.js d3-geo-projection.v1.min.js && git add d3-geo-projection.v1.js d3-geo-projection.v1.min.js && git commit -m \"d3-geo-projection ${VERSION}\" && git push && cd - && zip -j build/d3-geo-projection.zip -- LICENSE README.md build/d3-geo-projection.js build/d3-geo-projection.min.js" | ||
@@ -42,0 +42,0 @@ }, |
@@ -13,8 +13,18 @@ var epsilon = 1e-4, | ||
function normalizePoint(y) { | ||
y = quantize(y); | ||
return y <= y0 ? [0, y0] // south pole | ||
: y >= y1 ? [0, y1] // north pole | ||
: [x0, y]; // antimeridian | ||
return y === y0 || y === y1 | ||
? [0, y] // pole | ||
: [x0, quantize(y)]; // antimeridian | ||
} | ||
function clampPoint(p) { | ||
if (p[0] <= x0e) p[0] = x0; | ||
else if (p[0] >= x1e) p[0] = x1; | ||
if (p[1] <= y0e) p[1] = y0; | ||
else if (p[1] >= y1e) p[1] = y1; | ||
} | ||
function clampPoints(points) { | ||
points.forEach(clampPoint); | ||
} | ||
// For each ring, detect where it crosses the antimeridian or pole. | ||
@@ -36,2 +46,3 @@ function extractFragments(polygon, fragments) { | ||
if (x <= x0e || x >= x1e || y <= y0e || y >= y1e) { | ||
clampPoint(point); | ||
@@ -63,5 +74,3 @@ // Advance through any antimeridian or polar points… | ||
// we can ignore that fragment entirely. | ||
else { | ||
fragments.pop(); | ||
} | ||
else fragments.pop(); | ||
@@ -172,5 +181,25 @@ // If the remainder of the ring is an antimeridian fragment, | ||
var fragments, i, n; | ||
switch (o.type) { | ||
case "GeometryCollection": return o.geometries.forEach(stitchGeometry); | ||
case "Polygon": extractFragments(o.coordinates, fragments = []); break; | ||
case "GeometryCollection": { | ||
o.geometries.forEach(stitchGeometry); | ||
return; | ||
} | ||
case "Point": { | ||
clampPoint(o.coordinates); | ||
break; | ||
} | ||
case "MultiPoint": | ||
case "LineString": { | ||
clampPoints(o.coordinates); | ||
break; | ||
} | ||
case "MultiLineString": { | ||
o.coordinates.forEach(clampPoints); | ||
break; | ||
} | ||
case "Polygon": { | ||
extractFragments(o.coordinates, fragments = []); | ||
break; | ||
} | ||
case "MultiPolygon": { | ||
@@ -183,2 +212,3 @@ fragments = [], i = -1, n = o.coordinates.length; | ||
} | ||
stitchFragments(fragments); | ||
@@ -185,0 +215,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6818890
7916