var globals=function(t){t("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),t("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),t("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),t.WGS84=t["EPSG:4326"],t["EPSG:3785"]=t["EPSG:3857"],t.GOOGLE=t["EPSG:3857"],t["EPSG:900913"]=t["EPSG:3857"],t["EPSG:102113"]=t["EPSG:3857"]},PJD_3PARAM=1,PJD_7PARAM=2,PJD_GRIDSHIFT=3,PJD_WGS84=4,PJD_NODATUM=5,SRS_WGS84_SEMIMAJOR=6378137,SRS_WGS84_SEMIMINOR=6356752.314,SRS_WGS84_ESQUARED=.0066943799901413165,SEC_TO_RAD=484813681109536e-20,HALF_PI=Math.PI/2,SIXTH=.16666666666666666,RA4=.04722222222222222,RA6=.022156084656084655,EPSLN=1e-10,D2R=.017453292519943295,R2D=57.29577951308232,FORTPI=Math.PI/4,TWO_PI=2*Math.PI,SPI=3.14159265359,exports$1={greenwich:0,lisbon:-9.131906111111,paris:2.337229166667,bogota:-74.080916666667,madrid:-3.687938888889,rome:12.452333333333,bern:7.439583333333,jakarta:106.807719444444,ferro:-17.666666666667,brussels:4.367975,stockholm:18.058277777778,athens:23.7163375,oslo:10.722916666667},units={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},ignoredChar=/[\s_\-\/\(\)]/g;function match(t,s){if(t[s])return t[s];for(var i,a=Object.keys(t),e=s.toLowerCase().replace(ignoredChar,""),h=-1;++h=this.text.length)return;t=this.text[this.place++]}switch(this.state){case NEUTRAL:return this.neutral(t);case KEYWORD:return this.keyword(t);case QUOTED:return this.quoted(t);case AFTERQUOTE:return this.afterquote(t);case NUMBER:return this.number(t);case ENDED:return}},Parser.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=QUOTED);if(endThings.test(t))return this.word=this.word.trim(),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in afterquote yet, index '+this.place)},Parser.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=NEUTRAL)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=NEUTRAL,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=ENDED))):void 0},Parser.prototype.number=function(t){if(!digets.test(t)){if(endThings.test(t))return this.word=parseFloat(this.word),void this.afterItem(t);throw new Error("havn't handled \""+t+'" in number yet, index '+this.place)}this.word+=t},Parser.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=AFTERQUOTE},Parser.prototype.keyword=function(t){if(keyword.test(t))this.word+=t;else{if("["===t){var s=[];return s.push(this.word),this.level++,null===this.root?this.root=s:this.currentObject.push(s),this.stack.push(this.currentObject),this.currentObject=s,void(this.state=NEUTRAL)}if(!endThings.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},Parser.prototype.neutral=function(t){if(latin.test(t))return this.word=t,void(this.state=KEYWORD);if('"'===t)return this.word="",void(this.state=QUOTED);if(digets.test(t))return this.word=t,void(this.state=NUMBER);if(!endThings.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},Parser.prototype.output=function(){for(;this.place0?90:-90),t.lat_ts=t.lat1)}var wkt=function(t){var s=parseString(t),i=s.shift(),a=s.shift();s.unshift(["name",a]),s.unshift(["type",i]);var e={};return sExpr(s,e),cleanWKT(e),e};function defs(t){var s=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?defs[t]=parseProj(arguments[1]):defs[t]=wkt(arguments[1]):defs[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?defs.apply(s,t):defs(t)}));if("string"==typeof t){if(t in defs)return defs[t]}else"EPSG"in t?defs["EPSG:"+t.EPSG]=t:"ESRI"in t?defs["ESRI:"+t.ESRI]=t:"IAU2000"in t?defs["IAU2000:"+t.IAU2000]=t:console.log(t);return}}function testObj(t){return"string"==typeof t}function testDef(t){return t in defs}globals(defs);var codeWords=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function testWKT(t){return codeWords.some((function(s){return t.indexOf(s)>-1}))}var codes=["3857","900913","3785","102113"];function checkMercator(t){var s=match(t,"authority");if(s){var i=match(s,"epsg");return i&&codes.indexOf(i)>-1}}function checkProjStr(t){var s=match(t,"extension");if(s)return match(s,"proj4")}function testProj(t){return"+"===t[0]}function parse(t){if(!testObj(t))return t;if(testDef(t))return defs[t];if(testWKT(t)){var s=wkt(t);if(checkMercator(s))return defs["EPSG:3857"];var i=checkProjStr(s);return i?parseProj(i):s}return testProj(t)?parseProj(t):void 0}var extend=function(t,s){var i,a;if(t=t||{},!s)return t;for(a in s)void 0!==(i=s[a])&&(t[a]=i);return t},msfnz=function(t,s,i){var a=t*s;return i/Math.sqrt(1-a*a)},sign=function(t){return t<0?-1:1},adjust_lon=function(t){return Math.abs(t)<=SPI?t:t-sign(t)*TWO_PI},tsfnz=function(t,s,i){var a=t*i,e=.5*t;return a=Math.pow((1-a)/(1+a),e),Math.tan(.5*(HALF_PI-s))/a},phi2z=function(t,s){for(var i,a,e=.5*t,h=HALF_PI-2*Math.atan(s),n=0;n<=15;n++)if(i=t*Math.sin(h),h+=a=HALF_PI-2*Math.atan(s*Math.pow((1-i)/(1+i),e))-h,Math.abs(a)<=1e-10)return h;return-9999};function init(){var t=this.b/this.a;this.es=1-t*t,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function forward(t){var s,i,a=t.x,e=t.y;if(e*R2D>90&&e*R2D<-90&&a*R2D>180&&a*R2D<-180)return null;if(Math.abs(Math.abs(e)-HALF_PI)<=EPSLN)return null;if(this.sphere)s=this.x0+this.a*this.k0*adjust_lon(a-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(FORTPI+.5*e));else{var h=Math.sin(e),n=tsfnz(this.e,e,h);s=this.x0+this.a*this.k0*adjust_lon(a-this.long0),i=this.y0-this.a*this.k0*Math.log(n)}return t.x=s,t.y=i,t}function inverse(t){var s,i,a=t.x-this.x0,e=t.y-this.y0;if(this.sphere)i=HALF_PI-2*Math.atan(Math.exp(-e/(this.a*this.k0)));else{var h=Math.exp(-e/(this.a*this.k0));if(-9999===(i=phi2z(this.e,h)))return null}return s=adjust_lon(this.long0+a/(this.a*this.k0)),t.x=s,t.y=i,t}var names$1=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],merc={init:init,forward:forward,inverse:inverse,names:names$1};function init$1(){}function identity(t){return t}var names$2=["longlat","identity"],longlat={init:init$1,forward:identity,inverse:identity,names:names$2},projs=[merc,longlat],names={},projStore=[];function add(t,s){var i=projStore.length;return t.names?(projStore[i]=t,t.names.forEach((function(t){names[t.toLowerCase()]=i})),this):(console.log(s),!0)}function get(t){if(!t)return!1;var s=t.toLowerCase();return void 0!==names[s]&&projStore[names[s]]?projStore[names[s]]:void 0}function start(){projs.forEach(add)}var projections={start:start,add:add,get:get},exports$2={MERIT:{a:6378137,rf:298.257,ellipseName:"MERIT 1983"},SGS85:{a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"},GRS80:{a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"},IAU76:{a:6378140,rf:298.257,ellipseName:"IAU 1976"},airy:{a:6377563.396,b:6356256.91,ellipseName:"Airy 1830"},APL4:{a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"},NWL9D:{a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"},mod_airy:{a:6377340.189,b:6356034.446,ellipseName:"Modified Airy"},andrae:{a:6377104.43,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"},aust_SA:{a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"},GRS67:{a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"},bessel:{a:6377397.155,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483.865,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:6378206.4,b:6356583.8,ellipseName:"Clarke 1866"},clrk80:{a:6378249.145,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk58:{a:6378293.645208759,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:6375738.7,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:6378136.05,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276.345,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304.063,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301.243,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295.664,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298.556,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"},fschr60:{a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"},fschr60m:{a:6378155,rf:298.3,ellipseName:"Fischer 1960"},fschr68:{a:6378150,rf:298.3,ellipseName:"Fischer 1968"},helmert:{a:6378200,rf:298.3,ellipseName:"Helmert 1906"},hough:{a:6378270,rf:297,ellipseName:"Hough"},intl:{a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"},kaula:{a:6378163,rf:298.24,ellipseName:"Kaula 1961"},lerch:{a:6378139,rf:298.257,ellipseName:"Lerch 1979"},mprts:{a:6397300,rf:191,ellipseName:"Maupertius 1738"},new_intl:{a:6378157.5,b:6356772.2,ellipseName:"New International 1967"},plessis:{a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"},krass:{a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"},SEasia:{a:6378155,b:6356773.3205,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:6355834.8467,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"}},WGS84=exports$2.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};function eccentricity(t,s,i,a){var e=t*t,h=s*s,n=(e-h)/e,r=0;return a?(e=(t*=1-n*(SIXTH+n*(RA4+n*RA6)))*t,n=0):r=Math.sqrt(n),{es:n,e:r,ep2:(e-h)/h}}function sphere(t,s,i,a,e){if(!t){var h=match(exports$2,a);h||(h=WGS84),t=h.a,s=h.b,i=h.rf}return i&&!s&&(s=(1-1/i)*t),(0===i||Math.abs(t-s)3&&(0===r.datum_params[3]&&0===r.datum_params[4]&&0===r.datum_params[5]&&0===r.datum_params[6]||(r.datum_type=PJD_7PARAM,r.datum_params[3]*=SEC_TO_RAD,r.datum_params[4]*=SEC_TO_RAD,r.datum_params[5]*=SEC_TO_RAD,r.datum_params[6]=r.datum_params[6]/1e6+1))),n&&(r.datum_type=PJD_GRIDSHIFT,r.grids=n),r.a=i,r.b=a,r.es=e,r.ep2=h,r}exports$3.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},exports$3.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},exports$3.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},exports$3.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},exports$3.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},exports$3.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},exports$3.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},exports$3.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},exports$3.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},exports$3.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},exports$3.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},exports$3.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},exports$3.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},exports$3.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},exports$3.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},exports$3.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},exports$3.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};var loadedNadgrids={};function nadgrid(t,s){var i=new DataView(s),a=detectLittleEndian(i),e=readHeader(i,a);e.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var h={header:e,subgrids:readSubgrids(i,e,a)};return loadedNadgrids[t]=h,h}function getNadgrids(t){return void 0===t?null:t.split(",").map(parseNadgridString)}function parseNadgridString(t){if(0===t.length)return null;var s="@"===t[0];return s&&(t=t.slice(1)),"null"===t?{name:"null",mandatory:!s,grid:null,isNull:!0}:{name:t,mandatory:!s,grid:loadedNadgrids[t]||null,isNull:!1}}function secondsToRadians(t){return t/3600*Math.PI/180}function detectLittleEndian(t){var s=t.getInt32(8,!1);return 11!==s&&(11!==(s=t.getInt32(8,!0))&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function readHeader(t,s){return{nFields:t.getInt32(8,s),nSubgridFields:t.getInt32(24,s),nSubgrids:t.getInt32(40,s),shiftType:decodeString(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,s),fromSemiMinorAxis:t.getFloat64(136,s),toSemiMajorAxis:t.getFloat64(152,s),toSemiMinorAxis:t.getFloat64(168,s)}}function decodeString(t,s,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(s,i)))}function readSubgrids(t,s,i){for(var a=[],e=0;e5e-11)&&(t.datum_type===PJD_3PARAM?t.datum_params[0]===s.datum_params[0]&&t.datum_params[1]===s.datum_params[1]&&t.datum_params[2]===s.datum_params[2]:t.datum_type!==PJD_7PARAM||t.datum_params[0]===s.datum_params[0]&&t.datum_params[1]===s.datum_params[1]&&t.datum_params[2]===s.datum_params[2]&&t.datum_params[3]===s.datum_params[3]&&t.datum_params[4]===s.datum_params[4]&&t.datum_params[5]===s.datum_params[5]&&t.datum_params[6]===s.datum_params[6]))}function geodeticToGeocentric(t,s,i){var a,e,h,n,r=t.x,o=t.y,l=t.z?t.z:0;if(o<-HALF_PI&&o>-1.001*HALF_PI)o=-HALF_PI;else if(o>HALF_PI&&o<1.001*HALF_PI)o=HALF_PI;else{if(o<-HALF_PI)return{x:-1/0,y:-1/0,z:t.z};if(o>HALF_PI)return{x:1/0,y:1/0,z:t.z}}return r>Math.PI&&(r-=2*Math.PI),e=Math.sin(o),n=Math.cos(o),h=e*e,{x:((a=i/Math.sqrt(1-s*h))+l)*n*Math.cos(r),y:(a+l)*n*Math.sin(r),z:(a*(1-s)+l)*e}}function geocentricToGeodetic(t,s,i,a){var e,h,n,r,o,l,c,u,M,d,f,_,m,p,y,g=1e-12,v=t.x,x=t.y,P=t.z?t.z:0;if(e=Math.sqrt(v*v+x*x),h=Math.sqrt(v*v+x*x+P*P),e/i1e-24&&m<30);return{x:p,y:Math.atan(f/Math.abs(d)),z:y}}function geocentricToWgs84(t,s,i){if(s===PJD_3PARAM)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(s===PJD_7PARAM){var a=i[0],e=i[1],h=i[2],n=i[3],r=i[4],o=i[5],l=i[6];return{x:l*(t.x-o*t.y+r*t.z)+a,y:l*(o*t.x+t.y-n*t.z)+e,z:l*(-r*t.x+n*t.y+t.z)+h}}}function geocentricFromWgs84(t,s,i){if(s===PJD_3PARAM)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(s===PJD_7PARAM){var a=i[0],e=i[1],h=i[2],n=i[3],r=i[4],o=i[5],l=i[6],c=(t.x-a)/l,u=(t.y-e)/l,M=(t.z-h)/l;return{x:c+o*u-r*M,y:-o*c+u+n*M,z:r*c-n*u+M}}}function checkParams(t){return t===PJD_3PARAM||t===PJD_7PARAM}Projection.projections=projections,Projection.projections.start();var datum_transform=function(t,s,i){if(compareDatums(t,s))return i;if(t.datum_type===PJD_NODATUM||s.datum_type===PJD_NODATUM)return i;var a=t.a,e=t.es;if(t.datum_type===PJD_GRIDSHIFT){if(0!==applyGridShift(t,!1,i))return;a=SRS_WGS84_SEMIMAJOR,e=SRS_WGS84_ESQUARED}var h=s.a,n=s.b,r=s.es;if(s.datum_type===PJD_GRIDSHIFT&&(h=SRS_WGS84_SEMIMAJOR,n=SRS_WGS84_SEMIMINOR,r=SRS_WGS84_ESQUARED),e===r&&a===h&&!checkParams(t.datum_type)&&!checkParams(s.datum_type))return i;if((i=geodeticToGeocentric(i,e,a),checkParams(t.datum_type)&&(i=geocentricToWgs84(i,t.datum_type,t.datum_params)),checkParams(s.datum_type)&&(i=geocentricFromWgs84(i,s.datum_type,s.datum_params)),i=geocentricToGeodetic(i,r,h,n),s.datum_type===PJD_GRIDSHIFT)&&0!==applyGridShift(s,!0,i))return;return i};function applyGridShift(t,s,i){if(null===t.grids||0===t.grids.length)return console.log("Grid shift grids not found"),-1;for(var a={x:-i.x,y:i.y},e={x:Number.NaN,y:Number.NaN},h=[],n=0;na.y||c>a.x||d1e-12&&Math.abs(n.y)>1e-12);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),a;a.x=adjust_lon(h.x+i.ll[0]),a.y=h.y+i.ll[1]}else isNaN(h.x)||(a.x=t.x+h.x,a.y=t.y+h.y);return a}function nadInterpolate(t,s){var i,a={x:t.x/s.del[0],y:t.y/s.del[1]},e=Math.floor(a.x),h=Math.floor(a.y),n=a.x-1*e,r=a.y-1*h,o={x:Number.NaN,y:Number.NaN};if(e<0||e>=s.lim[0])return o;if(h<0||h>=s.lim[1])return o;i=h*s.lim[0]+e;var l=s.cvs[i][0],c=s.cvs[i][1];i++;var u=s.cvs[i][0],M=s.cvs[i][1];i+=s.lim[0];var d=s.cvs[i][0],f=s.cvs[i][1];i--;var _=s.cvs[i][0],m=s.cvs[i][1],p=n*r,y=n*(1-r),g=(1-n)*(1-r),v=(1-n)*r;return o.x=g*l+y*u+v*_+p*d,o.y=g*c+y*M+v*m+p*f,o}var adjust_axis=function(t,s,i){var a,e,h,n=i.x,r=i.y,o=i.z||0,l={};for(h=0;h<3;h++)if(!s||2!==h||void 0!==i.z)switch(0===h?(a=n,e=-1!=="ew".indexOf(t.axis[h])?"x":"y"):1===h?(a=r,e=-1!=="ns".indexOf(t.axis[h])?"y":"x"):(a=o,e="z"),t.axis[h]){case"e":case"n":l[e]=a;break;case"w":case"s":l[e]=-a;break;case"u":void 0!==i[e]&&(l.z=a);break;case"d":void 0!==i[e]&&(l.z=-a);break;default:return null}return l},toPoint=function(t){var s={x:t[0],y:t[1]};return t.length>2&&(s.z=t[2]),t.length>3&&(s.m=t[3]),s},checkSanity=function(t){checkCoord(t.x),checkCoord(t.y)};function checkCoord(t){if("function"==typeof Number.isFinite){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if("number"!=typeof t||t!=t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function checkNotWGS(t,s){return(t.datum.datum_type===PJD_3PARAM||t.datum.datum_type===PJD_7PARAM)&&"WGS84"!==s.datumCode||(s.datum.datum_type===PJD_3PARAM||s.datum.datum_type===PJD_7PARAM)&&"WGS84"!==t.datumCode}function transform(t,s,i,a){var e;if(Array.isArray(i)&&(i=toPoint(i)),checkSanity(i),t.datum&&s.datum&&checkNotWGS(t,s)&&(i=transform(t,e=new Projection("WGS84"),i,a),t=e),a&&"enu"!==t.axis&&(i=adjust_axis(t,!1,i)),"longlat"===t.projName)i={x:i.x*D2R,y:i.y*D2R,z:i.z||0};else if(t.to_meter&&(i={x:i.x*t.to_meter,y:i.y*t.to_meter,z:i.z||0}),!(i=t.inverse(i)))return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=datum_transform(t.datum,s.datum,i))return s.from_greenwich&&(i={x:i.x-s.from_greenwich,y:i.y,z:i.z||0}),"longlat"===s.projName?i={x:i.x*R2D,y:i.y*R2D,z:i.z||0}:(i=s.forward(i),s.to_meter&&(i={x:i.x/s.to_meter,y:i.y/s.to_meter,z:i.z||0})),a&&"enu"!==s.axis?adjust_axis(s,!0,i):i}var wgs84=Projection("WGS84");function transformer(t,s,i,a){var e,h,n;return Array.isArray(i)?(e=transform(t,s,i,a)||{x:NaN,y:NaN},i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==s.name&&"geocent"===s.name?"number"==typeof e.z?[e.x,e.y,e.z].concat(i.splice(3)):[e.x,e.y,i[2]].concat(i.splice(3)):[e.x,e.y].concat(i.splice(2)):[e.x,e.y]):(h=transform(t,s,i,a),2===(n=Object.keys(i)).length||n.forEach((function(a){if(void 0!==t.name&&"geocent"===t.name||void 0!==s.name&&"geocent"===s.name){if("x"===a||"y"===a||"z"===a)return}else if("x"===a||"y"===a)return;h[a]=i[a]})),h)}function checkProj(t){return t instanceof Projection?t:t.oProj?t.oProj:Projection(t)}function proj4$1(t,s,i){t=checkProj(t);var a,e=!1;return void 0===s?(s=t,t=wgs84,e=!0):(void 0!==s.x||Array.isArray(s))&&(i=s,s=t,t=wgs84,e=!0),s=checkProj(s),i?transformer(t,s,i):(a={forward:function(i,a){return transformer(t,s,i,a)},inverse:function(i,a){return transformer(s,t,i,a)}},e&&(a.oProj=s),a)}var NUM_100K_SETS=6,SET_ORIGIN_COLUMN_LETTERS="AJSAJS",SET_ORIGIN_ROW_LETTERS="AFAFAF",A=65,I=73,O=79,V=86,Z=90,mgrs={forward:forward$1,inverse:inverse$1,toPoint:toPoint$1};function forward$1(t,s){return s=s||5,encode(LLtoUTM({lat:t[1],lon:t[0]}),s)}function inverse$1(t){var s=UTMtoLL(decode(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat,s.lon,s.lat]:[s.left,s.bottom,s.right,s.top]}function toPoint$1(t){var s=UTMtoLL(decode(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat]:[(s.left+s.right)/2,(s.top+s.bottom)/2]}function degToRad(t){return t*(Math.PI/180)}function radToDeg(t){return t/Math.PI*180}function LLtoUTM(t){var s,i,a,e,h,n,r,o=t.lat,l=t.lon,c=6378137,u=.00669438,M=.9996,d=degToRad(o),f=degToRad(l);r=Math.floor((l+180)/6)+1,180===l&&(r=60),o>=56&&o<64&&l>=3&&l<12&&(r=32),o>=72&&o<84&&(l>=0&&l<9?r=31:l>=9&&l<21?r=33:l>=21&&l<33?r=35:l>=33&&l<42&&(r=37)),n=degToRad(6*(r-1)-180+3),s=.006739496752268451,i=c/Math.sqrt(1-u*Math.sin(d)*Math.sin(d)),a=Math.tan(d)*Math.tan(d),e=s*Math.cos(d)*Math.cos(d);var _=M*i*((h=Math.cos(d)*(f-n))+(1-a+e)*h*h*h/6+(5-18*a+a*a+72*e-58*s)*h*h*h*h*h/120)+5e5,m=M*(c*(.9983242984503243*d-.002514607064228144*Math.sin(2*d)+2639046602129982e-21*Math.sin(4*d)-3.418046101696858e-9*Math.sin(6*d))+i*Math.tan(d)*(h*h/2+(5-a+9*e+4*e*e)*h*h*h*h/24+(61-58*a+a*a+600*e-2.2240339282485886)*h*h*h*h*h*h/720));return o<0&&(m+=1e7),{northing:Math.round(m),easting:Math.round(_),zoneNumber:r,zoneLetter:getLetterDesignator(o)}}function UTMtoLL(t){var s=t.northing,i=t.easting,a=t.zoneLetter,e=t.zoneNumber;if(e<0||e>60)return null;var h,n,r,o,l,c,u,M,d,f=.9996,_=6378137,m=.00669438,p=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),y=i-5e5,g=s;a<"N"&&(g-=1e7),u=6*(e-1)-180+3,h=.006739496752268451,d=(M=g/f/6367449.145945056)+(3*p/2-27*p*p*p/32)*Math.sin(2*M)+(21*p*p/16-55*p*p*p*p/32)*Math.sin(4*M)+151*p*p*p/96*Math.sin(6*M),n=_/Math.sqrt(1-m*Math.sin(d)*Math.sin(d)),r=Math.tan(d)*Math.tan(d),o=h*Math.cos(d)*Math.cos(d),l=.99330562*_/Math.pow(1-m*Math.sin(d)*Math.sin(d),1.5),c=y/(n*f);var v=d-n*Math.tan(d)/l*(c*c/2-(5+3*r+10*o-4*o*o-9*h)*c*c*c*c/24+(61+90*r+298*o+45*r*r-1.6983531815716497-3*o*o)*c*c*c*c*c*c/720);v=radToDeg(v);var x,P=(c-(1+2*r+o)*c*c*c/6+(5-2*o+28*r-3*o*o+8*h+24*r*r)*c*c*c*c*c/120)/Math.cos(d);if(P=u+radToDeg(P),t.accuracy){var E=UTMtoLL({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});x={top:E.lat,right:E.lon,bottom:v,left:P}}else x={lat:v,lon:P};return x}function getLetterDesignator(t){var s="Z";return 84>=t&&t>=72?s="X":72>t&&t>=64?s="W":64>t&&t>=56?s="V":56>t&&t>=48?s="U":48>t&&t>=40?s="T":40>t&&t>=32?s="S":32>t&&t>=24?s="R":24>t&&t>=16?s="Q":16>t&&t>=8?s="P":8>t&&t>=0?s="N":0>t&&t>=-8?s="M":-8>t&&t>=-16?s="L":-16>t&&t>=-24?s="K":-24>t&&t>=-32?s="J":-32>t&&t>=-40?s="H":-40>t&&t>=-48?s="G":-48>t&&t>=-56?s="F":-56>t&&t>=-64?s="E":-64>t&&t>=-72?s="D":-72>t&&t>=-80&&(s="C"),s}function encode(t,s){var i="00000"+t.easting,a="00000"+t.northing;return t.zoneNumber+t.zoneLetter+get100kID(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,s)+a.substr(a.length-5,s)}function get100kID(t,s,i){var a=get100kSetForZone(i);return getLetter100kID(Math.floor(t/1e5),Math.floor(s/1e5)%20,a)}function get100kSetForZone(t){var s=t%NUM_100K_SETS;return 0===s&&(s=NUM_100K_SETS),s}function getLetter100kID(t,s,i){var a=i-1,e=SET_ORIGIN_COLUMN_LETTERS.charCodeAt(a),h=SET_ORIGIN_ROW_LETTERS.charCodeAt(a),n=e+t-1,r=h+s,o=!1;return n>Z&&(n=n-Z+A-1,o=!0),(n===I||eI||(n>I||eO||(n>O||eZ&&(n=n-Z+A-1),r>V?(r=r-V+A-1,o=!0):o=!1,(r===I||hI||(r>I||hO||(r>O||hV&&(r=r-V+A-1),String.fromCharCode(n)+String.fromCharCode(r)}function decode(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var s,i=t.length,a=null,e="",h=0;!/[A-Z]/.test(s=t.charAt(h));){if(h>=2)throw"MGRSPoint bad conversion from: "+t;e+=s,h++}var n=parseInt(e,10);if(0===h||h+3>i)throw"MGRSPoint bad conversion from: "+t;var r=t.charAt(h++);if(r<="A"||"B"===r||"Y"===r||r>="Z"||"I"===r||"O"===r)throw"MGRSPoint zone letter "+r+" not handled: "+t;a=t.substring(h,h+=2);for(var o=get100kSetForZone(n),l=getEastingFromChar(a.charAt(0),o),c=getNorthingFromChar(a.charAt(1),o);c0&&(M=1e5/Math.pow(10,_),d=t.substring(h,h+_),m=parseFloat(d)*M,f=t.substring(h+_),p=parseFloat(f)*M),{easting:m+l,northing:p+c,zoneLetter:r,zoneNumber:n,accuracy:M}}function getEastingFromChar(t,s){for(var i=SET_ORIGIN_COLUMN_LETTERS.charCodeAt(s-1),a=1e5,e=!1;i!==t.charCodeAt(0);){if(++i===I&&i++,i===O&&i++,i>Z){if(e)throw"Bad character: "+t;i=A,e=!0}a+=1e5}return a}function getNorthingFromChar(t,s){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=SET_ORIGIN_ROW_LETTERS.charCodeAt(s-1),a=0,e=!1;i!==t.charCodeAt(0);){if(++i===I&&i++,i===O&&i++,i>V){if(e)throw"Bad character: "+t;i=A,e=!0}a+=1e5}return a}function getMinNorthing(t){var s;switch(t){case"C":s=11e5;break;case"D":s=2e6;break;case"E":s=28e5;break;case"F":s=37e5;break;case"G":s=46e5;break;case"H":s=55e5;break;case"J":s=64e5;break;case"K":s=73e5;break;case"L":s=82e5;break;case"M":s=91e5;break;case"N":s=0;break;case"P":s=8e5;break;case"Q":s=17e5;break;case"R":s=26e5;break;case"S":s=35e5;break;case"T":s=44e5;break;case"U":s=53e5;break;case"V":s=62e5;break;case"W":s=7e6;break;case"X":s=79e5;break;default:s=-1}if(s>=0)return s;throw"Invalid zone letter: "+t}function Point(t,s,i){if(!(this instanceof Point))return new Point(t,s,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"==typeof t)this.x=t.x,this.y=t.y,this.z=t.z||0;else if("string"==typeof t&&void 0===s){var a=t.split(",");this.x=parseFloat(a[0],10),this.y=parseFloat(a[1],10),this.z=parseFloat(a[2],10)||0}else this.x=t,this.y=s,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Point.fromMGRS=function(t){return new Point(toPoint$1(t))},Point.prototype.toMGRS=function(t){return forward$1([this.x,this.y],t)};var C00=1,C02=.25,C04=.046875,C06=.01953125,C08=.01068115234375,C22=.75,C44=.46875,C46=.013020833333333334,C48=.007120768229166667,C66=.3645833333333333,C68=.005696614583333333,C88=.3076171875,pj_enfn=function(t){var s=[];s[0]=C00-t*(C02+t*(C04+t*(C06+t*C08))),s[1]=t*(C22-t*(C04+t*(C06+t*C08)));var i=t*t;return s[2]=i*(C44-t*(C46+t*C48)),i*=t,s[3]=i*(C66-t*C68),s[4]=i*t*C88,s},pj_mlfn=function(t,s,i,a){return i*=s,s*=s,a[0]*t-i*(a[1]+s*(a[2]+s*(a[3]+s*a[4])))},MAX_ITER=20,pj_inv_mlfn=function(t,s,i){for(var a=1/(1-s),e=t,h=MAX_ITER;h;--h){var n=Math.sin(e),r=1-s*n*n;if(e-=r=(pj_mlfn(e,n,Math.cos(e),i)-t)*(r*Math.sqrt(r))*a,Math.abs(r)EPSLN?Math.tan(h):0,f=Math.pow(d,2),_=Math.pow(f,2);s=1-this.es*Math.pow(r,2),l/=Math.sqrt(s);var m=pj_mlfn(h,r,o,this.en);i=this.a*(this.k0*l*(1+c/6*(1-f+u+c/20*(5-18*f+_+14*u-58*f*u+c/42*(61+179*_-_*f-479*f)))))+this.x0,a=this.a*(this.k0*(m-this.ml0+r*n*l/2*(1+c/12*(5-f+9*u+4*M+c/30*(61+_-58*f+270*u-330*f*u+c/56*(1385+543*_-_*f-3111*f))))))+this.y0}else{var p=o*Math.sin(n);if(Math.abs(Math.abs(p)-1)=1){if(p-1>EPSLN)return 93;a=0}else a=Math.acos(a);h<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return t.x=i,t.y=a,t}function inverse$2(t){var s,i,a,e,h=(t.x-this.x0)*(1/this.a),n=(t.y-this.y0)*(1/this.a);if(this.es)if(s=this.ml0+n/this.k0,i=pj_inv_mlfn(s,this.es,this.en),Math.abs(i)EPSLN?Math.tan(i):0,c=this.ep2*Math.pow(o,2),u=Math.pow(c,2),M=Math.pow(l,2),d=Math.pow(M,2);s=1-this.es*Math.pow(r,2);var f=h*Math.sqrt(s)/this.k0,_=Math.pow(f,2);a=i-(s*=l)*_/(1-this.es)*.5*(1-_/12*(5+3*M-9*c*M+c-4*u-_/30*(61+90*M-252*c*M+45*d+46*c-_/56*(1385+3633*M+4095*d+1574*d*M)))),e=adjust_lon(this.long0+f*(1-_/6*(1+2*M+c-_/20*(5+28*M+24*d+8*c*M+6*c-_/42*(61+662*M+1320*d+720*d*M))))/o)}else a=HALF_PI*sign(n),e=0;else{var m=Math.exp(h/this.k0),p=.5*(m-1/m),y=this.lat0+n/this.k0,g=Math.cos(y);s=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(p,2))),a=Math.asin(s),n<0&&(a=-a),e=0===p&&0===g?0:adjust_lon(Math.atan2(p,g)+this.long0)}return t.x=e,t.y=a,t}var names$3=["Fast_Transverse_Mercator","Fast Transverse Mercator"],tmerc={init:init$2,forward:forward$2,inverse:inverse$2,names:names$3},sinh=function(t){var s=Math.exp(t);return s=(s-1/s)/2},hypot=function(t,s){t=Math.abs(t),s=Math.abs(s);var i=Math.max(t,s),a=Math.min(t,s)/(i||1);return i*Math.sqrt(1+Math.pow(a,2))},log1py=function(t){var s=1+t,i=s-1;return 0===i?t:t*Math.log(s)/i},asinhy=function(t){var s=Math.abs(t);return s=log1py(s*(1+s/(hypot(1,s)+1))),t<0?-s:s},gatg=function(t,s){for(var i,a=2*Math.cos(2*s),e=t.length-1,h=t[e],n=0;--e>=0;)i=a*h-n+t[e],n=h,h=i;return s+i*Math.sin(2*s)},clens=function(t,s){for(var i,a=2*Math.cos(s),e=t.length-1,h=t[e],n=0;--e>=0;)i=a*h-n+t[e],n=h,h=i;return Math.sin(s)*i},cosh=function(t){var s=Math.exp(t);return s=(s+1/s)/2},clens_cmplx=function(t,s,i){for(var a,e,h=Math.sin(s),n=Math.cos(s),r=sinh(i),o=cosh(i),l=2*n*o,c=-2*h*r,u=t.length-1,M=t[u],d=0,f=0,_=0;--u>=0;)a=f,e=d,M=l*(f=M)-a-c*(d=_)+t[u],_=c*f-e+l*d;return[(l=h*o)*M-(c=n*r)*_,l*_+c*M]};function init$3(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(tmerc.init.apply(this),this.forward=tmerc.forward,this.inverse=tmerc.inverse),this.x0=void 0!==this.x0?this.x0:0,this.y0=void 0!==this.y0?this.y0:0,this.long0=void 0!==this.long0?this.long0:0,this.lat0=void 0!==this.lat0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),s=t/(2-t),i=s;this.cgb[0]=s*(2+s*(-2/3+s*(s*(116/45+s*(26/45+s*(-2854/675)))-2))),this.cbg[0]=s*(s*(2/3+s*(4/3+s*(-82/45+s*(32/45+s*(4642/4725)))))-2),i*=s,this.cgb[1]=i*(7/3+s*(s*(-227/45+s*(2704/315+s*(2323/945)))-1.6)),this.cbg[1]=i*(5/3+s*(-16/15+s*(-13/9+s*(904/315+s*(-1522/945))))),i*=s,this.cgb[2]=i*(56/15+s*(-136/35+s*(-1262/105+s*(73814/2835)))),this.cbg[2]=i*(-26/15+s*(34/21+s*(1.6+s*(-12686/2835)))),i*=s,this.cgb[3]=i*(4279/630+s*(-332/35+s*(-399572/14175))),this.cbg[3]=i*(1237/630+s*(s*(-24832/14175)-2.4)),i*=s,this.cgb[4]=i*(4174/315+s*(-144838/6237)),this.cbg[4]=i*(-734/315+s*(109598/31185)),i*=s,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(s,2),this.Qn=this.k0/(1+s)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=s*(s*(2/3+s*(-37/96+s*(1/360+s*(81/512+s*(-96199/604800)))))-.5),this.gtu[0]=s*(.5+s*(-2/3+s*(5/16+s*(41/180+s*(-127/288+s*(7891/37800)))))),this.utg[1]=i*(-1/48+s*(-1/15+s*(437/1440+s*(-46/105+s*(1118711/3870720))))),this.gtu[1]=i*(13/48+s*(s*(557/1440+s*(281/630+s*(-1983433/1935360)))-.6)),i*=s,this.utg[2]=i*(-17/480+s*(37/840+s*(209/4480+s*(-5569/90720)))),this.gtu[2]=i*(61/240+s*(-103/140+s*(15061/26880+s*(167603/181440)))),i*=s,this.utg[3]=i*(-4397/161280+s*(11/504+s*(830251/7257600))),this.gtu[3]=i*(49561/161280+s*(-179/168+s*(6601661/7257600))),i*=s,this.utg[4]=i*(-4583/161280+s*(108847/3991680)),this.gtu[4]=i*(34729/80640+s*(-3418889/1995840)),i*=s,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=.6650675310896665*i;var a=gatg(this.cbg,this.lat0);this.Zb=-this.Qn*(a+clens(this.gtu,2*a))}function forward$3(t){var s=adjust_lon(t.x-this.long0),i=t.y;i=gatg(this.cbg,i);var a=Math.sin(i),e=Math.cos(i),h=Math.sin(s),n=Math.cos(s);i=Math.atan2(a,n*e),s=Math.atan2(h*e,hypot(a,e*n)),s=asinhy(Math.tan(s));var r,o,l=clens_cmplx(this.gtu,2*i,2*s);return i+=l[0],s+=l[1],Math.abs(s)<=2.623395162778?(r=this.a*(this.Qn*s)+this.x0,o=this.a*(this.Qn*i+this.Zb)+this.y0):(r=1/0,o=1/0),t.x=r,t.y=o,t}function inverse$3(t){var s,i,a=(t.x-this.x0)*(1/this.a),e=(t.y-this.y0)*(1/this.a);if(e=(e-this.Zb)/this.Qn,a/=this.Qn,Math.abs(a)<=2.623395162778){var h=clens_cmplx(this.utg,2*e,2*a);e+=h[0],a+=h[1],a=Math.atan(sinh(a));var n=Math.sin(e),r=Math.cos(e),o=Math.sin(a),l=Math.cos(a);e=Math.atan2(n*l,hypot(o,l*r)),a=Math.atan2(o,l*r),s=adjust_lon(a+this.long0),i=gatg(this.cgb,e)}else s=1/0,i=1/0;return t.x=s,t.y=i,t}var names$4=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"],etmerc={init:init$3,forward:forward$3,inverse:inverse$3,names:names$4},adjust_zone=function(t,s){if(void 0===t){if((t=Math.floor(30*(adjust_lon(s)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t},dependsOn="etmerc";function init$4(){var t=adjust_zone(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*D2R,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,etmerc.init.apply(this),this.forward=etmerc.forward,this.inverse=etmerc.inverse}var names$5=["Universal Transverse Mercator System","utm"],utm={init:init$4,names:names$5,dependsOn:dependsOn},srat=function(t,s){return Math.pow((1-t)/(1+t),s)},MAX_ITER$1=20;function init$6(){var t=Math.sin(this.lat0),s=Math.cos(this.lat0);s*=s,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*s*s/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+FORTPI)/(Math.pow(Math.tan(.5*this.lat0+FORTPI),this.C)*srat(this.e*t,this.ratexp))}function forward$5(t){var s=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+FORTPI),this.C)*srat(this.e*Math.sin(i),this.ratexp))-HALF_PI,t.x=this.C*s,t}function inverse$5(t){for(var s=t.x/this.C,i=t.y,a=Math.pow(Math.tan(.5*i+FORTPI)/this.K,1/this.C),e=MAX_ITER$1;e>0&&(i=2*Math.atan(a*srat(this.e*Math.sin(t.y),-.5*this.e))-HALF_PI,!(Math.abs(i-t.y)<1e-14));--e)t.y=i;return e?(t.x=s,t.y=i,t):null}var names$7=["gauss"],gauss={init:init$6,forward:forward$5,inverse:inverse$5,names:names$7};function init$5(){gauss.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function forward$4(t){var s,i,a,e;return t.x=adjust_lon(t.x-this.long0),gauss.forward.apply(this,[t]),s=Math.sin(t.y),i=Math.cos(t.y),a=Math.cos(t.x),e=this.k0*this.R2/(1+this.sinc0*s+this.cosc0*i*a),t.x=e*i*Math.sin(t.x),t.y=e*(this.cosc0*s-this.sinc0*i*a),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function inverse$4(t){var s,i,a,e,h;if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,h=Math.sqrt(t.x*t.x+t.y*t.y)){var n=2*Math.atan2(h,this.R2);s=Math.sin(n),i=Math.cos(n),e=Math.asin(i*this.sinc0+t.y*s*this.cosc0/h),a=Math.atan2(t.x*s,h*this.cosc0*i-t.y*this.sinc0*s)}else e=this.phic0,a=0;return t.x=a,t.y=e,gauss.inverse.apply(this,[t]),t.x=adjust_lon(t.x+this.long0),t}var names$6=["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],sterea={init:init$5,forward:forward$4,inverse:inverse$4,names:names$6};function ssfn_(t,s,i){return s*=i,Math.tan(.5*(HALF_PI+t))*Math.pow((1-s)/(1+s),.5*i)}function init$7(){this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=EPSLN&&(this.k0=.5*(1+sign(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=EPSLN&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),1===this.k0&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=EPSLN&&(this.k0=.5*this.cons*msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/tsfnz(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=msfnz(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-HALF_PI,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function forward$6(t){var s,i,a,e,h,n,r=t.x,o=t.y,l=Math.sin(o),c=Math.cos(o),u=adjust_lon(r-this.long0);return Math.abs(Math.abs(r-this.long0)-Math.PI)<=EPSLN&&Math.abs(o+this.lat0)<=EPSLN?(t.x=NaN,t.y=NaN,t):this.sphere?(s=2*this.k0/(1+this.sinlat0*l+this.coslat0*c*Math.cos(u)),t.x=this.a*s*c*Math.sin(u)+this.x0,t.y=this.a*s*(this.coslat0*l-this.sinlat0*c*Math.cos(u))+this.y0,t):(i=2*Math.atan(this.ssfn_(o,l,this.e))-HALF_PI,e=Math.cos(i),a=Math.sin(i),Math.abs(this.coslat0)<=EPSLN?(h=tsfnz(this.e,o*this.con,this.con*l),n=2*this.a*this.k0*h/this.cons,t.x=this.x0+n*Math.sin(r-this.long0),t.y=this.y0-this.con*n*Math.cos(r-this.long0),t):(Math.abs(this.sinlat0)0?adjust_lon(this.long0+Math.atan2(t.x,-1*t.y)):adjust_lon(this.long0+Math.atan2(t.x,t.y)):adjust_lon(this.long0+Math.atan2(t.x*Math.sin(r),n*this.coslat0*Math.cos(r)-t.y*this.sinlat0*Math.sin(r))),t.x=s,t.y=i,t)}if(Math.abs(this.coslat0)<=EPSLN){if(n<=EPSLN)return i=this.lat0,s=this.long0,t.x=s,t.y=i,t;t.x*=this.con,t.y*=this.con,a=n*this.cons/(2*this.a*this.k0),i=this.con*phi2z(this.e,a),s=this.con*adjust_lon(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else e=2*Math.atan(n*this.cosX0/(2*this.a*this.k0*this.ms1)),s=this.long0,n<=EPSLN?h=this.X0:(h=Math.asin(Math.cos(e)*this.sinX0+t.y*Math.sin(e)*this.cosX0/n),s=adjust_lon(this.long0+Math.atan2(t.x*Math.sin(e),n*this.cosX0*Math.cos(e)-t.y*this.sinX0*Math.sin(e)))),i=-1*phi2z(this.e,Math.tan(.5*(HALF_PI+h)));return t.x=s,t.y=i,t}var names$8=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],stere={init:init$7,forward:forward$6,inverse:inverse$6,names:names$8,ssfn_:ssfn_};function init$8(){var t=this.lat0;this.lambda0=this.long0;var s=Math.sin(t),i=this.a,a=1/this.rf,e=2*a-Math.pow(a,2),h=this.e=Math.sqrt(e);this.R=this.k0*i*Math.sqrt(1-e)/(1-e*Math.pow(s,2)),this.alpha=Math.sqrt(1+e/(1-e)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(s/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),r=Math.log(Math.tan(Math.PI/4+t/2)),o=Math.log((1+h*s)/(1-h*s));this.K=n-this.alpha*r+this.alpha*h/2*o}function forward$7(t){var s=Math.log(Math.tan(Math.PI/4-t.y/2)),i=this.e/2*Math.log((1+this.e*Math.sin(t.y))/(1-this.e*Math.sin(t.y))),a=-this.alpha*(s+i)+this.K,e=2*(Math.atan(Math.exp(a))-Math.PI/4),h=this.alpha*(t.x-this.lambda0),n=Math.atan(Math.sin(h)/(Math.sin(this.b0)*Math.tan(e)+Math.cos(this.b0)*Math.cos(h))),r=Math.asin(Math.cos(this.b0)*Math.sin(e)-Math.sin(this.b0)*Math.cos(e)*Math.cos(h));return t.y=this.R/2*Math.log((1+Math.sin(r))/(1-Math.sin(r)))+this.y0,t.x=this.R*n+this.x0,t}function inverse$7(t){for(var s=t.x-this.x0,i=t.y-this.y0,a=s/this.R,e=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),h=Math.asin(Math.cos(this.b0)*Math.sin(e)+Math.sin(this.b0)*Math.cos(e)*Math.cos(a)),n=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(e))),r=this.lambda0+n/this.alpha,o=0,l=h,c=-1e3,u=0;Math.abs(l-c)>1e-7;){if(++u>20)return;o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+h/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(o))-Math.PI/2}return t.x=r,t.y=l,t}var names$9=["somerc"],somerc={init:init$8,forward:forward$7,inverse:inverse$7,names:names$9},TOL=1e-7;function isTypeA(t){var s="object"==typeof t.PROJECTION?Object.keys(t.PROJECTION)[0]:t.PROJECTION;return"no_uoff"in t||"no_off"in t||-1!==["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"].indexOf(s)}function init$9(){var t,s,i,a,e,h,n,r,o,l,c,u=0,M=0,d=0,f=0,_=0,m=0,p=0;this.no_off=isTypeA(this),this.no_rot="no_rot"in this;var y=!1;"alpha"in this&&(y=!0);var g=!1;if("rectified_grid_angle"in this&&(g=!0),y&&(p=this.alpha),g&&(u=this.rectified_grid_angle*D2R),y||g)M=this.longc;else if(d=this.long1,_=this.lat1,f=this.long2,m=this.lat2,Math.abs(_-m)<=TOL||(t=Math.abs(_))<=TOL||Math.abs(t-HALF_PI)<=TOL||Math.abs(Math.abs(this.lat0)-HALF_PI)<=TOL||Math.abs(Math.abs(m)-HALF_PI)<=TOL)throw new Error;var v=1-this.es;s=Math.sqrt(v),Math.abs(this.lat0)>EPSLN?(r=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*r*r,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/v),this.A=this.B*this.k0*s/t,(e=(a=this.B*s/(i*Math.sqrt(t)))*a-1)<=0?e=0:(e=Math.sqrt(e),this.lat0<0&&(e=-e)),this.E=e+=a,this.E*=Math.pow(tsfnz(this.e,this.lat0,r),this.B)):(this.B=1/s,this.A=this.k0,this.E=a=e=1),y||g?(y?(c=Math.asin(Math.sin(p)/a),g||(u=p)):(c=u,p=Math.asin(a*Math.sin(c))),this.lam0=M-Math.asin(.5*(e-1/e)*Math.tan(c))/this.B):(h=Math.pow(tsfnz(this.e,_,Math.sin(_)),this.B),n=Math.pow(tsfnz(this.e,m,Math.sin(m)),this.B),e=this.E/h,o=(n-h)/(n+h),l=((l=this.E*this.E)-n*h)/(l+n*h),(t=d-f)<-Math.pi?f-=TWO_PI:t>Math.pi&&(f+=TWO_PI),this.lam0=adjust_lon(.5*(d+f)-Math.atan(l*Math.tan(.5*this.B*(d-f))/o)/this.B),c=Math.atan(2*Math.sin(this.B*adjust_lon(d-this.lam0))/(e-1/e)),u=p=Math.asin(a*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(u),this.cosrot=Math.cos(u),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(a*a-1)/Math.cos(p))),this.lat0<0&&(this.u_0=-this.u_0)),e=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(FORTPI-e)),this.v_pole_s=this.ArB*Math.log(Math.tan(FORTPI+e))}function forward$8(t){var s,i,a,e,h,n,r,o,l={};if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-HALF_PI)>EPSLN){if(s=.5*((h=this.E/Math.pow(tsfnz(this.e,t.y,Math.sin(t.y)),this.B))-(n=1/h)),i=.5*(h+n),e=Math.sin(this.B*t.x),a=(s*this.singam-e*this.cosgam)/i,Math.abs(Math.abs(a)-1)0?this.v_pole_n:this.v_pole_s,r=this.ArB*t.y;return this.no_rot?(l.x=r,l.y=o):(r-=this.u_0,l.x=o*this.cosrot+r*this.sinrot,l.y=r*this.cosrot-o*this.sinrot),l.x=this.a*l.x+this.x0,l.y=this.a*l.y+this.y0,l}function inverse$8(t){var s,i,a,e,h,n,r,o={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(i=t.y,s=t.x):(i=t.x*this.cosrot-t.y*this.sinrot,s=t.y*this.cosrot+t.x*this.sinrot+this.u_0),e=.5*((a=Math.exp(-this.BrA*i))-1/a),h=.5*(a+1/a),r=((n=Math.sin(this.BrA*s))*this.cosgam+e*this.singam)/h,Math.abs(Math.abs(r)-1)EPSLN?this.ns=Math.log(a/r)/Math.log(e/o):this.ns=s,isNaN(this.ns)&&(this.ns=s),this.f0=a/(this.ns*Math.pow(e,this.ns)),this.rh=this.a*this.f0*Math.pow(l,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function forward$9(t){var s=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=EPSLN&&(i=sign(i)*(HALF_PI-2*EPSLN));var a,e,h=Math.abs(Math.abs(i)-HALF_PI);if(h>EPSLN)a=tsfnz(this.e,i,Math.sin(i)),e=this.a*this.f0*Math.pow(a,this.ns);else{if((h=i*this.ns)<=0)return null;e=0}var n=this.ns*adjust_lon(s-this.long0);return t.x=this.k0*(e*Math.sin(n))+this.x0,t.y=this.k0*(this.rh-e*Math.cos(n))+this.y0,t}function inverse$9(t){var s,i,a,e,h,n=(t.x-this.x0)/this.k0,r=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(s=Math.sqrt(n*n+r*r),i=1):(s=-Math.sqrt(n*n+r*r),i=-1);var o=0;if(0!==s&&(o=Math.atan2(i*n,i*r)),0!==s||this.ns>0){if(i=1/this.ns,a=Math.pow(s/(this.a*this.f0),i),-9999===(e=phi2z(this.e,a)))return null}else e=-HALF_PI;return h=adjust_lon(o/this.ns+this.long0),t.x=h,t.y=e,t}var names$11=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc"],lcc={init:init$10,forward:forward$9,inverse:inverse$9,names:names$11};function init$11(){this.a=6377397.155,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.4334234309119251),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function forward$10(t){var s,i,a,e,h,n,r,o=t.x,l=t.y,c=adjust_lon(o-this.long0);return s=Math.pow((1+this.e*Math.sin(l))/(1-this.e*Math.sin(l)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(l/2+this.s45),this.alfa)/s)-this.s45),a=-c*this.alfa,e=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(a)),h=Math.asin(Math.cos(i)*Math.sin(a)/Math.cos(e)),n=this.n*h,r=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(e/2+this.s45),this.n),t.y=r*Math.cos(n)/1,t.x=r*Math.sin(n)/1,this.czech||(t.y*=-1,t.x*=-1),t}function inverse$10(t){var s,i,a,e,h,n,r,o=t.x;t.x=t.y,t.y=o,this.czech||(t.y*=-1,t.x*=-1),h=Math.sqrt(t.x*t.x+t.y*t.y),e=Math.atan2(t.y,t.x)/Math.sin(this.s0),a=2*(Math.atan(Math.pow(this.ro0/h,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),s=Math.asin(Math.cos(this.ad)*Math.sin(a)-Math.sin(this.ad)*Math.cos(a)*Math.cos(e)),i=Math.asin(Math.cos(a)*Math.sin(e)/Math.cos(s)),t.x=this.long0-i/this.alfa,n=s,r=0;var l=0;do{t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(s/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(n))/(1-this.e*Math.sin(n)),this.e/2))-this.s45),Math.abs(n-t.y)<1e-10&&(r=1),n=t.y,l+=1}while(0===r&&l<15);return l>=15?null:t}var names$12=["Krovak","krovak"],krovak={init:init$11,forward:forward$10,inverse:inverse$10,names:names$12},mlfn=function(t,s,i,a,e){return t*e-s*Math.sin(2*e)+i*Math.sin(4*e)-a*Math.sin(6*e)},e0fn=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},e1fn=function(t){return.375*t*(1+.25*t*(1+.46875*t))},e2fn=function(t){return.05859375*t*t*(1+.75*t)},e3fn=function(t){return t*t*t*(35/3072)},gN=function(t,s,i){var a=s*i;return t/Math.sqrt(1-a*a)},adjust_lat=function(t){return Math.abs(t)1e-7?(1-t*t)*(s/(1-(i=t*s)*i)-.5/t*Math.log((1-i)/(1+i))):2*s},S_POLE=1,N_POLE=2,EQUIT=3,OBLIQ=4;function init$13(){var t,s=Math.abs(this.lat0);if(Math.abs(s-HALF_PI)0)switch(this.qp=qsfnz(this.e,1),this.mmf=.5/(1-this.es),this.apa=authset(this.es),this.mode){case this.N_POLE:case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),t=Math.sin(this.lat0),this.sinb1=qsfnz(this.e,t)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*t*t)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function forward$12(t){var s,i,a,e,h,n,r,o,l,c,u=t.x,M=t.y;if(u=adjust_lon(u-this.long0),this.sphere){if(h=Math.sin(M),c=Math.cos(M),a=Math.cos(u),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+c*a:1+this.sinph0*h+this.cosph0*c*a)<=EPSLN)return null;s=(i=Math.sqrt(2/i))*c*Math.sin(u),i*=this.mode===this.EQUIT?h:this.cosph0*h-this.sinph0*c*a}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),Math.abs(M+this.lat0)=0?(s=(l=Math.sqrt(n))*e,i=a*(this.mode===this.S_POLE?l:-l)):s=i=0}}return t.x=this.a*s+this.x0,t.y=this.a*i+this.y0,t}function inverse$12(t){t.x-=this.x0,t.y-=this.y0;var s,i,a,e,h,n,r,o=t.x/this.a,l=t.y/this.a;if(this.sphere){var c,u=0,M=0;if((i=.5*(c=Math.sqrt(o*o+l*l)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(M=Math.sin(i),u=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(c)<=EPSLN?0:Math.asin(l*M/c),o*=M,l=u*c;break;case this.OBLIQ:i=Math.abs(c)<=EPSLN?this.lat0:Math.asin(u*this.sinph0+l*M*this.cosph0/c),o*=M*this.cosph0,l=(u-Math.sin(i)*this.sinph0)*c;break;case this.N_POLE:l=-l,i=HALF_PI-i;break;case this.S_POLE:i-=HALF_PI}s=0!==l||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(o,l):0}else{if(r=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(o/=this.dd,l*=this.dd,(n=Math.sqrt(o*o+l*l))1&&(t=t>1?1:-1),Math.asin(t)};function init$14(){Math.abs(this.lat1+this.lat2)EPSLN?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function forward$13(t){var s=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var a=qsfnz(this.e3,this.sin_phi,this.cos_phi),e=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,h=this.ns0*adjust_lon(s-this.long0),n=e*Math.sin(h)+this.x0,r=this.rh-e*Math.cos(h)+this.y0;return t.x=n,t.y=r,t}function inverse$13(t){var s,i,a,e,h,n;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(s=Math.sqrt(t.x*t.x+t.y*t.y),a=1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),a=-1),e=0,0!==s&&(e=Math.atan2(a*t.x,a*t.y)),a=s*this.ns0/this.a,this.sphere?n=Math.asin((this.c-a*a)/(2*this.ns0)):(i=(this.c-a*a)/this.ns0,n=this.phi1z(this.e3,i)),h=adjust_lon(e/this.ns0+this.long0),t.x=h,t.y=n,t}function phi1z(t,s){var i,a,e,h,n=asinz(.5*s);if(t0||Math.abs(h)<=EPSLN?(n=this.x0+1*this.a*i*Math.sin(a)/h,r=this.y0+1*this.a*(this.cos_p14*s-this.sin_p14*i*e)/h):(n=this.x0+this.infinity_dist*i*Math.sin(a),r=this.y0+this.infinity_dist*(this.cos_p14*s-this.sin_p14*i*e)),t.x=n,t.y=r,t}function inverse$14(t){var s,i,a,e,h,n;return t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,t.x/=this.k0,t.y/=this.k0,(s=Math.sqrt(t.x*t.x+t.y*t.y))?(e=Math.atan2(s,this.rc),i=Math.sin(e),a=Math.cos(e),n=asinz(a*this.sin_p14+t.y*i*this.cos_p14/s),h=Math.atan2(t.x*i,s*this.cos_p14*a-t.y*this.sin_p14*i),h=adjust_lon(this.long0+h)):(n=this.phic0,h=0),t.x=h,t.y=n,t}var names$16=["gnom"],gnom={init:init$15,forward:forward$14,inverse:inverse$14,names:names$16},iqsfnz=function(t,s){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(s)-i)<1e-6)return s<0?-1*HALF_PI:HALF_PI;for(var a,e,h,n,r=Math.asin(.5*s),o=0;o<30;o++)if(e=Math.sin(r),h=Math.cos(r),n=t*e,r+=a=Math.pow(1-n*n,2)/(2*h)*(s/(1-t*t)-e/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),Math.abs(a)<=1e-10)return r;return NaN};function init$16(){this.sphere||(this.k0=msfnz(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function forward$15(t){var s,i,a=t.x,e=t.y,h=adjust_lon(a-this.long0);if(this.sphere)s=this.x0+this.a*h*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts);else{var n=qsfnz(this.e,Math.sin(e));s=this.x0+this.a*this.k0*h,i=this.y0+this.a*n*.5/this.k0}return t.x=s,t.y=i,t}function inverse$15(t){var s,i;return t.x-=this.x0,t.y-=this.y0,this.sphere?(s=adjust_lon(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=iqsfnz(this.e,2*t.y*this.k0/this.a),s=adjust_lon(this.long0+t.x/(this.a*this.k0))),t.x=s,t.y=i,t}var names$17=["cea"],cea={init:init$16,forward:forward$15,inverse:inverse$15,names:names$17};function init$17(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function forward$16(t){var s=t.x,i=t.y,a=adjust_lon(s-this.long0),e=adjust_lat(i-this.lat0);return t.x=this.x0+this.a*a*this.rc,t.y=this.y0+this.a*e,t}function inverse$16(t){var s=t.x,i=t.y;return t.x=adjust_lon(this.long0+(s-this.x0)/(this.a*this.rc)),t.y=adjust_lat(this.lat0+(i-this.y0)/this.a),t}var names$18=["Equirectangular","Equidistant_Cylindrical","eqc"],eqc={init:init$17,forward:forward$16,inverse:inverse$16,names:names$18},MAX_ITER$2=20;function init$18(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=e0fn(this.es),this.e1=e1fn(this.es),this.e2=e2fn(this.es),this.e3=e3fn(this.es),this.ml0=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,this.lat0)}function forward$17(t){var s,i,a,e=t.x,h=t.y,n=adjust_lon(e-this.long0);if(a=n*Math.sin(h),this.sphere)Math.abs(h)<=EPSLN?(s=this.a*n,i=-1*this.a*this.lat0):(s=this.a*Math.sin(a)/Math.tan(h),i=this.a*(adjust_lat(h-this.lat0)+(1-Math.cos(a))/Math.tan(h)));else if(Math.abs(h)<=EPSLN)s=this.a*n,i=-1*this.ml0;else{var r=gN(this.a,this.e,Math.sin(h))/Math.tan(h);s=r*Math.sin(a),i=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,h)-this.ml0+r*(1-Math.cos(a))}return t.x=s+this.x0,t.y=i+this.y0,t}function inverse$17(t){var s,i,a,e,h,n,r,o,l;if(a=t.x-this.x0,e=t.y-this.y0,this.sphere)if(Math.abs(e+this.a*this.lat0)<=EPSLN)s=adjust_lon(a/this.a+this.long0),i=0;else{var c;for(n=this.lat0+e/this.a,r=a*a/this.a/this.a+n*n,o=n,h=MAX_ITER$2;h;--h)if(o+=l=-1*(n*(o*(c=Math.tan(o))+1)-o-.5*(o*o+r)*c)/((o-n)/c-1),Math.abs(l)<=EPSLN){i=o;break}s=adjust_lon(this.long0+Math.asin(a*Math.tan(o)/this.a)/Math.sin(i))}else if(Math.abs(e+this.ml0)<=EPSLN)i=0,s=adjust_lon(this.long0+a/this.a);else{var u,M,d,f,_;for(n=(this.ml0+e)/this.a,r=a*a/this.a/this.a+n*n,o=n,h=MAX_ITER$2;h;--h)if(_=this.e*Math.sin(o),u=Math.sqrt(1-_*_)*Math.tan(o),M=this.a*mlfn(this.e0,this.e1,this.e2,this.e3,o),d=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o),o-=l=(n*(u*(f=M/this.a)+1)-f-.5*u*(f*f+r))/(this.es*Math.sin(2*o)*(f*f+r-2*n*f)/(4*u)+(n-f)*(u*d-2/Math.sin(2*o))-d),Math.abs(l)<=EPSLN){i=o;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),s=adjust_lon(this.long0+Math.asin(a*u/this.a)/Math.sin(i))}return t.x=s,t.y=i,t}var names$19=["Polyconic","poly"],poly={init:init$18,forward:forward$17,inverse:inverse$17,names:names$19};function init$19(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function forward$18(t){var s,i=t.x,a=t.y-this.lat0,e=i-this.long0,h=a/SEC_TO_RAD*1e-5,n=e,r=1,o=0;for(s=1;s<=10;s++)r*=h,o+=this.A[s]*r;var l,c=o,u=n,M=1,d=0,f=0,_=0;for(s=1;s<=6;s++)l=d*c+M*u,M=M*c-d*u,d=l,f=f+this.B_re[s]*M-this.B_im[s]*d,_=_+this.B_im[s]*M+this.B_re[s]*d;return t.x=_*this.a+this.x0,t.y=f*this.a+this.y0,t}function inverse$18(t){var s,i,a=t.x,e=t.y,h=a-this.x0,n=(e-this.y0)/this.a,r=h/this.a,o=1,l=0,c=0,u=0;for(s=1;s<=6;s++)i=l*n+o*r,o=o*n-l*r,l=i,c=c+this.C_re[s]*o-this.C_im[s]*l,u=u+this.C_im[s]*o+this.C_re[s]*l;for(var M=0;M.999999999999&&(i=.999999999999),s=Math.asin(i);var a=adjust_lon(this.long0+t.x/(.900316316158*this.a*Math.cos(s)));a<-Math.PI&&(a=-Math.PI),a>Math.PI&&(a=Math.PI),i=(2*s+Math.sin(2*s))/Math.PI,Math.abs(i)>1&&(i=1);var e=Math.asin(i);return t.x=a,t.y=e,t}var names$23=["Mollweide","moll"],moll={init:init$22,forward:forward$21,inverse:inverse$21,names:names$23};function init$23(){Math.abs(this.lat1+this.lat2)=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1);var h=0;if(0!==i&&(h=Math.atan2(s*t.x,s*t.y)),this.sphere)return e=adjust_lon(this.long0+h/this.ns),a=adjust_lat(this.g-i/this.a),t.x=e,t.y=a,t;var n=this.g-i/this.a;return a=imlfn(n,this.e0,this.e1,this.e2,this.e3),e=adjust_lon(this.long0+h/this.ns),t.x=e,t.y=a,t}var names$24=["Equidistant_Conic","eqdc"],eqdc={init:init$23,forward:forward$22,inverse:inverse$22,names:names$24};function init$24(){this.R=this.a}function forward$23(t){var s,i,a=t.x,e=t.y,h=adjust_lon(a-this.long0);Math.abs(e)<=EPSLN&&(s=this.x0+this.R*h,i=this.y0);var n=asinz(2*Math.abs(e/Math.PI));(Math.abs(h)<=EPSLN||Math.abs(Math.abs(e)-HALF_PI)<=EPSLN)&&(s=this.x0,i=e>=0?this.y0+Math.PI*this.R*Math.tan(.5*n):this.y0+Math.PI*this.R*-Math.tan(.5*n));var r=.5*Math.abs(Math.PI/h-h/Math.PI),o=r*r,l=Math.sin(n),c=Math.cos(n),u=c/(l+c-1),M=u*u,d=u*(2/l-1),f=d*d,_=Math.PI*this.R*(r*(u-f)+Math.sqrt(o*(u-f)*(u-f)-(f+o)*(M-f)))/(f+o);h<0&&(_=-_),s=this.x0+_;var m=o+u;return _=Math.PI*this.R*(d*m-r*Math.sqrt((f+o)*(o+1)-m*m))/(f+o),i=e>=0?this.y0+_:this.y0-_,t.x=s,t.y=i,t}function inverse$23(t){var s,i,a,e,h,n,r,o,l,c,u,M;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,h=(a=t.x/u)*a+(e=t.y/u)*e,u=3*(e*e/(o=-2*(n=-Math.abs(e)*(1+h))+1+2*e*e+h*h)+(2*(r=n-2*e*e+a*a)*r*r/o/o/o-9*n*r/o/o)/27)/(l=(n-r*r/3/o)/o)/(c=2*Math.sqrt(-l/3)),Math.abs(u)>1&&(u=u>=0?1:-1),M=Math.acos(u)/3,i=t.y>=0?(-c*Math.cos(M+Math.PI/3)-r/3/o)*Math.PI:-(-c*Math.cos(M+Math.PI/3)-r/3/o)*Math.PI,s=Math.abs(a)2*HALF_PI*this.a)return;return i=s/this.a,a=Math.sin(i),e=Math.cos(i),h=this.long0,Math.abs(s)<=EPSLN?n=this.lat0:(n=asinz(e*this.sin_p12+t.y*a*this.cos_p12/s),r=Math.abs(this.lat0)-HALF_PI,h=Math.abs(r)<=EPSLN?this.lat0>=0?adjust_lon(this.long0+Math.atan2(t.x,-t.y)):adjust_lon(this.long0-Math.atan2(-t.x,t.y)):adjust_lon(this.long0+Math.atan2(t.x*a,s*this.cos_p12*e-t.y*this.sin_p12*a))),t.x=h,t.y=n,t}return o=e0fn(this.es),l=e1fn(this.es),c=e2fn(this.es),u=e3fn(this.es),Math.abs(this.sin_p12-1)<=EPSLN?(M=this.a*mlfn(o,l,c,u,HALF_PI),s=Math.sqrt(t.x*t.x+t.y*t.y),n=imlfn((M-s)/this.a,o,l,c,u),h=adjust_lon(this.long0+Math.atan2(t.x,-1*t.y)),t.x=h,t.y=n,t):Math.abs(this.sin_p12+1)<=EPSLN?(M=this.a*mlfn(o,l,c,u,HALF_PI),s=Math.sqrt(t.x*t.x+t.y*t.y),n=imlfn((s-M)/this.a,o,l,c,u),h=adjust_lon(this.long0+Math.atan2(t.x,t.y)),t.x=h,t.y=n,t):(s=Math.sqrt(t.x*t.x+t.y*t.y),_=Math.atan2(t.x,t.y),d=gN(this.a,this.e,this.sin_p12),m=Math.cos(_),y=-(p=this.e*this.cos_p12*m)*p/(1-this.es),g=3*this.es*(1-y)*this.sin_p12*this.cos_p12*m/(1-this.es),P=1-y*(x=(v=s/d)-y*(1+y)*Math.pow(v,3)/6-g*(1+3*y)*Math.pow(v,4)/24)*x/2-v*x*x*x/6,f=Math.asin(this.sin_p12*Math.cos(x)+this.cos_p12*Math.sin(x)*m),h=adjust_lon(this.long0+Math.asin(Math.sin(_)*Math.sin(x)/Math.cos(f))),E=Math.sin(f),n=Math.atan2((E-this.es*P*this.sin_p12)*Math.tan(f),E*(1-this.es)),t.x=h,t.y=n,t)}var names$26=["Azimuthal_Equidistant","aeqd"],aeqd={init:init$25,forward:forward$24,inverse:inverse$24,names:names$26};function init$26(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function forward$25(t){var s,i,a,e,h,n,r,o=t.x,l=t.y;return a=adjust_lon(o-this.long0),s=Math.sin(l),i=Math.cos(l),e=Math.cos(a),1,((h=this.sin_p14*s+this.cos_p14*i*e)>0||Math.abs(h)<=EPSLN)&&(n=1*this.a*i*Math.sin(a),r=this.y0+1*this.a*(this.cos_p14*s-this.sin_p14*i*e)),t.x=n,t.y=r,t}function inverse$25(t){var s,i,a,e,h,n,r;return t.x-=this.x0,t.y-=this.y0,s=Math.sqrt(t.x*t.x+t.y*t.y),i=asinz(s/this.a),a=Math.sin(i),e=Math.cos(i),n=this.long0,Math.abs(s)<=EPSLN?(r=this.lat0,t.x=n,t.y=r,t):(r=asinz(e*this.sin_p14+t.y*a*this.cos_p14/s),h=Math.abs(this.lat0)-HALF_PI,Math.abs(h)<=EPSLN?(n=this.lat0>=0?adjust_lon(this.long0+Math.atan2(t.x,-t.y)):adjust_lon(this.long0-Math.atan2(-t.x,t.y)),t.x=n,t.y=r,t):(n=adjust_lon(this.long0+Math.atan2(t.x*a,s*this.cos_p14*e-t.y*this.sin_p14*a)),t.x=n,t.y=r,t))}var names$27=["ortho"],ortho={init:init$26,forward:forward$25,inverse:inverse$25,names:names$27},FACE_ENUM={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},AREA_ENUM={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function init$27(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=HALF_PI-FORTPI/2?this.face=FACE_ENUM.TOP:this.lat0<=-(HALF_PI-FORTPI/2)?this.face=FACE_ENUM.BOTTOM:Math.abs(this.long0)<=FORTPI?this.face=FACE_ENUM.FRONT:Math.abs(this.long0)<=HALF_PI+FORTPI?this.face=this.long0>0?FACE_ENUM.RIGHT:FACE_ENUM.LEFT:this.face=FACE_ENUM.BACK,0!==this.es&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function forward$26(t){var s,i,a,e,h,n,r={x:0,y:0},o={value:0};if(t.x-=this.long0,s=0!==this.es?Math.atan(this.one_minus_f_squared*Math.tan(t.y)):t.y,i=t.x,this.face===FACE_ENUM.TOP)e=HALF_PI-s,i>=FORTPI&&i<=HALF_PI+FORTPI?(o.value=AREA_ENUM.AREA_0,a=i-HALF_PI):i>HALF_PI+FORTPI||i<=-(HALF_PI+FORTPI)?(o.value=AREA_ENUM.AREA_1,a=i>0?i-SPI:i+SPI):i>-(HALF_PI+FORTPI)&&i<=-FORTPI?(o.value=AREA_ENUM.AREA_2,a=i+HALF_PI):(o.value=AREA_ENUM.AREA_3,a=i);else if(this.face===FACE_ENUM.BOTTOM)e=HALF_PI+s,i>=FORTPI&&i<=HALF_PI+FORTPI?(o.value=AREA_ENUM.AREA_0,a=-i+HALF_PI):i=-FORTPI?(o.value=AREA_ENUM.AREA_1,a=-i):i<-FORTPI&&i>=-(HALF_PI+FORTPI)?(o.value=AREA_ENUM.AREA_2,a=-i-HALF_PI):(o.value=AREA_ENUM.AREA_3,a=i>0?-i+SPI:-i-SPI);else{var l,c,u,M,d,f;this.face===FACE_ENUM.RIGHT?i=qsc_shift_lon_origin(i,+HALF_PI):this.face===FACE_ENUM.BACK?i=qsc_shift_lon_origin(i,+SPI):this.face===FACE_ENUM.LEFT&&(i=qsc_shift_lon_origin(i,-HALF_PI)),M=Math.sin(s),d=Math.cos(s),f=Math.sin(i),l=d*Math.cos(i),c=d*f,u=M,this.face===FACE_ENUM.FRONT?a=qsc_fwd_equat_face_theta(e=Math.acos(l),u,c,o):this.face===FACE_ENUM.RIGHT?a=qsc_fwd_equat_face_theta(e=Math.acos(c),u,-l,o):this.face===FACE_ENUM.BACK?a=qsc_fwd_equat_face_theta(e=Math.acos(-l),u,-c,o):this.face===FACE_ENUM.LEFT?a=qsc_fwd_equat_face_theta(e=Math.acos(-c),u,l,o):(e=a=0,o.value=AREA_ENUM.AREA_0)}return n=Math.atan(12/SPI*(a+Math.acos(Math.sin(a)*Math.cos(FORTPI))-HALF_PI)),h=Math.sqrt((1-Math.cos(e))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(a))))),o.value===AREA_ENUM.AREA_1?n+=HALF_PI:o.value===AREA_ENUM.AREA_2?n+=SPI:o.value===AREA_ENUM.AREA_3&&(n+=1.5*SPI),r.x=h*Math.cos(n),r.y=h*Math.sin(n),r.x=r.x*this.a+this.x0,r.y=r.y*this.a+this.y0,t.x=r.x,t.y=r.y,t}function inverse$26(t){var s,i,a,e,h,n,r,o,l,c,u,M,d={lam:0,phi:0},f={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,i=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),s=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?f.value=AREA_ENUM.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(f.value=AREA_ENUM.AREA_1,s-=HALF_PI):t.x<0&&-t.x>=Math.abs(t.y)?(f.value=AREA_ENUM.AREA_2,s=s<0?s+SPI:s-SPI):(f.value=AREA_ENUM.AREA_3,s+=HALF_PI),l=SPI/12*Math.tan(s),h=Math.sin(l)/(Math.cos(l)-1/Math.sqrt(2)),n=Math.atan(h),(r=1-(a=Math.cos(s))*a*(e=Math.tan(i))*e*(1-Math.cos(Math.atan(1/Math.cos(n)))))<-1?r=-1:r>1&&(r=1),this.face===FACE_ENUM.TOP)o=Math.acos(r),d.phi=HALF_PI-o,f.value===AREA_ENUM.AREA_0?d.lam=n+HALF_PI:f.value===AREA_ENUM.AREA_1?d.lam=n<0?n+SPI:n-SPI:f.value===AREA_ENUM.AREA_2?d.lam=n-HALF_PI:d.lam=n;else if(this.face===FACE_ENUM.BOTTOM)o=Math.acos(r),d.phi=o-HALF_PI,f.value===AREA_ENUM.AREA_0?d.lam=-n+HALF_PI:f.value===AREA_ENUM.AREA_1?d.lam=-n:f.value===AREA_ENUM.AREA_2?d.lam=-n-HALF_PI:d.lam=n<0?-n-SPI:-n+SPI;else{var _,m,p;l=(_=r)*_,m=(l+=(p=l>=1?0:Math.sqrt(1-l)*Math.sin(n))*p)>=1?0:Math.sqrt(1-l),f.value===AREA_ENUM.AREA_1?(l=m,m=-p,p=l):f.value===AREA_ENUM.AREA_2?(m=-m,p=-p):f.value===AREA_ENUM.AREA_3&&(l=m,m=p,p=-l),this.face===FACE_ENUM.RIGHT?(l=_,_=-m,m=l):this.face===FACE_ENUM.BACK?(_=-_,m=-m):this.face===FACE_ENUM.LEFT&&(l=_,_=m,m=-l),d.phi=Math.acos(-p)-HALF_PI,d.lam=Math.atan2(m,_),this.face===FACE_ENUM.RIGHT?d.lam=qsc_shift_lon_origin(d.lam,-HALF_PI):this.face===FACE_ENUM.BACK?d.lam=qsc_shift_lon_origin(d.lam,-SPI):this.face===FACE_ENUM.LEFT&&(d.lam=qsc_shift_lon_origin(d.lam,+HALF_PI))}0!==this.es&&(c=d.phi<0?1:0,u=Math.tan(d.phi),M=this.b/Math.sqrt(u*u+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-M*M)/(this.one_minus_f*M)),c&&(d.phi=-d.phi));return d.lam+=this.long0,t.x=d.lam,t.y=d.phi,t}function qsc_fwd_equat_face_theta(t,s,i,a){var e;return tFORTPI&&e<=HALF_PI+FORTPI?(a.value=AREA_ENUM.AREA_1,e-=HALF_PI):e>HALF_PI+FORTPI||e<=-(HALF_PI+FORTPI)?(a.value=AREA_ENUM.AREA_2,e=e>=0?e-SPI:e+SPI):(a.value=AREA_ENUM.AREA_3,e+=HALF_PI)),e}function qsc_shift_lon_origin(t,s){var i=t+s;return i<-SPI?i+=TWO_PI:i>+SPI&&(i-=TWO_PI),i}var names$28=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],qsc={init:init$27,forward:forward$26,inverse:inverse$26,names:names$28},COEFS_X=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-9.86701e-7],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,1.8736e-8],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,9.34959e-7],[.7986,-.00755338,-500009e-10,9.35324e-7],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],COEFS_Y=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-1.26793e-9,4.22642e-10],[.124,.0124,5.07171e-9,-1.60604e-9],[.186,.0123999,-1.90189e-8,6.00152e-9],[.248,.0124002,7.10039e-8,-2.24e-8],[.31,.0123992,-2.64997e-7,8.35986e-8],[.372,.0124029,9.88983e-7,-3.11994e-7],[.434,.0123893,-369093e-11,-4.35621e-7],[.4958,.0123198,-102252e-10,-3.45523e-7],[.5571,.0121916,-154081e-10,-5.82288e-7],[.6176,.0119938,-241424e-10,-5.25327e-7],[.6769,.011713,-320223e-10,-5.16405e-7],[.7346,.0113541,-397684e-10,-6.09052e-7],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-1.40374e-9],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],FXC=.8487,FYC=1.3523,C1=R2D/5,RC1=1/C1,NODES=18,poly3_val=function(t,s){return t[0]+s*(t[1]+s*(t[2]+s*t[3]))},poly3_der=function(t,s){return t[1]+s*(2*t[2]+3*s*t[3])};function newton_rapshon(t,s,i,a){for(var e=s;a;--a){var h=t(e);if(e-=h,Math.abs(h)=NODES&&(a=NODES-1),i=R2D*(i-RC1*a);var e={x:poly3_val(COEFS_X[a],i)*s,y:poly3_val(COEFS_Y[a],i)};return t.y<0&&(e.y=-e.y),e.x=e.x*this.a*FXC+this.x0,e.y=e.y*this.a*FYC+this.y0,e}function inverse$27(t){var s={x:(t.x-this.x0)/(this.a*FXC),y:Math.abs(t.y-this.y0)/(this.a*FYC)};if(s.y>=1)s.x/=COEFS_X[NODES][0],s.y=t.y<0?-HALF_PI:HALF_PI;else{var i=Math.floor(s.y*NODES);for(i<0?i=0:i>=NODES&&(i=NODES-1);;)if(COEFS_Y[i][0]>s.y)--i;else{if(!(COEFS_Y[i+1][0]<=s.y))break;++i}var a=COEFS_Y[i],e=5*(s.y-a[0])/(COEFS_Y[i+1][0]-a[0]);e=newton_rapshon((function(t){return(poly3_val(a,t)-s.y)/poly3_der(a,t)}),e,EPSLN,100),s.x/=poly3_val(COEFS_X[i],e),s.y=(5*i+e)*D2R,t.y<0&&(s.y=-s.y)}return s.x=adjust_lon(s.x+this.long0),s}var names$29=["Robinson","robin"],robin={init:init$28,forward:forward$27,inverse:inverse$27,names:names$29};function init$29(){this.name="geocent"}function forward$28(t){return geodeticToGeocentric(t,this.es,this.a)}function inverse$28(t){return geocentricToGeodetic(t,this.es,this.a,this.b)}var names$30=["Geocentric","geocentric","geocent","Geocent"],geocent={init:init$29,forward:forward$28,inverse:inverse$28,names:names$30},mode={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},params={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function init$30(){if(Object.keys(params).forEach(function(t){if(void 0===this[t])this[t]=params[t].def;else{if(params[t].num&&isNaN(this[t]))throw new Error("Invalid parameter value, must be numeric "+t+" = "+this[t]);params[t].num&&(this[t]=parseFloat(this[t]))}params[t].degrees&&(this[t]=this[t]*D2R)}.bind(this)),Math.abs(Math.abs(this.lat0)-HALF_PI)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,s=this.azi;this.cg=Math.cos(s),this.sg=Math.sin(s),this.cw=Math.cos(t),this.sw=Math.sin(t)}function forward$29(t){t.x-=this.long0;var s,i,a,e,h=Math.sin(t.y),n=Math.cos(t.y),r=Math.cos(t.x);switch(this.mode){case mode.OBLIQ:i=this.sinph0*h+this.cosph0*n*r;break;case mode.EQUIT:i=n*r;break;case mode.S_POLE:i=-h;break;case mode.N_POLE:i=h}switch(s=(i=this.pn1/(this.p-i))*n*Math.sin(t.x),this.mode){case mode.OBLIQ:i*=this.cosph0*h-this.sinph0*n*r;break;case mode.EQUIT:i*=h;break;case mode.N_POLE:i*=-n*r;break;case mode.S_POLE:i*=n*r}return e=1/((a=i*this.cg+s*this.sg)*this.sw*this.h1+this.cw),s=(s*this.cg-i*this.sg)*this.cw*e,i=a*e,t.x=s*this.a,t.y=i*this.a,t}function inverse$29(t){t.x/=this.a,t.y/=this.a;var s,i,a,e={x:t.x,y:t.y};a=1/(this.pn1-t.y*this.sw),s=this.pn1*t.x*a,i=this.pn1*t.y*this.cw*a,t.x=s*this.cg+i*this.sg,t.y=i*this.cg-s*this.sg;var h=hypot(t.x,t.y);if(Math.abs(h)