commit ef81eba6f8752ea07bd0257d75e4b6975f0554cf Author: Ana C. Custura ana@netstat.org.uk Date: Wed Dec 13 13:45:27 2017 +0000
Changes map projection to Cylindrical Equal Area, fixes #24563 --- js/libs/d3js/d3-array.v1.min.js | 2 ++ js/libs/d3js/d3-geo-projection.v2.min.js | 2 ++ js/libs/d3js/d3-geo-projection.v2.min.js.1 | 2 ++ js/libs/d3js/d3-geo.v1.min.js | 2 ++ js/main.js | 3 +++ js/views/aggregate/map.js | 9 +++++---- 6 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/js/libs/d3js/d3-array.v1.min.js b/js/libs/d3js/d3-array.v1.min.js new file mode 100644 index 0000000..508c424 --- /dev/null +++ b/js/libs/d3js/d3-array.v1.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-array/ Version 1.2.1. Copyright 2017 Mike Bostock. +!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(n.d3=n.d3||{})}(this,function(n){"use strict";function r(n){return function(r,t){return f(n(r),t)}}function t(n,r){return[n,r]}function e(n,r,t){var e=(r-n)/Math.max(0,t),o=Math.floor(Math.log(e)/Math.LN10),u=e/Math.pow(10,o);return o>=0?(u>=b?10:u>=q?5:u>=L?2:1)*Math.pow(10,o):-Math.pow(10,-o)/(u>=b?10:u>=q?5:u>=L?2:1)}function o(n,r,t){var e=Math.abs(r-n)/Math.max(0,t),o=Math.pow(10,Math.floor(Math.log(e)/Math.LN10)),u=e/o;return u>=b?o*=10:u>=q?o*=5:u>=L&&(o*=2),r<n?-o:o}function u(n){return n.length}var f=function(n,r){return n<r?-1:n>r?1:n>=r?0:NaN},l=function(n){return 1===n.length&&(n=r(n)),{left:function(r,t,e,o){for(null==e&&(e=0),null==o&&(o=r.length);e<o;){var u=e+o>>>1;n(r[u],t)<0?e=u+1:o=u}return e},right:function(r,t,e,o){for(null==e&&(e=0),null==o&&(o=r.length);e<o;){var u=e+o>>>1;n(r[u],t)>0?o=u:e=u+1}return e}}},i=l(f),a=i.righ t,h=i.left,c=function(n,r){null==r&&(r=t);for(var e=0,o=n.length-1,u=n[0],f=new Array(o<0?0:o);e<o;)f[e]=r(u,u=n[++e]);return f},s=function(n,r,e){var o,u,f,l,i=n.length,a=r.length,h=new Array(i*a);for(null==e&&(e=t),o=f=0;o<i;++o)for(l=n[o],u=0;u<a;++u,++f)h[f]=e(l,r[u]);return h},g=function(n,r){return r<n?-1:r>n?1:r>=n?0:NaN},M=function(n){return null===n?NaN:+n},v=function(n,r){var t,e,o=n.length,u=0,f=-1,l=0,i=0;if(null==r)for(;++f<o;)isNaN(t=M(n[f]))||(e=t-l,l+=e/++u,i+=e*(t-l));else for(;++f<o;)isNaN(t=M(r(n[f],f,n)))||(e=t-l,l+=e/++u,i+=e*(t-l));if(u>1)return i/(u-1)},p=function(n,r){var t=v(n,r);return t?Math.sqrt(t):t},d=function(n,r){var t,e,o,u=n.length,f=-1;if(null==r){for(;++f<u;)if(null!=(t=n[f])&&t>=t)for(e=o=t;++f<u;)null!=(t=n[f])&&(e>t&&(e=t),o<t&&(o=t))}else for(;++f<u;)if(null!=(t=r(n[f],f,n))&&t>=t)for(e=o=t;++f<u;)null!=(t=r(n[f],f,n))&&(e>t&&(e=t),o<t&&(o=t));return[e,o]},y=Array.prototype,N=y.slice,m=y.map,w=function(n){return function(){return n}},A=functio n(n){return n},x=function(n,r,t){n=+n,r=+r,t=(o=arguments.length)<2?(r=n,n=0,1):o<3?1:+t;for(var e=-1,o=0|Math.max(0,Math.ceil((r-n)/t)),u=new Array(o);++e<o;)u[e]=n+e*t;return u},b=Math.sqrt(50),q=Math.sqrt(10),L=Math.sqrt(2),k=function(n,r,t){var o,u,f,l,i=-1;if(r=+r,n=+n,t=+t,n===r&&t>0)return[n];if((o=r<n)&&(u=n,n=r,r=u),0===(l=e(n,r,t))||!isFinite(l))return[];if(l>0)for(n=Math.ceil(n/l),r=Math.floor(r/l),f=new Array(u=Math.ceil(r-n+1));++i<u;)f[i]=(n+i)*l;else for(n=Math.floor(n*l),r=Math.ceil(r*l),f=new Array(u=Math.ceil(n-r+1));++i<u;)f[i]=(n-i)/l;return o&&f.reverse(),f},S=function(n){return Math.ceil(Math.log(n.length)/Math.LN2)+1},j=function(){function n(n){var u,f,l=n.length,i=new Array(l);for(u=0;u<l;++u)i[u]=r(n[u],u,n);var h=t(i),c=h[0],s=h[1],g=e(i,c,s);Array.isArray(g)||(g=o(c,s,g),g=x(Math.ceil(c/g)*g,Math.floor(s/g)*g,g));for(var M=g.length;g[0]<=c;)g.shift(),--M;for(;g[M-1]>s;)g.pop(),--M;var v,p=new Array(M+1);for(u=0;u<=M;++u)v=p[u]=[],v.x0=u>0?g[u-1]:c,v.x1=u<M ?g[u]:s;for(u=0;u<l;++u)f=i[u],c<=f&&f<=s&&p[a(g,f,0,M)].push(n[u]);return p}var r=A,t=d,e=S;return n.value=function(t){return arguments.length?(r="function"==typeof t?t:w(t),n):r},n.domain=function(r){return arguments.length?(t="function"==typeof r?r:w([r[0],r[1]]),n):t},n.thresholds=function(r){return arguments.length?(e="function"==typeof r?r:w(Array.isArray(r)?N.call(r):r),n):e},n},F=function(n,r,t){if(null==t&&(t=M),e=n.length){if((r=+r)<=0||e<2)return+t(n[0],0,n);if(r>=1)return+t(n[e-1],e-1,n);var e,o=(e-1)*r,u=Math.floor(o),f=+t(n[u],u,n);return f+(+t(n[u+1],u+1,n)-f)*(o-u)}},_=function(n,r,t){return n=m.call(n,M).sort(f),Math.ceil((t-r)/(2*(F(n,.75)-F(n,.25))*Math.pow(n.length,-1/3)))},z=function(n,r,t){return Math.ceil((t-r)/(3.5*p(n)*Math.pow(n.length,-1/3)))},D=function(n,r){var t,e,o=n.length,u=-1;if(null==r){for(;++u<o;)if(null!=(t=n[u])&&t>=t)for(e=t;++u<o;)null!=(t=n[u])&&t>e&&(e=t)}else for(;++u<o;)if(null!=(t=r(n[u],u,n))&&t>=t)for(e=t;++u<o;)null!=(t=r(n[u],u,n))&& t>e&&(e=t);return e},I=function(n,r){var t,e=n.length,o=e,u=-1,f=0;if(null==r)for(;++u<e;)isNaN(t=M(n[u]))?--o:f+=t;else for(;++u<e;)isNaN(t=M(r(n[u],u,n)))?--o:f+=t;if(o)return f/o},O=function(n,r){var t,e=n.length,o=-1,u=[];if(null==r)for(;++o<e;)isNaN(t=M(n[o]))||u.push(t);else for(;++o<e;)isNaN(t=M(r(n[o],o,n)))||u.push(t);return F(u.sort(f),.5)},P=function(n){for(var r,t,e,o=n.length,u=-1,f=0;++u<o;)f+=n[u].length;for(t=new Array(f);--o>=0;)for(e=n[o],r=e.length;--r>=0;)t[--f]=e[r];return t},R=function(n,r){var t,e,o=n.length,u=-1;if(null==r){for(;++u<o;)if(null!=(t=n[u])&&t>=t)for(e=t;++u<o;)null!=(t=n[u])&&e>t&&(e=t)}else for(;++u<o;)if(null!=(t=r(n[u],u,n))&&t>=t)for(e=t;++u<o;)null!=(t=r(n[u],u,n))&&e>t&&(e=t);return e},B=function(n,r){for(var t=r.length,e=new Array(t);t--;)e[t]=n[r[t]];return e},C=function(n,r){if(t=n.length){var t,e,o=0,u=0,l=n[u];for(null==r&&(r=f);++o<t;)(r(e=n[o],l)<0||0!==r(l,l))&&(l=e,u=o);return 0===r(l,l)?u:void 0}},E=function(n,r,t){for(var e,o,u= (null==t?n.length:t)-(r=null==r?0:+r);u;)o=Math.random()*u--|0,e=n[u+r],n[u+r]=n[o+r],n[o+r]=e;return n},G=function(n,r){var t,e=n.length,o=-1,u=0;if(null==r)for(;++o<e;)(t=+n[o])&&(u+=t);else for(;++o<e;)(t=+r(n[o],o,n))&&(u+=t);return u},H=function(n){if(!(o=n.length))return[];for(var r=-1,t=R(n,u),e=new Array(t);++r<t;)for(var o,f=-1,l=e[r]=new Array(o);++f<o;)l[f]=n[f][r];return e},J=function(){return H(arguments)};n.bisect=a,n.bisectRight=a,n.bisectLeft=h,n.ascending=f,n.bisector=l,n.cross=s,n.descending=g,n.deviation=p,n.extent=d,n.histogram=j,n.thresholdFreedmanDiaconis=_,n.thresholdScott=z,n.thresholdSturges=S,n.max=D,n.mean=I,n.median=O,n.merge=P,n.min=R,n.pairs=c,n.permute=B,n.quantile=F,n.range=x,n.scan=C,n.shuffle=E,n.sum=G,n.ticks=k,n.tickIncrement=e,n.tickStep=o,n.transpose=H,n.variance=v,n.zip=J,Object.defineProperty(n,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/js/libs/d3js/d3-geo-projection.v2.min.js b/js/libs/d3js/d3-geo-projection.v2.min.js new file mode 100644 index 0000000..1d93da8 --- /dev/null +++ b/js/libs/d3js/d3-geo-projection.v2.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-geo-projection/ Version 2.3.2. Copyright 2017 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>1?Mr:n<-1?-Mr:Math.asin(n)}function o(n){return n>1?0:n<-1?jr:Math.acos(n)}function i(n){return n>0?Math.sqrt(n):0}function u(n){return(gr(n)-gr(-n))/2}function a(n){return(gr(n)+gr(-n))/2}function c(n){function r(n,r){var e=lr(n),t=lr(r),i=mr(r),u=t*e,a=-((1-u?sr((1+u)/2)/(1-u):-.5)+o/(1+u));return[a*t*mr(n),a*i]}var e=Pr(n/2),o=2*sr(lr(n/2))/(e*e);return r.invert=function(r,e){var u,a=i(r*r+e*e),c=-n/2,f=50;if(!a)return[0,0];do{var l=c/2,g=lr(l),v=mr(l),s=Pr(l),p=sr(1/g);c-=u=(2/s*p-o*s-a)/(-p/(v*v)+1-o/(2*g*g))}while(ar(u)>Rr&&--f>0);var h=mr(c);return[fr(r*h,a*lr(c)),t(e*h/a)]},r}function f(n,r){var e=lr(r),t=function(n){return n?n/Math.sin(n):1}(o(e*lr(n/=2)));return[2*e*mr(n)*t,mr(r)*t]}function l(n) {function r(n,r){var a=lr(r),c=lr(n/=2);return[(1+a)*mr(n),(o*r>-fr(c,i)-.001?0:10*-o)+u+mr(r)*t-(1+a)*e*c]}var e=mr(n),t=lr(n),o=n>=0?1:-1,i=Pr(o*n),u=(1+e-t)/2;return r.invert=function(n,r){var a=0,c=0,f=50;do{var l=lr(a),g=mr(a),v=lr(c),s=mr(c),p=1+v,h=p*g-n,d=u+s*t-p*e*l-r,w=p*l/2,y=-g*s,m=e*p*g/2,P=t*v+e*l*s,R=y*m-P*w,b=(d*y-h*P)/R/2,j=(h*m-d*w)/R;a-=b,c-=j}while((ar(b)>Rr||ar(j)>Rr)&&--f>0);return o*c>-fr(lr(a),i)-.001?[2*a,c]:null},r}function g(n,r){var e=Pr(r/2),t=i(1-e*e),o=1+t*lr(n/=2),u=mr(n)*t/o,a=e/o,c=u*u,f=a*a;return[4/3*u*(3+c-3*f),4/3*a*(3+3*c-f)]}function v(n,r){var e=ar(r);return e<Er?[n,sr(Pr(Er+r/2))]:[n*lr(e)*(2*Sr-1/mr(e)),yr(r)*(2*Sr*(e-Er)-sr(Pr(e/2)))]}function s(n){function e(n,e){var o=r.geoAzimuthalEquidistantRaw(n,e);if(ar(n)>Mr){var a=fr(o[1],o[0]),c=i(o[0]*o[0]+o[1]*o[1]),f=u*wr((a-Mr)/u)+Mr,l=fr(mr(a-=f),2-lr(a));a=f+t(jr/c*mr(l))-l,o[0]=c*lr(a),o[1]=c*mr(a)}return o}var u=2*jr/n;return e.invert=function(n,e){var t=i(n*n+e*e);if(t>Mr){var a=fr(e,n),c =u*wr((a-Mr)/u)+Mr,f=a>c?-1:1,l=t*lr(c-a),g=1/Pr(f*o((l-jr)/i(jr*(jr-2*l)+t*t)));a=c+2*cr((g+f*i(g*g-3))/3),n=t*lr(a),e=t*mr(a)}return r.geoAzimuthalEquidistantRaw.invert(n,e)},e}function p(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?h:(t.invert=function(t,o){var i=r.geoAzimuthalEqualAreaRaw.invert(t/n,o);return i[0]*=e,i},t)}function h(n,r){return[n*lr(r)/lr(r/=2),2*mr(r)]}function d(){var n=p(1.68,2);return function(r,e){if(r+e<-1.4){var t=(r-e+1.6)*(r+e+1.4)/8;r+=t,e-=.8*t*mr(e+jr/2)}var o=n(r,e),i=(1-lr(r*e))/12;return o[1]<0&&(o[0]*=1+i),o[1]>0&&(o[1]*=1+i/1.5*o[0]*o[0]),o}}function w(n,r){var e,t=n*mr(r),o=30;do{r-=e=(r+mr(r)-t)/(1+lr(r))}while(ar(e)>Rr&&--o>0);return r/2}function y(n,r,e){function o(t,o){return[n*t*lr(o=w(e,o)),r*mr(o)]}return o.invert=function(o,i){return i=t(i/r),[o/(n*lr(i)),t((2*i+mr(2*i))/e)]},o}function m(n,r){var e=w(jr,r);return[qr*n/(1/lr(r)+Br /lr(e)),(r+Sr*mr(e))/qr]}function P(n,r){return[n*lr(r),r]}function R(n){function r(r,t){var o=e+n-t,i=o?r*lr(t)/o:o;return[o*mr(i),e-o*lr(i)]}if(!n)return P;var e=1/Pr(n);return r.invert=function(r,t){var o=i(r*r+(t=e-t)*t),u=e+n-o;return[o/lr(u)*fr(r,t),u]},r}function b(n){function r(r,e){var t=Mr-e,o=t?r*n*mr(t)/t:t;return[t*mr(o)/n,Mr-t*lr(o)]}return r.invert=function(r,e){var t=r*n,o=Mr-e,u=i(t*t+o*o),a=fr(t,o);return[(u?u/mr(u):1)*a/n,Mr-u]},r}function j(n,r,e,u,a,c){var f,l=lr(c);if(ar(n)>1||ar(c)>1)f=o(e*a+r*u*l);else{var g=mr(n/2),v=mr(c/2);f=2*t(i(g*g+r*u*v*v))}return ar(f)>Rr?[f,fr(u*mr(c),r*a-e*u*l)]:[0,0]}function M(n,r,e){return o((n*n+r*r-e*e)/(2*n*r))}function E(n){return n-2*jr*vr((n+jr)/(2*jr))}function A(n,r,e){for(var t,o=[[n[0],n[1],mr(n[1]),lr(n[1])],[r[0],r[1],mr(r[1]),lr(r[1])],[e[0],e[1],mr(e[1]),lr(e[1])]],i=o[2],u=0;u<3;++u,i=t)t=o[u],i.v=j(t[1]-i[1],i[3],i[2],t[3],t[2],t[0]-i[0]),i.point=[0,0];var a=M(o[0].v[0],o[2].v[0],o[1].v[0]),c=M(o[0].v[0],o[1].v[0] ,o[2].v[0]),f=jr-a;o[2].point[1]=0,o[0].point[0]=-(o[1].point[0]=o[0].v[0]/2);var l=[o[2].point[0]=o[0].point[0]+o[2].v[0]*lr(a),2*(o[0].point[1]=o[1].point[1]=o[2].v[0]*mr(a))];return function(n,r){var e,t=mr(r),i=lr(r),u=new Array(3);for(e=0;e<3;++e){var a=o[e];if(u[e]=j(r-a[1],a[3],a[2],i,t,n-a[0]),!u[e][0])return a.point;u[e][1]=E(u[e][1]-a.v[1])}var g=l.slice();for(e=0;e<3;++e){var v=2==e?0:e+1,s=M(o[e].v[0],u[e][0],u[v][0]);u[e][1]<0&&(s=-s),e?1==e?(s=c-s,g[0]-=u[e][0]*lr(s),g[1]-=u[e][0]*mr(s)):(s=f-s,g[0]+=u[e][0]*lr(s),g[1]+=u[e][0]*mr(s)):(g[0]+=u[e][0]*lr(s),g[1]-=u[e][0]*mr(s))}return g[0]/=3,g[1]/=3,g}}function S(n){return n[0]*=Cr,n[1]*=Cr,n}function k(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(A(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 x(n,r){var e=i(1-mr(r));return[2/kr* n*e,kr*(1-e)]}function G(n){function r(n,r){return[n,(n?n/mr(n):1)*(mr(r)*lr(n)-e*lr(r))]}var e=Pr(n);return r.invert=e?function(n,r){n&&(r*=mr(n)/n);var t=lr(n);return[n,2*fr(i(t*t+e*e-r*r)-t,e-r)]}:function(n,r){return[n,t(n?r*Pr(n)/n:r)]},r}function C(n,r){return[Wr*n*(2*lr(2*r/3)-1)/kr,Wr*kr*mr(r/3)]}function z(n){function r(n,r){return[n*e,mr(r)/e]}var e=lr(n);return r.invert=function(n,r){return[n/e,t(r*e)]},r}function F(n){function r(n,r){return[n*e,(1+e)*Pr(r/2)]}var e=lr(n);return r.invert=function(n,r){return[n/e,2*cr(r/(1+e))]},r}function L(n,r){var e=i(8/(3*jr));return[e*n*(1-ar(r)/jr),e*r]}function q(n,r){var e=i(4-3*mr(ar(r)));return[2/i(6*jr)*n*e,yr(r)*i(2*jr/3)*(2-e)]}function B(n,r){var e=i(jr*(4+jr));return[2/e*n*(1+i(1-4*r*r/(jr*jr))),4/e*r]}function H(n,r){var e=(2+Mr)*mr(r);r/=2;for(var t=0,o=1/0;t<10&&ar(o)>Rr;t++){var u=lr(r);r-=o=(r+mr(r)*(u+2)-e)/(2*u*(1+u))}return[2/i(jr*(4+jr))*n*(1+lr(r)),2*i(jr/(4+jr))*mr(r)]}function I(n,r){return[n*(1+lr(r))/i(2+jr),2* r/i(2+jr)]}function W(n,r){for(var e=(1+Mr)*mr(r),t=0,o=1/0;t<10&&ar(o)>Rr;t++)r-=o=(r+mr(r)-e)/(1+lr(r));return e=i(2+jr),[n*(1+lr(r))/e,2*r/e]}function T(n,r){var e=mr(n/=2),t=lr(n),o=i(lr(r)),u=lr(r/=2),a=mr(r)/(u+Sr*t*o),c=i(2/(1+a*a)),f=i((Sr*u+(t+e)*o)/(Sr*u+(t-e)*o));return[Tr*(c*(f-1/f)-2*sr(f)),Tr*(c*a*(f+1/f)-2*cr(a))]}function D(n,r){var e=Pr(r/2);return[n*Dr*i(1-e*e),(1+Dr)*e]}function N(n,r){var e=r/2,t=lr(e);return[2*n/kr*lr(r)*t*t,kr*Pr(e)]}function Q(n){return[n[0]/2,t(Pr(n[1]/2*Cr))*Gr]}function V(n){return[2*n[0],2*cr(mr(n[1]*Cr))*Gr]}function _(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>u){var g=i(l),v=fr(f,c),s=o*wr(v/o),p=v-s,h=n*lr(p),d=(n*mr(p)-p*mr(h))/(Mr-h),w=K(p,d),y=(jr-n)/O(w,h,jr);c=g;var m,P=50;do{c-=m=(n+O(w,h,c)*y-g)/(w(c)*y)}while(ar(m)>Rr&&--P>0);f=p*mr(c),c<Mr&&(f-=d*(c-Mr));var R=mr(s),b=lr(s);a[0]=c*b-f*R,a[1]=c*R+f*b}return a}var o=2*jr/e,u=n*n;return t.invert=function(e,t){var a=e*e+t*t;if(a>u){va r c=i(a),f=fr(t,e),l=o*wr(f/o),g=f-l;e=c*lr(g),t=c*mr(g);for(var v=e-Mr,s=mr(e),p=t/s,h=e<Mr?1/0:0,d=10;;){var w=n*mr(p),y=n*lr(p),m=mr(y),P=Mr-y,R=(w-p*m)/P,b=K(p,R);if(ar(h)<br||!--d)break;p-=h=(p*s-R*v-t)/(s-2*v*(P*(y+p*w*lr(y)-m)-w*(w-p*m))/(P*P))}e=(c=n+O(b,y,e)*(jr-n)/O(b,y,jr))*lr(f=l+p),t=c*mr(f)}return r.geoAzimuthalEquidistantRaw.invert(e,t)},t}function K(n,r){return function(e){var t=n*lr(e);return e<Mr&&(t-=r),i(1+t*t)}}function O(n,r,e){for(var t=(e-r)/50,o=n(r)+n(e),i=1,u=r;i<50;++i)o+=2*n(u+=t);return.5*o*t}function U(n,r){var e=n*n,t=r*r;return[n*(1-.162388*t)*(.87-952426e-9*e*e),r*(1+t/12)]}function J(n,r){var e=yr(n),o=yr(r),u=lr(r),a=lr(n)*u,c=mr(n)*u,f=mr(o*r);n=ar(fr(c,f)),r=t(a),ar(n-Mr)>Rr&&(n%=Mr);var l=function(n,r){if(r===Mr)return[0,0];var e,o,u=mr(r),a=u*u,c=a*a,f=1+c,l=1+3*c,g=1-c,v=t(1/i(f)),s=g+a*f*v,p=(1-u)/s,h=i(p),d=p*f,w=i(d),y=h*g;if(0===n)return[0,-(y+a*w)];var m,P=lr(r),R=1/P,b=2*u*P,j=(-s*P-(-3*a+v*l)*b*(1-u))/(s*s),M=-R*b,E=-R*(a*f*j+p*l*b),A= -2*R*(g*(.5*j/h)-2*a*h*b),S=4*n/jr;if(n>.222*jr||r<jr/4&&n>.175*jr){if(e=(y+a*i(d*(1+c)-y*y))/(1+c),n>jr/4)return[e,e];var k=e,x=.5*e;e=.5*(x+k),o=50;do{var G=i(d-e*e),C=e*(A+M*G)+E*t(e/w)-S;if(!C)break;C<0?x=e:k=e,e=.5*(x+k)}while(ar(k-x)>Rr&&--o>0)}else{e=Rr,o=25;do{var z=e*e,F=i(d-z),L=A+M*F,q=e*L+E*t(e/w)-S,B=L+(E-M*z)/F;e-=m=F?q/B:0}while(ar(m)>Rr&&--o>0)}return[e,-y-a*i(d-e*e)]}(n>jr/4?Mr-n:n,r);return n>jr/4&&(f=l[0],l[0]=-l[1],l[1]=-f),l[0]*=e,l[1]*=-o,l}function X(n,r){var e,o,c,f,l;if(r<Rr)return f=mr(n),o=lr(n),e=r*(n-f*o)/4,[f-e*o,o+e*f,1-r*f*f/2,n-e];if(r>=1-Rr)return e=(1-r)/4,o=a(n),f=function(n){return((n=gr(2*n))-1)/(n+1)}(n),c=1/o,l=o*u(n),[f+e*(l-n)/(o*o),c-e*f*c*(l-n),c+e*f*c*(l+n),2*cr(gr(n))-Mr+e*(l-n)/o];var g=[1,0,0,0,0,0,0,0,0],v=[i(r),0,0,0,0,0,0,0,0],s=0;for(o=i(1-r),l=1;ar(v[s]/g[s])>Rr&&s<8;)e=g[s++],v[s]=(e-o)/2,g[s]=(e+o)/2,o=i(e*o),l*=2;c=l*g[s]*n;do{c=(t(f=v[s]*mr(o=c)/g[s])+c)/2}while(--s);return[mr(c),f=lr(c),f/lr(c-o),c]}function Y(n,r){if(!r)retu rn n;if(1===r)return sr(Pr(n/2+Er));for(var e=1,t=i(1-r),o=i(r),u=0;ar(o)>Rr;u++){if(n%jr){var a=cr(t*Pr(n)/e);a<0&&(a+=jr),n+=a+~~(n/jr)*jr}else n+=n;o=(e+t)/2,t=i(e*t),o=((e=o)-t)/2}return n/(dr(2,u)*e)}function Z(n,r){var e=(Sr-1)/(Sr+1),t=i(1-e*e),o=Y(Mr,t*t),a=sr(Pr(jr/4+ar(r)/2)),c=gr(-1*a)/i(e),f=function(n,r){var e=n*n,t=r+1,o=1-e-r*r;return[.5*((n>=0?Mr:-Mr)-fr(o,2*n)),-.25*sr(o*o+4*e)+.5*sr(t*t+e)]}(c*lr(-1*n),c*mr(-1*n)),l=function(n,r,e){var t=ar(n),o=u(ar(r));if(t){var a=1/mr(t),c=1/(Pr(t)*Pr(t)),f=-(c+e*(o*o*a*a)-1+e),l=(-f+i(f*f-(e-1)*c*4))/2;return[Y(cr(1/i(l)),e)*yr(n),Y(cr(i((l/c-1)/e)),1-e)*yr(r)]}return[0,Y(cr(o),1-e)*yr(r)]}(f[0],f[1],t*t);return[-l[1],(r>=0?1:-1)*(.5*o-l[0])]}function $(n){function r(n,r){var i=u(n,r);n=i[0],r=i[1];var a=mr(r),c=lr(r),f=lr(n),l=o(e*a+t*c*f),g=mr(l),v=ar(g)>Rr?l/g:1;return[v*t*mr(n),(ar(n)>Mr?v:-v)*(e*c-t*a*f)]}var e=mr(n),t=lr(n),u=nn(n);return u.invert=nn(-n),r.invert=function(n,r){var t=i(n*n+r*r),o=-mr(t),a=lr(t),c=t*a,f=-r* o,l=t*e,g=i(c*c+f*f-l*l),v=fr(c*l+f*g,f*l-c*g),s=(t>Mr?-1:1)*fr(n*o,t*lr(v)*a+r*mr(v)*o);return u.invert(s,v)},r}function nn(n){var r=mr(n),e=lr(n);return function(n,o){var i=lr(o),u=lr(n)*i,a=mr(n)*i,c=mr(o);return[fr(a,u*e-c*r),t(c*e+u*r)]}}function rn(n){function r(r,l){var g,v=ar(l);if(v>e){var s=hr(n-1,pr(0,vr((r+jr)/a)));(g=x(r+=jr*(n-1)/n-s*a,v))[0]=g[0]*xr/t-xr*(n-1)/(2*n)+s*xr/n,g[1]=o+4*(g[1]-i)*u/xr,l<0&&(g[1]=-g[1])}else g=Jr(r,l);return g[0]*=c,g[1]/=f,g}var e=Ur*Cr,t=x(jr,e)[0]-x(-jr,e)[0],o=Jr(0,e)[1],i=x(0,e)[1],u=kr-i,a=xr/n,c=4/xr,f=o+u*u*4/xr;return r.invert=function(r,e){r/=c;var l=ar(e*=f);if(l>o){var g=hr(n-1,pr(0,vr((r+jr)/a))),v=x.invert(r=(r+jr*(n-1)/n-g*a)*t/xr,.25*(l-o)*xr/u+i);return v[0]-=jr*(n-1)/n-g*a,e<0&&(v[1]=-v[1]),v}return Jr.invert(r,e)},r}function en(n){function r(r,t){var o,v,s=1-mr(t);if(s&&s<2){var p,h=Mr-t,d=25;do{var w=mr(h),y=lr(h),m=a+fr(w,u-y),P=1+g-2*u*y;h-=p=(h-l*a-u*w+P*m-.5*s*e)/(2*u*w*m)}while(ar(p)>br&&--d>0);o=c*i(P),v=r*m/jr}else o=c*(n+s),v=r*a/jr;return[o*mr(v),f-o*lr(v)]}var e,u=1+n,a=t(mr(1/u)),c=2*i(jr/(e=jr+4*a*u)),f=.5*c*(u+i(n*(2+n))),l=n*n,g=u*u;return r.invert=function(n,r){var v=n*n+(r-=f)*r,s=(1+g-v/(c*c))/(2*u),p=o(s),h=mr(p),d=a+fr(h,u-s);return[t(n/i(v))*jr/d,t(1-2*(p-l*a-u*h+(1+g-2*u*s)*d)/e)]},r}function tn(n,r){return r>-Xr?(n=Lr(n,r),n[1]+=Yr,n):P(n,r)}function on(n,r){return ar(r)>Xr?(n=Lr(n,r),n[1]-=r>0?Yr:-Yr,n):P(n,r)}function un(n,r){return ar(n[0]-r[0])<Rr&&ar(n[1]-r[1])<Rr}function an(n,r){for(var e,t,o,i=-1,u=n.length,a=n[0],c=[];++i<u;){t=((e=n[i])[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 cn(n,r){return[3/xr*n*i(jr*jr/3-r*r),r]}function fn(n){function r(r,e){if(ar(ar(e)-Mr)<Rr)return[0,e<0?-2:2];var t=mr(e),o=dr((1+t)/(1-t),n/2),i=.5*(o+1/o)+lr(r*=n);return[2*mr(r)/i,(o-1/o)/i]}return r.invert=function(r,e){var o=ar(e);if(ar(o-2)<Rr)return r?null:[0,yr(e)*Mr];if(o>2)return null;var i=(r/=2)*r,u=(e/=2)*e,a=2*e/(1+i+ u);return a=dr((1+a)/(1-a),1/n),[fr(2*r,1-i-u)/n,t((a-1)/(a+1))]},r}function ln(n,r){return[n*(1+i(lr(r)))/2,r/(lr(r/2)*lr(n/6))]}function gn(n,r){var e=n*n,t=r*r;return[n*(.975534+t*(-.0143059*e-.119161+-.0547009*t)),r*(1.00384+e*(.0802894+-.02855*t+199025e-9*e)+t*(.0998909+-.0491032*t))]}function vn(n,r){return[mr(n)/lr(r),Pr(r)*lr(n)]}function sn(n){function r(r,o){var i=o-n,u=ar(i)<Rr?r*e:ar(u=Er+o/2)<Rr||ar(ar(u)-Mr)<Rr?0:r*i/sr(Pr(u)/t);return[u,i]}var e=lr(n),t=Pr(Er+n/2);return r.invert=function(r,o){var i,u=o+n;return[ar(o)<Rr?r/e:ar(i=Er+u/2)<Rr||ar(ar(i)-Mr)<Rr?0:r*sr(Pr(i)/t)/o,u]},r}function pn(n,r){return[n,1.25*sr(Pr(Er+.4*r))]}function hn(n){function r(r,t){for(var o,i=lr(t),u=2/(1+i*lr(r)),a=u*i*mr(r),c=u*mr(t),f=e,l=n[f],g=l[0],v=l[1];--f>=0;)g=(l=n[f])[0]+a*(o=g)-c*v,v=l[1]+a*v+c*o;return g=a*(o=g)-c*v,v=a*v+c*o,[g,v]}var e=n.length-1;return r.invert=function(r,o){var u=20,a=r,c=o;do{for(var f,l=e,g=n[l],v=g[0],s=g[1],p=0,h=0;--l>=0;)p=v+a*(f=p)-c*h,h=s+a*h+c*f,v= (g=n[l])[0]+a*(f=v)-c*s,s=g[1]+a*s+c*f;var d,w,y=(p=v+a*(f=p)-c*h)*p+(h=s+a*h+c*f)*h;a-=d=((v=a*(f=v)-c*s-r)*p+(s=a*s+c*f-o)*h)/y,c-=w=(s*p-v*h)/y}while(ar(d)+ar(w)>Rr*Rr&&--u>0);if(u){var m=i(a*a+c*c),P=2*cr(.5*m),R=mr(P);return[fr(a*R,m*lr(P)),m?t(c*R/m):0]}},r}function dn(n,e){var t=r.geoProjection(hn(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 wn(n,r){var e=t(7*mr(r)/(3*ge));return[ge*n*(2*lr(2*e/3)-1)/ve,9*mr(e/3)/ve]}function yn(n,r){for(var e,t=(1+Ar)*mr(r),o=r,u=0;u<25&&(o-=e=(mr(o/2)+mr(o)-t)/(.5*lr(o/2)+lr(o)),!(ar(e)<Rr));u++);return[n*(1+2*lr(o)/lr(o/2))/(3*Sr),2*i(3)*mr(o/2)/i(2+Sr)]}function mn(n,r){for(var e,t=i(6/(4+jr)),o=(1+jr/4)*mr(r),u=r/2,a=0;a<25&&(u-=e=(u/2+mr(u)-o)/(.5+lr(u)),!(ar(e)<Rr));a++);return[t*(.5+lr(u))*n/1.5,t*u]}function Pn(n,r){var e=r*r,t=e*e,o=e*t;return[n*(.84719-.13063*e+o*o*(.05494*e-.04515-.02326*t+.00331*o)),r*(1.01183+t*t*(. 01926*e-.02625-.00396*t))]}function Rn(n,r){return[n*(1+lr(r))/2,2*(r-Pr(r/2))]}function bn(n,r){var e=r*r;return[n,r*(se+e*e*(pe+e*(he+de*e)))]}function jn(n,r){if(ar(r)<Rr)return[n,0];var e=Pr(r),t=n*mr(r);return[mr(t)/e,r+(1-lr(t))/e]}function Mn(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 En(n,r){return[n[0]-r[0],n[1]-r[1]]}function An(n){return i(n[0]*n[0]+n[1]*n[1])}function Sn(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!==ar(n[1])}),l=r.geoBounds({type:"MultiPoint",coordinates:f}),g=!1,v=-1,s=l[1][0]-l[0][0],p=180===s||360===s?[(l[0][0]+l[1][0])/2,(l[0][1]+l[1][1])/2]:r.geoCentroid(c);if(t)for(;++v<a&&u[v]!==t;);++v;for(var h=0;h<a;++h)i=u[(h+v)%a],Array.isArray(i)?(g||(n.point((o=r.geoInterpolate(i[0],p)(Rr))[0],o[1]),g=!0),n.point((o=r.geoInterpolate(i[1],p)(Rr))[0],o[1])):(g=!1,i!==t&&Sn(n,i,e))}f unction kn(n,r){return n&&r&&n[0]===r[0]&&n[1]===r[1]}function xn(n){return n.project.invert||n.children&&n.children.some(xn)}function Gn(n,r){var e=x(n,r);return[e[0]*Ae,e[1]]}function Cn(n,r){for(var e=0,t=n.length,o=0;e<t;++e)o+=n[e]*r[e];return o}function zn(n){return[fr(n[1],n[0])*Gr,t(pr(-1,hr(1,n[2])))*Gr]}function Fn(n){var r=n[0]*Cr,e=n[1]*Cr,t=lr(e);return[t*lr(r),t*mr(r),mr(e)]}function Ln(n,r){return{type:"FeatureCollection",features:n.features.map(function(n){return qn(n,r)})}}function qn(n,r){return{type:"Feature",id:n.id,properties:n.properties,geometry:Bn(n.geometry,r)}}function Bn(n,e){if(!n)return null;if("GeometryCollection"===n.type)return function(n,r){return{type:"GeometryCollection",geometries:n.geometries.map(function(n){return Bn(n,r)})}}(n,e);var t;switch(n.type){case"Point":case"MultiPoint":t=Ge;break;case"LineString":case"MultiLineString":t=Ce;break;case"Polygon":case"MultiPolygon":case"Sphere":t=ze;break;default:return null}return r.geoStream(n,e(t)),t.r esult()}function Hn(n){function r(r,t){var o=e?Pr(r*e/2)/e:r/2;if(!t)return[2*o,-n];var i=2*cr(o*mr(t)),u=1/Pr(t);return[mr(i)*u,t+(1-lr(i))*u-n]}var e=mr(n);return r.invert=function(r,i){if(ar(i+=n)<Rr)return[e?2*cr(e*r/2)/e:r,0];var u,a=r*r+i*i,c=0,f=10;do{var l=Pr(c),g=1/lr(c),v=a-2*i*c+c*c;c-=u=(l*v+2*(c-i))/(2+v*g*g+2*(c-i)*l)}while(ar(u)>Rr&&--f>0);var s=r*(l=Pr(c)),p=Pr(ar(i)<ar(c+1/l)?.5*t(s):.5*o(s)+jr/4)/mr(c);return[e?2*cr(e*p)/e:2*p,c]},r}function In(n,r){var e,t=hr(18,36*ar(r)/jr),o=vr(t),i=t-o,u=(e=qe[o])[0],a=e[1],c=(e=qe[++o])[0],f=e[1],l=(e=qe[hr(19,++o)])[0],g=e[1];return[n*(c+i*(l-u)/2+i*i*(l-2*c+u)/2),(r>0?Mr:-Mr)*(f+i*(g-a)/2+i*i*(g-2*f+a)/2)]}function Wn(n,r){function e(r,e){var t=o(r,e),i=t[1],c=i*a/(n-1)+u;return[t[0]*u/c,i/c]}var o=function(n){function r(r,e){var t=lr(e),o=(n-1)/(n-t*lr(r));return[o*t*mr(r),o*mr(e)]}return r.invert=function(r,e){var o=r*r+e*e,u=i(o),a=(n-i(1-o*(n+1)/(n-1)))/((n-1)/u+u/(n-1));return[fr(r*a,u*i(1-a*a)),u?t(e*a/u):0]},r}(n);if( !r)return o;var u=lr(r),a=mr(r);return e.invert=function(r,e){var t=(n-1)/(n-1-e*a);return o.invert(t*r,t*e*u)},e}function Tn(n){return n.length>0}function Dn(n){return n===De||n===Qe?[0,n]:[He,function(n){return Math.floor(n*Be)/Be}(n)]}function Nn(n){var r=n[0],e=n[1],t=!1;return r<=Ie?(r=He,t=!0):r>=Te&&(r=We,t=!0),e<=Ne?(e=De,t=!0):e>=Ve&&(e=Qe,t=!0),t?[r,e]:n}function Qn(n){return n.map(Nn)}function Vn(n,r,e){for(var t=0,o=n.length;t<o;++t){var i=n[t].slice();e.push({index:-1,polygon:r,ring:i});for(var u=0,a=i.length;u<a;++u){var c=i[u],f=c[0],l=c[1];if(f<=Ie||f>=Te||l<=Ne||l>=Ve){i[u]=Nn(c);for(var g=u+1;g<a;++g){var v=i[g],s=v[0],p=v[1];if(s>Ie&&s<Te&&p>Ne&&p<Ve)break}if(g===u+1)continue;if(u){var h={index:-1,polygon:r,ring:i.slice(0,u+1)};h.ring[h.ring.length-1]=Dn(l),e[e.length-1]=h}else e.pop();if(g>=a)break;e.push({index:-1,polygon:r,ring:i=i.slice(g-1)}),i[0]=Dn(i[0][1]),u=-1,a=i.length}}}}function _n(n){var r,e,t,o,i,u,a=n.length,c={},f={};for(r=0;r<a;++r)t=(e=n[r]).rin g[0],i=e.ring[e.ring.length-1],t[0]!==i[0]||t[1]!==i[1]?(e.index=r,c[t]=f[i]=e):(e.polygon.push(e.ring),n[r]=null);for(r=0;r<a;++r)if(e=n[r]){if(t=e.ring[0],i=e.ring[e.ring.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.ring);continue}o?(delete f[t],delete c[o.ring[0]],o.ring.pop(),n[o.index]=null,e={index:-1,polygon:o.polygon,ring:o.ring.concat(e.ring)},o===u?e.polygon.push(e.ring):(e.index=a++,n.push(c[e.ring[0]]=f[e.ring[e.ring.length-1]]=e))):u?(delete c[i],delete f[u.ring[u.ring.length-1]],e.ring.pop(),e={index:a++,polygon:u.polygon,ring:e.ring.concat(u.ring)},n[u.index]=null,n.push(c[e.ring[0]]=f[e.ring[e.ring.length-1]]=e)):(e.ring.push(e.ring[0]),e.polygon.push(e.ring))}}function Kn(n){var r={type:"Feature",geometry:On(n.geometry)};return null!=n.id&&(r.id=n.id),null!=n.bbox&&(r.bbox=n.bbox),null!=n.properties&&(r.properties=n.properties),r}function On(n){if(null==n)return n;var r,e,t,o;switch(n.type){case"GeometryCollection":r={ty pe:"GeometryCollection",geometries:n.geometries.map(On)};break;case"Point":r={type:"Point",coordinates:Nn(n.coordinates)};break;case"MultiPoint":case"LineString":r={type:n.type,coordinates:Qn(n.coordinates)};break;case"MultiLineString":r={type:"MultiLineString",coordinates:n.coordinates.map(Qn)};break;case"Polygon":var i=[];Vn(n.coordinates,i,e=[]),_n(e),r={type:"Polygon",coordinates:i};break;case"MultiPolygon":e=[],t=-1,o=n.coordinates.length;for(var u=new Array(o);++t<o;)Vn(n.coordinates[t],u[t]=[],e);_n(e),r={type:"MultiPolygon",coordinates:u.filter(Tn)};break;default:return n}return null!=n.bbox&&(r.bbox=n.bbox),r}function Un(n,r){var e=Pr(r/2),t=mr(Er*e);return[n*(.74482-.34588*t*t),1.70711*e]}function Jn(n){function e(n,e){var o=r.geoGnomonicRaw(n,e);return o[0]*=t,o}var t=lr(n);return e.invert=function(n,e){return r.geoGnomonicRaw.invert(n/t,e)},e}function Xn(n,r){return _e(Jn,n,r)}function Yn(n){function e(r,e){var c=o(lr(e)*lr(r-t)),f=o(lr(e)*lr(r-u));return c*=c,f*=f,[(c-f )/(2*n),(e<0?-1:1)*i(4*a*f-(a-c+f)*(a-c+f))/(2*n)]}if(!(n*=2))return r.geoAzimuthalEquidistantRaw;var t=-n/2,u=-t,a=n*n,c=Pr(u),f=.5/mr(u);return e.invert=function(n,r){var e,a,l=r*r,g=lr(i(l+(e=n+t)*e)),v=lr(i(l+(e=n+u)*e));return[fr(a=g-v,e=(g+v)*c),(r<0?-1:1)*o(i(e*e+a*a)*f)]},e}function Zn(n,r){return _e(Yn,n,r)}function $n(n,r){if(ar(r)<Rr)return[n,0];var e=ar(r/Mr),o=t(e);if(ar(n)<Rr||ar(ar(r)-Mr)<Rr)return[0,yr(r)*jr*Pr(o/2)];var u=lr(o),a=ar(jr/n-n/jr)/2,c=a*a,f=u/(e+u-1),l=f*(2/e-1),g=l*l,v=g+c,s=f-g,p=c+f;return[yr(n)*jr*(a*s+i(c*s*s-v*(f*f-g)))/v,yr(r)*jr*(l*p-a*i((c+1)*v-p*p))/v]}function nr(n,r){if(ar(r)<Rr)return[n,0];var e=ar(r/Mr),o=t(e);if(ar(n)<Rr||ar(ar(r)-Mr)<Rr)return[0,yr(r)*jr*Pr(o/2)];var u=lr(o),a=ar(jr/n-n/jr)/2,c=a*a,f=u*(i(1+c)-a*u)/(1+c*e*e);return[yr(n)*jr*f,yr(r)*jr*i(1-f*(2*a+f))]}function rr(n,r){if(ar(r)<Rr)return[n,0];var e=r/Mr,o=t(e);if(ar(n)<Rr||ar(ar(r)-Mr)<Rr)return[0,jr*Pr(o/2)];var u=(jr/n-n/jr)/2,a=e/(1+lr(o));return[jr*(yr(n)*i(u*u+1-a*a)- u),jr*a]}function er(n,r){if(!r)return[n,0];var e=ar(r);if(!n||e===Mr)return[0,r];var t=e/Mr,o=t*t,u=(8*t-o*(o+2)-5)/(2*o*(t-1)),a=u*u,c=t*u,f=o+a+2*c,l=t+3*u,g=n/Mr,v=g+1/g,s=yr(ar(n)-Mr)*i(v*v-4),p=s*s,h=(s*(f+a-1)+2*i(f*(o+a*p-1)+(1-o)*(o*(l*l+4*a)+12*c*a+4*a*a)))/(4*f+p);return[yr(n)*Mr*h,yr(r)*Mr*i(1+s*ar(h)-h*h)]}function tr(n,r){return[n*i(1-3*r*r/(jr*jr)),r]}function or(n,r){var e=.90631*mr(r),t=i(1-e*e),o=i(2/(1+t*lr(n/=3)));return[2.66723*t*o*mr(n),1.24104*e*o]}function ir(n,r){var e=lr(r),t=lr(n)*e,o=1-t,u=lr(n=fr(mr(n)*e,-mr(r))),a=mr(n);return e=i(1-t*t),[a*e-u*o,-u*e-a*o]}function ur(n,r){var e=f(n,r);return[(e[0]+n/Mr)/2,(e[1]+r)/2]}var ar=Math.abs,cr=Math.atan,fr=Math.atan2,lr=Math.cos,gr=Math.exp,vr=Math.floor,sr=Math.log,pr=Math.max,hr=Math.min,dr=Math.pow,wr=Math.round,yr=Math.sign||function(n){return n>0?1:n<0?-1:0},mr=Math.sin,Pr=Math.tan,Rr=1e-6,br=1e-12,jr=Math.PI,Mr=jr/2,Er=jr/4,Ar=Math.SQRT1_2,Sr=i(2),kr=i(jr),xr=2*jr,Gr=180/jr,Cr=jr/180;f.invert=function(n, r){if(!(n*n+4*r*r>jr*jr+Rr)){var e=n,t=r,u=25;do{var a,c=mr(e),f=mr(e/2),l=lr(e/2),g=mr(t),v=lr(t),s=mr(2*t),p=g*g,h=v*v,d=f*f,w=1-h*l*l,y=w?o(v*l)*i(a=1/w):a=0,m=2*y*v*f-n,P=y*g-r,R=a*(h*d+y*v*l*p),b=a*(.5*c*s-2*y*g*f),j=.25*a*(s*f-y*g*h*c),M=a*(p*l+y*d*v),E=b*j-M*R;if(!E)break;var A=(P*b-m*M)/E,S=(m*j-P*R)/E;e-=A,t-=S}while((ar(A)>Rr||ar(S)>Rr)&&--u>0);return[e,t]}};g.invert=function(n,r){if(n*=3/8,r*=3/8,!n&&ar(r)>1)return null;var e=1+n*n+r*r,o=i((e-i(e*e-4*r*r))/2),c=t(o)/3,f=o?function(n){return sr(n+i(n*n-1))}(ar(r/o))/3:function(n){return sr(n+i(n*n+1))}(ar(n))/3,l=lr(c),g=a(f),v=g*g-l*l;return[2*yr(n)*fr(u(f)*l,.25-v),2*yr(r)*fr(g*mr(c),.25+v)]};var zr=i(8),Fr=sr(1+Sr);v.invert=function(n,r){if((t=ar(r))<Fr)return[n,2*cr(gr(r))-Mr];var e,t,o=Er,i=25;do{var u=lr(o/2),a=Pr(o/2);o-=e=(zr*(o-Er)-sr(a)-t)/(zr-u*u/(2*a))}while(ar(e)>br&&--i>0);return[n/(lr(o)*(zr-1/mr(o))),yr(r)*o]};h.invert=function(n,r){var e=2*t(r/2);return[n*lr(e/2)/lr(e),e]};var Lr=y(Sr/Mr,Sr,jr),qr=2.00276, Br=1.11072;m.invert=function(n,r){var e,t,o=qr*r,i=r<0?-Er:Er,u=25;do{t=o-Sr*mr(i),i-=e=(mr(2*i)+2*i-jr*mr(t))/(2*lr(2*i)+2+jr*lr(t)*Sr*lr(i))}while(ar(e)>Rr&&--u>0);return t=o-Sr*mr(i),[n*(1/lr(t)+Br/lr(i))/qr,t]};var Hr=function(n){var e=0,t=r.geoProjectionMutator(n),o=t(e);return o.parallel=function(n){return arguments.length?t(e=n*Cr):e*Gr},o};P.invert=function(n,r){return[n/lr(r),r]};var Ir=y(1,4/jr,jr);x.invert=function(n,r){var e=(e=r/kr-1)*e;return[e>0?n*i(jr/e)/2:0,t(1-e)]};var Wr=i(3);C.invert=function(n,r){var e=3*t(r/(Wr*kr));return[kr*n/(Wr*(2*lr(2*e/3)-1)),e]};L.invert=function(n,r){var e=i(8/(3*jr)),t=r/e;return[n/(e*(1-ar(t)/jr)),t]};q.invert=function(n,r){var e=2-ar(r)/i(2*jr/3);return[n*i(6*jr)/(2*e),yr(r)*t((4-e*e)/3)]};B.invert=function(n,r){var e=i(jr*(4+jr))/2;return[n*e/(1+i(1-r*r*(4+jr)/(4*jr))),r*e/2]};H.invert=function(n,r){var e=r*i((4+jr)/jr)/2,o=t(e),u=lr(o);return[n/(2/i(jr*(4+jr))*(1+u)),t((o+e*(u+2))/(2+Mr))]};I.invert=function(n,r){var e=i(2+jr),t=r* e/2;return[e*n/(1+lr(t)),t]};W.invert=function(n,r){var e=1+Mr,o=i(e/2);return[2*n*o/(1+lr(r*=o)),t((r+mr(r))/e)]};var Tr=3+2*Sr;T.invert=function(n,r){if(!(e=g.invert(n/1.2,1.065*r)))return null;var e,t=e[0],o=e[1],u=20;n/=Tr,r/=Tr;do{var a=t/2,c=o/2,f=mr(a),l=lr(a),v=mr(c),s=lr(c),p=lr(o),h=i(p),d=v/(s+Sr*l*h),w=d*d,y=i(2/(1+w)),m=(Sr*s+(l+f)*h)/(Sr*s+(l-f)*h),P=i(m),R=P-1/P,b=P+1/P,j=y*R-2*sr(P)-n,M=y*d*b-2*cr(d)-r,E=v&&Ar*h*f*w/v,A=(Sr*l*s+h)/(2*(s+Sr*l*h)*(s+Sr*l*h)*h),S=-.5*d*y*y*y,k=S*E,x=S*A,G=(G=2*s+Sr*h*(l-f))*G*P,C=(Sr*l*s*h+p)/G,z=-Sr*f*v/(h*G),F=R*k-2*C/P+y*(C+C/m),L=R*x-2*z/P+y*(z+z/m),q=d*b*k-2*E/(1+w)+y*b*E+y*d*(C-C/m),B=d*b*x-2*A/(1+w)+y*b*A+y*d*(z-z/m),H=L*q-B*F;if(!H)break;var I=(M*L-j*B)/H,W=(j*q-M*F)/H;t-=I,o=pr(-Mr,hr(Mr,o-W))}while((ar(I)>Rr||ar(W)>Rr)&&--u>0);return ar(ar(o)-Mr)<Rr?[0,o]:u&&[t,o]};var Dr=lr(35*Cr);D.invert=function(n,r){var e=r/(1+Dr);return[n&&n/(Dr*i(1-e*e)),2*cr(e)]};N.invert=function(n,r){var e=cr(r/kr),t=lr(e),o=2*e;return[n*kr/2/(lr(o)* t*t),o]};var Nr=function(n,r,e,o,u,a,c,f){function l(i,l){if(!l)return[n*i/jr,0];var g=l*l,v=n+g*(r+g*(e+g*o)),s=l*(u-1+g*(a-f+g*c)),p=(v*v+s*s)/(2*s),h=i*t(v/p)/jr;return[p*mr(h),l*(1+g*f)+p*(1-lr(h))]}return arguments.length<8&&(f=0),l.invert=function(l,g){var v,s,p=jr*l/n,h=g,d=50;do{var w=h*h,y=n+w*(r+w*(e+w*o)),m=h*(u-1+w*(a-f+w*c)),P=y*y+m*m,R=2*m,b=P/R,j=b*b,M=t(y/b)/jr,E=p*M,A=y*y,S=(2*r+w*(4*e+6*w*o))*h,k=u+w*(3*a+5*w*c),x=(2*(y*S+m*(k-1))*R-P*(2*(k-1)))/(R*R),G=lr(E),C=mr(E),z=b*G,F=b*C,L=p/jr*(1/i(1-A/j))*(S*b-y*x)/j,q=F-l,B=h*(1+w*f)+b-z-g,H=x*C+z*L,I=z*M,W=1+x-(x*G-F*L),T=F*M,D=H*T-W*I;if(!D)break;p-=v=(B*H-q*W)/D,h-=s=(q*T-B*I)/D}while((ar(v)>Rr||ar(s)>Rr)&&--d>0);return[p,h]},l},Qr=Nr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Vr=Nr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),_r=Nr(5/6*jr,-.62636,-.0344,0,1.3493,-.05524,0,.045);U.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(ar(e)>Rr&&--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(ar(e)>Rr&&--i>0);return[t,o]};var Kr=Nr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762),Or=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(Mr,0)[0]-n(-Mr,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};J.invert=function(n,r){ar(n)>1&&(n=2*yr(n)-n),ar(r)>1&&(r=2*yr(r)-r);var e=yr(n),o=yr(r),u=-e*n,a=-o*r,c=a/u<1,f=function(n,r){for(var e=0,o=1,u=.5,a=50;;){var c=u*u,f=i(u),l=t(1/i(1+c)),g=1-c+u*(1+c)*l,v=(1-f)/g,s=i(v),p=v*(1+c),h=s*(1-c),d=i(p-n*n),w=r+h+u*d;if(ar(o-e)<br||0==--a||0===w)break;w>0?e=u:o=u,u=.5*(e+o)}if(!a)return null;var y=t(f),m=lr(y),P=1/m,R=2*f*m,b=(-g*m-(-3*u+l*(1+3*c))*R*(1-f))/(g*g);return[jr/4*(n*(-2*P*(.5*b/s*(1-c)-2*u*s*R)+-P*R*d)+-P*(u*(1+c)*b+v*(1+3*c)*R)*t(n/i(p))),y]}(c?a:u,c?u:a),l=f[0],g=f[1],v=lr(g);return c&&(l=-Mr-l),[e*(f r(mr(l)*v,-mr(g))+jr),o*t(lr(l)*v)]};Z.invert=function(n,r){var e=(Sr-1)/(Sr+1),t=i(1-e*e),o=function(n,r,e){var t,o,i;return n?(t=X(n,e),r?(o=X(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=X(r,1-e),[[0,o[0]/o[1]],[1/o[1],0],[o[2]/o[1],0]])}(.5*Y(Mr,t*t)-r,-n,t*t),u=function(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]}(o[0],o[1]);return[fr(u[1],u[0])/-1,2*cr(gr(-.5*sr(e*u[0]*u[0]+e*u[1]*u[1])))-Mr]};var Ur=41+48/36+37/3600,Jr=z(0),Xr=.7109889596207567,Yr=.0528035274542;tn.invert=function(n,r){return r>-Xr?Lr.invert(n,r-Yr):P.invert(n,r)};on.invert=function(n,r){return ar(r)>Xr?Lr.invert(n,r+(r>0?Yr:-Yr)):P.invert(n,r)};var Zr=function(n,t){function o(r,e){for(var o=e<0?-1:1,i=t[+(e<0)],u=0,a=i.length-1;u<a&&r>i[u][2][0];++u);var c=n(r-i[u][1][0],e);return c[0]+=n(i[u][1][0],o*e>o*i[u][0][1]?i[u][0][ 1]:e)[0],c}var i,u;n.invert&&(o.invert=function(r,e){for(var i=u[+(e<0)],a=t[+(e<0)],c=0,f=i.length;c<f;++c){var l=i[c];if(l[0][0]<=r&&r<l[1][0]&&l[0][1]<=e&&e<l[1][1]){var g=n.invert(r-n(a[c][1][0],0)[0],e);return g[0]+=a[c][1][0],un(o(g[0],g[1]),[r,e])?g:null}}});var a=r.geoProjection(o),c=a.stream;return a.stream=function(n){var e=a.rotate(),t=c(n),o=(a.rotate([0,0]),c(n));return a.rotate(e),t.sphere=function(){r.geoStream(i,o)},t},a.lobes=function(r){return arguments.length?(i=function(n){var r,t,o,i,u,a,c,f=[],l=n[0].length;for(c=0;c<l;++c)t=(r=n[0][c])[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(an([[t+Rr,o+Rr],[t+Rr,i-Rr],[u-Rr,i-Rr],[u-Rr,a+Rr]],30));for(c=n[1].length-1;c>=0;--c)t=(r=n[1][c])[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(an([[u-Rr,a-Rr],[u-Rr,i+Rr],[t+Rr,i+Rr],[t+Rr,o-Rr]],30));return{type:"Polygon",coordinates:[e.merge(f)]}}(r),t=r.map(function(n){return n.map(function(n){return[[n[0][0]*Cr,n[0][1]*Cr],[n[1][0]*Cr,n[1][1]*Cr],[n[2][0]*Cr,n[2 ][1]*Cr]]})}),u=t.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]]})}),a):t.map(function(n){return n.map(function(n){return[[n[0][0]*Gr,n[0][1]*Gr],[n[1][0]*Gr,n[1][1]*Gr],[n[2][0]*Gr,n[2][1]*Gr]]})})},null!=t&&a.lobes(t),a},$r=[[[[-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]]]],ne=[[[[-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]]]],re=[[[[-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]]]],ee=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0] ]]],te=[[[[-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]]]],oe=[[[[-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]]]];cn.invert=function(n,r){return[xr/3*n/i(jr*jr/3-r*r),r]};var ie=jr/Sr;ln.invert=function(n,r){var e=ar(n),t=ar(r),u=Rr,a=Mr;t<ie?a*=t/ie:u+=6*o(ie/t);for(var c=0;c<25;c++){var f=mr(a),l=i(lr(a)),g=mr(a/2),v=lr(a/2),s=mr(u/6),p=lr(u/6),h=.5*u*(1+l)-e,d=a/(v*p)-t,w=l?-.25*u*f/l:0,y=.5*(1+l),m=(1+.5*a*g/v)/(v*p),P=a/v*(s/6)/(p*p),R=w*P-m*y,b=(h*P-d*y)/R,j=(d*w-h*m)/R;if(a-=b,u-=j,ar(b)<Rr&&ar(j)<Rr)break}return[n<0?-u:u,r<0?-a:a]};gn.invert=function(n,r){var e=yr(n)*jr,t=r/2,o=50;do{var i=e*e,u=t*t,a=e*t,c=e*(.975534+u*(-.0143059*i-.119161+-.0547009*u))-n,f=t*(1.00384+i*(.0802894+-.02855*u+199025e-9*i)+u*(.0998909+-.0491032*u))-r,l=.975534-u*(.119161+3*i*.01430 59+.0547009*u),g=-a*(.238322+.2188036*u+.0286118*i),v=a*(.1605788+7961e-7*i+-.0571*u),s=1.00384+i*(.0802894+199025e-9*i)+u*(3*(.0998909-.02855*i)-.245516*u),p=g*v-s*l,h=(f*g-c*s)/p,d=(c*v-f*l)/p;e-=h,t-=d}while((ar(h)>Rr||ar(d)>Rr)&&--o>0);return o&&[e,t]};vn.invert=function(n,r){var e=n*n,u=r*r+1,a=e+u,c=n?Ar*i((a-i(a*a-4*e))/e):1/i(u);return[t(n*c),yr(r)*o(c)]};pn.invert=function(n,r){return[n,2.5*cr(gr(.8*r))-.625*jr]};var ue=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],ae=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],ce=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],fe=[[.9245,0],[0,0],[.01943,0]],le=[[.721316,0],[0,0],[-.00881625,-.00617325]],ge=i(6),ve=i(7);wn.invert=function(n,r){var e=3*t(r*ve/9);return[n*ve/(ge*(2*lr(2*e/3)-1)),t(3*mr(e)*ge/7)]}; yn.invert=function(n,r){var e=r*i(2+Sr)/(2*i(3)),o=2*t(e);return[3*Sr*n/(1+2*lr(o)/lr(o/2)),t((e+mr(o))/(1+Ar))]};mn.invert=function(n,r){var e=i(6/(4+jr)),o=r/e;return ar(ar(o)-Mr)<Rr&&(o=o<0?-Mr:Mr),[1.5*n/(e*(.5+lr(o))),t((o/2+mr(o))/(1+jr/4))]};Pn.invert=function(n,r){var e,t,o,i,u=r,a=25;do{u-=e=(u*(1.01183+(o=(t=u*u)*t)*o*(.01926*t-.02625-.00396*o))-r)/(1.01183+o*o*(.21186*t-.23625+-.05148*o))}while(ar(e)>br&&--a>0);return t=u*u,o=t*t,i=t*o,[n/(.84719-.13063*t+i*i*(.05494*t-.04515-.02326*o+.00331*i)),u]};Rn.invert=function(n,r){for(var e=r/2,t=0,o=1/0;t<10&&ar(o)>Rr;++t){var i=lr(r/2);r-=o=(r-Pr(r/2)-e)/(1-.5/(i*i))}return[2*n/(1+lr(r)),r]};var se=1.0148,pe=.23185,he=-.14499,de=.02406,we=se,ye=5*pe,me=7*he,Pe=9*de,Re=1.790857183;bn.invert=function(n,r){r>Re?r=Re:r<-Re&&(r=-Re);var e,t=r;do{var o=t*t;t-=e=(t*(se+o*o*(pe+o*(he+de*o)))-r)/(we+o*o*(ye+o*(me+Pe*o)))}while(ar(e)>Rr);return[n,t]};jn.invert=function(n,r){if(ar(r)<Rr)return[n,0];var e,i=n*n+r*r,u=.5*r,a=10;do{var c=Pr( u),f=1/lr(u),l=i-2*r*u+u*u;u-=e=(c*l+2*(u-r))/(2+l*f*f+2*(u-r)*c)}while(ar(e)>Rr&&--a>0);return c=Pr(u),[(ar(r)<ar(u+1/c)?t(n*c):yr(n)*(o(ar(n*c))+Mr))/mr(u),u]};var be=function(n,r){var e=En(n[1],n[0]),t=En(r[1],r[0]),o=function(n,r){return fr(n[0]*r[1]-n[1]*r[0],n[0]*r[0]+n[1]*r[1])}(e,t),i=An(e)/An(t);return Mn([1,0,n[0][0],0,1,n[0][1]],Mn([i,0,0,0,i,0],Mn([lr(o),mr(o),0,-mr(o),lr(o),0],[1,0,-r[0][0],0,1,-r[0][1]])))},je=function(n,e,t){function o(n,r){if(n.edges=function(n){for(var r=n.length,e=[],t=n[r-1],o=0;o<r;++o)e.push([t,t=n[o]]);return e}(n.face),r.face){var e=n.shared=function(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}}}(n.face,r.face),t=be(e.map(r.project),e.map(n.project));n.transform=r.transform?Mn(r.transform,t):t;for(var i=r.edges,u=0,a=i.length;u<a;++u)kn(e[0],i[u][1])&&kn(e[1],i[u][0])&&(i[u]=n),kn(e[0],i[u][0])&&kn(e[1],i[u][1])&&(i[u]=n);for(u=0,a=(i=n.edges).length ;u<a;++u)kn(e[0],i[u][0])&&kn(e[1],i[u][1])&&(i[u]=r),kn(e[0],i[u][1])&&kn(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*Gr,r*Gr]);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 t=n.project.invert,o=n.transform,i=r;if(o&&(i=[(o=function(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])]}(o))[0]*i[0]+o[1]*i[1]+o[2],o[3]*i[0]+o[4]*i[1]+o[5]]),t&&n===function(n){return e(n[0]*Cr,n[1]*Cr)}(a=t(i)))return a;for(var a,c=n.children,f=0,l=c&&c.length;f<l;++f)if(a=u(c[f],r))return a}o(n,{transform:[lr(t=null==t?-jr/6:t),mr(t),0,-mr(t),lr(t),0]}),xn(n)&&(i.invert=function(r,e){var t=u(n,[r,-e]);return t&&(t[0]*=Cr,t[1]*=Cr,t)});var a=r.geoProjection(i),c=a.stream;return a.stream=function(r){var e=a.rotate(),t=c(r),o=(a.rotate([0,0]),c(r));return a.ro tate(e),t.sphere=function(){o.polygonStart(),o.lineStart(),Sn(o,n),o.lineEnd(),o.polygonEnd()},t},a},Me=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],Ee=[[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 Me[n]})}),Ae=2/i(3);Gn.invert=function(n,r){return x.invert(n/Ae,r)};var Se=function(){},ke=[],xe=[],Ge={point:function(n,r){ke.push([n,r])},result:function(){var n=ke.length?ke.length<2?{type:"Point",coordinates:ke[0]}:{type:"MultiPoint",coordinates:ke}:null;return ke=[],n}},Ce={lineStart:Se,point:function(n,r){ke.push([n,r])},lineEnd:function(){ke.length&&(xe.push(ke),ke=[])},result:function(){var n=xe.length?xe.length<2?{type:"LineString",coordinates:xe[0]}:{type:"MultiLineString",coordinates:xe}:null;return xe=[],n}},ze={polygonStart:Se,lineStart:Se,point:function(n,r){ke.push([n,r])},lineEnd:function(){var n=ke.length;if(n){do{ke.push(ke[0].slice())}while(++n<4);xe.push(ke),ke=[]}},polygonEnd:Se,result:function(){if (!xe.length)return null;var n=[],r=[];return xe.forEach(function(e){!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}(e)?r.push(e):n.push([e])}),r.forEach(function(r){var e=r[0];n.some(function(n){if(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],g=n[a],v=g[0],s=g[1];l>t^s>t&&e<(v-f)*(t-l)/(s-l)+f&&(o=!o)}return o}(n[0],e))return n.push(r),!0})||n.push([r])}),xe=[],n.length?n.length>1?{type:"MultiPolygon",coordinates:n}:{type:"Polygon",coordinates:n[0]}:null}},Fe=function(n){function e(r,e){var o=ar(r)<Mr,i=n(o?r:r>0?r-jr:r+jr,e),u=(i[0]-i[1])*Ar,a=(i[0]+i[1])*Ar;if(o)return[u,a];var c=t*Ar,f=u>0^a>0?-1:1;return[f*u-yr(a)*c,f*a-yr(u)*c]}var t=n(Mr,0)[0]-n(-Mr,0)[0];return n.invert&&(e.invert=function(r,e){var o=(r+e)*Ar,i=(e-r)*Ar,u=ar(o)<.5*t&&ar(i)<.5*t;if(!u){var a=t*Ar,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)*Ar,i=(f-l)*Ar}var g=n.invert(o,i);return u||(g[0]+=o>0?jr:-jr),g}),r.geoProjection(e).rotate([-90,-90,45]).clipAngle(179.999)},Le=function(){return Fe(Z).scale(111.48)},qe=[[.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]];qe.forEach(function(n){n[1]*=1.0144}),In.invert=function(n,r){var e=r/Mr,t=90*e,o=hr(18,ar(t/5)),i=pr(0,vr(o));do{var u=qe[i][1],a=qe[i+1][1],c=qe[hr(19,i+2)][1],f=c-u,l=c-2*a+u,g=2*(ar(e)-a)/f,v=l/f,s=g*(1-v*g*(1-2*v*g));if(s>=0||1===i){t=(r>=0?5:-5)*(s+o);var p,h=50;do{s=(o=hr(18,ar(t)/5))-(i=vr(o)),u=qe[i][1],a=qe[i+1][1],c=qe[hr(19,i+2)][1],t-=(p=(r>=0?Mr:-Mr)*(a+s*(c-u)/2+s*s*(c-2*a+u)/2)-r)*Gr}while(ar(p)>br&&--h>0);break}}while(--i>=0);var d=qe[i][0],w=qe[i+1][0],y=qe[hr(19,i+2)][0];return[n/(w+s*(y-d)/2+s*s*(y-2*w+d)/2),t*Cr]};var Be=1e4,He=-180,Ie=He+ 1e-4,We=180,Te=We-1e-4,De=-90,Ne=De+1e-4,Qe=90,Ve=Qe-1e-4;Un.invert=function(n,r){var e=r/1.70711,t=mr(Er*e);return[n/(.74482-.34588*t*t),2*cr(e)]};var _e=function(n,e,o){var i=r.geoInterpolate(e,o),u=i(.5),a=r.geoRotation([-u[0],-u[1]])(e),c=i.distance/2,f=-t(mr(a[1]*Cr)/mr(c)),l=[-u[0],-u[1],-(a[0]>0?jr-f:f)*Gr],g=r.geoProjection(n(c)).rotate(l),v=r.geoRotation(l),s=g.center;return delete g.rotate,g.center=function(n){return arguments.length?s(v(n)):v.invert(s())},g.clipAngle(90)};$n.invert=function(n,r){if(ar(r)<Rr)return[n,0];if(ar(n)<Rr)return[0,Mr*mr(2*cr(r/jr))];var e=(n/=jr)*n,t=(r/=jr)*r,u=e+t,a=u*u,c=-ar(r)*(1+u),f=c-2*t+e,l=-2*c+1+2*t+a,g=t/l+(2*f*f*f/(l*l*l)-9*c*f/(l*l))/27,v=(c-f*f/(3*l))/l,s=2*i(-v/3),p=o(3*g/(v*s))/3;return[jr*(u-1+i(1+2*(e-t)+a))/(2*n),yr(r)*jr*(-s*lr(p+jr/3)-f/(3*l))]};nr.invert=function(n,r){if(!n)return[0,Mr*mr(2*cr(r/jr))];var e=ar(n/jr),t=(1-e*e-(r/=jr)*r)/(2*e),o=i(t*t+1);return[yr(n)*jr*(o-t),yr(r)*Mr*mr(2*fr(i((1-2*t*e)*(t+o)-e),i(o+t+e)))]}; rr.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*(yr(n)*i(t*t+1)-t):0,Mr*mr(2*cr(e))]};er.invert=function(n,r){var e;if(!n||!r)return[n,r];r/=jr;var t=yr(n)*n/Mr,o=(t*t-1+4*r*r)/ar(t),u=o*o,a=2*r,c=50;do{var f=a*a,l=(8*a-f*(f+2)-5)/(2*f*(a-1)),g=(3*a-f*a-10)/(2*f*a),v=l*l,s=a*l,p=a+l,h=p*p,d=a+3*l,w=-2*p*(4*s*v+(1-4*f+3*f*f)*(1+g)+v*(14*f-6-u+(8*f-8-2*u)*g)+s*(12*f-8+(10*f-10-u)*g)),y=i(h*(f+v*u-1)+(1-f)*(f*(d*d+4*v)+v*(12*s+4*v)));a-=e=(o*(h+v-1)+2*y-t*(4*h+u))/(o*(2*l*g+2*p*(1+g))+w/y-8*p*(o*(-1+v+h)+2*y)*(1+g)/(u+4*h))}while(e>Rr&&--c>0);return[yr(n)*(i(o*o+4)+o)*jr/4,Mr*a]};var Ke=4*jr+3*i(3),Oe=2*i(2*jr*i(3)/Ke),Ue=y(Oe*i(3)/jr,Oe,Ke/6);tr.invert=function(n,r){return[n/i(1-3*r*r/(jr*jr)),r]};or.invert=function(n,r){var e=n/2.66723,o=r/1.24104,u=i(e*e+o*o),a=2*t(u/2);return[3*fr(n*Pr(a),2.66723*u),u&&t(r*mr(a)/(1.24104*.90631*u))]};ir.invert=function(n,r){var e=(n*n+r*r)/-2,o=i(-e*(2+e)),u=r*e+n*o,a=n*e-r*o,c=i(a*a+u*u);return[fr(o* u,c*(1+e)),c?-t(o*a/c):0]};ur.invert=function(n,r){var e=n,t=r,u=25;do{var a,c=lr(t),f=mr(t),l=mr(2*t),g=f*f,v=c*c,s=mr(e),p=lr(e/2),h=mr(e/2),d=h*h,w=1-v*p*p,y=w?o(c*p)*i(a=1/w):a=0,m=.5*(2*y*c*h+e/Mr)-n,P=.5*(y*f+t)-r,R=.5*a*(v*d+y*c*p*g)+.5/Mr,b=a*(s*l/4-y*f*h),j=.125*a*(l*h-y*f*v*s),M=.5*a*(g*p+y*d*c)+.5,E=b*j-M*R,A=(P*b-m*M)/E,S=(m*j-P*R)/E;e-=A,t-=S}while((ar(A)>Rr||ar(S)>Rr)&&--u>0);return[e,t]};n.geoAiry=function(){var n=Mr,e=r.geoProjectionMutator(c),t=e(n);return t.radius=function(r){return arguments.length?e(n=r*Cr):n*Gr},t.scale(179.976).clipAngle(147)},n.geoAiryRaw=c,n.geoAitoff=function(){return r.geoProjection(f).scale(152.63)},n.geoAitoffRaw=f,n.geoArmadillo=function(){var n=20*Cr,e=n>=0?1:-1,t=Pr(e*n),o=r.geoProjectionMutator(l),i=o(n),u=i.stream;return i.parallel=function(r){return arguments.length?(t=Pr((e=(n=r*Cr)>=0?1:-1)*n),o(n)):n*Gr},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=-180*e;e*r<180;r+=90*e)c.point(r,90*e);for(;e*(r-=n)>=-180;)c.point(r,e*-fr(lr(r*Cr/2),t)*Gr);c.lineEnd(),c.polygonEnd()},a},i.scale(218.695).center([0,28.0974])},n.geoArmadilloRaw=l,n.geoAugust=function(){return r.geoProjection(g).scale(66.1603)},n.geoAugustRaw=g,n.geoBaker=function(){return r.geoProjection(v).scale(112.314)},n.geoBakerRaw=v,n.geoBerghaus=function(){var n=5,e=r.geoProjectionMutator(s),o=e(n),i=o.stream,u=-lr(.01*Cr),a=mr(.01*Cr);return o.lobes=function(r){return arguments.length?e(n=+r):n},o.stream=function(r){var e=o.rotate(),c=i(r),f=(o.rotate([0,0]),i(r));return o.rotate(e),c.sphere=function(){f.polygonStart(),f.lineStart();for(var r=0,e=360/n,o=2*jr/n,i=90-180/n,c=Mr;r<n;++r,i-=e,c-=o)f.point(fr(a*lr(c),u)*Gr,t(a*mr(c))*Gr),i<-90?(f.point(-90,-180-i-.01),f.point(-90,-180-i+.01)):(f.point(90,i+.01),f.point(90,i-.01));f.lineEnd(),f.polygonEnd()},c},o.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},n.geoBerghausRaw=s,n.geoBertin1953=f unction(){var n=r.geoProjection(d());return n.rotate([-16.5,-42]),delete n.rotate,n.scale(176.57).center([7.93,.09])},n.geoBertin1953Raw=d,n.geoBoggs=function(){return r.geoProjection(m).scale(160.857)},n.geoBoggsRaw=m,n.geoBonne=function(){return Hr(R).scale(123.082).center([0,26.1441]).parallel(45)},n.geoBonneRaw=R,n.geoBottomley=function(){var n=.5,e=r.geoProjectionMutator(b),t=e(n);return t.fraction=function(r){return arguments.length?e(n=+r):n},t.scale(158.837)},n.geoBottomleyRaw=b,n.geoBromley=function(){return r.geoProjection(Ir).scale(152.63)},n.geoBromleyRaw=Ir,n.geoChamberlin=k,n.geoChamberlinRaw=A,n.geoChamberlinAfrica=function(){return k([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])},n.geoCollignon=function(){return r.geoProjection(x).scale(95.6464).center([0,30])},n.geoCollignonRaw=x,n.geoCraig=function(){return Hr(G).scale(249.828).clipAngle(90)},n.geoCraigRaw=G,n.geoCraster=function(){return r.geoProjection(C).scale(156.19)},n.geoCrasterRaw=C,n.geoCylindrical EqualArea=function(){return Hr(z).parallel(38.58).scale(195.044)},n.geoCylindricalEqualAreaRaw=z,n.geoCylindricalStereographic=function(){return Hr(F).scale(124.75)},n.geoCylindricalStereographicRaw=F,n.geoEckert1=function(){return r.geoProjection(L).scale(165.664)},n.geoEckert1Raw=L,n.geoEckert2=function(){return r.geoProjection(q).scale(165.664)},n.geoEckert2Raw=q,n.geoEckert3=function(){return r.geoProjection(B).scale(180.739)},n.geoEckert3Raw=B,n.geoEckert4=function(){return r.geoProjection(H).scale(180.739)},n.geoEckert4Raw=H,n.geoEckert5=function(){return r.geoProjection(I).scale(173.044)},n.geoEckert5Raw=I,n.geoEckert6=function(){return r.geoProjection(W).scale(173.044)},n.geoEckert6Raw=W,n.geoEisenlohr=function(){return r.geoProjection(T).scale(62.5271)},n.geoEisenlohrRaw=T,n.geoFahey=function(){return r.geoProjection(D).scale(137.152)},n.geoFaheyRaw=D,n.geoFoucaut=function(){return r.geoProjection(N).scale(135.264)},n.geoFoucautRaw=N,n.geoGilbert=function(n){function e(n){r eturn i(Q(n))}function o(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(Gr).precision(0).clipAngle(null).translate([0,0]);return i.invert&&(e.invert=function(n){return V(i.invert(n))}),e.stream=function(n){var r=i.stream(n),e=u.stream({point:function(n,e){r.point(n/2,t(Pr(-e/2*Cr))*Gr)},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(Q(n)),e):V(i.center())},o("clipAngle"),o("clipExtent"),o("scale"),o("translate"),o("precision"),e.scale(249.5)},n.geoGingery=function(){var n=6,e=30*Cr,o=lr(e),i=mr(e),u=r.geoProjectionMutator(_),a=u(e,n),c=a.stream,f=-lr(.01*Cr),l=mr(.01*Cr);return a.radius=function(r){return arguments.length?(o=lr(e=r*Cr),i=mr( e),u(e,n)):e*Gr},a.lobes=function(r){return arguments.length?u(e,n=+r):n},a.stream=function(r){var e=a.rotate(),u=c(r),g=(a.rotate([0,0]),c(r));return a.rotate(e),u.sphere=function(){g.polygonStart(),g.lineStart();for(var r=0,e=2*jr/n,u=0;r<n;++r,u-=e)g.point(fr(l*lr(u),f)*Gr,t(l*mr(u))*Gr),g.point(fr(i*lr(u-e/2),o)*Gr,t(i*mr(u-e/2))*Gr);g.lineEnd(),g.polygonEnd()},u},a.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},n.geoGingeryRaw=_,n.geoGinzburg4=function(){return r.geoProjection(Qr).scale(149.995)},n.geoGinzburg4Raw=Qr,n.geoGinzburg5=function(){return r.geoProjection(Vr).scale(153.93)},n.geoGinzburg5Raw=Vr,n.geoGinzburg6=function(){return r.geoProjection(_r).scale(130.945)},n.geoGinzburg6Raw=_r,n.geoGinzburg8=function(){return r.geoProjection(U).scale(131.747)},n.geoGinzburg8Raw=U,n.geoGinzburg9=function(){return r.geoProjection(Kr).scale(131.087)},n.geoGinzburg9Raw=Kr,n.geoGringorten=function(){return r.geoProjection(Or(J)).scale(239.75)},n.geoGringortenRaw=J,n.geoGuyou=fun ction(){return r.geoProjection(Or(Z)).scale(151.496)},n.geoGuyouRaw=Z,n.geoHammer=function(){var n=2,e=r.geoProjectionMutator(p),t=e(n);return t.coefficient=function(r){return arguments.length?e(n=+r):n},t.scale(169.529)},n.geoHammerRaw=p,n.geoHammerRetroazimuthal=function(){var n=0,e=r.geoProjectionMutator($),t=e(n),o=t.rotate,i=t.stream,u=r.geoCircle();return t.parallel=function(r){if(!arguments.length)return n*Gr;var o=t.rotate();return e(n=r*Cr).rotate(o)},t.rotate=function(r){return arguments.length?(o.call(t,[r[0],r[1]-n*Gr]),u.center([-r[0],-r[1]]),t):(r=o.call(t),r[1]+=n*Gr,r)},t.stream=function(n){return n=i(n),n.sphere=function(){n.polygonStart();var r,e=u.radius(89.99)().coordinates[0],t=e.length-1,o=-1;for(n.lineStart();++o<t;)n.point((r=e[o])[0],r[1]);for(n.lineEnd(),t=(e=u.radius(90.01)().coordinates[0]).length-1,n.lineStart();--o>=0;)n.point((r=e[o])[0],r[1]);n.lineEnd(),n.polygonEnd()},n},t.scale(79.4187).parallel(45).clipAngle(179.999)},n.geoHammerRetroazimuthalRaw= $,n.geoHealpix=function(){var n=4,t=r.geoProjectionMutator(rn),o=t(n),i=o.stream;return o.lobes=function(r){return arguments.length?t(n=+r):n},o.stream=function(t){var u=o.rotate(),a=i(t),c=(o.rotate([0,0]),i(t));return o.rotate(u),a.sphere=function(){r.geoStream(function(n){return{type:"Polygon",coordinates:[e.range(-180,180+n/2,n).map(function(n,r){return[n,1&r?90-1e-6:Ur]}).concat(e.range(180,-180-n/2,-n).map(function(n,r){return[n,1&r?1e-6-90:-Ur]}))]}}(180/n),c)},a},o.scale(239.75)},n.geoHealpixRaw=rn,n.geoHill=function(){var n=1,e=r.geoProjectionMutator(en),t=e(n);return t.ratio=function(r){return arguments.length?e(n=+r):n},t.scale(167.774).center([0,18.67])},n.geoHillRaw=en,n.geoHomolosine=function(){return r.geoProjection(on).scale(152.63)},n.geoHomolosineRaw=on,n.geoInterrupt=Zr,n.geoInterruptedBoggs=function(){return Zr(m,$r).scale(160.857)},n.geoInterruptedHomolosine=function(){return Zr(on,ne).scale(152.63)},n.geoInterruptedMollweide=function(){return Zr(Lr,re).scale(16 9.529)},n.geoInterruptedMollweideHemispheres=function(){return Zr(Lr,ee).scale(169.529).rotate([20,0])},n.geoInterruptedSinuMollweide=function(){return Zr(tn,te).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},n.geoInterruptedSinusoidal=function(){return Zr(P,oe).scale(152.63).rotate([-20,0])},n.geoKavrayskiy7=function(){return r.geoProjection(cn).scale(158.837)},n.geoKavrayskiy7Raw=cn,n.geoLagrange=function(){var n=.5,e=r.geoProjectionMutator(fn),t=e(n);return t.spacing=function(r){return arguments.length?e(n=+r):n},t.scale(124.75)},n.geoLagrangeRaw=fn,n.geoLarrivee=function(){return r.geoProjection(ln).scale(97.2672)},n.geoLarriveeRaw=ln,n.geoLaskowski=function(){return r.geoProjection(gn).scale(139.98)},n.geoLaskowskiRaw=gn,n.geoLittrow=function(){return r.geoProjection(vn).scale(144.049).clipAngle(89.999)},n.geoLittrowRaw=vn,n.geoLoximuthal=function(){return Hr(sn).parallel(40).scale(158.837)},n.geoLoximuthalRaw=sn,n.geoMiller=function(){return r.geoProjection(pn).scale(10 8.318)},n.geoMillerRaw=pn,n.geoModifiedStereographic=dn,n.geoModifiedStereographicRaw=hn,n.geoModifiedStereographicAlaska=function(){return dn(ue,[152,-64]).scale(1500).center([-160.908,62.4864]).clipAngle(25)},n.geoModifiedStereographicGs48=function(){return dn(ae,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},n.geoModifiedStereographicGs50=function(){return dn(ce,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},n.geoModifiedStereographicMiller=function(){return dn(fe,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},n.geoModifiedStereographicLee=function(){return dn(le,[165,10]).scale(250).clipAngle(130).center([-165,-10])},n.geoMollweide=function(){return r.geoProjection(Lr).scale(169.529)},n.geoMollweideRaw=Lr,n.geoMtFlatPolarParabolic=function(){return r.geoProjection(wn).scale(164.859)},n.geoMtFlatPolarParabolicRaw=wn,n.geoMtFlatPolarQuartic=function(){return r.geoProjection(yn).scale(188.209)},n.geoMtFlatPolarQuarticRaw=yn,n.geoM tFlatPolarSinusoidal=function(){return r.geoProjection(mn).scale(166.518)},n.geoMtFlatPolarSinusoidalRaw=mn,n.geoNaturalEarth=r.geoNaturalEarth1,n.geoNaturalEarthRaw=r.geoNaturalEarth1Raw,n.geoNaturalEarth2=function(){return r.geoProjection(Pn).scale(175.295)},n.geoNaturalEarth2Raw=Pn,n.geoNellHammer=function(){return r.geoProjection(Rn).scale(152.63)},n.geoNellHammerRaw=Rn,n.geoPatterson=function(){return r.geoProjection(bn).scale(139.319)},n.geoPattersonRaw=bn,n.geoPolyconic=function(){return r.geoProjection(jn).scale(103.74)},n.geoPolyconicRaw=jn,n.geoPolyhedral=je,n.geoPolyhedralButterfly=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=Ee.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])}),je(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])},n.geoPolyhedralCollignon=function(n){n=n||function(n){var e=r.geoCentroid({type:"MultiPoint",coordinates:n});return r.geoProjection(Gn).translate([0,0]).scale(1).rotate(e[1]>0?[-e[0],0]:[180-e[0],180])};var e=Ee.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])}),je(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])},n.geoPolyhedralWaterman=function(n){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 e=Ee.map(function(n){for(var r,e=n.map(Fn),t=e.length,o=e[t-1],i=[],u=0;u<t;++u)r=e[u],i.push(zn([.9486832980505138*o[0]+.31622776601683794*r[0],.9486832980505138*o[1]+.31622776601683794*r[1],.9486832980505138*o[2]+.31622776601683794*r[2]]),zn([.9486832980505138*r[0]+.316227766 01683794*o[0],.9486832980505138*r[1]+.31622776601683794*o[1],.9486832980505138*r[2]+.31622776601683794*o[2]])),o=r;return i}),t=[],o=[-1,0,0,1,0,1,4,5];e.forEach(function(n,r){for(var i=Ee[r],u=i.length,a=t[r]=[],c=0;c<u;++c)e.push([i[c],n[(2*c+2)%(2*u)],n[(2*c+1)%(2*u)]]),o.push(r),a.push(function(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]]}(Fn(n[(2*c+2)%(2*u)]),Fn(n[(2*c+1)%(2*u)])))});var i=e.map(function(r){return{project:n(r),face:r}});return o.forEach(function(n,r){var e=i[n];e&&(e.children||(e.children=[])).push(i[r])}),je(i[0],function(n,r){var e=lr(r),o=[e*lr(n),e*mr(n),mr(r)],u=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=t[u];return i[Cn(a[0],o)<0?8+3*u:Cn(a[1],o)<0?8+3*u+1:Cn(a[2],o)<0?8+3*u+2:u]}).scale(110.625).center([0,45])},n.geoProject=function(n,r){var e,t=r.stream;if(!t)throw new Error("invalid projection");switch(n&&n.type){case"Feature":e=qn;break;case"FeatureCollection":e=Ln;break;default:e=Bn}return e(n,t)},n.geoGringorten Quincuncial=function(){return Fe(J).scale(176.423)},n.geoPeirceQuincuncial=Le,n.geoPierceQuincuncial=Le,n.geoQuantize=function(n,r){function e(n){var e=n.length,t=2,o=new Array(e);for(o[0]=+n[0].toFixed(r),o[1]=+n[1].toFixed(r);t<e;)o[t]=n[t],++t;return o}function t(n){return n.map(e)}function o(n){return n.map(t)}function i(n){if(null==n)return n;var r;switch(n.type){case"GeometryCollection":r={type:"GeometryCollection",geometries:n.geometries.map(i)};break;case"Point":r={type:"Point",coordinates:e(n.coordinates)};break;case"MultiPoint":case"LineString":r={type:n.type,coordinates:t(n.coordinates)};break;case"MultiLineString":case"Polygon":r={type:n.type,coordinates:o(n.coordinates)};break;case"MultiPolygon":r={type:"MultiPolygon",coordinates:n.coordinates.map(o)};break;default:return n}return null!=n.bbox&&(r.bbox=n.bbox),r}function u(n){var r={type:"Feature",properties:n.properties,geometry:i(n.geometry)};return null!=n.id&&(r.id=n.id),null!=n.bbox&&(r.bbox=n.bbox),r}if(!(0<=(r=+r )&&r<=20))throw new Error("invalid digits");if(null!=n)switch(n.type){case"Feature":return u(n);case"FeatureCollection":var a={type:"FeatureCollection",features:n.features.map(u)};return null!=n.bbox&&(a.bbox=n.bbox),a;default:return i(n)}return n},n.geoQuincuncial=Fe,n.geoRectangularPolyconic=function(){return Hr(Hn).scale(131.215)},n.geoRectangularPolyconicRaw=Hn,n.geoRobinson=function(){return r.geoProjection(In).scale(152.63)},n.geoRobinsonRaw=In,n.geoSatellite=function(){var n=2,e=0,t=r.geoProjectionMutator(Wn),i=t(n,e);return i.distance=function(r){return arguments.length?t(n=+r,e):n},i.tilt=function(r){return arguments.length?t(n,e=r*Cr):e*Gr},i.scale(432.147).clipAngle(o(1/n)*Gr-1e-6)},n.geoSatelliteRaw=Wn,n.geoSinuMollweide=function(){return r.geoProjection(tn).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},n.geoSinuMollweideRaw=tn,n.geoSinusoidal=function(){return r.geoProjection(P).scale(152.63)},n.geoSinusoidalRaw=P,n.geoStitch=function(n){if(null==n)return n;swit ch(n.type){case"Feature":return Kn(n);case"FeatureCollection":var r={type:"FeatureCollection",features:n.features.map(Kn)};return null!=n.bbox&&(r.bbox=n.bbox),r;default:return On(n)}},n.geoTimes=function(){return r.geoProjection(Un).scale(146.153)},n.geoTimesRaw=Un,n.geoTwoPointAzimuthal=Xn,n.geoTwoPointAzimuthalRaw=Jn,n.geoTwoPointAzimuthalUsa=function(){return Xn([-158,21.5],[-77,39]).clipAngle(60).scale(400)},n.geoTwoPointEquidistant=Zn,n.geoTwoPointEquidistantRaw=Yn,n.geoTwoPointEquidistantUsa=function(){return Zn([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},n.geoVanDerGrinten=function(){return r.geoProjection($n).scale(79.4183)},n.geoVanDerGrintenRaw=$n,n.geoVanDerGrinten2=function(){return r.geoProjection(nr).scale(79.4183)},n.geoVanDerGrinten2Raw=nr,n.geoVanDerGrinten3=function(){return r.geoProjection(rr).scale(79.4183)},n.geoVanDerGrinten3Raw=rr,n.geoVanDerGrinten4=function(){return r.geoProjection(er).scale(127.16)},n.geoVanDerGrinten4Raw=er,n.geoWagner4=function( ){return r.geoProjection(Ue).scale(176.84)},n.geoWagner4Raw=Ue,n.geoWagner6=function(){return r.geoProjection(tr).scale(152.63)},n.geoWagner6Raw=tr,n.geoWagner7=function(){return r.geoProjection(or).scale(172.632)},n.geoWagner7Raw=or,n.geoWiechel=function(){return r.geoProjection(ir).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},n.geoWiechelRaw=ir,n.geoWinkel3=function(){return r.geoProjection(ur).scale(158.837)},n.geoWinkel3Raw=ur,Object.defineProperty(n,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/js/libs/d3js/d3-geo-projection.v2.min.js.1 b/js/libs/d3js/d3-geo-projection.v2.min.js.1 new file mode 100644 index 0000000..1d93da8 --- /dev/null +++ b/js/libs/d3js/d3-geo-projection.v2.min.js.1 @@ -0,0 +1,2 @@ +// https://d3js.org/d3-geo-projection/ Version 2.3.2. Copyright 2017 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>1?Mr:n<-1?-Mr:Math.asin(n)}function o(n){return n>1?0:n<-1?jr:Math.acos(n)}function i(n){return n>0?Math.sqrt(n):0}function u(n){return(gr(n)-gr(-n))/2}function a(n){return(gr(n)+gr(-n))/2}function c(n){function r(n,r){var e=lr(n),t=lr(r),i=mr(r),u=t*e,a=-((1-u?sr((1+u)/2)/(1-u):-.5)+o/(1+u));return[a*t*mr(n),a*i]}var e=Pr(n/2),o=2*sr(lr(n/2))/(e*e);return r.invert=function(r,e){var u,a=i(r*r+e*e),c=-n/2,f=50;if(!a)return[0,0];do{var l=c/2,g=lr(l),v=mr(l),s=Pr(l),p=sr(1/g);c-=u=(2/s*p-o*s-a)/(-p/(v*v)+1-o/(2*g*g))}while(ar(u)>Rr&&--f>0);var h=mr(c);return[fr(r*h,a*lr(c)),t(e*h/a)]},r}function f(n,r){var e=lr(r),t=function(n){return n?n/Math.sin(n):1}(o(e*lr(n/=2)));return[2*e*mr(n)*t,mr(r)*t]}function l(n) {function r(n,r){var a=lr(r),c=lr(n/=2);return[(1+a)*mr(n),(o*r>-fr(c,i)-.001?0:10*-o)+u+mr(r)*t-(1+a)*e*c]}var e=mr(n),t=lr(n),o=n>=0?1:-1,i=Pr(o*n),u=(1+e-t)/2;return r.invert=function(n,r){var a=0,c=0,f=50;do{var l=lr(a),g=mr(a),v=lr(c),s=mr(c),p=1+v,h=p*g-n,d=u+s*t-p*e*l-r,w=p*l/2,y=-g*s,m=e*p*g/2,P=t*v+e*l*s,R=y*m-P*w,b=(d*y-h*P)/R/2,j=(h*m-d*w)/R;a-=b,c-=j}while((ar(b)>Rr||ar(j)>Rr)&&--f>0);return o*c>-fr(lr(a),i)-.001?[2*a,c]:null},r}function g(n,r){var e=Pr(r/2),t=i(1-e*e),o=1+t*lr(n/=2),u=mr(n)*t/o,a=e/o,c=u*u,f=a*a;return[4/3*u*(3+c-3*f),4/3*a*(3+3*c-f)]}function v(n,r){var e=ar(r);return e<Er?[n,sr(Pr(Er+r/2))]:[n*lr(e)*(2*Sr-1/mr(e)),yr(r)*(2*Sr*(e-Er)-sr(Pr(e/2)))]}function s(n){function e(n,e){var o=r.geoAzimuthalEquidistantRaw(n,e);if(ar(n)>Mr){var a=fr(o[1],o[0]),c=i(o[0]*o[0]+o[1]*o[1]),f=u*wr((a-Mr)/u)+Mr,l=fr(mr(a-=f),2-lr(a));a=f+t(jr/c*mr(l))-l,o[0]=c*lr(a),o[1]=c*mr(a)}return o}var u=2*jr/n;return e.invert=function(n,e){var t=i(n*n+e*e);if(t>Mr){var a=fr(e,n),c =u*wr((a-Mr)/u)+Mr,f=a>c?-1:1,l=t*lr(c-a),g=1/Pr(f*o((l-jr)/i(jr*(jr-2*l)+t*t)));a=c+2*cr((g+f*i(g*g-3))/3),n=t*lr(a),e=t*mr(a)}return r.geoAzimuthalEquidistantRaw.invert(n,e)},e}function p(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?h:(t.invert=function(t,o){var i=r.geoAzimuthalEqualAreaRaw.invert(t/n,o);return i[0]*=e,i},t)}function h(n,r){return[n*lr(r)/lr(r/=2),2*mr(r)]}function d(){var n=p(1.68,2);return function(r,e){if(r+e<-1.4){var t=(r-e+1.6)*(r+e+1.4)/8;r+=t,e-=.8*t*mr(e+jr/2)}var o=n(r,e),i=(1-lr(r*e))/12;return o[1]<0&&(o[0]*=1+i),o[1]>0&&(o[1]*=1+i/1.5*o[0]*o[0]),o}}function w(n,r){var e,t=n*mr(r),o=30;do{r-=e=(r+mr(r)-t)/(1+lr(r))}while(ar(e)>Rr&&--o>0);return r/2}function y(n,r,e){function o(t,o){return[n*t*lr(o=w(e,o)),r*mr(o)]}return o.invert=function(o,i){return i=t(i/r),[o/(n*lr(i)),t((2*i+mr(2*i))/e)]},o}function m(n,r){var e=w(jr,r);return[qr*n/(1/lr(r)+Br /lr(e)),(r+Sr*mr(e))/qr]}function P(n,r){return[n*lr(r),r]}function R(n){function r(r,t){var o=e+n-t,i=o?r*lr(t)/o:o;return[o*mr(i),e-o*lr(i)]}if(!n)return P;var e=1/Pr(n);return r.invert=function(r,t){var o=i(r*r+(t=e-t)*t),u=e+n-o;return[o/lr(u)*fr(r,t),u]},r}function b(n){function r(r,e){var t=Mr-e,o=t?r*n*mr(t)/t:t;return[t*mr(o)/n,Mr-t*lr(o)]}return r.invert=function(r,e){var t=r*n,o=Mr-e,u=i(t*t+o*o),a=fr(t,o);return[(u?u/mr(u):1)*a/n,Mr-u]},r}function j(n,r,e,u,a,c){var f,l=lr(c);if(ar(n)>1||ar(c)>1)f=o(e*a+r*u*l);else{var g=mr(n/2),v=mr(c/2);f=2*t(i(g*g+r*u*v*v))}return ar(f)>Rr?[f,fr(u*mr(c),r*a-e*u*l)]:[0,0]}function M(n,r,e){return o((n*n+r*r-e*e)/(2*n*r))}function E(n){return n-2*jr*vr((n+jr)/(2*jr))}function A(n,r,e){for(var t,o=[[n[0],n[1],mr(n[1]),lr(n[1])],[r[0],r[1],mr(r[1]),lr(r[1])],[e[0],e[1],mr(e[1]),lr(e[1])]],i=o[2],u=0;u<3;++u,i=t)t=o[u],i.v=j(t[1]-i[1],i[3],i[2],t[3],t[2],t[0]-i[0]),i.point=[0,0];var a=M(o[0].v[0],o[2].v[0],o[1].v[0]),c=M(o[0].v[0],o[1].v[0] ,o[2].v[0]),f=jr-a;o[2].point[1]=0,o[0].point[0]=-(o[1].point[0]=o[0].v[0]/2);var l=[o[2].point[0]=o[0].point[0]+o[2].v[0]*lr(a),2*(o[0].point[1]=o[1].point[1]=o[2].v[0]*mr(a))];return function(n,r){var e,t=mr(r),i=lr(r),u=new Array(3);for(e=0;e<3;++e){var a=o[e];if(u[e]=j(r-a[1],a[3],a[2],i,t,n-a[0]),!u[e][0])return a.point;u[e][1]=E(u[e][1]-a.v[1])}var g=l.slice();for(e=0;e<3;++e){var v=2==e?0:e+1,s=M(o[e].v[0],u[e][0],u[v][0]);u[e][1]<0&&(s=-s),e?1==e?(s=c-s,g[0]-=u[e][0]*lr(s),g[1]-=u[e][0]*mr(s)):(s=f-s,g[0]+=u[e][0]*lr(s),g[1]+=u[e][0]*mr(s)):(g[0]+=u[e][0]*lr(s),g[1]-=u[e][0]*mr(s))}return g[0]/=3,g[1]/=3,g}}function S(n){return n[0]*=Cr,n[1]*=Cr,n}function k(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(A(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 x(n,r){var e=i(1-mr(r));return[2/kr* n*e,kr*(1-e)]}function G(n){function r(n,r){return[n,(n?n/mr(n):1)*(mr(r)*lr(n)-e*lr(r))]}var e=Pr(n);return r.invert=e?function(n,r){n&&(r*=mr(n)/n);var t=lr(n);return[n,2*fr(i(t*t+e*e-r*r)-t,e-r)]}:function(n,r){return[n,t(n?r*Pr(n)/n:r)]},r}function C(n,r){return[Wr*n*(2*lr(2*r/3)-1)/kr,Wr*kr*mr(r/3)]}function z(n){function r(n,r){return[n*e,mr(r)/e]}var e=lr(n);return r.invert=function(n,r){return[n/e,t(r*e)]},r}function F(n){function r(n,r){return[n*e,(1+e)*Pr(r/2)]}var e=lr(n);return r.invert=function(n,r){return[n/e,2*cr(r/(1+e))]},r}function L(n,r){var e=i(8/(3*jr));return[e*n*(1-ar(r)/jr),e*r]}function q(n,r){var e=i(4-3*mr(ar(r)));return[2/i(6*jr)*n*e,yr(r)*i(2*jr/3)*(2-e)]}function B(n,r){var e=i(jr*(4+jr));return[2/e*n*(1+i(1-4*r*r/(jr*jr))),4/e*r]}function H(n,r){var e=(2+Mr)*mr(r);r/=2;for(var t=0,o=1/0;t<10&&ar(o)>Rr;t++){var u=lr(r);r-=o=(r+mr(r)*(u+2)-e)/(2*u*(1+u))}return[2/i(jr*(4+jr))*n*(1+lr(r)),2*i(jr/(4+jr))*mr(r)]}function I(n,r){return[n*(1+lr(r))/i(2+jr),2* r/i(2+jr)]}function W(n,r){for(var e=(1+Mr)*mr(r),t=0,o=1/0;t<10&&ar(o)>Rr;t++)r-=o=(r+mr(r)-e)/(1+lr(r));return e=i(2+jr),[n*(1+lr(r))/e,2*r/e]}function T(n,r){var e=mr(n/=2),t=lr(n),o=i(lr(r)),u=lr(r/=2),a=mr(r)/(u+Sr*t*o),c=i(2/(1+a*a)),f=i((Sr*u+(t+e)*o)/(Sr*u+(t-e)*o));return[Tr*(c*(f-1/f)-2*sr(f)),Tr*(c*a*(f+1/f)-2*cr(a))]}function D(n,r){var e=Pr(r/2);return[n*Dr*i(1-e*e),(1+Dr)*e]}function N(n,r){var e=r/2,t=lr(e);return[2*n/kr*lr(r)*t*t,kr*Pr(e)]}function Q(n){return[n[0]/2,t(Pr(n[1]/2*Cr))*Gr]}function V(n){return[2*n[0],2*cr(mr(n[1]*Cr))*Gr]}function _(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>u){var g=i(l),v=fr(f,c),s=o*wr(v/o),p=v-s,h=n*lr(p),d=(n*mr(p)-p*mr(h))/(Mr-h),w=K(p,d),y=(jr-n)/O(w,h,jr);c=g;var m,P=50;do{c-=m=(n+O(w,h,c)*y-g)/(w(c)*y)}while(ar(m)>Rr&&--P>0);f=p*mr(c),c<Mr&&(f-=d*(c-Mr));var R=mr(s),b=lr(s);a[0]=c*b-f*R,a[1]=c*R+f*b}return a}var o=2*jr/e,u=n*n;return t.invert=function(e,t){var a=e*e+t*t;if(a>u){va r c=i(a),f=fr(t,e),l=o*wr(f/o),g=f-l;e=c*lr(g),t=c*mr(g);for(var v=e-Mr,s=mr(e),p=t/s,h=e<Mr?1/0:0,d=10;;){var w=n*mr(p),y=n*lr(p),m=mr(y),P=Mr-y,R=(w-p*m)/P,b=K(p,R);if(ar(h)<br||!--d)break;p-=h=(p*s-R*v-t)/(s-2*v*(P*(y+p*w*lr(y)-m)-w*(w-p*m))/(P*P))}e=(c=n+O(b,y,e)*(jr-n)/O(b,y,jr))*lr(f=l+p),t=c*mr(f)}return r.geoAzimuthalEquidistantRaw.invert(e,t)},t}function K(n,r){return function(e){var t=n*lr(e);return e<Mr&&(t-=r),i(1+t*t)}}function O(n,r,e){for(var t=(e-r)/50,o=n(r)+n(e),i=1,u=r;i<50;++i)o+=2*n(u+=t);return.5*o*t}function U(n,r){var e=n*n,t=r*r;return[n*(1-.162388*t)*(.87-952426e-9*e*e),r*(1+t/12)]}function J(n,r){var e=yr(n),o=yr(r),u=lr(r),a=lr(n)*u,c=mr(n)*u,f=mr(o*r);n=ar(fr(c,f)),r=t(a),ar(n-Mr)>Rr&&(n%=Mr);var l=function(n,r){if(r===Mr)return[0,0];var e,o,u=mr(r),a=u*u,c=a*a,f=1+c,l=1+3*c,g=1-c,v=t(1/i(f)),s=g+a*f*v,p=(1-u)/s,h=i(p),d=p*f,w=i(d),y=h*g;if(0===n)return[0,-(y+a*w)];var m,P=lr(r),R=1/P,b=2*u*P,j=(-s*P-(-3*a+v*l)*b*(1-u))/(s*s),M=-R*b,E=-R*(a*f*j+p*l*b),A= -2*R*(g*(.5*j/h)-2*a*h*b),S=4*n/jr;if(n>.222*jr||r<jr/4&&n>.175*jr){if(e=(y+a*i(d*(1+c)-y*y))/(1+c),n>jr/4)return[e,e];var k=e,x=.5*e;e=.5*(x+k),o=50;do{var G=i(d-e*e),C=e*(A+M*G)+E*t(e/w)-S;if(!C)break;C<0?x=e:k=e,e=.5*(x+k)}while(ar(k-x)>Rr&&--o>0)}else{e=Rr,o=25;do{var z=e*e,F=i(d-z),L=A+M*F,q=e*L+E*t(e/w)-S,B=L+(E-M*z)/F;e-=m=F?q/B:0}while(ar(m)>Rr&&--o>0)}return[e,-y-a*i(d-e*e)]}(n>jr/4?Mr-n:n,r);return n>jr/4&&(f=l[0],l[0]=-l[1],l[1]=-f),l[0]*=e,l[1]*=-o,l}function X(n,r){var e,o,c,f,l;if(r<Rr)return f=mr(n),o=lr(n),e=r*(n-f*o)/4,[f-e*o,o+e*f,1-r*f*f/2,n-e];if(r>=1-Rr)return e=(1-r)/4,o=a(n),f=function(n){return((n=gr(2*n))-1)/(n+1)}(n),c=1/o,l=o*u(n),[f+e*(l-n)/(o*o),c-e*f*c*(l-n),c+e*f*c*(l+n),2*cr(gr(n))-Mr+e*(l-n)/o];var g=[1,0,0,0,0,0,0,0,0],v=[i(r),0,0,0,0,0,0,0,0],s=0;for(o=i(1-r),l=1;ar(v[s]/g[s])>Rr&&s<8;)e=g[s++],v[s]=(e-o)/2,g[s]=(e+o)/2,o=i(e*o),l*=2;c=l*g[s]*n;do{c=(t(f=v[s]*mr(o=c)/g[s])+c)/2}while(--s);return[mr(c),f=lr(c),f/lr(c-o),c]}function Y(n,r){if(!r)retu rn n;if(1===r)return sr(Pr(n/2+Er));for(var e=1,t=i(1-r),o=i(r),u=0;ar(o)>Rr;u++){if(n%jr){var a=cr(t*Pr(n)/e);a<0&&(a+=jr),n+=a+~~(n/jr)*jr}else n+=n;o=(e+t)/2,t=i(e*t),o=((e=o)-t)/2}return n/(dr(2,u)*e)}function Z(n,r){var e=(Sr-1)/(Sr+1),t=i(1-e*e),o=Y(Mr,t*t),a=sr(Pr(jr/4+ar(r)/2)),c=gr(-1*a)/i(e),f=function(n,r){var e=n*n,t=r+1,o=1-e-r*r;return[.5*((n>=0?Mr:-Mr)-fr(o,2*n)),-.25*sr(o*o+4*e)+.5*sr(t*t+e)]}(c*lr(-1*n),c*mr(-1*n)),l=function(n,r,e){var t=ar(n),o=u(ar(r));if(t){var a=1/mr(t),c=1/(Pr(t)*Pr(t)),f=-(c+e*(o*o*a*a)-1+e),l=(-f+i(f*f-(e-1)*c*4))/2;return[Y(cr(1/i(l)),e)*yr(n),Y(cr(i((l/c-1)/e)),1-e)*yr(r)]}return[0,Y(cr(o),1-e)*yr(r)]}(f[0],f[1],t*t);return[-l[1],(r>=0?1:-1)*(.5*o-l[0])]}function $(n){function r(n,r){var i=u(n,r);n=i[0],r=i[1];var a=mr(r),c=lr(r),f=lr(n),l=o(e*a+t*c*f),g=mr(l),v=ar(g)>Rr?l/g:1;return[v*t*mr(n),(ar(n)>Mr?v:-v)*(e*c-t*a*f)]}var e=mr(n),t=lr(n),u=nn(n);return u.invert=nn(-n),r.invert=function(n,r){var t=i(n*n+r*r),o=-mr(t),a=lr(t),c=t*a,f=-r* o,l=t*e,g=i(c*c+f*f-l*l),v=fr(c*l+f*g,f*l-c*g),s=(t>Mr?-1:1)*fr(n*o,t*lr(v)*a+r*mr(v)*o);return u.invert(s,v)},r}function nn(n){var r=mr(n),e=lr(n);return function(n,o){var i=lr(o),u=lr(n)*i,a=mr(n)*i,c=mr(o);return[fr(a,u*e-c*r),t(c*e+u*r)]}}function rn(n){function r(r,l){var g,v=ar(l);if(v>e){var s=hr(n-1,pr(0,vr((r+jr)/a)));(g=x(r+=jr*(n-1)/n-s*a,v))[0]=g[0]*xr/t-xr*(n-1)/(2*n)+s*xr/n,g[1]=o+4*(g[1]-i)*u/xr,l<0&&(g[1]=-g[1])}else g=Jr(r,l);return g[0]*=c,g[1]/=f,g}var e=Ur*Cr,t=x(jr,e)[0]-x(-jr,e)[0],o=Jr(0,e)[1],i=x(0,e)[1],u=kr-i,a=xr/n,c=4/xr,f=o+u*u*4/xr;return r.invert=function(r,e){r/=c;var l=ar(e*=f);if(l>o){var g=hr(n-1,pr(0,vr((r+jr)/a))),v=x.invert(r=(r+jr*(n-1)/n-g*a)*t/xr,.25*(l-o)*xr/u+i);return v[0]-=jr*(n-1)/n-g*a,e<0&&(v[1]=-v[1]),v}return Jr.invert(r,e)},r}function en(n){function r(r,t){var o,v,s=1-mr(t);if(s&&s<2){var p,h=Mr-t,d=25;do{var w=mr(h),y=lr(h),m=a+fr(w,u-y),P=1+g-2*u*y;h-=p=(h-l*a-u*w+P*m-.5*s*e)/(2*u*w*m)}while(ar(p)>br&&--d>0);o=c*i(P),v=r*m/jr}else o=c*(n+s),v=r*a/jr;return[o*mr(v),f-o*lr(v)]}var e,u=1+n,a=t(mr(1/u)),c=2*i(jr/(e=jr+4*a*u)),f=.5*c*(u+i(n*(2+n))),l=n*n,g=u*u;return r.invert=function(n,r){var v=n*n+(r-=f)*r,s=(1+g-v/(c*c))/(2*u),p=o(s),h=mr(p),d=a+fr(h,u-s);return[t(n/i(v))*jr/d,t(1-2*(p-l*a-u*h+(1+g-2*u*s)*d)/e)]},r}function tn(n,r){return r>-Xr?(n=Lr(n,r),n[1]+=Yr,n):P(n,r)}function on(n,r){return ar(r)>Xr?(n=Lr(n,r),n[1]-=r>0?Yr:-Yr,n):P(n,r)}function un(n,r){return ar(n[0]-r[0])<Rr&&ar(n[1]-r[1])<Rr}function an(n,r){for(var e,t,o,i=-1,u=n.length,a=n[0],c=[];++i<u;){t=((e=n[i])[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 cn(n,r){return[3/xr*n*i(jr*jr/3-r*r),r]}function fn(n){function r(r,e){if(ar(ar(e)-Mr)<Rr)return[0,e<0?-2:2];var t=mr(e),o=dr((1+t)/(1-t),n/2),i=.5*(o+1/o)+lr(r*=n);return[2*mr(r)/i,(o-1/o)/i]}return r.invert=function(r,e){var o=ar(e);if(ar(o-2)<Rr)return r?null:[0,yr(e)*Mr];if(o>2)return null;var i=(r/=2)*r,u=(e/=2)*e,a=2*e/(1+i+ u);return a=dr((1+a)/(1-a),1/n),[fr(2*r,1-i-u)/n,t((a-1)/(a+1))]},r}function ln(n,r){return[n*(1+i(lr(r)))/2,r/(lr(r/2)*lr(n/6))]}function gn(n,r){var e=n*n,t=r*r;return[n*(.975534+t*(-.0143059*e-.119161+-.0547009*t)),r*(1.00384+e*(.0802894+-.02855*t+199025e-9*e)+t*(.0998909+-.0491032*t))]}function vn(n,r){return[mr(n)/lr(r),Pr(r)*lr(n)]}function sn(n){function r(r,o){var i=o-n,u=ar(i)<Rr?r*e:ar(u=Er+o/2)<Rr||ar(ar(u)-Mr)<Rr?0:r*i/sr(Pr(u)/t);return[u,i]}var e=lr(n),t=Pr(Er+n/2);return r.invert=function(r,o){var i,u=o+n;return[ar(o)<Rr?r/e:ar(i=Er+u/2)<Rr||ar(ar(i)-Mr)<Rr?0:r*sr(Pr(i)/t)/o,u]},r}function pn(n,r){return[n,1.25*sr(Pr(Er+.4*r))]}function hn(n){function r(r,t){for(var o,i=lr(t),u=2/(1+i*lr(r)),a=u*i*mr(r),c=u*mr(t),f=e,l=n[f],g=l[0],v=l[1];--f>=0;)g=(l=n[f])[0]+a*(o=g)-c*v,v=l[1]+a*v+c*o;return g=a*(o=g)-c*v,v=a*v+c*o,[g,v]}var e=n.length-1;return r.invert=function(r,o){var u=20,a=r,c=o;do{for(var f,l=e,g=n[l],v=g[0],s=g[1],p=0,h=0;--l>=0;)p=v+a*(f=p)-c*h,h=s+a*h+c*f,v= (g=n[l])[0]+a*(f=v)-c*s,s=g[1]+a*s+c*f;var d,w,y=(p=v+a*(f=p)-c*h)*p+(h=s+a*h+c*f)*h;a-=d=((v=a*(f=v)-c*s-r)*p+(s=a*s+c*f-o)*h)/y,c-=w=(s*p-v*h)/y}while(ar(d)+ar(w)>Rr*Rr&&--u>0);if(u){var m=i(a*a+c*c),P=2*cr(.5*m),R=mr(P);return[fr(a*R,m*lr(P)),m?t(c*R/m):0]}},r}function dn(n,e){var t=r.geoProjection(hn(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 wn(n,r){var e=t(7*mr(r)/(3*ge));return[ge*n*(2*lr(2*e/3)-1)/ve,9*mr(e/3)/ve]}function yn(n,r){for(var e,t=(1+Ar)*mr(r),o=r,u=0;u<25&&(o-=e=(mr(o/2)+mr(o)-t)/(.5*lr(o/2)+lr(o)),!(ar(e)<Rr));u++);return[n*(1+2*lr(o)/lr(o/2))/(3*Sr),2*i(3)*mr(o/2)/i(2+Sr)]}function mn(n,r){for(var e,t=i(6/(4+jr)),o=(1+jr/4)*mr(r),u=r/2,a=0;a<25&&(u-=e=(u/2+mr(u)-o)/(.5+lr(u)),!(ar(e)<Rr));a++);return[t*(.5+lr(u))*n/1.5,t*u]}function Pn(n,r){var e=r*r,t=e*e,o=e*t;return[n*(.84719-.13063*e+o*o*(.05494*e-.04515-.02326*t+.00331*o)),r*(1.01183+t*t*(. 01926*e-.02625-.00396*t))]}function Rn(n,r){return[n*(1+lr(r))/2,2*(r-Pr(r/2))]}function bn(n,r){var e=r*r;return[n,r*(se+e*e*(pe+e*(he+de*e)))]}function jn(n,r){if(ar(r)<Rr)return[n,0];var e=Pr(r),t=n*mr(r);return[mr(t)/e,r+(1-lr(t))/e]}function Mn(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 En(n,r){return[n[0]-r[0],n[1]-r[1]]}function An(n){return i(n[0]*n[0]+n[1]*n[1])}function Sn(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!==ar(n[1])}),l=r.geoBounds({type:"MultiPoint",coordinates:f}),g=!1,v=-1,s=l[1][0]-l[0][0],p=180===s||360===s?[(l[0][0]+l[1][0])/2,(l[0][1]+l[1][1])/2]:r.geoCentroid(c);if(t)for(;++v<a&&u[v]!==t;);++v;for(var h=0;h<a;++h)i=u[(h+v)%a],Array.isArray(i)?(g||(n.point((o=r.geoInterpolate(i[0],p)(Rr))[0],o[1]),g=!0),n.point((o=r.geoInterpolate(i[1],p)(Rr))[0],o[1])):(g=!1,i!==t&&Sn(n,i,e))}f unction kn(n,r){return n&&r&&n[0]===r[0]&&n[1]===r[1]}function xn(n){return n.project.invert||n.children&&n.children.some(xn)}function Gn(n,r){var e=x(n,r);return[e[0]*Ae,e[1]]}function Cn(n,r){for(var e=0,t=n.length,o=0;e<t;++e)o+=n[e]*r[e];return o}function zn(n){return[fr(n[1],n[0])*Gr,t(pr(-1,hr(1,n[2])))*Gr]}function Fn(n){var r=n[0]*Cr,e=n[1]*Cr,t=lr(e);return[t*lr(r),t*mr(r),mr(e)]}function Ln(n,r){return{type:"FeatureCollection",features:n.features.map(function(n){return qn(n,r)})}}function qn(n,r){return{type:"Feature",id:n.id,properties:n.properties,geometry:Bn(n.geometry,r)}}function Bn(n,e){if(!n)return null;if("GeometryCollection"===n.type)return function(n,r){return{type:"GeometryCollection",geometries:n.geometries.map(function(n){return Bn(n,r)})}}(n,e);var t;switch(n.type){case"Point":case"MultiPoint":t=Ge;break;case"LineString":case"MultiLineString":t=Ce;break;case"Polygon":case"MultiPolygon":case"Sphere":t=ze;break;default:return null}return r.geoStream(n,e(t)),t.r esult()}function Hn(n){function r(r,t){var o=e?Pr(r*e/2)/e:r/2;if(!t)return[2*o,-n];var i=2*cr(o*mr(t)),u=1/Pr(t);return[mr(i)*u,t+(1-lr(i))*u-n]}var e=mr(n);return r.invert=function(r,i){if(ar(i+=n)<Rr)return[e?2*cr(e*r/2)/e:r,0];var u,a=r*r+i*i,c=0,f=10;do{var l=Pr(c),g=1/lr(c),v=a-2*i*c+c*c;c-=u=(l*v+2*(c-i))/(2+v*g*g+2*(c-i)*l)}while(ar(u)>Rr&&--f>0);var s=r*(l=Pr(c)),p=Pr(ar(i)<ar(c+1/l)?.5*t(s):.5*o(s)+jr/4)/mr(c);return[e?2*cr(e*p)/e:2*p,c]},r}function In(n,r){var e,t=hr(18,36*ar(r)/jr),o=vr(t),i=t-o,u=(e=qe[o])[0],a=e[1],c=(e=qe[++o])[0],f=e[1],l=(e=qe[hr(19,++o)])[0],g=e[1];return[n*(c+i*(l-u)/2+i*i*(l-2*c+u)/2),(r>0?Mr:-Mr)*(f+i*(g-a)/2+i*i*(g-2*f+a)/2)]}function Wn(n,r){function e(r,e){var t=o(r,e),i=t[1],c=i*a/(n-1)+u;return[t[0]*u/c,i/c]}var o=function(n){function r(r,e){var t=lr(e),o=(n-1)/(n-t*lr(r));return[o*t*mr(r),o*mr(e)]}return r.invert=function(r,e){var o=r*r+e*e,u=i(o),a=(n-i(1-o*(n+1)/(n-1)))/((n-1)/u+u/(n-1));return[fr(r*a,u*i(1-a*a)),u?t(e*a/u):0]},r}(n);if( !r)return o;var u=lr(r),a=mr(r);return e.invert=function(r,e){var t=(n-1)/(n-1-e*a);return o.invert(t*r,t*e*u)},e}function Tn(n){return n.length>0}function Dn(n){return n===De||n===Qe?[0,n]:[He,function(n){return Math.floor(n*Be)/Be}(n)]}function Nn(n){var r=n[0],e=n[1],t=!1;return r<=Ie?(r=He,t=!0):r>=Te&&(r=We,t=!0),e<=Ne?(e=De,t=!0):e>=Ve&&(e=Qe,t=!0),t?[r,e]:n}function Qn(n){return n.map(Nn)}function Vn(n,r,e){for(var t=0,o=n.length;t<o;++t){var i=n[t].slice();e.push({index:-1,polygon:r,ring:i});for(var u=0,a=i.length;u<a;++u){var c=i[u],f=c[0],l=c[1];if(f<=Ie||f>=Te||l<=Ne||l>=Ve){i[u]=Nn(c);for(var g=u+1;g<a;++g){var v=i[g],s=v[0],p=v[1];if(s>Ie&&s<Te&&p>Ne&&p<Ve)break}if(g===u+1)continue;if(u){var h={index:-1,polygon:r,ring:i.slice(0,u+1)};h.ring[h.ring.length-1]=Dn(l),e[e.length-1]=h}else e.pop();if(g>=a)break;e.push({index:-1,polygon:r,ring:i=i.slice(g-1)}),i[0]=Dn(i[0][1]),u=-1,a=i.length}}}}function _n(n){var r,e,t,o,i,u,a=n.length,c={},f={};for(r=0;r<a;++r)t=(e=n[r]).rin g[0],i=e.ring[e.ring.length-1],t[0]!==i[0]||t[1]!==i[1]?(e.index=r,c[t]=f[i]=e):(e.polygon.push(e.ring),n[r]=null);for(r=0;r<a;++r)if(e=n[r]){if(t=e.ring[0],i=e.ring[e.ring.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.ring);continue}o?(delete f[t],delete c[o.ring[0]],o.ring.pop(),n[o.index]=null,e={index:-1,polygon:o.polygon,ring:o.ring.concat(e.ring)},o===u?e.polygon.push(e.ring):(e.index=a++,n.push(c[e.ring[0]]=f[e.ring[e.ring.length-1]]=e))):u?(delete c[i],delete f[u.ring[u.ring.length-1]],e.ring.pop(),e={index:a++,polygon:u.polygon,ring:e.ring.concat(u.ring)},n[u.index]=null,n.push(c[e.ring[0]]=f[e.ring[e.ring.length-1]]=e)):(e.ring.push(e.ring[0]),e.polygon.push(e.ring))}}function Kn(n){var r={type:"Feature",geometry:On(n.geometry)};return null!=n.id&&(r.id=n.id),null!=n.bbox&&(r.bbox=n.bbox),null!=n.properties&&(r.properties=n.properties),r}function On(n){if(null==n)return n;var r,e,t,o;switch(n.type){case"GeometryCollection":r={ty pe:"GeometryCollection",geometries:n.geometries.map(On)};break;case"Point":r={type:"Point",coordinates:Nn(n.coordinates)};break;case"MultiPoint":case"LineString":r={type:n.type,coordinates:Qn(n.coordinates)};break;case"MultiLineString":r={type:"MultiLineString",coordinates:n.coordinates.map(Qn)};break;case"Polygon":var i=[];Vn(n.coordinates,i,e=[]),_n(e),r={type:"Polygon",coordinates:i};break;case"MultiPolygon":e=[],t=-1,o=n.coordinates.length;for(var u=new Array(o);++t<o;)Vn(n.coordinates[t],u[t]=[],e);_n(e),r={type:"MultiPolygon",coordinates:u.filter(Tn)};break;default:return n}return null!=n.bbox&&(r.bbox=n.bbox),r}function Un(n,r){var e=Pr(r/2),t=mr(Er*e);return[n*(.74482-.34588*t*t),1.70711*e]}function Jn(n){function e(n,e){var o=r.geoGnomonicRaw(n,e);return o[0]*=t,o}var t=lr(n);return e.invert=function(n,e){return r.geoGnomonicRaw.invert(n/t,e)},e}function Xn(n,r){return _e(Jn,n,r)}function Yn(n){function e(r,e){var c=o(lr(e)*lr(r-t)),f=o(lr(e)*lr(r-u));return c*=c,f*=f,[(c-f )/(2*n),(e<0?-1:1)*i(4*a*f-(a-c+f)*(a-c+f))/(2*n)]}if(!(n*=2))return r.geoAzimuthalEquidistantRaw;var t=-n/2,u=-t,a=n*n,c=Pr(u),f=.5/mr(u);return e.invert=function(n,r){var e,a,l=r*r,g=lr(i(l+(e=n+t)*e)),v=lr(i(l+(e=n+u)*e));return[fr(a=g-v,e=(g+v)*c),(r<0?-1:1)*o(i(e*e+a*a)*f)]},e}function Zn(n,r){return _e(Yn,n,r)}function $n(n,r){if(ar(r)<Rr)return[n,0];var e=ar(r/Mr),o=t(e);if(ar(n)<Rr||ar(ar(r)-Mr)<Rr)return[0,yr(r)*jr*Pr(o/2)];var u=lr(o),a=ar(jr/n-n/jr)/2,c=a*a,f=u/(e+u-1),l=f*(2/e-1),g=l*l,v=g+c,s=f-g,p=c+f;return[yr(n)*jr*(a*s+i(c*s*s-v*(f*f-g)))/v,yr(r)*jr*(l*p-a*i((c+1)*v-p*p))/v]}function nr(n,r){if(ar(r)<Rr)return[n,0];var e=ar(r/Mr),o=t(e);if(ar(n)<Rr||ar(ar(r)-Mr)<Rr)return[0,yr(r)*jr*Pr(o/2)];var u=lr(o),a=ar(jr/n-n/jr)/2,c=a*a,f=u*(i(1+c)-a*u)/(1+c*e*e);return[yr(n)*jr*f,yr(r)*jr*i(1-f*(2*a+f))]}function rr(n,r){if(ar(r)<Rr)return[n,0];var e=r/Mr,o=t(e);if(ar(n)<Rr||ar(ar(r)-Mr)<Rr)return[0,jr*Pr(o/2)];var u=(jr/n-n/jr)/2,a=e/(1+lr(o));return[jr*(yr(n)*i(u*u+1-a*a)- u),jr*a]}function er(n,r){if(!r)return[n,0];var e=ar(r);if(!n||e===Mr)return[0,r];var t=e/Mr,o=t*t,u=(8*t-o*(o+2)-5)/(2*o*(t-1)),a=u*u,c=t*u,f=o+a+2*c,l=t+3*u,g=n/Mr,v=g+1/g,s=yr(ar(n)-Mr)*i(v*v-4),p=s*s,h=(s*(f+a-1)+2*i(f*(o+a*p-1)+(1-o)*(o*(l*l+4*a)+12*c*a+4*a*a)))/(4*f+p);return[yr(n)*Mr*h,yr(r)*Mr*i(1+s*ar(h)-h*h)]}function tr(n,r){return[n*i(1-3*r*r/(jr*jr)),r]}function or(n,r){var e=.90631*mr(r),t=i(1-e*e),o=i(2/(1+t*lr(n/=3)));return[2.66723*t*o*mr(n),1.24104*e*o]}function ir(n,r){var e=lr(r),t=lr(n)*e,o=1-t,u=lr(n=fr(mr(n)*e,-mr(r))),a=mr(n);return e=i(1-t*t),[a*e-u*o,-u*e-a*o]}function ur(n,r){var e=f(n,r);return[(e[0]+n/Mr)/2,(e[1]+r)/2]}var ar=Math.abs,cr=Math.atan,fr=Math.atan2,lr=Math.cos,gr=Math.exp,vr=Math.floor,sr=Math.log,pr=Math.max,hr=Math.min,dr=Math.pow,wr=Math.round,yr=Math.sign||function(n){return n>0?1:n<0?-1:0},mr=Math.sin,Pr=Math.tan,Rr=1e-6,br=1e-12,jr=Math.PI,Mr=jr/2,Er=jr/4,Ar=Math.SQRT1_2,Sr=i(2),kr=i(jr),xr=2*jr,Gr=180/jr,Cr=jr/180;f.invert=function(n, r){if(!(n*n+4*r*r>jr*jr+Rr)){var e=n,t=r,u=25;do{var a,c=mr(e),f=mr(e/2),l=lr(e/2),g=mr(t),v=lr(t),s=mr(2*t),p=g*g,h=v*v,d=f*f,w=1-h*l*l,y=w?o(v*l)*i(a=1/w):a=0,m=2*y*v*f-n,P=y*g-r,R=a*(h*d+y*v*l*p),b=a*(.5*c*s-2*y*g*f),j=.25*a*(s*f-y*g*h*c),M=a*(p*l+y*d*v),E=b*j-M*R;if(!E)break;var A=(P*b-m*M)/E,S=(m*j-P*R)/E;e-=A,t-=S}while((ar(A)>Rr||ar(S)>Rr)&&--u>0);return[e,t]}};g.invert=function(n,r){if(n*=3/8,r*=3/8,!n&&ar(r)>1)return null;var e=1+n*n+r*r,o=i((e-i(e*e-4*r*r))/2),c=t(o)/3,f=o?function(n){return sr(n+i(n*n-1))}(ar(r/o))/3:function(n){return sr(n+i(n*n+1))}(ar(n))/3,l=lr(c),g=a(f),v=g*g-l*l;return[2*yr(n)*fr(u(f)*l,.25-v),2*yr(r)*fr(g*mr(c),.25+v)]};var zr=i(8),Fr=sr(1+Sr);v.invert=function(n,r){if((t=ar(r))<Fr)return[n,2*cr(gr(r))-Mr];var e,t,o=Er,i=25;do{var u=lr(o/2),a=Pr(o/2);o-=e=(zr*(o-Er)-sr(a)-t)/(zr-u*u/(2*a))}while(ar(e)>br&&--i>0);return[n/(lr(o)*(zr-1/mr(o))),yr(r)*o]};h.invert=function(n,r){var e=2*t(r/2);return[n*lr(e/2)/lr(e),e]};var Lr=y(Sr/Mr,Sr,jr),qr=2.00276, Br=1.11072;m.invert=function(n,r){var e,t,o=qr*r,i=r<0?-Er:Er,u=25;do{t=o-Sr*mr(i),i-=e=(mr(2*i)+2*i-jr*mr(t))/(2*lr(2*i)+2+jr*lr(t)*Sr*lr(i))}while(ar(e)>Rr&&--u>0);return t=o-Sr*mr(i),[n*(1/lr(t)+Br/lr(i))/qr,t]};var Hr=function(n){var e=0,t=r.geoProjectionMutator(n),o=t(e);return o.parallel=function(n){return arguments.length?t(e=n*Cr):e*Gr},o};P.invert=function(n,r){return[n/lr(r),r]};var Ir=y(1,4/jr,jr);x.invert=function(n,r){var e=(e=r/kr-1)*e;return[e>0?n*i(jr/e)/2:0,t(1-e)]};var Wr=i(3);C.invert=function(n,r){var e=3*t(r/(Wr*kr));return[kr*n/(Wr*(2*lr(2*e/3)-1)),e]};L.invert=function(n,r){var e=i(8/(3*jr)),t=r/e;return[n/(e*(1-ar(t)/jr)),t]};q.invert=function(n,r){var e=2-ar(r)/i(2*jr/3);return[n*i(6*jr)/(2*e),yr(r)*t((4-e*e)/3)]};B.invert=function(n,r){var e=i(jr*(4+jr))/2;return[n*e/(1+i(1-r*r*(4+jr)/(4*jr))),r*e/2]};H.invert=function(n,r){var e=r*i((4+jr)/jr)/2,o=t(e),u=lr(o);return[n/(2/i(jr*(4+jr))*(1+u)),t((o+e*(u+2))/(2+Mr))]};I.invert=function(n,r){var e=i(2+jr),t=r* e/2;return[e*n/(1+lr(t)),t]};W.invert=function(n,r){var e=1+Mr,o=i(e/2);return[2*n*o/(1+lr(r*=o)),t((r+mr(r))/e)]};var Tr=3+2*Sr;T.invert=function(n,r){if(!(e=g.invert(n/1.2,1.065*r)))return null;var e,t=e[0],o=e[1],u=20;n/=Tr,r/=Tr;do{var a=t/2,c=o/2,f=mr(a),l=lr(a),v=mr(c),s=lr(c),p=lr(o),h=i(p),d=v/(s+Sr*l*h),w=d*d,y=i(2/(1+w)),m=(Sr*s+(l+f)*h)/(Sr*s+(l-f)*h),P=i(m),R=P-1/P,b=P+1/P,j=y*R-2*sr(P)-n,M=y*d*b-2*cr(d)-r,E=v&&Ar*h*f*w/v,A=(Sr*l*s+h)/(2*(s+Sr*l*h)*(s+Sr*l*h)*h),S=-.5*d*y*y*y,k=S*E,x=S*A,G=(G=2*s+Sr*h*(l-f))*G*P,C=(Sr*l*s*h+p)/G,z=-Sr*f*v/(h*G),F=R*k-2*C/P+y*(C+C/m),L=R*x-2*z/P+y*(z+z/m),q=d*b*k-2*E/(1+w)+y*b*E+y*d*(C-C/m),B=d*b*x-2*A/(1+w)+y*b*A+y*d*(z-z/m),H=L*q-B*F;if(!H)break;var I=(M*L-j*B)/H,W=(j*q-M*F)/H;t-=I,o=pr(-Mr,hr(Mr,o-W))}while((ar(I)>Rr||ar(W)>Rr)&&--u>0);return ar(ar(o)-Mr)<Rr?[0,o]:u&&[t,o]};var Dr=lr(35*Cr);D.invert=function(n,r){var e=r/(1+Dr);return[n&&n/(Dr*i(1-e*e)),2*cr(e)]};N.invert=function(n,r){var e=cr(r/kr),t=lr(e),o=2*e;return[n*kr/2/(lr(o)* t*t),o]};var Nr=function(n,r,e,o,u,a,c,f){function l(i,l){if(!l)return[n*i/jr,0];var g=l*l,v=n+g*(r+g*(e+g*o)),s=l*(u-1+g*(a-f+g*c)),p=(v*v+s*s)/(2*s),h=i*t(v/p)/jr;return[p*mr(h),l*(1+g*f)+p*(1-lr(h))]}return arguments.length<8&&(f=0),l.invert=function(l,g){var v,s,p=jr*l/n,h=g,d=50;do{var w=h*h,y=n+w*(r+w*(e+w*o)),m=h*(u-1+w*(a-f+w*c)),P=y*y+m*m,R=2*m,b=P/R,j=b*b,M=t(y/b)/jr,E=p*M,A=y*y,S=(2*r+w*(4*e+6*w*o))*h,k=u+w*(3*a+5*w*c),x=(2*(y*S+m*(k-1))*R-P*(2*(k-1)))/(R*R),G=lr(E),C=mr(E),z=b*G,F=b*C,L=p/jr*(1/i(1-A/j))*(S*b-y*x)/j,q=F-l,B=h*(1+w*f)+b-z-g,H=x*C+z*L,I=z*M,W=1+x-(x*G-F*L),T=F*M,D=H*T-W*I;if(!D)break;p-=v=(B*H-q*W)/D,h-=s=(q*T-B*I)/D}while((ar(v)>Rr||ar(s)>Rr)&&--d>0);return[p,h]},l},Qr=Nr(2.8284,-1.6988,.75432,-.18071,1.76003,-.38914,.042555),Vr=Nr(2.583819,-.835827,.170354,-.038094,1.543313,-.411435,.082742),_r=Nr(5/6*jr,-.62636,-.0344,0,1.3493,-.05524,0,.045);U.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(ar(e)>Rr&&--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(ar(e)>Rr&&--i>0);return[t,o]};var Kr=Nr(2.6516,-.76534,.19123,-.047094,1.36289,-.13965,.031762),Or=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(Mr,0)[0]-n(-Mr,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};J.invert=function(n,r){ar(n)>1&&(n=2*yr(n)-n),ar(r)>1&&(r=2*yr(r)-r);var e=yr(n),o=yr(r),u=-e*n,a=-o*r,c=a/u<1,f=function(n,r){for(var e=0,o=1,u=.5,a=50;;){var c=u*u,f=i(u),l=t(1/i(1+c)),g=1-c+u*(1+c)*l,v=(1-f)/g,s=i(v),p=v*(1+c),h=s*(1-c),d=i(p-n*n),w=r+h+u*d;if(ar(o-e)<br||0==--a||0===w)break;w>0?e=u:o=u,u=.5*(e+o)}if(!a)return null;var y=t(f),m=lr(y),P=1/m,R=2*f*m,b=(-g*m-(-3*u+l*(1+3*c))*R*(1-f))/(g*g);return[jr/4*(n*(-2*P*(.5*b/s*(1-c)-2*u*s*R)+-P*R*d)+-P*(u*(1+c)*b+v*(1+3*c)*R)*t(n/i(p))),y]}(c?a:u,c?u:a),l=f[0],g=f[1],v=lr(g);return c&&(l=-Mr-l),[e*(f r(mr(l)*v,-mr(g))+jr),o*t(lr(l)*v)]};Z.invert=function(n,r){var e=(Sr-1)/(Sr+1),t=i(1-e*e),o=function(n,r,e){var t,o,i;return n?(t=X(n,e),r?(o=X(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=X(r,1-e),[[0,o[0]/o[1]],[1/o[1],0],[o[2]/o[1],0]])}(.5*Y(Mr,t*t)-r,-n,t*t),u=function(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]}(o[0],o[1]);return[fr(u[1],u[0])/-1,2*cr(gr(-.5*sr(e*u[0]*u[0]+e*u[1]*u[1])))-Mr]};var Ur=41+48/36+37/3600,Jr=z(0),Xr=.7109889596207567,Yr=.0528035274542;tn.invert=function(n,r){return r>-Xr?Lr.invert(n,r-Yr):P.invert(n,r)};on.invert=function(n,r){return ar(r)>Xr?Lr.invert(n,r+(r>0?Yr:-Yr)):P.invert(n,r)};var Zr=function(n,t){function o(r,e){for(var o=e<0?-1:1,i=t[+(e<0)],u=0,a=i.length-1;u<a&&r>i[u][2][0];++u);var c=n(r-i[u][1][0],e);return c[0]+=n(i[u][1][0],o*e>o*i[u][0][1]?i[u][0][ 1]:e)[0],c}var i,u;n.invert&&(o.invert=function(r,e){for(var i=u[+(e<0)],a=t[+(e<0)],c=0,f=i.length;c<f;++c){var l=i[c];if(l[0][0]<=r&&r<l[1][0]&&l[0][1]<=e&&e<l[1][1]){var g=n.invert(r-n(a[c][1][0],0)[0],e);return g[0]+=a[c][1][0],un(o(g[0],g[1]),[r,e])?g:null}}});var a=r.geoProjection(o),c=a.stream;return a.stream=function(n){var e=a.rotate(),t=c(n),o=(a.rotate([0,0]),c(n));return a.rotate(e),t.sphere=function(){r.geoStream(i,o)},t},a.lobes=function(r){return arguments.length?(i=function(n){var r,t,o,i,u,a,c,f=[],l=n[0].length;for(c=0;c<l;++c)t=(r=n[0][c])[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(an([[t+Rr,o+Rr],[t+Rr,i-Rr],[u-Rr,i-Rr],[u-Rr,a+Rr]],30));for(c=n[1].length-1;c>=0;--c)t=(r=n[1][c])[0][0],o=r[0][1],i=r[1][1],u=r[2][0],a=r[2][1],f.push(an([[u-Rr,a-Rr],[u-Rr,i+Rr],[t+Rr,i+Rr],[t+Rr,o-Rr]],30));return{type:"Polygon",coordinates:[e.merge(f)]}}(r),t=r.map(function(n){return n.map(function(n){return[[n[0][0]*Cr,n[0][1]*Cr],[n[1][0]*Cr,n[1][1]*Cr],[n[2][0]*Cr,n[2 ][1]*Cr]]})}),u=t.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]]})}),a):t.map(function(n){return n.map(function(n){return[[n[0][0]*Gr,n[0][1]*Gr],[n[1][0]*Gr,n[1][1]*Gr],[n[2][0]*Gr,n[2][1]*Gr]]})})},null!=t&&a.lobes(t),a},$r=[[[[-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]]]],ne=[[[[-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]]]],re=[[[[-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]]]],ee=[[[[-180,0],[-90,90],[0,0]],[[0,0],[90,90],[180,0]]],[[[-180,0],[-90,-90],[0,0]],[[0,0],[90,-90],[180,0] ]]],te=[[[[-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]]]],oe=[[[[-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]]]];cn.invert=function(n,r){return[xr/3*n/i(jr*jr/3-r*r),r]};var ie=jr/Sr;ln.invert=function(n,r){var e=ar(n),t=ar(r),u=Rr,a=Mr;t<ie?a*=t/ie:u+=6*o(ie/t);for(var c=0;c<25;c++){var f=mr(a),l=i(lr(a)),g=mr(a/2),v=lr(a/2),s=mr(u/6),p=lr(u/6),h=.5*u*(1+l)-e,d=a/(v*p)-t,w=l?-.25*u*f/l:0,y=.5*(1+l),m=(1+.5*a*g/v)/(v*p),P=a/v*(s/6)/(p*p),R=w*P-m*y,b=(h*P-d*y)/R,j=(d*w-h*m)/R;if(a-=b,u-=j,ar(b)<Rr&&ar(j)<Rr)break}return[n<0?-u:u,r<0?-a:a]};gn.invert=function(n,r){var e=yr(n)*jr,t=r/2,o=50;do{var i=e*e,u=t*t,a=e*t,c=e*(.975534+u*(-.0143059*i-.119161+-.0547009*u))-n,f=t*(1.00384+i*(.0802894+-.02855*u+199025e-9*i)+u*(.0998909+-.0491032*u))-r,l=.975534-u*(.119161+3*i*.01430 59+.0547009*u),g=-a*(.238322+.2188036*u+.0286118*i),v=a*(.1605788+7961e-7*i+-.0571*u),s=1.00384+i*(.0802894+199025e-9*i)+u*(3*(.0998909-.02855*i)-.245516*u),p=g*v-s*l,h=(f*g-c*s)/p,d=(c*v-f*l)/p;e-=h,t-=d}while((ar(h)>Rr||ar(d)>Rr)&&--o>0);return o&&[e,t]};vn.invert=function(n,r){var e=n*n,u=r*r+1,a=e+u,c=n?Ar*i((a-i(a*a-4*e))/e):1/i(u);return[t(n*c),yr(r)*o(c)]};pn.invert=function(n,r){return[n,2.5*cr(gr(.8*r))-.625*jr]};var ue=[[.9972523,0],[.0052513,-.0041175],[.0074606,.0048125],[-.0153783,-.1968253],[.0636871,-.1408027],[.3660976,-.2937382]],ae=[[.98879,0],[0,0],[-.050909,0],[0,0],[.075528,0]],ce=[[.984299,0],[.0211642,.0037608],[-.1036018,-.0575102],[-.0329095,-.0320119],[.0499471,.1223335],[.026046,.0899805],[7388e-7,-.1435792],[.0075848,-.1334108],[-.0216473,.0776645],[-.0225161,.0853673]],fe=[[.9245,0],[0,0],[.01943,0]],le=[[.721316,0],[0,0],[-.00881625,-.00617325]],ge=i(6),ve=i(7);wn.invert=function(n,r){var e=3*t(r*ve/9);return[n*ve/(ge*(2*lr(2*e/3)-1)),t(3*mr(e)*ge/7)]}; yn.invert=function(n,r){var e=r*i(2+Sr)/(2*i(3)),o=2*t(e);return[3*Sr*n/(1+2*lr(o)/lr(o/2)),t((e+mr(o))/(1+Ar))]};mn.invert=function(n,r){var e=i(6/(4+jr)),o=r/e;return ar(ar(o)-Mr)<Rr&&(o=o<0?-Mr:Mr),[1.5*n/(e*(.5+lr(o))),t((o/2+mr(o))/(1+jr/4))]};Pn.invert=function(n,r){var e,t,o,i,u=r,a=25;do{u-=e=(u*(1.01183+(o=(t=u*u)*t)*o*(.01926*t-.02625-.00396*o))-r)/(1.01183+o*o*(.21186*t-.23625+-.05148*o))}while(ar(e)>br&&--a>0);return t=u*u,o=t*t,i=t*o,[n/(.84719-.13063*t+i*i*(.05494*t-.04515-.02326*o+.00331*i)),u]};Rn.invert=function(n,r){for(var e=r/2,t=0,o=1/0;t<10&&ar(o)>Rr;++t){var i=lr(r/2);r-=o=(r-Pr(r/2)-e)/(1-.5/(i*i))}return[2*n/(1+lr(r)),r]};var se=1.0148,pe=.23185,he=-.14499,de=.02406,we=se,ye=5*pe,me=7*he,Pe=9*de,Re=1.790857183;bn.invert=function(n,r){r>Re?r=Re:r<-Re&&(r=-Re);var e,t=r;do{var o=t*t;t-=e=(t*(se+o*o*(pe+o*(he+de*o)))-r)/(we+o*o*(ye+o*(me+Pe*o)))}while(ar(e)>Rr);return[n,t]};jn.invert=function(n,r){if(ar(r)<Rr)return[n,0];var e,i=n*n+r*r,u=.5*r,a=10;do{var c=Pr( u),f=1/lr(u),l=i-2*r*u+u*u;u-=e=(c*l+2*(u-r))/(2+l*f*f+2*(u-r)*c)}while(ar(e)>Rr&&--a>0);return c=Pr(u),[(ar(r)<ar(u+1/c)?t(n*c):yr(n)*(o(ar(n*c))+Mr))/mr(u),u]};var be=function(n,r){var e=En(n[1],n[0]),t=En(r[1],r[0]),o=function(n,r){return fr(n[0]*r[1]-n[1]*r[0],n[0]*r[0]+n[1]*r[1])}(e,t),i=An(e)/An(t);return Mn([1,0,n[0][0],0,1,n[0][1]],Mn([i,0,0,0,i,0],Mn([lr(o),mr(o),0,-mr(o),lr(o),0],[1,0,-r[0][0],0,1,-r[0][1]])))},je=function(n,e,t){function o(n,r){if(n.edges=function(n){for(var r=n.length,e=[],t=n[r-1],o=0;o<r;++o)e.push([t,t=n[o]]);return e}(n.face),r.face){var e=n.shared=function(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}}}(n.face,r.face),t=be(e.map(r.project),e.map(n.project));n.transform=r.transform?Mn(r.transform,t):t;for(var i=r.edges,u=0,a=i.length;u<a;++u)kn(e[0],i[u][1])&&kn(e[1],i[u][0])&&(i[u]=n),kn(e[0],i[u][0])&&kn(e[1],i[u][1])&&(i[u]=n);for(u=0,a=(i=n.edges).length ;u<a;++u)kn(e[0],i[u][0])&&kn(e[1],i[u][1])&&(i[u]=r),kn(e[0],i[u][1])&&kn(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*Gr,r*Gr]);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 t=n.project.invert,o=n.transform,i=r;if(o&&(i=[(o=function(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])]}(o))[0]*i[0]+o[1]*i[1]+o[2],o[3]*i[0]+o[4]*i[1]+o[5]]),t&&n===function(n){return e(n[0]*Cr,n[1]*Cr)}(a=t(i)))return a;for(var a,c=n.children,f=0,l=c&&c.length;f<l;++f)if(a=u(c[f],r))return a}o(n,{transform:[lr(t=null==t?-jr/6:t),mr(t),0,-mr(t),lr(t),0]}),xn(n)&&(i.invert=function(r,e){var t=u(n,[r,-e]);return t&&(t[0]*=Cr,t[1]*=Cr,t)});var a=r.geoProjection(i),c=a.stream;return a.stream=function(r){var e=a.rotate(),t=c(r),o=(a.rotate([0,0]),c(r));return a.ro tate(e),t.sphere=function(){o.polygonStart(),o.lineStart(),Sn(o,n),o.lineEnd(),o.polygonEnd()},t},a},Me=[[0,90],[-90,0],[0,0],[90,0],[180,0],[0,-90]],Ee=[[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 Me[n]})}),Ae=2/i(3);Gn.invert=function(n,r){return x.invert(n/Ae,r)};var Se=function(){},ke=[],xe=[],Ge={point:function(n,r){ke.push([n,r])},result:function(){var n=ke.length?ke.length<2?{type:"Point",coordinates:ke[0]}:{type:"MultiPoint",coordinates:ke}:null;return ke=[],n}},Ce={lineStart:Se,point:function(n,r){ke.push([n,r])},lineEnd:function(){ke.length&&(xe.push(ke),ke=[])},result:function(){var n=xe.length?xe.length<2?{type:"LineString",coordinates:xe[0]}:{type:"MultiLineString",coordinates:xe}:null;return xe=[],n}},ze={polygonStart:Se,lineStart:Se,point:function(n,r){ke.push([n,r])},lineEnd:function(){var n=ke.length;if(n){do{ke.push(ke[0].slice())}while(++n<4);xe.push(ke),ke=[]}},polygonEnd:Se,result:function(){if (!xe.length)return null;var n=[],r=[];return xe.forEach(function(e){!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}(e)?r.push(e):n.push([e])}),r.forEach(function(r){var e=r[0];n.some(function(n){if(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],g=n[a],v=g[0],s=g[1];l>t^s>t&&e<(v-f)*(t-l)/(s-l)+f&&(o=!o)}return o}(n[0],e))return n.push(r),!0})||n.push([r])}),xe=[],n.length?n.length>1?{type:"MultiPolygon",coordinates:n}:{type:"Polygon",coordinates:n[0]}:null}},Fe=function(n){function e(r,e){var o=ar(r)<Mr,i=n(o?r:r>0?r-jr:r+jr,e),u=(i[0]-i[1])*Ar,a=(i[0]+i[1])*Ar;if(o)return[u,a];var c=t*Ar,f=u>0^a>0?-1:1;return[f*u-yr(a)*c,f*a-yr(u)*c]}var t=n(Mr,0)[0]-n(-Mr,0)[0];return n.invert&&(e.invert=function(r,e){var o=(r+e)*Ar,i=(e-r)*Ar,u=ar(o)<.5*t&&ar(i)<.5*t;if(!u){var a=t*Ar,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)*Ar,i=(f-l)*Ar}var g=n.invert(o,i);return u||(g[0]+=o>0?jr:-jr),g}),r.geoProjection(e).rotate([-90,-90,45]).clipAngle(179.999)},Le=function(){return Fe(Z).scale(111.48)},qe=[[.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]];qe.forEach(function(n){n[1]*=1.0144}),In.invert=function(n,r){var e=r/Mr,t=90*e,o=hr(18,ar(t/5)),i=pr(0,vr(o));do{var u=qe[i][1],a=qe[i+1][1],c=qe[hr(19,i+2)][1],f=c-u,l=c-2*a+u,g=2*(ar(e)-a)/f,v=l/f,s=g*(1-v*g*(1-2*v*g));if(s>=0||1===i){t=(r>=0?5:-5)*(s+o);var p,h=50;do{s=(o=hr(18,ar(t)/5))-(i=vr(o)),u=qe[i][1],a=qe[i+1][1],c=qe[hr(19,i+2)][1],t-=(p=(r>=0?Mr:-Mr)*(a+s*(c-u)/2+s*s*(c-2*a+u)/2)-r)*Gr}while(ar(p)>br&&--h>0);break}}while(--i>=0);var d=qe[i][0],w=qe[i+1][0],y=qe[hr(19,i+2)][0];return[n/(w+s*(y-d)/2+s*s*(y-2*w+d)/2),t*Cr]};var Be=1e4,He=-180,Ie=He+ 1e-4,We=180,Te=We-1e-4,De=-90,Ne=De+1e-4,Qe=90,Ve=Qe-1e-4;Un.invert=function(n,r){var e=r/1.70711,t=mr(Er*e);return[n/(.74482-.34588*t*t),2*cr(e)]};var _e=function(n,e,o){var i=r.geoInterpolate(e,o),u=i(.5),a=r.geoRotation([-u[0],-u[1]])(e),c=i.distance/2,f=-t(mr(a[1]*Cr)/mr(c)),l=[-u[0],-u[1],-(a[0]>0?jr-f:f)*Gr],g=r.geoProjection(n(c)).rotate(l),v=r.geoRotation(l),s=g.center;return delete g.rotate,g.center=function(n){return arguments.length?s(v(n)):v.invert(s())},g.clipAngle(90)};$n.invert=function(n,r){if(ar(r)<Rr)return[n,0];if(ar(n)<Rr)return[0,Mr*mr(2*cr(r/jr))];var e=(n/=jr)*n,t=(r/=jr)*r,u=e+t,a=u*u,c=-ar(r)*(1+u),f=c-2*t+e,l=-2*c+1+2*t+a,g=t/l+(2*f*f*f/(l*l*l)-9*c*f/(l*l))/27,v=(c-f*f/(3*l))/l,s=2*i(-v/3),p=o(3*g/(v*s))/3;return[jr*(u-1+i(1+2*(e-t)+a))/(2*n),yr(r)*jr*(-s*lr(p+jr/3)-f/(3*l))]};nr.invert=function(n,r){if(!n)return[0,Mr*mr(2*cr(r/jr))];var e=ar(n/jr),t=(1-e*e-(r/=jr)*r)/(2*e),o=i(t*t+1);return[yr(n)*jr*(o-t),yr(r)*Mr*mr(2*fr(i((1-2*t*e)*(t+o)-e),i(o+t+e)))]}; rr.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*(yr(n)*i(t*t+1)-t):0,Mr*mr(2*cr(e))]};er.invert=function(n,r){var e;if(!n||!r)return[n,r];r/=jr;var t=yr(n)*n/Mr,o=(t*t-1+4*r*r)/ar(t),u=o*o,a=2*r,c=50;do{var f=a*a,l=(8*a-f*(f+2)-5)/(2*f*(a-1)),g=(3*a-f*a-10)/(2*f*a),v=l*l,s=a*l,p=a+l,h=p*p,d=a+3*l,w=-2*p*(4*s*v+(1-4*f+3*f*f)*(1+g)+v*(14*f-6-u+(8*f-8-2*u)*g)+s*(12*f-8+(10*f-10-u)*g)),y=i(h*(f+v*u-1)+(1-f)*(f*(d*d+4*v)+v*(12*s+4*v)));a-=e=(o*(h+v-1)+2*y-t*(4*h+u))/(o*(2*l*g+2*p*(1+g))+w/y-8*p*(o*(-1+v+h)+2*y)*(1+g)/(u+4*h))}while(e>Rr&&--c>0);return[yr(n)*(i(o*o+4)+o)*jr/4,Mr*a]};var Ke=4*jr+3*i(3),Oe=2*i(2*jr*i(3)/Ke),Ue=y(Oe*i(3)/jr,Oe,Ke/6);tr.invert=function(n,r){return[n/i(1-3*r*r/(jr*jr)),r]};or.invert=function(n,r){var e=n/2.66723,o=r/1.24104,u=i(e*e+o*o),a=2*t(u/2);return[3*fr(n*Pr(a),2.66723*u),u&&t(r*mr(a)/(1.24104*.90631*u))]};ir.invert=function(n,r){var e=(n*n+r*r)/-2,o=i(-e*(2+e)),u=r*e+n*o,a=n*e-r*o,c=i(a*a+u*u);return[fr(o* u,c*(1+e)),c?-t(o*a/c):0]};ur.invert=function(n,r){var e=n,t=r,u=25;do{var a,c=lr(t),f=mr(t),l=mr(2*t),g=f*f,v=c*c,s=mr(e),p=lr(e/2),h=mr(e/2),d=h*h,w=1-v*p*p,y=w?o(c*p)*i(a=1/w):a=0,m=.5*(2*y*c*h+e/Mr)-n,P=.5*(y*f+t)-r,R=.5*a*(v*d+y*c*p*g)+.5/Mr,b=a*(s*l/4-y*f*h),j=.125*a*(l*h-y*f*v*s),M=.5*a*(g*p+y*d*c)+.5,E=b*j-M*R,A=(P*b-m*M)/E,S=(m*j-P*R)/E;e-=A,t-=S}while((ar(A)>Rr||ar(S)>Rr)&&--u>0);return[e,t]};n.geoAiry=function(){var n=Mr,e=r.geoProjectionMutator(c),t=e(n);return t.radius=function(r){return arguments.length?e(n=r*Cr):n*Gr},t.scale(179.976).clipAngle(147)},n.geoAiryRaw=c,n.geoAitoff=function(){return r.geoProjection(f).scale(152.63)},n.geoAitoffRaw=f,n.geoArmadillo=function(){var n=20*Cr,e=n>=0?1:-1,t=Pr(e*n),o=r.geoProjectionMutator(l),i=o(n),u=i.stream;return i.parallel=function(r){return arguments.length?(t=Pr((e=(n=r*Cr)>=0?1:-1)*n),o(n)):n*Gr},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=-180*e;e*r<180;r+=90*e)c.point(r,90*e);for(;e*(r-=n)>=-180;)c.point(r,e*-fr(lr(r*Cr/2),t)*Gr);c.lineEnd(),c.polygonEnd()},a},i.scale(218.695).center([0,28.0974])},n.geoArmadilloRaw=l,n.geoAugust=function(){return r.geoProjection(g).scale(66.1603)},n.geoAugustRaw=g,n.geoBaker=function(){return r.geoProjection(v).scale(112.314)},n.geoBakerRaw=v,n.geoBerghaus=function(){var n=5,e=r.geoProjectionMutator(s),o=e(n),i=o.stream,u=-lr(.01*Cr),a=mr(.01*Cr);return o.lobes=function(r){return arguments.length?e(n=+r):n},o.stream=function(r){var e=o.rotate(),c=i(r),f=(o.rotate([0,0]),i(r));return o.rotate(e),c.sphere=function(){f.polygonStart(),f.lineStart();for(var r=0,e=360/n,o=2*jr/n,i=90-180/n,c=Mr;r<n;++r,i-=e,c-=o)f.point(fr(a*lr(c),u)*Gr,t(a*mr(c))*Gr),i<-90?(f.point(-90,-180-i-.01),f.point(-90,-180-i+.01)):(f.point(90,i+.01),f.point(90,i-.01));f.lineEnd(),f.polygonEnd()},c},o.scale(87.8076).center([0,17.1875]).clipAngle(179.999)},n.geoBerghausRaw=s,n.geoBertin1953=f unction(){var n=r.geoProjection(d());return n.rotate([-16.5,-42]),delete n.rotate,n.scale(176.57).center([7.93,.09])},n.geoBertin1953Raw=d,n.geoBoggs=function(){return r.geoProjection(m).scale(160.857)},n.geoBoggsRaw=m,n.geoBonne=function(){return Hr(R).scale(123.082).center([0,26.1441]).parallel(45)},n.geoBonneRaw=R,n.geoBottomley=function(){var n=.5,e=r.geoProjectionMutator(b),t=e(n);return t.fraction=function(r){return arguments.length?e(n=+r):n},t.scale(158.837)},n.geoBottomleyRaw=b,n.geoBromley=function(){return r.geoProjection(Ir).scale(152.63)},n.geoBromleyRaw=Ir,n.geoChamberlin=k,n.geoChamberlinRaw=A,n.geoChamberlinAfrica=function(){return k([0,22],[45,22],[22.5,-22]).scale(380).center([22.5,2])},n.geoCollignon=function(){return r.geoProjection(x).scale(95.6464).center([0,30])},n.geoCollignonRaw=x,n.geoCraig=function(){return Hr(G).scale(249.828).clipAngle(90)},n.geoCraigRaw=G,n.geoCraster=function(){return r.geoProjection(C).scale(156.19)},n.geoCrasterRaw=C,n.geoCylindrical EqualArea=function(){return Hr(z).parallel(38.58).scale(195.044)},n.geoCylindricalEqualAreaRaw=z,n.geoCylindricalStereographic=function(){return Hr(F).scale(124.75)},n.geoCylindricalStereographicRaw=F,n.geoEckert1=function(){return r.geoProjection(L).scale(165.664)},n.geoEckert1Raw=L,n.geoEckert2=function(){return r.geoProjection(q).scale(165.664)},n.geoEckert2Raw=q,n.geoEckert3=function(){return r.geoProjection(B).scale(180.739)},n.geoEckert3Raw=B,n.geoEckert4=function(){return r.geoProjection(H).scale(180.739)},n.geoEckert4Raw=H,n.geoEckert5=function(){return r.geoProjection(I).scale(173.044)},n.geoEckert5Raw=I,n.geoEckert6=function(){return r.geoProjection(W).scale(173.044)},n.geoEckert6Raw=W,n.geoEisenlohr=function(){return r.geoProjection(T).scale(62.5271)},n.geoEisenlohrRaw=T,n.geoFahey=function(){return r.geoProjection(D).scale(137.152)},n.geoFaheyRaw=D,n.geoFoucaut=function(){return r.geoProjection(N).scale(135.264)},n.geoFoucautRaw=N,n.geoGilbert=function(n){function e(n){r eturn i(Q(n))}function o(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(Gr).precision(0).clipAngle(null).translate([0,0]);return i.invert&&(e.invert=function(n){return V(i.invert(n))}),e.stream=function(n){var r=i.stream(n),e=u.stream({point:function(n,e){r.point(n/2,t(Pr(-e/2*Cr))*Gr)},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(Q(n)),e):V(i.center())},o("clipAngle"),o("clipExtent"),o("scale"),o("translate"),o("precision"),e.scale(249.5)},n.geoGingery=function(){var n=6,e=30*Cr,o=lr(e),i=mr(e),u=r.geoProjectionMutator(_),a=u(e,n),c=a.stream,f=-lr(.01*Cr),l=mr(.01*Cr);return a.radius=function(r){return arguments.length?(o=lr(e=r*Cr),i=mr( e),u(e,n)):e*Gr},a.lobes=function(r){return arguments.length?u(e,n=+r):n},a.stream=function(r){var e=a.rotate(),u=c(r),g=(a.rotate([0,0]),c(r));return a.rotate(e),u.sphere=function(){g.polygonStart(),g.lineStart();for(var r=0,e=2*jr/n,u=0;r<n;++r,u-=e)g.point(fr(l*lr(u),f)*Gr,t(l*mr(u))*Gr),g.point(fr(i*lr(u-e/2),o)*Gr,t(i*mr(u-e/2))*Gr);g.lineEnd(),g.polygonEnd()},u},a.rotate([90,-40]).scale(91.7095).clipAngle(179.999)},n.geoGingeryRaw=_,n.geoGinzburg4=function(){return r.geoProjection(Qr).scale(149.995)},n.geoGinzburg4Raw=Qr,n.geoGinzburg5=function(){return r.geoProjection(Vr).scale(153.93)},n.geoGinzburg5Raw=Vr,n.geoGinzburg6=function(){return r.geoProjection(_r).scale(130.945)},n.geoGinzburg6Raw=_r,n.geoGinzburg8=function(){return r.geoProjection(U).scale(131.747)},n.geoGinzburg8Raw=U,n.geoGinzburg9=function(){return r.geoProjection(Kr).scale(131.087)},n.geoGinzburg9Raw=Kr,n.geoGringorten=function(){return r.geoProjection(Or(J)).scale(239.75)},n.geoGringortenRaw=J,n.geoGuyou=fun ction(){return r.geoProjection(Or(Z)).scale(151.496)},n.geoGuyouRaw=Z,n.geoHammer=function(){var n=2,e=r.geoProjectionMutator(p),t=e(n);return t.coefficient=function(r){return arguments.length?e(n=+r):n},t.scale(169.529)},n.geoHammerRaw=p,n.geoHammerRetroazimuthal=function(){var n=0,e=r.geoProjectionMutator($),t=e(n),o=t.rotate,i=t.stream,u=r.geoCircle();return t.parallel=function(r){if(!arguments.length)return n*Gr;var o=t.rotate();return e(n=r*Cr).rotate(o)},t.rotate=function(r){return arguments.length?(o.call(t,[r[0],r[1]-n*Gr]),u.center([-r[0],-r[1]]),t):(r=o.call(t),r[1]+=n*Gr,r)},t.stream=function(n){return n=i(n),n.sphere=function(){n.polygonStart();var r,e=u.radius(89.99)().coordinates[0],t=e.length-1,o=-1;for(n.lineStart();++o<t;)n.point((r=e[o])[0],r[1]);for(n.lineEnd(),t=(e=u.radius(90.01)().coordinates[0]).length-1,n.lineStart();--o>=0;)n.point((r=e[o])[0],r[1]);n.lineEnd(),n.polygonEnd()},n},t.scale(79.4187).parallel(45).clipAngle(179.999)},n.geoHammerRetroazimuthalRaw= $,n.geoHealpix=function(){var n=4,t=r.geoProjectionMutator(rn),o=t(n),i=o.stream;return o.lobes=function(r){return arguments.length?t(n=+r):n},o.stream=function(t){var u=o.rotate(),a=i(t),c=(o.rotate([0,0]),i(t));return o.rotate(u),a.sphere=function(){r.geoStream(function(n){return{type:"Polygon",coordinates:[e.range(-180,180+n/2,n).map(function(n,r){return[n,1&r?90-1e-6:Ur]}).concat(e.range(180,-180-n/2,-n).map(function(n,r){return[n,1&r?1e-6-90:-Ur]}))]}}(180/n),c)},a},o.scale(239.75)},n.geoHealpixRaw=rn,n.geoHill=function(){var n=1,e=r.geoProjectionMutator(en),t=e(n);return t.ratio=function(r){return arguments.length?e(n=+r):n},t.scale(167.774).center([0,18.67])},n.geoHillRaw=en,n.geoHomolosine=function(){return r.geoProjection(on).scale(152.63)},n.geoHomolosineRaw=on,n.geoInterrupt=Zr,n.geoInterruptedBoggs=function(){return Zr(m,$r).scale(160.857)},n.geoInterruptedHomolosine=function(){return Zr(on,ne).scale(152.63)},n.geoInterruptedMollweide=function(){return Zr(Lr,re).scale(16 9.529)},n.geoInterruptedMollweideHemispheres=function(){return Zr(Lr,ee).scale(169.529).rotate([20,0])},n.geoInterruptedSinuMollweide=function(){return Zr(tn,te).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},n.geoInterruptedSinusoidal=function(){return Zr(P,oe).scale(152.63).rotate([-20,0])},n.geoKavrayskiy7=function(){return r.geoProjection(cn).scale(158.837)},n.geoKavrayskiy7Raw=cn,n.geoLagrange=function(){var n=.5,e=r.geoProjectionMutator(fn),t=e(n);return t.spacing=function(r){return arguments.length?e(n=+r):n},t.scale(124.75)},n.geoLagrangeRaw=fn,n.geoLarrivee=function(){return r.geoProjection(ln).scale(97.2672)},n.geoLarriveeRaw=ln,n.geoLaskowski=function(){return r.geoProjection(gn).scale(139.98)},n.geoLaskowskiRaw=gn,n.geoLittrow=function(){return r.geoProjection(vn).scale(144.049).clipAngle(89.999)},n.geoLittrowRaw=vn,n.geoLoximuthal=function(){return Hr(sn).parallel(40).scale(158.837)},n.geoLoximuthalRaw=sn,n.geoMiller=function(){return r.geoProjection(pn).scale(10 8.318)},n.geoMillerRaw=pn,n.geoModifiedStereographic=dn,n.geoModifiedStereographicRaw=hn,n.geoModifiedStereographicAlaska=function(){return dn(ue,[152,-64]).scale(1500).center([-160.908,62.4864]).clipAngle(25)},n.geoModifiedStereographicGs48=function(){return dn(ae,[95,-38]).scale(1e3).clipAngle(55).center([-96.5563,38.8675])},n.geoModifiedStereographicGs50=function(){return dn(ce,[120,-45]).scale(359.513).clipAngle(55).center([-117.474,53.0628])},n.geoModifiedStereographicMiller=function(){return dn(fe,[-20,-18]).scale(209.091).center([20,16.7214]).clipAngle(82)},n.geoModifiedStereographicLee=function(){return dn(le,[165,10]).scale(250).clipAngle(130).center([-165,-10])},n.geoMollweide=function(){return r.geoProjection(Lr).scale(169.529)},n.geoMollweideRaw=Lr,n.geoMtFlatPolarParabolic=function(){return r.geoProjection(wn).scale(164.859)},n.geoMtFlatPolarParabolicRaw=wn,n.geoMtFlatPolarQuartic=function(){return r.geoProjection(yn).scale(188.209)},n.geoMtFlatPolarQuarticRaw=yn,n.geoM tFlatPolarSinusoidal=function(){return r.geoProjection(mn).scale(166.518)},n.geoMtFlatPolarSinusoidalRaw=mn,n.geoNaturalEarth=r.geoNaturalEarth1,n.geoNaturalEarthRaw=r.geoNaturalEarth1Raw,n.geoNaturalEarth2=function(){return r.geoProjection(Pn).scale(175.295)},n.geoNaturalEarth2Raw=Pn,n.geoNellHammer=function(){return r.geoProjection(Rn).scale(152.63)},n.geoNellHammerRaw=Rn,n.geoPatterson=function(){return r.geoProjection(bn).scale(139.319)},n.geoPattersonRaw=bn,n.geoPolyconic=function(){return r.geoProjection(jn).scale(103.74)},n.geoPolyconicRaw=jn,n.geoPolyhedral=je,n.geoPolyhedralButterfly=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=Ee.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])}),je(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])},n.geoPolyhedralCollignon=function(n){n=n||function(n){var e=r.geoCentroid({type:"MultiPoint",coordinates:n});return r.geoProjection(Gn).translate([0,0]).scale(1).rotate(e[1]>0?[-e[0],0]:[180-e[0],180])};var e=Ee.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])}),je(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])},n.geoPolyhedralWaterman=function(n){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 e=Ee.map(function(n){for(var r,e=n.map(Fn),t=e.length,o=e[t-1],i=[],u=0;u<t;++u)r=e[u],i.push(zn([.9486832980505138*o[0]+.31622776601683794*r[0],.9486832980505138*o[1]+.31622776601683794*r[1],.9486832980505138*o[2]+.31622776601683794*r[2]]),zn([.9486832980505138*r[0]+.316227766 01683794*o[0],.9486832980505138*r[1]+.31622776601683794*o[1],.9486832980505138*r[2]+.31622776601683794*o[2]])),o=r;return i}),t=[],o=[-1,0,0,1,0,1,4,5];e.forEach(function(n,r){for(var i=Ee[r],u=i.length,a=t[r]=[],c=0;c<u;++c)e.push([i[c],n[(2*c+2)%(2*u)],n[(2*c+1)%(2*u)]]),o.push(r),a.push(function(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]]}(Fn(n[(2*c+2)%(2*u)]),Fn(n[(2*c+1)%(2*u)])))});var i=e.map(function(r){return{project:n(r),face:r}});return o.forEach(function(n,r){var e=i[n];e&&(e.children||(e.children=[])).push(i[r])}),je(i[0],function(n,r){var e=lr(r),o=[e*lr(n),e*mr(n),mr(r)],u=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=t[u];return i[Cn(a[0],o)<0?8+3*u:Cn(a[1],o)<0?8+3*u+1:Cn(a[2],o)<0?8+3*u+2:u]}).scale(110.625).center([0,45])},n.geoProject=function(n,r){var e,t=r.stream;if(!t)throw new Error("invalid projection");switch(n&&n.type){case"Feature":e=qn;break;case"FeatureCollection":e=Ln;break;default:e=Bn}return e(n,t)},n.geoGringorten Quincuncial=function(){return Fe(J).scale(176.423)},n.geoPeirceQuincuncial=Le,n.geoPierceQuincuncial=Le,n.geoQuantize=function(n,r){function e(n){var e=n.length,t=2,o=new Array(e);for(o[0]=+n[0].toFixed(r),o[1]=+n[1].toFixed(r);t<e;)o[t]=n[t],++t;return o}function t(n){return n.map(e)}function o(n){return n.map(t)}function i(n){if(null==n)return n;var r;switch(n.type){case"GeometryCollection":r={type:"GeometryCollection",geometries:n.geometries.map(i)};break;case"Point":r={type:"Point",coordinates:e(n.coordinates)};break;case"MultiPoint":case"LineString":r={type:n.type,coordinates:t(n.coordinates)};break;case"MultiLineString":case"Polygon":r={type:n.type,coordinates:o(n.coordinates)};break;case"MultiPolygon":r={type:"MultiPolygon",coordinates:n.coordinates.map(o)};break;default:return n}return null!=n.bbox&&(r.bbox=n.bbox),r}function u(n){var r={type:"Feature",properties:n.properties,geometry:i(n.geometry)};return null!=n.id&&(r.id=n.id),null!=n.bbox&&(r.bbox=n.bbox),r}if(!(0<=(r=+r )&&r<=20))throw new Error("invalid digits");if(null!=n)switch(n.type){case"Feature":return u(n);case"FeatureCollection":var a={type:"FeatureCollection",features:n.features.map(u)};return null!=n.bbox&&(a.bbox=n.bbox),a;default:return i(n)}return n},n.geoQuincuncial=Fe,n.geoRectangularPolyconic=function(){return Hr(Hn).scale(131.215)},n.geoRectangularPolyconicRaw=Hn,n.geoRobinson=function(){return r.geoProjection(In).scale(152.63)},n.geoRobinsonRaw=In,n.geoSatellite=function(){var n=2,e=0,t=r.geoProjectionMutator(Wn),i=t(n,e);return i.distance=function(r){return arguments.length?t(n=+r,e):n},i.tilt=function(r){return arguments.length?t(n,e=r*Cr):e*Gr},i.scale(432.147).clipAngle(o(1/n)*Gr-1e-6)},n.geoSatelliteRaw=Wn,n.geoSinuMollweide=function(){return r.geoProjection(tn).rotate([-20,-55]).scale(164.263).center([0,-5.4036])},n.geoSinuMollweideRaw=tn,n.geoSinusoidal=function(){return r.geoProjection(P).scale(152.63)},n.geoSinusoidalRaw=P,n.geoStitch=function(n){if(null==n)return n;swit ch(n.type){case"Feature":return Kn(n);case"FeatureCollection":var r={type:"FeatureCollection",features:n.features.map(Kn)};return null!=n.bbox&&(r.bbox=n.bbox),r;default:return On(n)}},n.geoTimes=function(){return r.geoProjection(Un).scale(146.153)},n.geoTimesRaw=Un,n.geoTwoPointAzimuthal=Xn,n.geoTwoPointAzimuthalRaw=Jn,n.geoTwoPointAzimuthalUsa=function(){return Xn([-158,21.5],[-77,39]).clipAngle(60).scale(400)},n.geoTwoPointEquidistant=Zn,n.geoTwoPointEquidistantRaw=Yn,n.geoTwoPointEquidistantUsa=function(){return Zn([-158,21.5],[-77,39]).clipAngle(130).scale(122.571)},n.geoVanDerGrinten=function(){return r.geoProjection($n).scale(79.4183)},n.geoVanDerGrintenRaw=$n,n.geoVanDerGrinten2=function(){return r.geoProjection(nr).scale(79.4183)},n.geoVanDerGrinten2Raw=nr,n.geoVanDerGrinten3=function(){return r.geoProjection(rr).scale(79.4183)},n.geoVanDerGrinten3Raw=rr,n.geoVanDerGrinten4=function(){return r.geoProjection(er).scale(127.16)},n.geoVanDerGrinten4Raw=er,n.geoWagner4=function( ){return r.geoProjection(Ue).scale(176.84)},n.geoWagner4Raw=Ue,n.geoWagner6=function(){return r.geoProjection(tr).scale(152.63)},n.geoWagner6Raw=tr,n.geoWagner7=function(){return r.geoProjection(or).scale(172.632)},n.geoWagner7Raw=or,n.geoWiechel=function(){return r.geoProjection(ir).rotate([0,-90,45]).scale(124.75).clipAngle(179.999)},n.geoWiechelRaw=ir,n.geoWinkel3=function(){return r.geoProjection(ur).scale(158.837)},n.geoWinkel3Raw=ur,Object.defineProperty(n,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/js/libs/d3js/d3-geo.v1.min.js b/js/libs/d3js/d3-geo.v1.min.js new file mode 100644 index 0000000..eb0e79d --- /dev/null +++ b/js/libs/d3js/d3-geo.v1.min.js @@ -0,0 +1,2 @@ +// https://d3js.org/d3-geo/ Version 1.9.1. Copyright 2017 Mike Bostock. +!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-array")):"function"==typeof define&&define.amd?define(["exports","d3-array"],t):t(n.d3=n.d3||{},n.d3)}(this,function(n,t){"use strict";function r(){this.reset()}function i(n,t,r){var i=n.s=t+r,e=i-t,o=i-e;n.t=t-o+(r-e)}function e(n){return n>1?0:n<-1?Gt:Math.acos(n)}function o(n){return n>1?Tt:n<-1?-Tt:Math.asin(n)}function u(n){return(n=Kt(n/2))*n}function c(){}function a(n,t){n&&tr.hasOwnProperty(n.type)&&tr[n.type](n,t)}function l(n,t,r){var i,e=-1,o=n.length-r;for(t.lineStart();++e<o;)i=n[e],t.point(i[0],i[1],i[2]);t.lineEnd()}function f(n,t){var r=-1,i=n.length;for(t.polygonStart();++r<i;)l(n[r],t,1);t.polygonEnd()}function s(){or.point=h}function p(){g(it,et)}function h(n,t){or.point=g,it=n,et=t,ot=n*=It,ut=Ut(t=(t*=It)/2+kt),ct=Kt(t)}function g(n,t){t=(t*=It)/2+kt;var r=(n*=It)-ot,i=r>=0?1:-1,e=i*r,o=Ut(t),u=Kt(t),c=ct*u,a=ut*o+c*Ut(e),l=c*i*Kt(e);ir.add(Dt(l,a)),ot=n,ut=o,ct=u}function v(n){return[Dt(n[1],n[0]),o(n[2])]}function d(n){var t=n[0],r=n[1],i=Ut(r);return[i*Ut(t),i*Kt(t),Kt(r)]}function E(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function y(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function S(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function m(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function M(n){var t=Vt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function x(n,t){dt.push(Et=[at=n,ft=n]),t<lt&&(lt=t),t>st&&(st=t)}function _(n,t){var r=d([n*It,t*It]);if(vt){var i=y(vt,r),e=y([i[1],-i[0],0],i);M(e),e=v(e);var o,u=n-pt,c=u>0?1:-1,a=e[0]*Ht*c,l=Wt(u)>180;l^(c*pt<a&&a<c*n)?(o=e[1]*Ht)>st&&(st=o):(a=(a+360)%360-180,l^(c*pt<a&&a<c*n)?(o=-e[1]*Ht)<lt&&(lt=o):(t<lt&&(lt=t),t>st&&(st=t))),l?n<pt?A(at,n)>A(at,ft)&&(ft=n):A(n,ft)>A(at,ft)&&(at=n):ft>=at?(n<at&&(at=n),n>ft&&(ft=n)):n>pt?A(at,n)>A(at,ft)&&(ft=n):A(n,ft)>A(at,ft)&&(at=n)}else dt.push(Et=[at=n,ft=n]);t<lt&&(lt=t),t>st&&(st=t),vt=r,pt=n}function N(){cr.point=_}function w (){Et[0]=at,Et[1]=ft,cr.point=x,vt=null}function C(n,t){if(vt){var r=n-pt;ur.add(Wt(r)>180?r+(r>0?360:-360):r)}else ht=n,gt=t;or.point(n,t),_(n,t)}function P(){or.lineStart()}function R(){C(ht,gt),or.lineEnd(),Wt(ur)>Ot&&(at=-(ft=180)),Et[0]=at,Et[1]=ft,vt=null}function A(n,t){return(t-=n)<0?t+360:t}function j(n,t){return n[0]-t[0]}function q(n,t){return n[0]<=n[1]?n[0]<=t&&t<=n[1]:t<n[0]||n[1]<t}function z(n,t){n*=It;var r=Ut(t*=It);b(r*Ut(n),r*Kt(n),Kt(t))}function b(n,t,r){mt+=(n-mt)/++yt,Mt+=(t-Mt)/yt,xt+=(r-xt)/yt}function L(){ar.point=O}function O(n,t){n*=It;var r=Ut(t*=It);qt=r*Ut(n),zt=r*Kt(n),bt=Kt(t),ar.point=G,b(qt,zt,bt)}function G(n,t){n*=It;var r=Ut(t*=It),i=r*Ut(n),e=r*Kt(n),o=Kt(t),u=Dt(Vt((u=zt*o-bt*e)*u+(u=bt*i-qt*o)*u+(u=qt*e-zt*i)*u),qt*i+zt*e+bt*o);St+=u,_t+=u*(qt+(qt=i)),Nt+=u*(zt+(zt=e)),wt+=u*(bt+(bt=o)),b(qt,zt,bt)}function T(){ar.point=z}function k(){ar.point=H}function F(){I(At,jt),ar.point=z}function H(n,t){At=n,jt=t,n*=It,t*=It,ar.point=I;var r=Ut(t);qt= r*Ut(n),zt=r*Kt(n),bt=Kt(t),b(qt,zt,bt)}function I(n,t){n*=It;var r=Ut(t*=It),i=r*Ut(n),e=r*Kt(n),u=Kt(t),c=zt*u-bt*e,a=bt*i-qt*u,l=qt*e-zt*i,f=Vt(c*c+a*a+l*l),s=o(f),p=f&&-s/f;Ct+=p*c,Pt+=p*a,Rt+=p*l,St+=s,_t+=s*(qt+(qt=i)),Nt+=s*(zt+(zt=e)),wt+=s*(bt+(bt=u)),b(qt,zt,bt)}function W(n,t){return[n>Gt?n-Ft:n<-Gt?n+Ft:n,t]}function B(n,t,r){return(n%=Ft)?t||r?fr(U(n),X(t,r)):U(n):t||r?X(t,r):W}function D(n){return function(t,r){return t+=n,[t>Gt?t-Ft:t<-Gt?t+Ft:t,r]}}function U(n){var t=D(n);return t.invert=D(-n),t}function X(n,t){function r(n,t){var r=Ut(t),a=Ut(n)*r,l=Kt(n)*r,f=Kt(t),s=f*i+a*e;return[Dt(l*u-s*c,a*i-f*e),o(s*u+l*c)]}var i=Ut(n),e=Kt(n),u=Ut(t),c=Kt(t);return r.invert=function(n,t){var r=Ut(t),a=Ut(n)*r,l=Kt(n)*r,f=Kt(t),s=f*u-l*c;return[Dt(l*u+f*c,a*i+s*e),o(s*i-a*e)]},r}function Y(n,t,r,i,e,o){if(r){var u=Ut(t),c=Kt(t),a=i*r;null==e?(e=t+i*Ft,o=t-a/2):(e=Z(u,e),o=Z(u,o),(i>0?e<o:e>o)&&(e+=i*Ft));for(var l,f=e;i>0?f>o:f<o;f-=a)l=v([u,-c*Ut(f),-c*Kt(f)]),n.point(l[0],l [1])}}function Z(n,t){(t=d(t))[0]-=n,M(t);var r=e(-t[1]);return((-t[2]<0?-r:r)+Ft-Ot)%Ft}function J(n,t,r,i){this.x=n,this.z=t,this.o=r,this.e=i,this.v=!1,this.n=this.p=null}function K(n){if(t=n.length){for(var t,r,i=0,e=n[0];++i<t;)e.n=r=n[i],r.p=e,e=r;e.n=r=n[0],r.p=e}}function Q(n){return n.length>1}function V(n,t){return((n=n.x)[0]<0?n[1]-Tt-Ot:Tt-n[1])-((t=t.x)[0]<0?t[1]-Tt-Ot:Tt-t[1])}function $(n,r,i,e){function o(t,o){return n<=t&&t<=i&&r<=o&&o<=e}function u(t,o,u,a){var f=0,s=0;if(null==t||(f=c(t,u))!==(s=c(o,u))||l(t,o)<0^u>0)do{a.point(0===f||3===f?n:i,f>1?e:r)}while((f=(f+u+4)%4)!==s);else a.point(o[0],o[1])}function c(t,e){return Wt(t[0]-n)<Ot?e>0?0:3:Wt(t[0]-i)<Ot?e>0?2:1:Wt(t[1]-r)<Ot?e>0?1:0:e>0?3:2}function a(n,t){return l(n.x,t.x)}function l(n,t){var r=c(n,1),i=c(t,1);return r!==i?r-i:0===r?t[1]-n[1]:1===r?n[0]-t[0]:2===r?n[1]-t[1]:t[0]-n[0]}return function(c){function l(n,t){o(n,t)&&x.point(n,t)}function f(t,u){var c=o(t,u);if(p&&h.push([t,u]),m)g=t,v=u,d=c,m=!1,c &&(x.lineStart(),x.point(t,u));else if(c&&S)x.point(t,u);else{var a=[E=Math.max(br,Math.min(zr,E)),y=Math.max(br,Math.min(zr,y))],l=[t=Math.max(br,Math.min(zr,t)),u=Math.max(br,Math.min(zr,u))];qr(a,l,n,r,i,e)?(S||(x.lineStart(),x.point(a[0],a[1])),x.point(l[0],l[1]),c||x.lineEnd(),M=!1):c&&(x.lineStart(),x.point(t,u),M=!1)}E=t,y=u,S=c}var s,p,h,g,v,d,E,y,S,m,M,x=c,_=_r(),N={point:l,lineStart:function(){N.point=f,p&&p.push(h=[]),m=!0,S=!1,E=y=NaN},lineEnd:function(){s&&(f(g,v),d&&S&&_.rejoin(),s.push(_.result())),N.point=l,S&&x.lineEnd()},polygonStart:function(){x=_,s=[],p=[],M=!0},polygonEnd:function(){var r=function(){for(var t=0,r=0,i=p.length;r<i;++r)for(var o,u,c=p[r],a=1,l=c.length,f=c[0],s=f[0],h=f[1];a<l;++a)o=s,u=h,s=(f=c[a])[0],h=f[1],u<=e?h>e&&(s-o)*(e-u)>(h-u)*(n-o)&&++t:h<=e&&(s-o)*(e-u)<(h-u)*(n-o)&&--t;return t}(),i=M&&r,o=(s=t.merge(s)).length;(i||o)&&(c.polygonStart(),i&&(c.lineStart(),u(null,null,1,c),c.lineEnd()),o&&wr(s,a,r,u,c),c.polygonEnd()),x=c,s=p=h=null}};r eturn N}}function nn(){Or.point=Or.lineEnd=c}function tn(n,t){sr=n*=It,pr=Kt(t*=It),hr=Ut(t),Or.point=rn}function rn(n,t){n*=It;var r=Kt(t*=It),i=Ut(t),e=Wt(n-sr),o=Ut(e),u=i*Kt(e),c=hr*r-pr*i*o,a=pr*r+hr*i*o;Lr.add(Dt(Vt(u*u+c*c),a)),sr=n,pr=r,hr=i}function en(n,t){return!(!n||!Ir.hasOwnProperty(n.type))&&Ir[n.type](n,t)}function on(n,t){return 0===Fr(n,t)}function un(n,t){var r=Fr(n[0],n[1]);return Fr(n[0],t)+Fr(t,n[1])<=r+Ot}function cn(n,t){return!!Pr(n.map(an),ln(t))}function an(n){return(n=n.map(ln)).pop(),n}function ln(n){return[n[0]*It,n[1]*It]}function fn(n,r,i){var e=t.range(n,r-Ot,i).concat(r);return function(n){return e.map(function(t){return[n,t]})}}function sn(n,r,i){var e=t.range(n,r-Ot,i).concat(r);return function(n){return e.map(function(t){return[t,n]})}}function pn(){function n(){return{type:"MultiLineString",coordinates:r()}}function r(){return t.range(Xt(u/E)*E,o,E).map(h).concat(t.range(Xt(f/y)*y,l,y).map(g)).concat(t.range(Xt(e/v)*v,i,v).filter(function(n){ret urn Wt(n%E)>Ot}).map(s)).concat(t.range(Xt(a/d)*d,c,d).filter(function(n){return Wt(n%y)>Ot}).map(p))}var i,e,o,u,c,a,l,f,s,p,h,g,v=10,d=v,E=90,y=360,S=2.5;return n.lines=function(){return r().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(u).concat(g(l).slice(1),h(o).reverse().slice(1),g(f).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.extentMajor(t).extentMinor(t):n.extentMinor()},n.extentMajor=function(t){return arguments.length?(u=+t[0][0],o=+t[1][0],f=+t[0][1],l=+t[1][1],u>o&&(t=u,u=o,o=t),f>l&&(t=f,f=l,l=t),n.precision(S)):[[u,f],[o,l]]},n.extentMinor=function(t){return arguments.length?(e=+t[0][0],i=+t[1][0],a=+t[0][1],c=+t[1][1],e>i&&(t=e,e=i,i=t),a>c&&(t=a,a=c,c=t),n.precision(S)):[[e,a],[i,c]]},n.step=function(t){return arguments.length?n.stepMajor(t).stepMinor(t):n.stepMinor()},n.stepMajor=function(t){return arguments.length?(E=+t[0],y=+t[1],n):[E,y]},n.stepMinor=function(t){retu rn arguments.length?(v=+t[0],d=+t[1],n):[v,d]},n.precision=function(t){return arguments.length?(S=+t,s=fn(a,c,90),p=sn(e,i,S),h=fn(f,l,90),g=sn(u,o,S),n):S},n.extentMajor([[-180,-90+Ot],[180,90-Ot]]).extentMinor([[-180,-80-Ot],[180,80+Ot]])}function hn(){Ur.point=gn}function gn(n,t){Ur.point=vn,gr=dr=n,vr=Er=t}function vn(n,t){Dr.add(Er*n-dr*t),dr=n,Er=t}function dn(){vn(gr,vr)}function En(n,t){Qr+=n,Vr+=t,++$r}function yn(){ui.point=Sn}function Sn(n,t){ui.point=mn,En(mr=n,Mr=t)}function mn(n,t){var r=n-mr,i=t-Mr,e=Vt(r*r+i*i);ni+=e*(mr+n)/2,ti+=e*(Mr+t)/2,ri+=e,En(mr=n,Mr=t)}function Mn(){ui.point=En}function xn(){ui.point=Nn}function _n(){wn(yr,Sr)}function Nn(n,t){ui.point=wn,En(yr=mr=n,Sr=Mr=t)}function wn(n,t){var r=n-mr,i=t-Mr,e=Vt(r*r+i*i);ni+=e*(mr+n)/2,ti+=e*(Mr+t)/2,ri+=e,ii+=(e=Mr*n-mr*t)*(mr+n),ei+=e*(Mr+t),oi+=3*e,En(mr=n,Mr=t)}function Cn(n){this._context=n}function Pn(n,t){hi.point=Rn,ai=fi=n,li=si=t}function Rn(n,t){fi-=n,si-=t,pi.add(Vt(fi*fi+si*si)),fi=n,si=t}funct ion An(){this._string=[]}function jn(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function qn(n){return function(t){var r=new zn;for(var i in n)r[i]=n[i];return r.stream=t,r}}function zn(){}function bn(n,t,r){var i=n.clipExtent&&n.clipExtent();return n.scale(150).translate([0,0]),null!=i&&n.clipExtent(null),rr(r,n.stream(Kr)),t(Kr.result()),null!=i&&n.clipExtent(i),n}function Ln(n,t,r){return bn(n,function(r){var i=t[1][0]-t[0][0],e=t[1][1]-t[0][1],o=Math.min(i/(r[1][0]-r[0][0]),e/(r[1][1]-r[0][1])),u=+t[0][0]+(i-o*(r[1][0]+r[0][0]))/2,c=+t[0][1]+(e-o*(r[1][1]+r[0][1]))/2;n.scale(150*o).translate([u,c])},r)}function On(n,t,r){return Ln(n,[[0,0],t],r)}function Gn(n,t,r){return bn(n,function(r){var i=+t,e=i/(r[1][0]-r[0][0]),o=(i-e*(r[1][0]+r[0][0]))/2,u=-e*r[0][1];n.scale(150*e).translate([o,u])},r)}function Tn(n,t,r){return bn(n,function(r){var i=+t,e=i/(r[1][1]-r[0][1]),o=-e*r[0][0],u=(i-e*(r[1][1]+r[0][1]))/2;n.scale(150*e).translate([o,u])},r)}fun ction kn(n){return Fn(function(){return n})()}function Fn(n){function t(n){return n=l(n[0]*It,n[1]*It),[n[0]*v+u,c-n[1]*v]}function r(n,t){return n=o(n,t),[n[0]*v+u,c-n[1]*v]}function i(){l=fr(a=B(m,M,x),o);var n=o(y,S);return u=d-n[0]*v,c=E+n[1]*v,e()}function e(){return h=g=null,t}var o,u,c,a,l,f,s,p,h,g,v=150,d=480,E=250,y=0,S=0,m=0,M=0,x=0,_=null,N=Ar,w=null,C=Wr,P=.5,R=di(r,P);return t.stream=function(n){return h&&g===n?h:h=Ei(function(n){return qn({point:function(t,r){var i=n(t,r);return this.stream.point(i[0],i[1])}})}(a)(N(R(C(g=n)))))},t.preclip=function(n){return arguments.length?(N=n,_=void 0,e()):N},t.postclip=function(n){return arguments.length?(C=n,w=f=s=p=null,e()):C},t.clipAngle=function(n){return arguments.length?(N=+n?jr(_=n*It):(_=null,Ar),e()):_*Ht},t.clipExtent=function(n){return arguments.length?(C=null==n?(w=f=s=p=null,Wr):$(w=+n[0][0],f=+n[0][1],s=+n[1][0],p=+n[1][1]),e()):null==w?null:[[w,f],[s,p]]},t.scale=function(n){return arguments.length?(v=+n,i()):v},t .translate=function(n){return arguments.length?(d=+n[0],E=+n[1],i()):[d,E]},t.center=function(n){return arguments.length?(y=n[0]%360*It,S=n[1]%360*It,i()):[y*Ht,S*Ht]},t.rotate=function(n){return arguments.length?(m=n[0]%360*It,M=n[1]%360*It,x=n.length>2?n[2]%360*It:0,i()):[m*Ht,M*Ht,x*Ht]},t.precision=function(n){return arguments.length?(R=di(r,P=n*n),e()):Vt(P)},t.fitExtent=function(n,r){return Ln(t,n,r)},t.fitSize=function(n,r){return On(t,n,r)},t.fitWidth=function(n,r){return Gn(t,n,r)},t.fitHeight=function(n,r){return Tn(t,n,r)},function(){return o=n.apply(this,arguments),t.invert=o.invert&&function(n){return(n=l.invert((n[0]-u)/v,(c-n[1])/v))&&[n[0]*Ht,n[1]*Ht]},i()}}function Hn(n){var t=0,r=Gt/3,i=Fn(n),e=i(t,r);return e.parallels=function(n){return arguments.length?i(t=n[0]*It,r=n[1]*It):[t*Ht,r*Ht]},e}function In(n,t){function r(n,t){var r=Vt(u-2*e*Kt(t))/e;return[r*Kt(n*=e),c-r*Ut(n)]}var i=Kt(n),e=(i+Kt(t))/2;if(Wt(e)<Ot)return function(n){function t(n,t){return[n*r,Kt(t) /r]}var r=Ut(n);return t.invert=function(n,t){return[n/r,o(t*r)]},t}(n);var u=1+i*(2*e-i),c=Vt(u)/e;return r.invert=function(n,t){var r=c-t;return[Dt(n,Wt(r))/e*Qt(r),o((u-(n*n+r*r)*e*e)/(2*e))]},r}function Wn(n){return function(t,r){var i=Ut(t),e=Ut(r),o=n(i*e);return[o*e*Kt(t),o*Kt(r)]}}function Bn(n){return function(t,r){var i=Vt(t*t+r*r),e=n(i),u=Kt(e),c=Ut(e);return[Dt(t*u,i*c),o(i&&r*u/i)]}}function Dn(n,t){return[n,Zt($t((Tt+t)/2))]}function Un(n){function t(){var t=Gt*c(),u=o(xr(o.rotate()).invert([0,0]));return l(null==f?[[u[0]-t,u[1]-t],[u[0]+t,u[1]+t]]:n===Dn?[[Math.max(u[0]-t,f),r],[Math.min(u[0]+t,i),e]]:[[f,Math.max(u[1]-t,r)],[i,Math.min(u[1]+t,e)]])}var r,i,e,o=kn(n),u=o.center,c=o.scale,a=o.translate,l=o.clipExtent,f=null;return o.scale=function(n){return arguments.length?(c(n),t()):c()},o.translate=function(n){return arguments.length?(a(n),t()):a()},o.center=function(n){return arguments.length?(u(n),t()):u()},o.clipExtent=function(n){return arguments.length?(null== n?f=r=i=e=null:(f=+n[0][0],r=+n[0][1],i=+n[1][0],e=+n[1][1]),t()):null==f?null:[[f,r],[i,e]]},t()}function Xn(n){return $t((Tt+n)/2)}function Yn(n,t){function r(n,t){o>0?t<-Tt+Ot&&(t=-Tt+Ot):t>Tt-Ot&&(t=Tt-Ot);var r=o/Jt(Xn(t),e);return[r*Kt(e*n),o-r*Ut(e*n)]}var i=Ut(n),e=n===t?Kt(n):Zt(i/Ut(t))/Zt(Xn(t)/Xn(n)),o=i*Jt(Xn(n),e)/e;return e?(r.invert=function(n,t){var r=o-t,i=Qt(e)*Vt(n*n+r*r);return[Dt(n,Wt(r))/e*Qt(r),2*Bt(Jt(o/i,1/e))-Tt]},r):Dn}function Zn(n,t){return[n,t]}function Jn(n,t){function r(n,t){var r=o-t,i=e*n;return[r*Kt(i),o-r*Ut(i)]}var i=Ut(n),e=n===t?Kt(n):(i-Ut(t))/(t-n),o=i/e+n;return Wt(e)<Ot?Zn:(r.invert=function(n,t){var r=o-t;return[Dt(n,Wt(r))/e*Qt(r),o-Qt(e)*Vt(n*n+r*r)]},r)}function Kn(n,t){var r=Ut(t),i=Ut(n)*r;return[r*Kt(n)/i,Kt(t)/i]}function Qn(n,t,r,i){return 1===n&&1===t&&0===r&&0===i?Wr:qn({point:function(e,o){this.stream.point(e*n+r,o*t+i)}})}function Vn(n,t){var r=t*t,i=r*r;return[n*(.8707-.131979*r+i*(i*(.003971*r-.001529*i)-.013791)),t*(1.00722 6+r*(.015085+i*(.028874*r-.044475-.005916*i)))]}function $n(n,t){return[Ut(t)*Kt(n),Kt(t)]}function nt(n,t){var r=Ut(t),i=1+Ut(n)*r;return[r*Kt(n)/i,Kt(t)/i]}function tt(n,t){return[Zt($t((Tt+t)/2)),-n]}var rt=function(){return new r};r.prototype={constructor:r,reset:function(){this.s=this.t=0},add:function(n){i(Lt,n,this.t),i(this,Lt.s,this.s),this.s?this.t+=Lt.t:this.s=Lt.t},valueOf:function(){return this.s}};var it,et,ot,ut,ct,at,lt,ft,st,pt,ht,gt,vt,dt,Et,yt,St,mt,Mt,xt,_t,Nt,wt,Ct,Pt,Rt,At,jt,qt,zt,bt,Lt=new r,Ot=1e-6,Gt=Math.PI,Tt=Gt/2,kt=Gt/4,Ft=2*Gt,Ht=180/Gt,It=Gt/180,Wt=Math.abs,Bt=Math.atan,Dt=Math.atan2,Ut=Math.cos,Xt=Math.ceil,Yt=Math.exp,Zt=Math.log,Jt=Math.pow,Kt=Math.sin,Qt=Math.sign||function(n){return n>0?1:n<0?-1:0},Vt=Math.sqrt,$t=Math.tan,nr={Feature:function(n,t){a(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i<e;)a(r[i].geometry,t)}},tr={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n [1],n[2])},MultiPoint:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)n=r[i],t.point(n[0],n[1],n[2])},LineString:function(n,t){l(n.coordinates,t,0)},MultiLineString:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)l(r[i],t,0)},Polygon:function(n,t){f(n.coordinates,t)},MultiPolygon:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)f(r[i],t)},GeometryCollection:function(n,t){for(var r=n.geometries,i=-1,e=r.length;++i<e;)a(r[i],t)}},rr=function(n,t){n&&nr.hasOwnProperty(n.type)?nr[n.type](n,t):a(n,t)},ir=rt(),er=rt(),or={point:c,lineStart:c,lineEnd:c,polygonStart:function(){ir.reset(),or.lineStart=s,or.lineEnd=p},polygonEnd:function(){var n=+ir;er.add(n<0?Ft+n:n),this.lineStart=this.lineEnd=this.point=c},sphere:function(){er.add(Ft)}},ur=rt(),cr={point:x,lineStart:N,lineEnd:w,polygonStart:function(){cr.point=C,cr.lineStart=P,cr.lineEnd=R,ur.reset(),or.polygonStart()},polygonEnd:function(){or.polygonEnd(),cr.point=x,cr.lineStart=N,cr.lineEnd=w,ir<0?(a t=-(ft=180),lt=-(st=90)):ur>Ot?st=90:ur<-Ot&&(lt=-90),Et[0]=at,Et[1]=ft}},ar={sphere:c,point:z,lineStart:L,lineEnd:T,polygonStart:function(){ar.lineStart=k,ar.lineEnd=F},polygonEnd:function(){ar.lineStart=L,ar.lineEnd=T}},lr=function(n){return function(){return n}},fr=function(n,t){function r(r,i){return r=n(r,i),t(r[0],r[1])}return n.invert&&t.invert&&(r.invert=function(r,i){return(r=t.invert(r,i))&&n.invert(r[0],r[1])}),r};W.invert=W;var sr,pr,hr,gr,vr,dr,Er,yr,Sr,mr,Mr,xr=function(n){function t(t){return t=n(t[0]*It,t[1]*It),t[0]*=Ht,t[1]*=Ht,t}return n=B(n[0]*It,n[1]*It,n.length>2?n[2]*It:0),t.invert=function(t){return t=n.invert(t[0]*It,t[1]*It),t[0]*=Ht,t[1]*=Ht,t},t},_r=function(){var n,t=[];return{point:function(t,r){n.push([t,r])},lineStart:function(){t.push(n=[])},lineEnd:c,rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))},result:function(){var r=t;return t=[],n=null,r}}},Nr=function(n,t){return Wt(n[0]-t[0])<Ot&&Wt(n[1]-t[1])<Ot},wr=function(n,t,r,i,e){var o,u,c=[],a=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,r,i=n[0],u=n[t];if(Nr(i,u)){for(e.lineStart(),o=0;o<t;++o)e.point((i=n[o])[0],i[1]);e.lineEnd()}else c.push(r=new J(i,n,null,!0)),a.push(r.o=new J(i,null,r,!1)),c.push(r=new J(u,n,null,!1)),a.push(r.o=new J(u,null,r,!0))}}),c.length){for(a.sort(t),K(c),K(a),o=0,u=a.length;o<u;++o)a[o].e=r=!r;for(var l,f,s=c[0];;){for(var p=s,h=!0;p.v;)if((p=p.n)===s)return;l=p.z,e.lineStart();do{if(p.v=p.o.v=!0,p.e){if(h)for(o=0,u=l.length;o<u;++o)e.point((f=l[o])[0],f[1]);else i(p.x,p.n.x,1,e);p=p.n}else{if(h)for(l=p.p.z,o=l.length-1;o>=0;--o)e.point((f=l[o])[0],f[1]);else i(p.x,p.p.x,-1,e);p=p.p}l=(p=p.o).z,h=!h}while(!p.v);e.lineEnd()}}},Cr=rt(),Pr=function(n,t){var r=t[0],i=t[1],e=[Kt(r),-Ut(r),0],u=0,c=0;Cr.reset();for(var a=0,l=n.length;a<l;++a)if(s=(f=n[a]).length)for(var f,s,p=f[s-1],h=p[0],g=p[1]/2+kt,v=Kt(g),E=Ut(g),S=0;S<s;++S,h=x,v=N,E=w,p=m){var m=f[S],x=m[0],_=m[1]/2+kt,N=Kt(_),w=Ut(_),C=x-h,P=C>=0?1:-1,R=P*C,A=R>Gt, j=v*N;if(Cr.add(Dt(j*P*Kt(R),E*w+j*Ut(R))),u+=A?C+P*Ft:C,A^h>=r^x>=r){var q=y(d(p),d(m));M(q);var z=y(e,q);M(z);var b=(A^C>=0?-1:1)*o(z[2]);(i>b||i===b&&(q[0]||q[1]))&&(c+=A^C>=0?1:-1)}}return(u<-Ot||u<Ot&&Cr<-Ot)^1&c},Rr=function(n,r,i,e){return function(o){function u(t,r){n(t,r)&&o.point(t,r)}function c(n,t){d.point(n,t)}function a(){m.point=c,d.lineStart()}function l(){m.point=u,d.lineEnd()}function f(n,t){v.push([n,t]),y.point(n,t)}function s(){y.lineStart(),v=[]}function p(){f(v[0][0],v[0][1]),y.lineEnd();var n,t,r,i,e=y.clean(),u=E.result(),c=u.length;if(v.pop(),h.push(v),v=null,c)if(1&e){if(r=u[0],(t=r.length-1)>0){for(S||(o.polygonStart(),S=!0),o.lineStart(),n=0;n<t;++n)o.point((i=r[n])[0],i[1]);o.lineEnd()}}else c>1&&2&e&&u.push(u.pop().concat(u.shift())),g.push(u.filter(Q))}var h,g,v,d=r(o),E=_r(),y=r(E),S=!1,m={point:u,lineStart:a,lineEnd:l,polygonStart:function(){m.point=f,m.lineStart=s,m.lineEnd=p,g=[],h=[]},polygonEnd:function(){m.point=u,m.lineStart=a,m.lineEnd=l,g=t. merge(g);var n=Pr(h,e);g.length?(S||(o.polygonStart(),S=!0),wr(g,V,n,i,o)):n&&(S||(o.polygonStart(),S=!0),o.lineStart(),i(null,null,1,o),o.lineEnd()),S&&(o.polygonEnd(),S=!1),g=h=null},sphere:function(){o.polygonStart(),o.lineStart(),i(null,null,1,o),o.lineEnd(),o.polygonEnd()}};return m}},Ar=Rr(function(){return!0},function(n){var t,r=NaN,i=NaN,e=NaN;return{lineStart:function(){n.lineStart(),t=1},point:function(o,u){var c=o>0?Gt:-Gt,a=Wt(o-r);Wt(a-Gt)<Ot?(n.point(r,i=(i+u)/2>0?Tt:-Tt),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(c,i),n.point(o,i),t=0):e!==c&&a>=Gt&&(Wt(r-e)<Ot&&(r-=e*Ot),Wt(o-c)<Ot&&(o-=c*Ot),i=function(n,t,r,i){var e,o,u=Kt(n-r);return Wt(u)>Ot?Bt((Kt(t)*(o=Ut(i))*Kt(r)-Kt(i)*(e=Ut(t))*Kt(n))/(e*o*u)):(t+i)/2}(r,i,o,u),n.point(e,i),n.lineEnd(),n.lineStart(),n.point(c,i),t=0),n.point(r=o,i=u),e=c},lineEnd:function(){n.lineEnd(),r=i=NaN},clean:function(){return 2-t}}},function(n,t,r,i){var e;if(null==n)e=r*Tt,i.point(-Gt,e),i.point(0,e),i.point(Gt,e),i.point(Gt,0) ,i.point(Gt,-e),i.point(0,-e),i.point(-Gt,-e),i.point(-Gt,0),i.point(-Gt,e);else if(Wt(n[0]-t[0])>Ot){var o=n[0]<t[0]?Gt:-Gt;e=r*o/2,i.point(-o,e),i.point(0,e),i.point(o,e)}else i.point(t[0],t[1])},[-Gt,-Tt]),jr=function(n){function t(n,t){return Ut(n)*Ut(t)>e}function r(n,t,r){var i=[1,0,0],o=y(d(n),d(t)),u=E(o,o),c=o[0],a=u-c*c;if(!a)return!r&&n;var l=e*u/a,f=-e*c/a,s=y(i,o),p=m(i,l);S(p,m(o,f));var h=s,g=E(p,h),M=E(h,h),x=g*g-M*(E(p,p)-1);if(!(x<0)){var _=Vt(x),N=m(h,(-g-_)/M);if(S(N,p),N=v(N),!r)return N;var w,C=n[0],P=t[0],R=n[1],A=t[1];P<C&&(w=C,C=P,P=w);var j=P-C,q=Wt(j-Gt)<Ot;if(!q&&A<R&&(w=R,R=A,A=w),q||j<Ot?q?R+A>0^N[1]<(Wt(N[0]-C)<Ot?R:A):R<=N[1]&&N[1]<=A:j>Gt^(C<=N[0]&&N[0]<=P)){var z=m(h,(-g+_)/M);return S(z,p),[N,v(z)]}}}function i(t,r){var i=u?n:Gt-n,e=0;return t<-i?e|=1:t>i&&(e|=2),r<-i?e|=4:r>i&&(e|=8),e}var e=Ut(n),o=6*It,u=e>0,c=Wt(e)>Ot;return Rr(t,function(n){var e,o,a,l,f;return{lineStart:function(){l=a=!1,f=1},point:function(s,p){var h,g=[s,p],v=t(s,p),d=u?v?0 :i(s,p):v?i(s+(s<0?Gt:-Gt),p):0;if(!e&&(l=a=v)&&n.lineStart(),v!==a&&(!(h=r(e,g))||Nr(e,h)||Nr(g,h))&&(g[0]+=Ot,g[1]+=Ot,v=t(g[0],g[1])),v!==a)f=0,v?(n.lineStart(),h=r(g,e),n.point(h[0],h[1])):(h=r(e,g),n.point(h[0],h[1]),n.lineEnd()),e=h;else if(c&&e&&u^v){var E;d&o||!(E=r(g,e,!0))||(f=0,u?(n.lineStart(),n.point(E[0][0],E[0][1]),n.point(E[1][0],E[1][1]),n.lineEnd()):(n.point(E[1][0],E[1][1]),n.lineEnd(),n.lineStart(),n.point(E[0][0],E[0][1])))}!v||e&&Nr(e,g)||n.point(g[0],g[1]),e=g,a=v,o=d},lineEnd:function(){a&&n.lineEnd(),e=null},clean:function(){return f|(l&&a)<<1}}},function(t,r,i,e){Y(e,n,o,i,t,r)},u?[0,-n]:[-Gt,n-Gt])},qr=function(n,t,r,i,e,o){var u,c=n[0],a=n[1],l=0,f=1,s=t[0]-c,p=t[1]-a;if(u=r-c,s||!(u>0)){if(u/=s,s<0){if(u<l)return;u<f&&(f=u)}else if(s>0){if(u>f)return;u>l&&(l=u)}if(u=e-c,s||!(u<0)){if(u/=s,s<0){if(u>f)return;u>l&&(l=u)}else if(s>0){if(u<l)return;u<f&&(f=u)}if(u=i-a,p||!(u>0)){if(u/=p,p<0){if(u<l)return;u<f&&(f=u)}else if(p>0){if(u>f)return;u>l&&(l=u)}if(u =o-a,p||!(u<0)){if(u/=p,p<0){if(u>f)return;u>l&&(l=u)}else if(p>0){if(u<l)return;u<f&&(f=u)}return l>0&&(n[0]=c+l*s,n[1]=a+l*p),f<1&&(t[0]=c+f*s,t[1]=a+f*p),!0}}}}},zr=1e9,br=-zr,Lr=rt(),Or={sphere:c,point:c,lineStart:function(){Or.point=tn,Or.lineEnd=nn},lineEnd:c,polygonStart:c,polygonEnd:c},Gr=function(n){return Lr.reset(),rr(n,Or),+Lr},Tr=[null,null],kr={type:"LineString",coordinates:Tr},Fr=function(n,t){return Tr[0]=n,Tr[1]=t,Gr(kr)},Hr={Feature:function(n,t){return en(n.geometry,t)},FeatureCollection:function(n,t){for(var r=n.features,i=-1,e=r.length;++i<e;)if(en(r[i].geometry,t))return!0;return!1}},Ir={Sphere:function(){return!0},Point:function(n,t){return on(n.coordinates,t)},MultiPoint:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)if(on(r[i],t))return!0;return!1},LineString:function(n,t){return un(n.coordinates,t)},MultiLineString:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)if(un(r[i],t))return!0;return!1},Polygon:function(n,t){return cn(n.co ordinates,t)},MultiPolygon:function(n,t){for(var r=n.coordinates,i=-1,e=r.length;++i<e;)if(cn(r[i],t))return!0;return!1},GeometryCollection:function(n,t){for(var r=n.geometries,i=-1,e=r.length;++i<e;)if(en(r[i],t))return!0;return!1}},Wr=function(n){return n},Br=rt(),Dr=rt(),Ur={point:c,lineStart:c,lineEnd:c,polygonStart:function(){Ur.lineStart=hn,Ur.lineEnd=dn},polygonEnd:function(){Ur.lineStart=Ur.lineEnd=Ur.point=c,Br.add(Wt(Dr)),Dr.reset()},result:function(){var n=Br/2;return Br.reset(),n}},Xr=1/0,Yr=Xr,Zr=-Xr,Jr=Zr,Kr={point:function(n,t){n<Xr&&(Xr=n),n>Zr&&(Zr=n),t<Yr&&(Yr=t),t>Jr&&(Jr=t)},lineStart:c,lineEnd:c,polygonStart:c,polygonEnd:c,result:function(){var n=[[Xr,Yr],[Zr,Jr]];return Zr=Jr=-(Yr=Xr=1/0),n}},Qr=0,Vr=0,$r=0,ni=0,ti=0,ri=0,ii=0,ei=0,oi=0,ui={point:En,lineStart:yn,lineEnd:Mn,polygonStart:function(){ui.lineStart=xn,ui.lineEnd=_n},polygonEnd:function(){ui.point=En,ui.lineStart=yn,ui.lineEnd=Mn},result:function(){var n=oi?[ii/oi,ei/oi]:ri?[ni/ri,ti/ri]:$r?[Qr/$r,Vr/ $r]:[NaN,NaN];return Qr=Vr=$r=ni=ti=ri=ii=ei=oi=0,n}};Cn.prototype={_radius:4.5,pointRadius:function(n){return this._radius=n,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(n,t){switch(this._point){case 0:this._context.moveTo(n,t),this._point=1;break;case 1:this._context.lineTo(n,t);break;default:this._context.moveTo(n+this._radius,t),this._context.arc(n,t,this._radius,0,Ft)}},result:c};var ci,ai,li,fi,si,pi=rt(),hi={point:c,lineStart:function(){hi.point=Pn},lineEnd:function(){ci&&Rn(ai,li),hi.point=c},polygonStart:function(){ci=!0},polygonEnd:function(){ci=null},result:function(){var n=+pi;return pi.reset(),n}};An.prototype={_radius:4.5,_circle:jn(4.5),pointRadius:function(n){return(n=+n)!==this._radius&&(this._radius=n,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},l ineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(n,t){switch(this._point){case 0:this._string.push("M",n,",",t),this._point=1;break;case 1:this._string.push("L",n,",",t);break;default:null==this._circle&&(this._circle=jn(this._radius)),this._string.push("M",n,",",t,this._circle)}},result:function(){if(this._string.length){var n=this._string.join("");return this._string=[],n}return null}};zn.prototype={constructor:zn,point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var gi=16,vi=Ut(30*It),di=function(n,t){return+t?function(n,t){function r(i,e,u,c,a,l,f,s,p,h,g,v,d,E){var y=f-i,S=s-e,m=y*y+S*S;if(m>4*t&&d--){var M=c+h,x=a+g,_=l+v,N=Vt(M*M+x*x+_*_),w=o(_/=N),C=Wt(Wt(_)-1)<Ot||Wt(u-p)<Ot?(u+p) /2:Dt(x,M),P=n(C,w),R=P[0],A=P[1],j=R-i,q=A-e,z=S*j-y*q;(z*z/m>t||Wt((y*j+S*q)/m-.5)>.3||c*h+a*g+l*v<vi)&&(r(i,e,u,c,a,l,R,A,C,M/=N,x/=N,_,d,E),E.point(R,A),r(R,A,C,M,x,_,f,s,p,h,g,v,d,E))}}return function(t){function i(r,i){r=n(r,i),t.point(r[0],r[1])}function e(){y=NaN,_.point=o,t.lineStart()}function o(i,e){var o=d([i,e]),u=n(i,e);r(y,S,E,m,M,x,y=u[0],S=u[1],E=i,m=o[0],M=o[1],x=o[2],gi,t),t.point(y,S)}function u(){_.point=i,t.lineEnd()}function c(){e(),_.point=a,_.lineEnd=l}function a(n,t){o(f=n,t),s=y,p=S,h=m,g=M,v=x,_.point=o}function l(){r(y,S,E,m,M,x,s,p,f,h,g,v,gi,t),_.lineEnd=u,u()}var f,s,p,h,g,v,E,y,S,m,M,x,_={point:i,lineStart:e,lineEnd:u,polygonStart:function(){t.polygonStart(),_.lineStart=c},polygonEnd:function(){t.polygonEnd(),_.lineStart=e}};return _}}(n,t):function(n){return qn({point:function(t,r){t=n(t,r),this.stream.point(t[0],t[1])}})}(n)},Ei=qn({point:function(n,t){this.stream.point(n*It,t*It)}}),yi=function(){return Hn(In).scale(155.424).center([0,33.6442])},S i=function(){return yi().parallels([29.5,45.5]).scale(1070).translate([480,250]).rotate([96,0]).center([-.6,38.7])},mi=Wn(function(n){return Vt(2/(1+n))});mi.invert=Bn(function(n){return 2*o(n/2)});var Mi=Wn(function(n){return(n=e(n))&&n/Kt(n)});Mi.invert=Bn(function(n){return n});Dn.invert=function(n,t){return[n,2*Bt(Yt(t))-Tt]};Zn.invert=Zn;Kn.invert=Bn(Bt);Vn.invert=function(n,t){var r,i=t,e=25;do{var o=i*i,u=o*o;i-=r=(i*(1.007226+o*(.015085+u*(.028874*o-.044475-.005916*u)))-t)/(1.007226+o*(.045255+u*(.259866*o-.311325-.005916*11*u)))}while(Wt(r)>Ot&&--e>0);return[n/(.8707+(o=i*i)*(o*(o*o*o*(.003971-.001529*o)-.013791)-.131979)),i]};$n.invert=Bn(o);nt.invert=Bn(function(n){return 2*Bt(n)});tt.invert=function(n,t){return[-t,2*Bt(Yt(n))-Tt]};n.geoArea=function(n){return er.reset(),rr(n,or),2*er},n.geoBounds=function(n){var t,r,i,e,o,u,c;if(st=ft=-(at=lt=1/0),dt=[],rr(n,cr),r=dt.length){for(dt.sort(j),t=1,o=[i=dt[0]];t<r;++t)q(i,(e=dt[t])[0])||q(i,e[1])?(A(i[0],e[1])>A(i[0],i[1])&&( i[1]=e[1]),A(e[0],i[1])>A(i[0],i[1])&&(i[0]=e[0])):o.push(i=e);for(u=-1/0,t=0,i=o[r=o.length-1];t<=r;i=e,++t)e=o[t],(c=A(i[1],e[0]))>u&&(u=c,at=e[0],ft=i[1])}return dt=Et=null,at===1/0||lt===1/0?[[NaN,NaN],[NaN,NaN]]:[[at,lt],[ft,st]]},n.geoCentroid=function(n){yt=St=mt=Mt=xt=_t=Nt=wt=Ct=Pt=Rt=0,rr(n,ar);var t=Ct,r=Pt,i=Rt,e=t*t+r*r+i*i;return e<1e-12&&(t=_t,r=Nt,i=wt,St<Ot&&(t=mt,r=Mt,i=xt),(e=t*t+r*r+i*i)<1e-12)?[NaN,NaN]:[Dt(r,t)*Ht,o(i/Vt(e))*Ht]},n.geoCircle=function(){function n(){var n=i.apply(this,arguments),c=e.apply(this,arguments)*It,a=o.apply(this,arguments)*It;return t=[],r=B(-n[0]*It,-n[1]*It,0).invert,Y(u,c,a,1),n={type:"Polygon",coordinates:[t]},t=r=null,n}var t,r,i=lr([0,0]),e=lr(90),o=lr(6),u={point:function(n,i){t.push(n=r(n,i)),n[0]*=Ht,n[1]*=Ht}};return n.center=function(t){return arguments.length?(i="function"==typeof t?t:lr([+t[0],+t[1]]),n):i},n.radius=function(t){return arguments.length?(e="function"==typeof t?t:lr(+t),n):e},n.precision=function(t){return ar guments.length?(o="function"==typeof t?t:lr(+t),n):o},n},n.geoClipAntimeridian=Ar,n.geoClipCircle=jr,n.geoClipExtent=function(){var n,t,r,i=0,e=0,o=960,u=500;return r={stream:function(r){return n&&t===r?n:n=$(i,e,o,u)(t=r)},extent:function(c){return arguments.length?(i=+c[0][0],e=+c[0][1],o=+c[1][0],u=+c[1][1],n=t=null,r):[[i,e],[o,u]]}}},n.geoClipRectangle=$,n.geoContains=function(n,t){return(n&&Hr.hasOwnProperty(n.type)?Hr[n.type]:en)(n,t)},n.geoDistance=Fr,n.geoGraticule=pn,n.geoGraticule10=function(){return pn()()},n.geoInterpolate=function(n,t){var r=n[0]*It,i=n[1]*It,e=t[0]*It,c=t[1]*It,a=Ut(i),l=Kt(i),f=Ut(c),s=Kt(c),p=a*Ut(r),h=a*Kt(r),g=f*Ut(e),v=f*Kt(e),d=2*o(Vt(u(c-i)+a*f*u(e-r))),E=Kt(d),y=d?function(n){var t=Kt(n*=d)/E,r=Kt(d-n)/E,i=r*p+t*g,e=r*h+t*v,o=r*l+t*s;return[Dt(e,i)*Ht,Dt(o,Vt(i*i+e*e))*Ht]}:function(){return[r*Ht,i*Ht]};return y.distance=d,y},n.geoLength=Gr,n.geoPath=function(n,t){function r(n){return n&&("function"==typeof o&&e.pointRadius(+o.apply(this,argum ents)),rr(n,i(e))),e.result()}var i,e,o=4.5;return r.area=function(n){return rr(n,i(Ur)),Ur.result()},r.measure=function(n){return rr(n,i(hi)),hi.result()},r.bounds=function(n){return rr(n,i(Kr)),Kr.result()},r.centroid=function(n){return rr(n,i(ui)),ui.result()},r.projection=function(t){return arguments.length?(i=null==t?(n=null,Wr):(n=t).stream,r):n},r.context=function(n){return arguments.length?(e=null==n?(t=null,new An):new Cn(t=n),"function"!=typeof o&&e.pointRadius(o),r):t},r.pointRadius=function(n){return arguments.length?(o="function"==typeof n?n:(e.pointRadius(+n),+n),r):o},r.projection(n).context(t)},n.geoAlbers=Si,n.geoAlbersUsa=function(){function n(n){var t=n[0],r=n[1];return c=null,e.point(t,r),c||(o.point(t,r),c)||(u.point(t,r),c)}function t(){return r=i=null,n}var r,i,e,o,u,c,a=Si(),l=yi().rotate([154,0]).center([-2,58.5]).parallels([55,65]),f=yi().rotate([157,0]).center([-3,19.9]).parallels([8,18]),s={point:function(n,t){c=[n,t]}};return n.invert=function(n){var t=a .scale(),r=a.translate(),i=(n[0]-r[0])/t,e=(n[1]-r[1])/t;return(e>=.12&&e<.234&&i>=-.425&&i<-.214?l:e>=.166&&e<.234&&i>=-.214&&i<-.115?f:a).invert(n)},n.stream=function(n){return r&&i===n?r:r=function(n){var t=n.length;return{point:function(r,i){for(var e=-1;++e<t;)n[e].point(r,i)},sphere:function(){for(var r=-1;++r<t;)n[r].sphere()},lineStart:function(){for(var r=-1;++r<t;)n[r].lineStart()},lineEnd:function(){for(var r=-1;++r<t;)n[r].lineEnd()},polygonStart:function(){for(var r=-1;++r<t;)n[r].polygonStart()},polygonEnd:function(){for(var r=-1;++r<t;)n[r].polygonEnd()}}}([a.stream(i=n),l.stream(n),f.stream(n)])},n.precision=function(n){return arguments.length?(a.precision(n),l.precision(n),f.precision(n),t()):a.precision()},n.scale=function(t){return arguments.length?(a.scale(t),l.scale(.35*t),f.scale(t),n.translate(a.translate())):a.scale()},n.translate=function(n){if(!arguments.length)return a.translate();var r=a.scale(),i=+n[0],c=+n[1];return e=a.translate(n).clipExtent([[i-.455* r,c-.238*r],[i+.455*r,c+.238*r]]).stream(s),o=l.translate([i-.307*r,c+.201*r]).clipExtent([[i-.425*r+Ot,c+.12*r+Ot],[i-.214*r-Ot,c+.234*r-Ot]]).stream(s),u=f.translate([i-.205*r,c+.212*r]).clipExtent([[i-.214*r+Ot,c+.166*r+Ot],[i-.115*r-Ot,c+.234*r-Ot]]).stream(s),t()},n.fitExtent=function(t,r){return Ln(n,t,r)},n.fitSize=function(t,r){return On(n,t,r)},n.fitWidth=function(t,r){return Gn(n,t,r)},n.fitHeight=function(t,r){return Tn(n,t,r)},n.scale(1070)},n.geoAzimuthalEqualArea=function(){return kn(mi).scale(124.75).clipAngle(179.999)},n.geoAzimuthalEqualAreaRaw=mi,n.geoAzimuthalEquidistant=function(){return kn(Mi).scale(79.4188).clipAngle(179.999)},n.geoAzimuthalEquidistantRaw=Mi,n.geoConicConformal=function(){return Hn(Yn).scale(109.5).parallels([30,30])},n.geoConicConformalRaw=Yn,n.geoConicEqualArea=yi,n.geoConicEqualAreaRaw=In,n.geoConicEquidistant=function(){return Hn(Jn).scale(131.154).center([0,13.9389])},n.geoConicEquidistantRaw=Jn,n.geoEquirectangular=function(){return kn(Zn ).scale(152.63)},n.geoEquirectangularRaw=Zn,n.geoGnomonic=function(){return kn(Kn).scale(144.049).clipAngle(60)},n.geoGnomonicRaw=Kn,n.geoIdentity=function(){function n(){return e=o=null,u}var t,r,i,e,o,u,c=1,a=0,l=0,f=1,s=1,p=Wr,h=null,g=Wr;return u={stream:function(n){return e&&o===n?e:e=p(g(o=n))},postclip:function(e){return arguments.length?(g=e,h=t=r=i=null,n()):g},clipExtent:function(e){return arguments.length?(g=null==e?(h=t=r=i=null,Wr):$(h=+e[0][0],t=+e[0][1],r=+e[1][0],i=+e[1][1]),n()):null==h?null:[[h,t],[r,i]]},scale:function(t){return arguments.length?(p=Qn((c=+t)*f,c*s,a,l),n()):c},translate:function(t){return arguments.length?(p=Qn(c*f,c*s,a=+t[0],l=+t[1]),n()):[a,l]},reflectX:function(t){return arguments.length?(p=Qn(c*(f=t?-1:1),c*s,a,l),n()):f<0},reflectY:function(t){return arguments.length?(p=Qn(c*f,c*(s=t?-1:1),a,l),n()):s<0},fitExtent:function(n,t){return Ln(u,n,t)},fitSize:function(n,t){return On(u,n,t)},fitWidth:function(n,t){return Gn(u,n,t)},fitHeight:functi on(n,t){return Tn(u,n,t)}}},n.geoProjection=kn,n.geoProjectionMutator=Fn,n.geoMercator=function(){return Un(Dn).scale(961/Ft)},n.geoMercatorRaw=Dn,n.geoNaturalEarth1=function(){return kn(Vn).scale(175.295)},n.geoNaturalEarth1Raw=Vn,n.geoOrthographic=function(){return kn($n).scale(249.5).clipAngle(90+Ot)},n.geoOrthographicRaw=$n,n.geoStereographic=function(){return kn(nt).scale(250).clipAngle(142)},n.geoStereographicRaw=nt,n.geoTransverseMercator=function(){var n=Un(tt),t=n.center,r=n.rotate;return n.center=function(n){return arguments.length?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return arguments.length?r([n[0],n[1],n.length>2?n[2]+90:90]):(n=r(),[n[0],n[1],n[2]-90])},r([0,0,90]).scale(159.155)},n.geoTransverseMercatorRaw=tt,n.geoRotation=xr,n.geoStream=rr,n.geoTransform=function(n){return{stream:qn(n)}},Object.defineProperty(n,"__esModule",{value:!0})}); \ No newline at end of file diff --git a/js/main.js b/js/main.js index 866eae6..842dc07 100644 --- a/js/main.js +++ b/js/main.js @@ -17,6 +17,9 @@ require.config({ bootstrap: 'libs/bootstrap/bootstrap.min', datatablesbs: 'libs/datatables/dataTables.bootstrap', d3js: 'libs/d3js/d3.v3.min', + "d3-geo-projection": 'libs/d3js/d3-geo-projection.v2.min', + "d3-geo": 'libs/d3js/d3-geo.v1.min', + "d3-array": 'libs/d3js/d3-array.v1.min', topojson: 'libs/d3js/topojson.v1.min', jssha: 'libs/jssha/sha1', templates: '../templates', diff --git a/js/views/aggregate/map.js b/js/views/aggregate/map.js index 4b0b943..367845c 100644 --- a/js/views/aggregate/map.js +++ b/js/views/aggregate/map.js @@ -4,6 +4,9 @@ define([ 'underscore', 'backbone', 'topojson', + 'd3-array', + 'd3-geo', + 'd3-geo-projection', 'collections/aggregates', 'text!templates/aggregate/map.html', 'datatables', @@ -11,7 +14,7 @@ define([ 'helpers', 'bootstrap', 'datatablesbs' -], function($, _, Backbone, topojson, aggregatesCollection, aggregateMapTemplate){ +], function($, _, Backbone, topojson, d3array, d3geo, d3geoproj, aggregatesCollection, aggregateMapTemplate){ var aggregateSearchView = Backbone.View.extend({ el: "#content", initialize: function() { @@ -27,9 +30,7 @@ define([ var width = 938; var height = 500;
- var projection = d3.geo.mercator() - .scale(800) - .translate([width / 2, height / 1.5]); + var projection = d3geoproj.geoCylindricalEqualArea();
var path = d3.geo.path() .projection(projection);