Free javascript Hosting


proj4-minified.js

Uploaded on Mar 11 2022 16:19 by kiemcut

export default function(){"use strict";var t=1,s=2,i=4,a=5,h=484813681109536e-20,e=Math.PI/2,n=.16666666666666666,r=.04722222222222222,o=.022156084656084655,l=1e-10,M=.017453292519943295,c=57.29577951308232,u=Math.PI/4,f=2*Math.PI,m=3.14159265359,p={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},d={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},y=/[\s_\-\/\(\)]/g;function _(t,s){if(t[s])return t[s];for(var i,a=Object.keys(t),h=s.toLowerCase().replace(y,""),e=-1;++e<a.length;)if((i=a[e]).toLowerCase().replace(y,"")===h)return t[i]}var v=function(t){var s,i,a,h={},e=t.split("+").map(function(t){return t.trim()}).filter(function(t){return t}).reduce(function(t,s){var i=s.split("=");return i.push(!0),t[i[0].toLowerCase()]=i[1],t},{}),n={proj:"projName",datum:"datumCode",rf:function(t){h.rf=parseFloat(t)},lat_0:function(t){h.lat0=t*M},lat_1:function(t){h.lat1=t*M},lat_2:function(t){h.lat2=t*M},lat_ts:function(t){h.lat_ts=t*M},lon_0:function(t){h.long0=t*M},lon_1:function(t){h.long1=t*M},lon_2:function(t){h.long2=t*M},alpha:function(t){h.alpha=parseFloat(t)*M},lonc:function(t){h.longc=t*M},x_0:function(t){h.x0=parseFloat(t)},y_0:function(t){h.y0=parseFloat(t)},k_0:function(t){h.k0=parseFloat(t)},k:function(t){h.k0=parseFloat(t)},a:function(t){h.a=parseFloat(t)},b:function(t){h.b=parseFloat(t)},r_a:function(){h.R_A=!0},zone:function(t){h.zone=parseInt(t,10)},south:function(){h.utmSouth=!0},towgs84:function(t){h.datum_params=t.split(",").map(function(t){return parseFloat(t)})},to_meter:function(t){h.to_meter=parseFloat(t)},units:function(t){h.units=t;var s=_(d,t);s&&(h.to_meter=s.to_meter)},from_greenwich:function(t){h.from_greenwich=t*M},pm:function(t){var s=_(p,t);h.from_greenwich=(s||parseFloat(t))*M},nadgrids:function(t){"@null"===t?h.datumCode="none":h.nadgrids=t},axis:function(t){3===t.length&&-1!=="ewnsud".indexOf(t.substr(0,1))&&-1!=="ewnsud".indexOf(t.substr(1,1))&&-1!=="ewnsud".indexOf(t.substr(2,1))&&(h.axis=t)}};for(s in e)i=e[s],s in n?"function"==typeof(a=n[s])?a(i):h[a]=i:h[s]=i;return"string"==typeof h.datumCode&&"WGS84"!==h.datumCode&&(h.datumCode=h.datumCode.toLowerCase()),h},x=1,g=/\s/,b=/[A-Za-z]/,w=/[A-Za-z84]/,A=/[,\]]/,C=/[\d\.E\-\+]/;function E(t){if("string"!=typeof t)throw new Error("not a string");this.text=t.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=x}function P(t,s,i){Array.isArray(s)&&(i.unshift(s),s=null);var a=s?{}:t,h=i.reduce(function(t,s){return N(s,t),t},a);s&&(t[s]=h)}function N(t,s){if(Array.isArray(t)){var i,a=t.shift();if("PARAMETER"===a&&(a=t.shift()),1===t.length)return Array.isArray(t[0])?(s[a]={},void N(t[0],s[a])):void(s[a]=t[0]);if(t.length)if("TOWGS84"!==a)switch(Array.isArray(a)||(s[a]={}),a){case"UNIT":case"PRIMEM":case"VERT_DATUM":return s[a]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&N(t[2],s[a]));case"SPHEROID":case"ELLIPSOID":return s[a]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&N(t[3],s[a]));case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":return t[0]=["name",t[0]],void P(s,a,t);default:for(i=-1;++i<t.length;)if(!Array.isArray(t[i]))return N(t,s[a]);return P(s,a,t)}else s[a]=t;else s[a]=!0}else s[t]=!0}E.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;g.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case x:return this.neutral(t);case 2:return this.keyword(t);case 4:return this.quoted(t);case 5:return this.afterquote(t);case 3:return this.number(t);case-1:return}},E.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(A.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)},E.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=x)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=x,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},E.prototype.number=function(t){if(!C.test(t)){if(A.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},E.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},E.prototype.keyword=function(t){if(w.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=x)}if(!A.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},E.prototype.neutral=function(t){if(b.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(C.test(t))return this.word=t,void(this.state=3);if(!A.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},E.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(-1===this.state)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};var S=.017453292519943295;function k(t){return t*S}var q=function(t){var s=new E(t).output(),i=s.shift(),a=s.shift();s.unshift(["name",a]),s.unshift(["type",i]);var h={};return N(s,h),function(t){"GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"==typeof t.PROJECTION?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),"metre"===t.units&&(t.units="meter"),t.UNIT.convert&&("GEOGCS"===t.type?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var s=t.GEOGCS;function i(s){return s*(t.to_meter||1)}"GEOGCS"===t.type&&(s=t),s&&(s.DATUM?t.datumCode=s.DATUM.name.toLowerCase():t.datumCode=s.name.toLowerCase(),"d_"===t.datumCode.slice(0,2)&&(t.datumCode=t.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==t.datumCode&&"new_zealand_1949"!==t.datumCode||(t.datumCode="nzgd49"),"wgs_1984"===t.datumCode&&("Mercator_Auxiliary_Sphere"===t.PROJECTION&&(t.sphere=!0),t.datumCode="wgs84"),"_ferro"===t.datumCode.slice(-6)&&(t.datumCode=t.datumCode.slice(0,-6)),"_jakarta"===t.datumCode.slice(-8)&&(t.datumCode=t.datumCode.slice(0,-8)),~t.datumCode.indexOf("belge")&&(t.datumCode="rnb72"),s.DATUM&&s.DATUM.SPHEROID&&(t.ellps=s.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=s.DATUM.SPHEROID.a,t.rf=parseFloat(s.DATUM.SPHEROID.rf,10)),s.DATUM&&s.DATUM.TOWGS84&&(t.datum_params=s.DATUM.TOWGS84),~t.datumCode.indexOf("osgb_1936")&&(t.datumCode="osgb36"),~t.datumCode.indexOf("osni_1952")&&(t.datumCode="osni52"),(~t.datumCode.indexOf("tm65")||~t.datumCode.indexOf("geodetic_datum_of_1965"))&&(t.datumCode="ire65"),"ch1903+"===t.datumCode&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_2","Standard_Parallel_2"],["false_easting","False_Easting"],["false_northing","False_Northing"],["central_meridian","Central_Meridian"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",k],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",k],["x0","false_easting",i],["y0","false_northing",i],["long0","central_meridian",k],["lat0","latitude_of_origin",k],["lat0","standard_parallel_1",k],["lat1","standard_parallel_1",k],["lat2","standard_parallel_2",k],["azimuth","Azimuth"],["alpha","azimuth",k],["srsCode","name"]].forEach(function(s){return i=t,h=(a=s)[0],e=a[1],void(!(h in i)&&e in i&&(i[h]=i[e],3===a.length&&(i[h]=a[2](i[h]))));var i,a,h,e}),t.long0||!t.longc||"Albers_Conic_Equal_Area"!==t.projName&&"Lambert_Azimuthal_Equal_Area"!==t.projName||(t.long0=t.longc),t.lat_ts||!t.lat1||"Stereographic_South_Pole"!==t.projName&&"Polar Stereographic (variant B)"!==t.projName||(t.lat0=k(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(h),h};function I(t){var s=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?I[t]=v(arguments[1]):I[t]=q(arguments[1]):I[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?I.apply(s,t):I(t)});if("string"==typeof t){if(t in I)return I[t]}else"EPSG"in t?I["EPSG:"+t.EPSG]=t:"ESRI"in t?I["ESRI:"+t.ESRI]=t:"IAU2000"in t?I["IAU2000:"+t.IAU2000]=t:console.log(t);return}}!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"]}(I);var O=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var R=["3857","900913","3785","102113"];function G(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in I}(t))return I[t];if(function(t){return O.some(function(s){return t.indexOf(s)>-1})}(t)){var s=q(t);if(function(t){var s=_(t,"authority");if(s){var i=_(s,"epsg");return i&&R.indexOf(i)>-1}}(s))return I["EPSG:3857"];var i=function(t){var s=_(t,"extension");if(s)return _(s,"proj4")}(s);return i?v(i):s}return function(t){return"+"===t[0]}(t)?v(t):void 0}var T=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},j=function(t,s,i){var a=t*s;return i/Math.sqrt(1-a*a)},L=function(t){return t<0?-1:1},z=function(t){return Math.abs(t)<=m?t:t-L(t)*f},D=function(t,s,i){var a=t*i,h=.5*t;return a=Math.pow((1-a)/(1+a),h),Math.tan(.5*(e-s))/a},B=function(t,s){for(var i,a,h=.5*t,n=e-2*Math.atan(s),r=0;r<=15;r++)if(i=t*Math.sin(n),n+=a=e-2*Math.atan(s*Math.pow((1-i)/(1+i),h))-n,Math.abs(a)<=1e-10)return n;return-9999};function U(t){return t}var F=[{init:function(){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=j(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)},forward:function(t){var s,i,a=t.x,h=t.y;if(h*c>90&&h*c<-90&&a*c>180&&a*c<-180)return null;if(Math.abs(Math.abs(h)-e)<=l)return null;if(this.sphere)s=this.x0+this.a*this.k0*z(a-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(u+.5*h));else{var n=Math.sin(h),r=D(this.e,h,n);s=this.x0+this.a*this.k0*z(a-this.long0),i=this.y0-this.a*this.k0*Math.log(r)}return t.x=s,t.y=i,t},inverse:function(t){var s,i,a=t.x-this.x0,h=t.y-this.y0;if(this.sphere)i=e-2*Math.atan(Math.exp(-h/(this.a*this.k0)));else{var n=Math.exp(-h/(this.a*this.k0));if(-9999===(i=B(this.e,n)))return null}return s=z(this.long0+a/(this.a*this.k0)),t.x=s,t.y=i,t},names:["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"]},{init:function(){},forward:U,inverse:U,names:["longlat","identity"]}],Q={},W=[];function H(t,s){var i=W.length;return t.names?(W[i]=t,t.names.forEach(function(t){Q[t.toLowerCase()]=i}),this):(console.log(s),!0)}var K={start:function(){F.forEach(H)},add:H,get:function(t){if(!t)return!1;var s=t.toLowerCase();return void 0!==Q[s]&&W[Q[s]]?W[Q[s]]:void 0}},X={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"}},J=X.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};X.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var V={};function Z(e,M){if(!(this instanceof Z))return new Z(e);M=M||function(t){if(t)throw t};var c=G(e);if("object"==typeof c){var u=Z.projections.get(c.projName);if(u){if(c.datumCode&&"none"!==c.datumCode){var f=_(V,c.datumCode);f&&(c.datum_params=f.towgs84?f.towgs84.split(","):null,c.ellps=f.ellipse,c.datumName=f.datumName?f.datumName:c.datumCode)}c.k0=c.k0||1,c.axis=c.axis||"enu",c.ellps=c.ellps||"wgs84";var m,p,d,y,v,x,g,b=function(t,s,i,a,h){if(!t){var e=_(X,a);e||(e=J),t=e.a,s=e.b,i=e.rf}return i&&!s&&(s=(1-1/i)*t),(0===i||Math.abs(t-s)<l)&&(h=!0,s=t),{a:t,b:s,rf:i,sphere:h}}(c.a,c.b,c.rf,c.ellps,c.sphere),w=(m=b.a,p=b.b,b.rf,d=c.R_A,x=((y=m*m)-(v=p*p))/y,g=0,d?(y=(m*=1-x*(n+x*(r+x*o)))*m,x=0):g=Math.sqrt(x),{es:x,e:g,ep2:(y-v)/v}),A=c.datum||function(e,n,r,o,l,M){var c={};return c.datum_type=void 0===e||"none"===e?a:i,n&&(c.datum_params=n.map(parseFloat),0===c.datum_params[0]&&0===c.datum_params[1]&&0===c.datum_params[2]||(c.datum_type=t),c.datum_params.length>3&&(0===c.datum_params[3]&&0===c.datum_params[4]&&0===c.datum_params[5]&&0===c.datum_params[6]||(c.datum_type=s,c.datum_params[3]*=h,c.datum_params[4]*=h,c.datum_params[5]*=h,c.datum_params[6]=c.datum_params[6]/1e6+1))),c.a=r,c.b=o,c.es=l,c.ep2=M,c}(c.datumCode,c.datum_params,b.a,b.b,w.es,w.ep2);T(this,c),T(this,u),this.a=b.a,this.b=b.b,this.rf=b.rf,this.sphere=b.sphere,this.es=w.es,this.e=w.e,this.ep2=w.ep2,this.datum=A,this.init(),M(null,this)}else M(e)}else M(e)}function Y(i){return i===t||i===s}V.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},V.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},V.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},V.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},V.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},V.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},V.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},V.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},V.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},V.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},V.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},V.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},V.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},V.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},V.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},V.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},V.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},Z.projections=K,Z.projections.start();var $=function(i,h,n){return function(i,a){return i.datum_type===a.datum_type&&!(i.a!==a.a||Math.abs(i.es-a.es)>5e-11)&&(i.datum_type===t?i.datum_params[0]===a.datum_params[0]&&i.datum_params[1]===a.datum_params[1]&&i.datum_params[2]===a.datum_params[2]:i.datum_type!==s||i.datum_params[0]===a.datum_params[0]&&i.datum_params[1]===a.datum_params[1]&&i.datum_params[2]===a.datum_params[2]&&i.datum_params[3]===a.datum_params[3]&&i.datum_params[4]===a.datum_params[4]&&i.datum_params[5]===a.datum_params[5]&&i.datum_params[6]===a.datum_params[6])}(i,h)?n:i.datum_type===a||h.datum_type===a?n:i.es!==h.es||i.a!==h.a||Y(i.datum_type)||Y(h.datum_type)?(n=function(t,s,i){var a,h,n,r,o=t.x,l=t.y,M=t.z?t.z:0;if(l<-e&&l>-1.001*e)l=-e;else if(l>e&&l<1.001*e)l=e;else{if(l<-e)return{x:-1/0,y:-1/0,z:t.z};if(l>e)return{x:1/0,y:1/0,z:t.z}}return o>Math.PI&&(o-=2*Math.PI),h=Math.sin(l),r=Math.cos(l),n=h*h,{x:((a=i/Math.sqrt(1-s*n))+M)*r*Math.cos(o),y:(a+M)*r*Math.sin(o),z:(a*(1-s)+M)*h}}(n,i.es,i.a),Y(i.datum_type)&&(n=function(i,a,h){if(a===t)return{x:i.x+h[0],y:i.y+h[1],z:i.z+h[2]};if(a===s){var e=h[0],n=h[1],r=h[2],o=h[3],l=h[4],M=h[5],c=h[6];return{x:c*(i.x-M*i.y+l*i.z)+e,y:c*(M*i.x+i.y-o*i.z)+n,z:c*(-l*i.x+o*i.y+i.z)+r}}}(n,i.datum_type,i.datum_params)),Y(h.datum_type)&&(n=function(i,a,h){if(a===t)return{x:i.x-h[0],y:i.y-h[1],z:i.z-h[2]};if(a===s){var e=h[0],n=h[1],r=h[2],o=h[3],l=h[4],M=h[5],c=h[6],u=(i.x-e)/c,f=(i.y-n)/c,m=(i.z-r)/c;return{x:u+M*f-l*m,y:-M*u+f+o*m,z:l*u-o*f+m}}}(n,h.datum_type,h.datum_params)),function(t,s,i,a){var h,e,n,r,o,l,M,c,u,f,m,p,d,y,_,v=t.x,x=t.y,g=t.z?t.z:0;if(h=Math.sqrt(v*v+x*x),e=Math.sqrt(v*v+x*x+g*g),h/i<1e-12){if(y=0,e/i<1e-12)return _=-a,{x:t.x,y:t.y,z:t.z}}else y=Math.atan2(x,v);n=g/e,c=(r=h/e)*(1-s)*(o=1/Math.sqrt(1-s*(2-s)*r*r)),u=n*o,d=0;do{d++,l=s*(M=i/Math.sqrt(1-s*u*u))/(M+(_=h*c+g*u-M*(1-s*u*u))),p=(m=n*(o=1/Math.sqrt(1-l*(2-l)*r*r)))*c-(f=r*(1-l)*o)*u,c=f,u=m}while(p*p>1e-24&&d<30);return{x:y,y:Math.atan(m/Math.abs(f)),z:_}}(n,h.es,h.a,h.b)):n},tt=function(t,s,i){var a,h,e,n=i.x,r=i.y,o=i.z||0,l={};for(e=0;e<3;e++)if(!s||2!==e||void 0!==i.z)switch(0===e?(a=n,h="x"):1===e?(a=r,h="y"):(a=o,h="z"),t.axis[e]){case"e":l[h]=a;break;case"w":l[h]=-a;break;case"n":l[h]=a;break;case"s":l[h]=-a;break;case"u":void 0!==i[h]&&(l.z=a);break;case"d":void 0!==i[h]&&(l.z=-a);break;default:return null}return l},st=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},it=function(t){at(t.x),at(t.y)};function at(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 ht(i,a,h){var e;return Array.isArray(h)&&(h=st(h)),it(h),i.datum&&a.datum&&function(i,a){return(i.datum.datum_type===t||i.datum.datum_type===s)&&"WGS84"!==a.datumCode||(a.datum.datum_type===t||a.datum.datum_type===s)&&"WGS84"!==i.datumCode}(i,a)&&(h=ht(i,e=new Z("WGS84"),h),i=e),"enu"!==i.axis&&(h=tt(i,!1,h)),"longlat"===i.projName?h={x:h.x*M,y:h.y*M}:(i.to_meter&&(h={x:h.x*i.to_meter,y:h.y*i.to_meter}),h=i.inverse(h)),i.from_greenwich&&(h.x+=i.from_greenwich),h=$(i.datum,a.datum,h),a.from_greenwich&&(h={x:h.x-a.from_greenwich,y:h.y}),"longlat"===a.projName?h={x:h.x*c,y:h.y*c}:(h=a.forward(h),a.to_meter&&(h={x:h.x/a.to_meter,y:h.y/a.to_meter})),"enu"!==a.axis?tt(a,!0,h):h}var et=Z("WGS84");function nt(t,s,i){var a,h,e;return Array.isArray(i)?(a=ht(t,s,i),3===i.length?[a.x,a.y,a.z]:[a.x,a.y]):(h=ht(t,s,i),2===(e=Object.keys(i)).length?h:(e.forEach(function(t){"x"!==t&&"y"!==t&&(h[t]=i[t])}),h))}function rt(t){return t instanceof Z?t:t.oProj?t.oProj:Z(t)}function ot(t,s,i){t=rt(t);var a,h=!1;return void 0===s?(s=t,t=et,h=!0):(void 0!==s.x||Array.isArray(s))&&(i=s,s=t,t=et,h=!0),s=rt(s),i?nt(t,s,i):(a={forward:function(i){return nt(t,s,i)},inverse:function(i){return nt(s,t,i)}},h&&(a.oProj=s),a)}var lt=6,Mt="AJSAJS",ct="AFAFAF",ut=65,ft=73,mt=79,pt=86,dt=90,yt={forward:_t,inverse:function(t){var s=bt(Ct(t.toUpperCase()));if(s.lat&&s.lon)return[s.lon,s.lat,s.lon,s.lat];return[s.left,s.bottom,s.right,s.top]},toPoint:vt};function _t(t,s){return s=s||5,function(t,s){var i="00000"+t.easting,a="00000"+t.northing;return t.zoneNumber+t.zoneLetter+(f=t.easting,m=t.northing,p=t.zoneNumber,d=At(p),y=Math.floor(f/1e5),_=Math.floor(m/1e5)%20,h=y,e=_,n=d,r=n-1,o=Mt.charCodeAt(r),l=ct.charCodeAt(r),M=o+h-1,c=l+e,u=!1,M>dt&&(M=M-dt+ut-1,u=!0),(M===ft||o<ft&&M>ft||(M>ft||o<ft)&&u)&&M++,(M===mt||o<mt&&M>mt||(M>mt||o<mt)&&u)&&++M===ft&&M++,M>dt&&(M=M-dt+ut-1),c>pt?(c=c-pt+ut-1,u=!0):u=!1,(c===ft||l<ft&&c>ft||(c>ft||l<ft)&&u)&&c++,(c===mt||l<mt&&c>mt||(c>mt||l<mt)&&u)&&++c===ft&&c++,c>pt&&(c=c-pt+ut-1),String.fromCharCode(M)+String.fromCharCode(c))+i.substr(i.length-5,s)+a.substr(a.length-5,s);var h,e,n,r,o,l,M,c,u;var f,m,p,d,y,_}(function(t){var s,i,a,h,e,n,r,o=t.lat,l=t.lon,M=6378137,c=xt(o),u=xt(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=xt(6*(r-1)-180+3),.006739496752268451,s=M/Math.sqrt(1-.00669438*Math.sin(c)*Math.sin(c)),i=Math.tan(c)*Math.tan(c),a=.006739496752268451*Math.cos(c)*Math.cos(c),h=Math.cos(c)*(u-n),e=M*(.9983242984503243*c-.002514607064228144*Math.sin(2*c)+2639046602129982e-21*Math.sin(4*c)-3.418046101696858e-9*Math.sin(6*c));var f=.9996*s*(h+(1-i+a)*h*h*h/6+(5-18*i+i*i+72*a-.39089081163157013)*h*h*h*h*h/120)+5e5,m=.9996*(e+s*Math.tan(c)*(h*h/2+(5-i+9*a+4*a*a)*h*h*h*h/24+(61-58*i+i*i+600*a-2.2240339282485886)*h*h*h*h*h*h/720));o<0&&(m+=1e7);return{northing:Math.round(m),easting:Math.round(f),zoneNumber:r,zoneLetter:wt(o)}}({lat:t[1],lon:t[0]}),s)}function vt(t){var s=bt(Ct(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat]:[(s.left+s.right)/2,(s.top+s.bottom)/2]}function xt(t){return t*(Math.PI/180)}function gt(t){return t/Math.PI*180}function bt(t){var s=t.northing,i=t.easting,a=t.zoneLetter,h=t.zoneNumber;if(h<0||h>60)return null;var e,n,r,o,l,M,c,u,f=6378137,m=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),p=i-5e5,d=s;a<"N"&&(d-=1e7),M=6*(h-1)-180+3,u=(c=d/.9996/6367449.145945056)+(3*m/2-27*m*m*m/32)*Math.sin(2*c)+(21*m*m/16-55*m*m*m*m/32)*Math.sin(4*c)+151*m*m*m/96*Math.sin(6*c),e=f/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),n=Math.tan(u)*Math.tan(u),r=.006739496752268451*Math.cos(u)*Math.cos(u),o=.99330562*f/Math.pow(1-.00669438*Math.sin(u)*Math.sin(u),1.5),l=p/(.9996*e);var y=u-e*Math.tan(u)/o*(l*l/2-(5+3*n+10*r-4*r*r-.06065547077041606)*l*l*l*l/24+(61+90*n+298*r+45*n*n-1.6983531815716497-3*r*r)*l*l*l*l*l*l/720);y=gt(y);var _,v=(l-(1+2*n+r)*l*l*l/6+(5-2*r+28*n-3*r*r+.05391597401814761+24*n*n)*l*l*l*l*l/120)/Math.cos(u);if(v=M+gt(v),t.accuracy){var x=bt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});_={top:x.lat,right:x.lon,bottom:y,left:v}}else _={lat:y,lon:v};return _}function wt(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 At(t){var s=t%lt;return 0===s&&(s=lt),s}function Ct(t){if(t&&0===t.length)throw"MGRSPoint coverting from nothing";for(var s,i=t.length,a=null,h="",e=0;!/[A-Z]/.test(s=t.charAt(e));){if(e>=2)throw"MGRSPoint bad conversion from: "+t;h+=s,e++}var n=parseInt(h,10);if(0===e||e+3>i)throw"MGRSPoint bad conversion from: "+t;var r=t.charAt(e++);if(r<="A"||"B"===r||"Y"===r||r>="Z"||"I"===r||"O"===r)throw"MGRSPoint zone letter "+r+" not handled: "+t;a=t.substring(e,e+=2);for(var o=At(n),l=function(t,s){var i=Mt.charCodeAt(s-1),a=1e5,h=!1;for(;i!==t.charCodeAt(0);){if(++i===ft&&i++,i===mt&&i++,i>dt){if(h)throw"Bad character: "+t;i=ut,h=!0}a+=1e5}return a}(a.charAt(0),o),M=function(t,s){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var i=ct.charCodeAt(s-1),a=0,h=!1;for(;i!==t.charCodeAt(0);){if(++i===ft&&i++,i===mt&&i++,i>pt){if(h)throw"Bad character: "+t;i=ut,h=!0}a+=1e5}return a}(a.charAt(1),o);M<Et(r);)M+=2e6;var c=i-e;if(c%2!=0)throw"MGRSPoint has to have an even number \nof digits after the zone letter and two 100km letters - front \nhalf for easting meters, second half for \nnorthing meters"+t;var u,f,m,p=c/2,d=0,y=0;return p>0&&(u=1e5/Math.pow(10,p),f=t.substring(e,e+p),d=parseFloat(f)*u,m=t.substring(e+p),y=parseFloat(m)*u),{easting:d+l,northing:y+M,zoneLetter:r,zoneNumber:n,accuracy:u}}function Et(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 Pt(t,s,i){if(!(this instanceof Pt))return new Pt(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")}Pt.fromMGRS=function(t){return new Pt(vt(t))},Pt.prototype.toMGRS=function(t){return _t([this.x,this.y],t)};var Nt=.01068115234375,St=function(t){var s=[];s[0]=1-t*(.25+t*(.046875+t*(.01953125+t*Nt))),s[1]=t*(.75-t*(.046875+t*(.01953125+t*Nt)));var i=t*t;return s[2]=i*(.46875-t*(.013020833333333334+.007120768229166667*t)),i*=t,s[3]=i*(.3645833333333333-.005696614583333333*t),s[4]=i*t*.3076171875,s},kt=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])))},qt=function(t,s,i){for(var a=1/(1-s),h=t,e=20;e;--e){var n=Math.sin(h),r=1-s*n*n;if(h-=r=(kt(h,n,Math.cos(h),i)-t)*(r*Math.sqrt(r))*a,Math.abs(r)<l)return h}return h};var It={init:function(){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.es&&(this.en=St(this.es),this.ml0=kt(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var s,i,a,h=t.x,e=t.y,n=z(h-this.long0),r=Math.sin(e),o=Math.cos(e);if(this.es){var M=o*n,c=Math.pow(M,2),u=this.ep2*Math.pow(o,2),f=Math.pow(u,2),m=Math.abs(o)>l?Math.tan(e):0,p=Math.pow(m,2),d=Math.pow(p,2);s=1-this.es*Math.pow(r,2),M/=Math.sqrt(s);var y=kt(e,r,o,this.en);i=this.a*(this.k0*M*(1+c/6*(1-p+u+c/20*(5-18*p+d+14*u-58*p*u+c/42*(61+179*d-d*p-479*p)))))+this.x0,a=this.a*(this.k0*(y-this.ml0+r*n*M/2*(1+c/12*(5-p+9*u+4*f+c/30*(61+d-58*p+270*u-330*p*u+c/56*(1385+543*d-d*p-3111*p))))))+this.y0}else{var _=o*Math.sin(n);if(Math.abs(Math.abs(_)-1)<l)return 93;if(i=.5*this.a*this.k0*Math.log((1+_)/(1-_))+this.x0,a=o*Math.cos(n)/Math.sqrt(1-Math.pow(_,2)),(_=Math.abs(a))>=1){if(_-1>l)return 93;a=0}else a=Math.acos(a);e<0&&(a=-a),a=this.a*this.k0*(a-this.lat0)+this.y0}return t.x=i,t.y=a,t},inverse:function(t){var s,i,a,h,n=(t.x-this.x0)*(1/this.a),r=(t.y-this.y0)*(1/this.a);if(this.es)if(s=this.ml0+r/this.k0,i=qt(s,this.es,this.en),Math.abs(i)<e){var o=Math.sin(i),M=Math.cos(i),c=Math.abs(M)>l?Math.tan(i):0,u=this.ep2*Math.pow(M,2),f=Math.pow(u,2),m=Math.pow(c,2),p=Math.pow(m,2);s=1-this.es*Math.pow(o,2);var d=n*Math.sqrt(s)/this.k0,y=Math.pow(d,2);a=i-(s*=c)*y/(1-this.es)*.5*(1-y/12*(5+3*m-9*u*m+u-4*f-y/30*(61+90*m-252*u*m+45*p+46*u-y/56*(1385+3633*m+4095*p+1574*p*m)))),h=z(this.long0+d*(1-y/6*(1+2*m+u-y/20*(5+28*m+24*p+8*u*m+6*u-y/42*(61+662*m+1320*p+720*p*m))))/M)}else a=e*L(r),h=0;else{var _=Math.exp(n/this.k0),v=.5*(_-1/_),x=this.lat0+r/this.k0,g=Math.cos(x);s=Math.sqrt((1-Math.pow(g,2))/(1+Math.pow(v,2))),a=Math.asin(s),r<0&&(a=-a),h=0===v&&0===g?0:z(Math.atan2(v,g)+this.long0)}return t.x=h,t.y=a,t},names:["Transverse_Mercator","Transverse Mercator","tmerc"]},Ot=function(t){var s=Math.exp(t);return s=(s-1/s)/2},Rt=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))},Gt=function(t){var s=Math.abs(t);return s=function(t){var s=1+t,i=s-1;return 0===i?t:t*Math.log(s)/i}(s*(1+s/(Rt(1,s)+1))),t<0?-s:s},Tt=function(t,s){for(var i,a=2*Math.cos(2*s),h=t.length-1,e=t[h],n=0;--h>=0;)i=a*e-n+t[h],n=e,e=i;return s+i*Math.sin(2*s)},jt=function(t,s){for(var i,a=2*Math.cos(s),h=t.length-1,e=t[h],n=0;--h>=0;)i=a*e-n+t[h],n=e,e=i;return Math.sin(s)*i},Lt=function(t,s,i){for(var a,h,e=Math.sin(s),n=Math.cos(s),r=Ot(i),o=function(t){var s=Math.exp(t);return s=(s+1/s)/2}(i),l=2*n*o,M=-2*e*r,c=t.length-1,u=t[c],f=0,m=0,p=0;--c>=0;)a=m,h=f,u=l*(m=u)-a-M*(f=p)+t[c],p=M*m-h+l*f;return[(l=e*o)*u-(M=n*r)*p,l*p+M*u]};var zt={init:function(){if(void 0===this.es||this.es<=0)throw new Error("incorrect elliptical usage");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*(.25+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]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var a=Tt(this.cbg,this.lat0);this.Zb=-this.Qn*(a+jt(this.gtu,2*a))},forward:function(t){var s=z(t.x-this.long0),i=t.y;i=Tt(this.cbg,i);var a=Math.sin(i),h=Math.cos(i),e=Math.sin(s),n=Math.cos(s);i=Math.atan2(a,n*h),s=Math.atan2(e*h,Rt(a,h*n)),s=Gt(Math.tan(s));var r,o,l=Lt(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},inverse:function(t){var s,i,a=(t.x-this.x0)*(1/this.a),h=(t.y-this.y0)*(1/this.a);if(h=(h-this.Zb)/this.Qn,a/=this.Qn,Math.abs(a)<=2.623395162778){var e=Lt(this.utg,2*h,2*a);h+=e[0],a+=e[1],a=Math.atan(Ot(a));var n=Math.sin(h),r=Math.cos(h),o=Math.sin(a),l=Math.cos(a);h=Math.atan2(n*l,Rt(o,l*r)),a=Math.atan2(o,l*r),s=z(a+this.long0),i=Tt(this.cgb,h)}else s=1/0,i=1/0;return t.x=s,t.y=i,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"]},Dt=function(t,s){if(void 0===t){if((t=Math.floor(30*(z(s)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)return 60}return t};var Bt={init:function(){var t=Dt(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*M,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,zt.init.apply(this),this.forward=zt.forward,this.inverse=zt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},Ut=function(t,s){return Math.pow((1-t)/(1+t),s)},Ft=20;var Qt={init:function(){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+u)/(Math.pow(Math.tan(.5*this.lat0+u),this.C)*Ut(this.e*t,this.ratexp))},forward:function(t){var s=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+u),this.C)*Ut(this.e*Math.sin(i),this.ratexp))-e,t.x=this.C*s,t},inverse:function(t){for(var s=t.x/this.C,i=t.y,a=Math.pow(Math.tan(.5*i+u)/this.K,1/this.C),h=Ft;h>0&&(i=2*Math.atan(a*Ut(this.e*Math.sin(t.y),-.5*this.e))-e,!(Math.abs(i-t.y)<1e-14));--h)t.y=i;return h?(t.x=s,t.y=i,t):null},names:["gauss"]};var Wt={init:function(){Qt.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"))},forward:function(t){var s,i,a,h;return t.x=z(t.x-this.long0),Qt.forward.apply(this,[t]),s=Math.sin(t.y),i=Math.cos(t.y),a=Math.cos(t.x),h=this.k0*this.R2/(1+this.sinc0*s+this.cosc0*i*a),t.x=h*i*Math.sin(t.x),t.y=h*(this.cosc0*s-this.sinc0*i*a),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t},inverse:function(t){var s,i,a,h,e;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,e=Math.sqrt(t.x*t.x+t.y*t.y)){var n=2*Math.atan2(e,this.R2);s=Math.sin(n),i=Math.cos(n),h=Math.asin(i*this.sinc0+t.y*s*this.cosc0/e),a=Math.atan2(t.x*s,e*this.cosc0*i-t.y*this.sinc0*s)}else h=this.phic0,a=0;return t.x=a,t.y=h,Qt.inverse.apply(this,[t]),t.x=z(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var Ht={init:function(){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)<=l&&(this.k0=.5*(1+L(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=l&&(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)<=l&&(this.k0=.5*this.cons*j(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/D(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=j(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-e,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var s,i,a,h,n,r,o=t.x,M=t.y,c=Math.sin(M),u=Math.cos(M),f=z(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=l&&Math.abs(M+this.lat0)<=l?(t.x=NaN,t.y=NaN,t):this.sphere?(s=2*this.k0/(1+this.sinlat0*c+this.coslat0*u*Math.cos(f)),t.x=this.a*s*u*Math.sin(f)+this.x0,t.y=this.a*s*(this.coslat0*c-this.sinlat0*u*Math.cos(f))+this.y0,t):(i=2*Math.atan(this.ssfn_(M,c,this.e))-e,h=Math.cos(i),a=Math.sin(i),Math.abs(this.coslat0)<=l?(n=D(this.e,M*this.con,this.con*c),r=2*this.a*this.k0*n/this.cons,t.x=this.x0+r*Math.sin(o-this.long0),t.y=this.y0-this.con*r*Math.cos(o-this.long0),t):(Math.abs(this.sinlat0)<l?(s=2*this.a*this.k0/(1+h*Math.cos(f)),t.y=s*a):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*h*Math.cos(f))),t.y=s*(this.cosX0*a-this.sinX0*h*Math.cos(f))+this.y0),t.x=s*h*Math.sin(f)+this.x0,t))},inverse:function(t){var s,i,a,h,n;t.x-=this.x0,t.y-=this.y0;var r=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var o=2*Math.atan(r/(2*this.a*this.k0));return s=this.long0,i=this.lat0,r<=l?(t.x=s,t.y=i,t):(i=Math.asin(Math.cos(o)*this.sinlat0+t.y*Math.sin(o)*this.coslat0/r),s=Math.abs(this.coslat0)<l?this.lat0>0?z(this.long0+Math.atan2(t.x,-1*t.y)):z(this.long0+Math.atan2(t.x,t.y)):z(this.long0+Math.atan2(t.x*Math.sin(o),r*this.coslat0*Math.cos(o)-t.y*this.sinlat0*Math.sin(o))),t.x=s,t.y=i,t)}if(Math.abs(this.coslat0)<=l){if(r<=l)return i=this.lat0,s=this.long0,t.x=s,t.y=i,t;t.x*=this.con,t.y*=this.con,a=r*this.cons/(2*this.a*this.k0),i=this.con*B(this.e,a),s=this.con*z(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else h=2*Math.atan(r*this.cosX0/(2*this.a*this.k0*this.ms1)),s=this.long0,r<=l?n=this.X0:(n=Math.asin(Math.cos(h)*this.sinX0+t.y*Math.sin(h)*this.cosX0/r),s=z(this.long0+Math.atan2(t.x*Math.sin(h),r*this.cosX0*Math.cos(h)-t.y*this.sinX0*Math.sin(h)))),i=-1*B(this.e,Math.tan(.5*(e+n)));return t.x=s,t.y=i,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,s,i){return s*=i,Math.tan(.5*(e+t))*Math.pow((1-s)/(1+s),.5*i)}};var Kt={init:function(){var t=this.lat0;this.lambda0=this.long0;var s=Math.sin(t),i=this.a,a=1/this.rf,h=2*a-Math.pow(a,2),e=this.e=Math.sqrt(h);this.R=this.k0*i*Math.sqrt(1-h)/(1-h*Math.pow(s,2)),this.alpha=Math.sqrt(1+h/(1-h)*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+e*s)/(1-e*s));this.K=n-this.alpha*r+this.alpha*e/2*o},forward:function(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,h=2*(Math.atan(Math.exp(a))-Math.PI/4),e=this.alpha*(t.x-this.lambda0),n=Math.atan(Math.sin(e)/(Math.sin(this.b0)*Math.tan(h)+Math.cos(this.b0)*Math.cos(e))),r=Math.asin(Math.cos(this.b0)*Math.sin(h)-Math.sin(this.b0)*Math.cos(h)*Math.cos(e));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},inverse:function(t){for(var s=t.x-this.x0,i=t.y-this.y0,a=s/this.R,h=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),e=Math.asin(Math.cos(this.b0)*Math.sin(h)+Math.sin(this.b0)*Math.cos(h)*Math.cos(a)),n=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(h))),r=this.lambda0+n/this.alpha,o=0,l=e,M=-1e3,c=0;Math.abs(l-M)>1e-7;){if(++c>20)return;o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+e/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),M=l,l=2*Math.atan(Math.exp(o))-Math.PI/2}return t.x=r,t.y=l,t},names:["somerc"]};var Xt={init:function(){this.no_off=this.no_off||!1,this.no_rot=this.no_rot||!1,isNaN(this.k0)&&(this.k0=1);var t=Math.sin(this.lat0),s=Math.cos(this.lat0),i=this.e*t;this.bl=Math.sqrt(1+this.es/(1-this.es)*Math.pow(s,4)),this.al=this.a*this.bl*this.k0*Math.sqrt(1-this.es)/(1-i*i);var a,h,e=D(this.e,this.lat0,t),n=this.bl/s*Math.sqrt((1-this.es)/(1-i*i));if(n*n<1&&(n=1),isNaN(this.longc)){var r=D(this.e,this.lat1,Math.sin(this.lat1)),o=D(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(n+Math.sqrt(n*n-1))*Math.pow(e,this.bl):this.el=(n-Math.sqrt(n*n-1))*Math.pow(e,this.bl);var l=Math.pow(r,this.bl),M=Math.pow(o,this.bl);h=.5*((a=this.el/l)-1/a);var c=(this.el*this.el-M*l)/(this.el*this.el+M*l),u=(M-l)/(M+l),f=z(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(c*Math.tan(.5*this.bl*f)/u)/this.bl,this.long0=z(this.long0);var m=z(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*m)/h),this.alpha=Math.asin(n*Math.sin(this.gamma0))}else a=this.lat0>=0?n+Math.sqrt(n*n-1):n-Math.sqrt(n*n-1),this.el=a*Math.pow(e,this.bl),h=.5*(a-1/a),this.gamma0=Math.asin(Math.sin(this.alpha)/n),this.long0=this.longc-Math.asin(h*Math.tan(this.gamma0))/this.bl;this.no_off?this.uc=0:this.lat0>=0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(n*n-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(n*n-1),Math.cos(this.alpha))},forward:function(t){var s,i,a,h=t.x,n=t.y,r=z(h-this.long0);if(Math.abs(Math.abs(n)-e)<=l)a=n>0?-1:1,i=this.al/this.bl*Math.log(Math.tan(u+a*this.gamma0*.5)),s=-1*a*e*this.al/this.bl;else{var o=D(this.e,n,Math.sin(n)),M=this.el/Math.pow(o,this.bl),c=.5*(M-1/M),f=.5*(M+1/M),m=Math.sin(this.bl*r),p=(c*Math.sin(this.gamma0)-m*Math.cos(this.gamma0))/f;i=Math.abs(Math.abs(p)-1)<=l?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-p)/(1+p))/this.bl,s=Math.abs(Math.cos(this.bl*r))<=l?this.al*this.bl*r:this.al*Math.atan2(c*Math.cos(this.gamma0)+m*Math.sin(this.gamma0),Math.cos(this.bl*r))/this.bl}return this.no_rot?(t.x=this.x0+s,t.y=this.y0+i):(s-=this.uc,t.x=this.x0+i*Math.cos(this.alpha)+s*Math.sin(this.alpha),t.y=this.y0+s*Math.cos(this.alpha)-i*Math.sin(this.alpha)),t},inverse:function(t){var s,i;this.no_rot?(i=t.y-this.y0,s=t.x-this.x0):(i=(t.x-this.x0)*Math.cos(this.alpha)-(t.y-this.y0)*Math.sin(this.alpha),s=(t.y-this.y0)*Math.cos(this.alpha)+(t.x-this.x0)*Math.sin(this.alpha),s+=this.uc);var a=Math.exp(-1*this.bl*i/this.al),h=.5*(a-1/a),n=.5*(a+1/a),r=Math.sin(this.bl*s/this.al),o=(r*Math.cos(this.gamma0)+h*Math.sin(this.gamma0))/n,M=Math.pow(this.el/Math.sqrt((1+o)/(1-o)),1/this.bl);return Math.abs(o-1)<l?(t.x=this.long0,t.y=e):Math.abs(o+1)<l?(t.x=this.long0,t.y=-1*e):(t.y=B(this.e,M),t.x=z(this.long0-Math.atan2(h*Math.cos(this.gamma0)-r*Math.sin(this.gamma0),Math.cos(this.bl*s/this.al))/this.bl)),t},names:["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","omerc"]};var Jt={init:function(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<l)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var s=Math.sin(this.lat1),i=Math.cos(this.lat1),a=j(this.e,s,i),h=D(this.e,this.lat1,s),e=Math.sin(this.lat2),n=Math.cos(this.lat2),r=j(this.e,e,n),o=D(this.e,this.lat2,e),M=D(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>l?this.ns=Math.log(a/r)/Math.log(h/o):this.ns=s,isNaN(this.ns)&&(this.ns=s),this.f0=a/(this.ns*Math.pow(h,this.ns)),this.rh=this.a*this.f0*Math.pow(M,this.ns),this.title||(this.title="Lambert Conformal Conic")}},forward:function(t){var s=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=l&&(i=L(i)*(e-2*l));var a,h,n=Math.abs(Math.abs(i)-e);if(n>l)a=D(this.e,i,Math.sin(i)),h=this.a*this.f0*Math.pow(a,this.ns);else{if((n=i*this.ns)<=0)return null;h=0}var r=this.ns*z(s-this.long0);return t.x=this.k0*(h*Math.sin(r))+this.x0,t.y=this.k0*(this.rh-h*Math.cos(r))+this.y0,t},inverse:function(t){var s,i,a,h,n,r=(t.x-this.x0)/this.k0,o=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(s=Math.sqrt(r*r+o*o),i=1):(s=-Math.sqrt(r*r+o*o),i=-1);var l=0;if(0!==s&&(l=Math.atan2(i*r,i*o)),0!==s||this.ns>0){if(i=1/this.ns,a=Math.pow(s/(this.a*this.f0),i),-9999===(h=B(this.e,a)))return null}else h=-e;return n=z(l/this.ns+this.long0),t.x=n,t.y=h,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]};var Vt={init:function(){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},forward:function(t){var s,i,a,h,e,n,r,o=t.x,l=t.y,M=z(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=-M*this.alfa,h=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(a)),e=Math.asin(Math.cos(i)*Math.sin(a)/Math.cos(h)),n=this.n*e,r=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(h/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},inverse:function(t){var s,i,a,h,e,n,r,o=t.x;t.x=t.y,t.y=o,this.czech||(t.y*=-1,t.x*=-1),e=Math.sqrt(t.x*t.x+t.y*t.y),h=Math.atan2(t.y,t.x)/Math.sin(this.s0),a=2*(Math.atan(Math.pow(this.ro0/e,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(h)),i=Math.asin(Math.cos(a)*Math.sin(h)/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},names:["Krovak","krovak"]},Zt=function(t,s,i,a,h){return t*h-s*Math.sin(2*h)+i*Math.sin(4*h)-a*Math.sin(6*h)},Yt=function(t){return 1-.25*t*(1+t/16*(3+1.25*t))},$t=function(t){return.375*t*(1+.25*t*(1+.46875*t))},ts=function(t){return.05859375*t*t*(1+.75*t)},ss=function(t){return t*t*t*(35/3072)},is=function(t,s,i){var a=s*i;return t/Math.sqrt(1-a*a)},as=function(t){return Math.abs(t)<e?t:t-L(t)*Math.PI},hs=function(t,s,i,a,h){var e,n;e=t/s;for(var r=0;r<15;r++)if(e+=n=(t-(s*e-i*Math.sin(2*e)+a*Math.sin(4*e)-h*Math.sin(6*e)))/(s-2*i*Math.cos(2*e)+4*a*Math.cos(4*e)-6*h*Math.cos(6*e)),Math.abs(n)<=1e-10)return e;return NaN};var es={init:function(){this.sphere||(this.e0=Yt(this.es),this.e1=$t(this.es),this.e2=ts(this.es),this.e3=ss(this.es),this.ml0=this.a*Zt(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var s,i,a=t.x,h=t.y;if(a=z(a-this.long0),this.sphere)s=this.a*Math.asin(Math.cos(h)*Math.sin(a)),i=this.a*(Math.atan2(Math.tan(h),Math.cos(a))-this.lat0);else{var e=Math.sin(h),n=Math.cos(h),r=is(this.a,this.e,e),o=Math.tan(h)*Math.tan(h),l=a*Math.cos(h),M=l*l,c=this.es*n*n/(1-this.es);s=r*l*(1-M*o*(1/6-(8-o+8*c)*M/120)),i=this.a*Zt(this.e0,this.e1,this.e2,this.e3,h)-this.ml0+r*e/n*M*(.5+(5-o+6*c)*M/24)}return t.x=s+this.x0,t.y=i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s,i,a=t.x/this.a,h=t.y/this.a;if(this.sphere){var n=h+this.lat0;s=Math.asin(Math.sin(n)*Math.cos(a)),i=Math.atan2(Math.tan(a),Math.cos(n))}else{var r=this.ml0/this.a+h,o=hs(r,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(o)-e)<=l)return t.x=this.long0,t.y=e,h<0&&(t.y*=-1),t;var M=is(this.a,this.e,Math.sin(o)),c=M*M*M/this.a/this.a*(1-this.es),u=Math.pow(Math.tan(o),2),f=a*this.a/M,m=f*f;s=o-M*Math.tan(o)/c*f*f*(.5-(1+3*u)*f*f/24),i=f*(1-m*(u/3+(1+3*u)*u*m/15))/Math.cos(o)}return t.x=z(i+this.long0),t.y=as(s),t},names:["Cassini","Cassini_Soldner","cass"]},ns=function(t,s){var i;return t>1e-7?(1-t*t)*(s/(1-(i=t*s)*i)-.5/t*Math.log((1-i)/(1+i))):2*s};var rs=.3333333333333333,os=.17222222222222222,ls=.10257936507936508,Ms=.06388888888888888,cs=.0664021164021164,us=.016415012942191543;var fs={init:function(){var t,s=Math.abs(this.lat0);if(Math.abs(s-e)<l?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(s)<l?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0)switch(this.qp=ns(this.e,1),this.mmf=.5/(1-this.es),this.apa=function(t){var s,i=[];return i[0]=t*rs,s=t*t,i[0]+=s*os,i[1]=s*Ms,s*=t,i[0]+=s*ls,i[1]+=s*cs,i[2]=s*us,i}(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=ns(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))},forward:function(t){var s,i,a,h,n,r,o,M,c,f,m=t.x,p=t.y;if(m=z(m-this.long0),this.sphere){if(n=Math.sin(p),f=Math.cos(p),a=Math.cos(m),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+f*a:1+this.sinph0*n+this.cosph0*f*a)<=l)return null;s=(i=Math.sqrt(2/i))*f*Math.sin(m),i*=this.mode===this.EQUIT?n:this.cosph0*n-this.sinph0*f*a}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),Math.abs(p+this.phi0)<l)return null;i=u-.5*p,s=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(m),i*=a}}else{switch(o=0,M=0,c=0,a=Math.cos(m),h=Math.sin(m),n=Math.sin(p),r=ns(this.e,n),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(o=r/this.qp,M=Math.sqrt(1-o*o)),this.mode){case this.OBLIQ:c=1+this.sinb1*o+this.cosb1*M*a;break;case this.EQUIT:c=1+M*a;break;case this.N_POLE:c=e+p,r=this.qp-r;break;case this.S_POLE:c=p-e,r=this.qp+r}if(Math.abs(c)<l)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:c=Math.sqrt(2/c),i=this.mode===this.OBLIQ?this.ymf*c*(this.cosb1*o-this.sinb1*M*a):(c=Math.sqrt(2/(1+M*a)))*o*this.ymf,s=this.xmf*c*M*h;break;case this.N_POLE:case this.S_POLE:r>=0?(s=(c=Math.sqrt(r))*h,i=a*(this.mode===this.S_POLE?c:-c)):s=i=0}}return t.x=this.a*s+this.x0,t.y=this.a*i+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s,i,a,h,n,r,o,M,c,u,f=t.x/this.a,m=t.y/this.a;if(this.sphere){var p,d=0,y=0;if((i=.5*(p=Math.sqrt(f*f+m*m)))>1)return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(y=Math.sin(i),d=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(p)<=l?0:Math.asin(m*y/p),f*=y,m=d*p;break;case this.OBLIQ:i=Math.abs(p)<=l?this.phi0:Math.asin(d*this.sinph0+m*y*this.cosph0/p),f*=y*this.cosph0,m=(d-Math.sin(i)*this.sinph0)*p;break;case this.N_POLE:m=-m,i=e-i;break;case this.S_POLE:i-=e}s=0!==m||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(f,m):0}else{if(o=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,m*=this.dd,(r=Math.sqrt(f*f+m*m))<l)return t.x=0,t.y=this.phi0,t;h=2*Math.asin(.5*r/this.rq),a=Math.cos(h),f*=h=Math.sin(h),this.mode===this.OBLIQ?(o=a*this.sinb1+m*h*this.cosb1/r,n=this.qp*o,m=r*this.cosb1*a-m*this.sinb1*h):(o=m*h/r,n=this.qp*o,m=r*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(m=-m),!(n=f*f+m*m))return t.x=0,t.y=this.phi0,t;o=1-n/this.qp,this.mode===this.S_POLE&&(o=-o)}s=Math.atan2(f,m),M=Math.asin(o),c=this.apa,u=M+M,i=M+c[0]*Math.sin(u)+c[1]*Math.sin(u+u)+c[2]*Math.sin(u+u+u)}return t.x=z(this.long0+s),t.y=i,t},names:["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],S_POLE:1,N_POLE:2,EQUIT:3,OBLIQ:4},ms=function(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)};var ps={init:function(){Math.abs(this.lat1+this.lat2)<l||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=j(this.e3,this.sin_po,this.cos_po),this.qs1=ns(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=j(this.e3,this.sin_po,this.cos_po),this.qs2=ns(this.e3,this.sin_po,this.cos_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=ns(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>l?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)},forward:function(t){var s=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var a=ns(this.e3,this.sin_phi,this.cos_phi),h=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,e=this.ns0*z(s-this.long0),n=h*Math.sin(e)+this.x0,r=this.rh-h*Math.cos(e)+this.y0;return t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h,e,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),h=0,0!==s&&(h=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)),e=z(h/this.ns0+this.long0),t.x=e,t.y=n,t},names:["Albers_Conic_Equal_Area","Albers","aea"],phi1z:function(t,s){var i,a,h,e,n=ms(.5*s);if(t<l)return n;for(var r=t*t,o=1;o<=25;o++)if(n+=e=.5*(h=1-(a=t*(i=Math.sin(n)))*a)*h/Math.cos(n)*(s/(1-r)-i/h+.5/t*Math.log((1-a)/(1+a))),Math.abs(e)<=1e-7)return n;return null}};var ds={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1},forward:function(t){var s,i,a,h,e,n,r,o=t.x,M=t.y;return a=z(o-this.long0),s=Math.sin(M),i=Math.cos(M),h=Math.cos(a),(e=this.sin_p14*s+this.cos_p14*i*h)>0||Math.abs(e)<=l?(n=this.x0+1*this.a*i*Math.sin(a)/e,r=this.y0+1*this.a*(this.cos_p14*s-this.sin_p14*i*h)/e):(n=this.x0+this.infinity_dist*i*Math.sin(a),r=this.y0+this.infinity_dist*(this.cos_p14*s-this.sin_p14*i*h)),t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h,e,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))?(h=Math.atan2(s,this.rc),i=Math.sin(h),a=Math.cos(h),n=ms(a*this.sin_p14+t.y*i*this.cos_p14/s),e=Math.atan2(t.x*i,s*this.cos_p14*a-t.y*this.sin_p14*i),e=z(this.long0+e)):(n=this.phic0,e=0),t.x=e,t.y=n,t},names:["gnom"]},ys=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*e:e;for(var a,h,n,r,o=Math.asin(.5*s),l=0;l<30;l++)if(h=Math.sin(o),n=Math.cos(o),r=t*h,o+=a=Math.pow(1-r*r,2)/(2*n)*(s/(1-t*t)-h/(1-r*r)+.5/t*Math.log((1-r)/(1+r))),Math.abs(a)<=1e-10)return o;return NaN};var _s={init:function(){this.sphere||(this.k0=j(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var s,i,a=t.x,h=t.y,e=z(a-this.long0);if(this.sphere)s=this.x0+this.a*e*Math.cos(this.lat_ts),i=this.y0+this.a*Math.sin(h)/Math.cos(this.lat_ts);else{var n=ns(this.e,Math.sin(h));s=this.x0+this.a*this.k0*e,i=this.y0+this.a*n*.5/this.k0}return t.x=s,t.y=i,t},inverse:function(t){var s,i;return t.x-=this.x0,t.y-=this.y0,this.sphere?(s=z(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=ys(this.e,2*t.y*this.k0/this.a),s=z(this.long0+t.x/(this.a*this.k0))),t.x=s,t.y=i,t},names:["cea"]};var vs={init:function(){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)},forward:function(t){var s=t.x,i=t.y,a=z(s-this.long0),h=as(i-this.lat0);return t.x=this.x0+this.a*a*this.rc,t.y=this.y0+this.a*h,t},inverse:function(t){var s=t.x,i=t.y;return t.x=z(this.long0+(s-this.x0)/(this.a*this.rc)),t.y=as(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},xs=20;var gs={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Yt(this.es),this.e1=$t(this.es),this.e2=ts(this.es),this.e3=ss(this.es),this.ml0=this.a*Zt(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var s,i,a,h=t.x,e=t.y,n=z(h-this.long0);if(a=n*Math.sin(e),this.sphere)Math.abs(e)<=l?(s=this.a*n,i=-1*this.a*this.lat0):(s=this.a*Math.sin(a)/Math.tan(e),i=this.a*(as(e-this.lat0)+(1-Math.cos(a))/Math.tan(e)));else if(Math.abs(e)<=l)s=this.a*n,i=-1*this.ml0;else{var r=is(this.a,this.e,Math.sin(e))/Math.tan(e);s=r*Math.sin(a),i=this.a*Zt(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+r*(1-Math.cos(a))}return t.x=s+this.x0,t.y=i+this.y0,t},inverse:function(t){var s,i,a,h,e,n,r,o,M;if(a=t.x-this.x0,h=t.y-this.y0,this.sphere)if(Math.abs(h+this.a*this.lat0)<=l)s=z(a/this.a+this.long0),i=0;else{var c;for(n=this.lat0+h/this.a,r=a*a/this.a/this.a+n*n,o=n,e=xs;e;--e)if(o+=M=-1*(n*(o*(c=Math.tan(o))+1)-o-.5*(o*o+r)*c)/((o-n)/c-1),Math.abs(M)<=l){i=o;break}s=z(this.long0+Math.asin(a*Math.tan(o)/this.a)/Math.sin(i))}else if(Math.abs(h+this.ml0)<=l)i=0,s=z(this.long0+a/this.a);else{var u,f,m,p,d;for(n=(this.ml0+h)/this.a,r=a*a/this.a/this.a+n*n,o=n,e=xs;e;--e)if(d=this.e*Math.sin(o),u=Math.sqrt(1-d*d)*Math.tan(o),f=this.a*Zt(this.e0,this.e1,this.e2,this.e3,o),m=this.e0-2*this.e1*Math.cos(2*o)+4*this.e2*Math.cos(4*o)-6*this.e3*Math.cos(6*o),o-=M=(n*(u*(p=f/this.a)+1)-p-.5*u*(p*p+r))/(this.es*Math.sin(2*o)*(p*p+r-2*n*p)/(4*u)+(n-p)*(u*m-2/Math.sin(2*o))-m),Math.abs(M)<=l){i=o;break}u=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),s=z(this.long0+Math.asin(a*u/this.a)/Math.sin(i))}return t.x=s,t.y=i,t},names:["Polyconic","poly"]};var bs={init:function(){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},forward:function(t){var s,i=t.x,a=t.y-this.lat0,e=i-this.long0,n=a/h*1e-5,r=e,o=1,l=0;for(s=1;s<=10;s++)o*=n,l+=this.A[s]*o;var M,c=l,u=r,f=1,m=0,p=0,d=0;for(s=1;s<=6;s++)M=m*c+f*u,f=f*c-m*u,m=M,p=p+this.B_re[s]*f-this.B_im[s]*m,d=d+this.B_im[s]*f+this.B_re[s]*m;return t.x=d*this.a+this.x0,t.y=p*this.a+this.y0,t},inverse:function(t){var s,i,a=t.x,e=t.y,n=a-this.x0,r=(e-this.y0)/this.a,o=n/this.a,l=1,M=0,c=0,u=0;for(s=1;s<=6;s++)i=M*r+l*o,l=l*r-M*o,M=i,c=c+this.C_re[s]*l-this.C_im[s]*M,u=u+this.C_im[s]*l+this.C_re[s]*M;for(var f=0;f<this.iterations;f++){var m,p=c,d=u,y=r,_=o;for(s=2;s<=6;s++)m=d*c+p*u,p=p*c-d*u,d=m,y+=(s-1)*(this.B_re[s]*p-this.B_im[s]*d),_+=(s-1)*(this.B_im[s]*p+this.B_re[s]*d);p=1,d=0;var v=this.B_re[1],x=this.B_im[1];for(s=2;s<=6;s++)m=d*c+p*u,p=p*c-d*u,d=m,v+=s*(this.B_re[s]*p-this.B_im[s]*d),x+=s*(this.B_im[s]*p+this.B_re[s]*d);var g=v*v+x*x;c=(y*v+_*x)/g,u=(_*v-y*x)/g}var b=c,w=u,A=1,C=0;for(s=1;s<=9;s++)A*=b,C+=this.D[s]*A;var E=this.lat0+C*h*1e5,P=this.long0+w;return t.x=P,t.y=E,t},names:["New_Zealand_Map_Grid","nzmg"]};var ws={init:function(){},forward:function(t){var s=t.x,i=t.y,a=z(s-this.long0),h=this.x0+this.a*a,e=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=h,t.y=e,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s=z(this.long0+t.x/this.a),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=s,t.y=i,t},names:["Miller_Cylindrical","mill"]},As=20;var Cs={init:function(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=St(this.es)},forward:function(t){var s,i,a=t.x,h=t.y;if(a=z(a-this.long0),this.sphere){if(this.m)for(var e=this.n*Math.sin(h),n=As;n;--n){var r=(this.m*h+Math.sin(h)-e)/(this.m+Math.cos(h));if(h-=r,Math.abs(r)<l)break}else h=1!==this.n?Math.asin(this.n*Math.sin(h)):h;s=this.a*this.C_x*a*(this.m+Math.cos(h)),i=this.a*this.C_y*h}else{var o=Math.sin(h),M=Math.cos(h);i=this.a*kt(h,o,M,this.en),s=this.a*a*M/Math.sqrt(1-this.es*o*o)}return t.x=s,t.y=i,t},inverse:function(t){var s,i,a,h;return t.x-=this.x0,a=t.x/this.a,t.y-=this.y0,s=t.y/this.a,this.sphere?(s/=this.C_y,a/=this.C_x*(this.m+Math.cos(s)),this.m?s=ms((this.m*s+Math.sin(s))/this.n):1!==this.n&&(s=ms(Math.sin(s)/this.n)),a=z(a+this.long0),s=as(s)):(s=qt(t.y/this.a,this.es,this.en),(h=Math.abs(s))<e?(h=Math.sin(s),i=this.long0+t.x*Math.sqrt(1-this.es*h*h)/(this.a*Math.cos(s)),a=z(i)):h-l<e&&(a=this.long0)),t.x=a,t.y=s,t},names:["Sinusoidal","sinu"]};var Es={init:function(){},forward:function(t){for(var s=t.x,i=t.y,a=z(s-this.long0),h=i,e=Math.PI*Math.sin(i);;){var n=-(h+Math.sin(h)-e)/(1+Math.cos(h));if(h+=n,Math.abs(n)<l)break}h/=2,Math.PI/2-Math.abs(i)<l&&(a=0);var r=.900316316158*this.a*a*Math.cos(h)+this.x0,o=1.4142135623731*this.a*Math.sin(h)+this.y0;return t.x=r,t.y=o,t},inverse:function(t){var s,i;t.x-=this.x0,t.y-=this.y0,i=t.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),s=Math.asin(i);var a=z(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 h=Math.asin(i);return t.x=a,t.y=h,t},names:["Mollweide","moll"]};var Ps={init:function(){Math.abs(this.lat1+this.lat2)<l||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Yt(this.es),this.e1=$t(this.es),this.e2=ts(this.es),this.e3=ss(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=j(this.e,this.sinphi,this.cosphi),this.ml1=Zt(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<l?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=j(this.e,this.sinphi,this.cosphi),this.ml2=Zt(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=Zt(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var s,i=t.x,a=t.y;if(this.sphere)s=this.a*(this.g-a);else{var h=Zt(this.e0,this.e1,this.e2,this.e3,a);s=this.a*(this.g-h)}var e=this.ns*z(i-this.long0),n=this.x0+s*Math.sin(e),r=this.y0+this.rh-s*Math.cos(e);return t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h;t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns>=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 e=0;if(0!==i&&(e=Math.atan2(s*t.x,s*t.y)),this.sphere)return h=z(this.long0+e/this.ns),a=as(this.g-i/this.a),t.x=h,t.y=a,t;var n=this.g-i/this.a;return a=hs(n,this.e0,this.e1,this.e2,this.e3),h=z(this.long0+e/this.ns),t.x=h,t.y=a,t},names:["Equidistant_Conic","eqdc"]};var Ns={init:function(){this.R=this.a},forward:function(t){var s,i,a=t.x,h=t.y,n=z(a-this.long0);Math.abs(h)<=l&&(s=this.x0+this.R*n,i=this.y0);var r=ms(2*Math.abs(h/Math.PI));(Math.abs(n)<=l||Math.abs(Math.abs(h)-e)<=l)&&(s=this.x0,i=h>=0?this.y0+Math.PI*this.R*Math.tan(.5*r):this.y0+Math.PI*this.R*-Math.tan(.5*r));var o=.5*Math.abs(Math.PI/n-n/Math.PI),M=o*o,c=Math.sin(r),u=Math.cos(r),f=u/(c+u-1),m=f*f,p=f*(2/c-1),d=p*p,y=Math.PI*this.R*(o*(f-d)+Math.sqrt(M*(f-d)*(f-d)-(d+M)*(m-d)))/(d+M);n<0&&(y=-y),s=this.x0+y;var _=M+f;return y=Math.PI*this.R*(p*_-o*Math.sqrt((d+M)*(M+1)-_*_))/(d+M),i=h>=0?this.y0+y:this.y0-y,t.x=s,t.y=i,t},inverse:function(t){var s,i,a,h,e,n,r,o,M,c,u,f;return t.x-=this.x0,t.y-=this.y0,u=Math.PI*this.R,e=(a=t.x/u)*a+(h=t.y/u)*h,u=3*(h*h/(o=-2*(n=-Math.abs(h)*(1+e))+1+2*h*h+e*e)+(2*(r=n-2*h*h+a*a)*r*r/o/o/o-9*n*r/o/o)/27)/(M=(n-r*r/3/o)/o)/(c=2*Math.sqrt(-M/3)),Math.abs(u)>1&&(u=u>=0?1:-1),f=Math.acos(u)/3,i=t.y>=0?(-c*Math.cos(f+Math.PI/3)-r/3/o)*Math.PI:-(-c*Math.cos(f+Math.PI/3)-r/3/o)*Math.PI,s=Math.abs(a)<l?this.long0:z(this.long0+Math.PI*(e-1+Math.sqrt(1+2*(a*a-h*h)+e*e))/2/a),t.x=s,t.y=i,t},names:["Van_der_Grinten_I","VanDerGrinten","vandg"]};var Ss={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var s,i,a,h,n,r,o,M,c,u,f,m,p,d,y,_,v,x,g,b,w,A,C=t.x,E=t.y,P=Math.sin(t.y),N=Math.cos(t.y),S=z(C-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=l?(t.x=this.x0+this.a*(e-E)*Math.sin(S),t.y=this.y0-this.a*(e-E)*Math.cos(S),t):Math.abs(this.sin_p12+1)<=l?(t.x=this.x0+this.a*(e+E)*Math.sin(S),t.y=this.y0+this.a*(e+E)*Math.cos(S),t):(x=this.sin_p12*P+this.cos_p12*N*Math.cos(S),v=(_=Math.acos(x))/Math.sin(_),t.x=this.x0+this.a*v*N*Math.sin(S),t.y=this.y0+this.a*v*(this.cos_p12*P-this.sin_p12*N*Math.cos(S)),t):(s=Yt(this.es),i=$t(this.es),a=ts(this.es),h=ss(this.es),Math.abs(this.sin_p12-1)<=l?(n=this.a*Zt(s,i,a,h,e),r=this.a*Zt(s,i,a,h,E),t.x=this.x0+(n-r)*Math.sin(S),t.y=this.y0-(n-r)*Math.cos(S),t):Math.abs(this.sin_p12+1)<=l?(n=this.a*Zt(s,i,a,h,e),r=this.a*Zt(s,i,a,h,E),t.x=this.x0+(n+r)*Math.sin(S),t.y=this.y0+(n+r)*Math.cos(S),t):(o=P/N,M=is(this.a,this.e,this.sin_p12),c=is(this.a,this.e,P),u=Math.atan((1-this.es)*o+this.es*M*this.sin_p12/(c*N)),g=0===(f=Math.atan2(Math.sin(S),this.cos_p12*Math.tan(u)-this.sin_p12*Math.cos(S)))?Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.abs(Math.abs(f)-Math.PI)<=l?-Math.asin(this.cos_p12*Math.sin(u)-this.sin_p12*Math.cos(u)):Math.asin(Math.sin(S)*Math.cos(u)/Math.sin(f)),m=this.e*this.sin_p12/Math.sqrt(1-this.es),_=M*g*(1-(b=g*g)*(y=(p=this.e*this.cos_p12*Math.cos(f)/Math.sqrt(1-this.es))*p)*(1-y)/6+(w=b*g)/8*(d=m*p)*(1-2*y)+(A=w*g)/120*(y*(4-7*y)-3*m*m*(1-7*y))-A*g/48*d),t.x=this.x0+_*Math.sin(f),t.y=this.y0+_*Math.cos(f),t))},inverse:function(t){var s,i,a,h,n,r,o,M,c,u,f,m,p,d,y,_,v,x,g,b,w,A;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((s=Math.sqrt(t.x*t.x+t.y*t.y))>2*e*this.a)return;return i=s/this.a,a=Math.sin(i),h=Math.cos(i),n=this.long0,Math.abs(s)<=l?r=this.lat0:(r=ms(h*this.sin_p12+t.y*a*this.cos_p12/s),o=Math.abs(this.lat0)-e,n=Math.abs(o)<=l?this.lat0>=0?z(this.long0+Math.atan2(t.x,-t.y)):z(this.long0-Math.atan2(-t.x,t.y)):z(this.long0+Math.atan2(t.x*a,s*this.cos_p12*h-t.y*this.sin_p12*a))),t.x=n,t.y=r,t}return M=Yt(this.es),c=$t(this.es),u=ts(this.es),f=ss(this.es),Math.abs(this.sin_p12-1)<=l?(m=this.a*Zt(M,c,u,f,e),s=Math.sqrt(t.x*t.x+t.y*t.y),r=hs((m-s)/this.a,M,c,u,f),n=z(this.long0+Math.atan2(t.x,-1*t.y)),t.x=n,t.y=r,t):Math.abs(this.sin_p12+1)<=l?(m=this.a*Zt(M,c,u,f,e),s=Math.sqrt(t.x*t.x+t.y*t.y),r=hs((s-m)/this.a,M,c,u,f),n=z(this.long0+Math.atan2(t.x,t.y)),t.x=n,t.y=r,t):(s=Math.sqrt(t.x*t.x+t.y*t.y),y=Math.atan2(t.x,t.y),p=is(this.a,this.e,this.sin_p12),_=Math.cos(y),x=-(v=this.e*this.cos_p12*_)*v/(1-this.es),g=3*this.es*(1-x)*this.sin_p12*this.cos_p12*_/(1-this.es),A=1-x*(w=(b=s/p)-x*(1+x)*Math.pow(b,3)/6-g*(1+3*x)*Math.pow(b,4)/24)*w/2-b*w*w*w/6,d=Math.asin(this.sin_p12*Math.cos(w)+this.cos_p12*Math.sin(w)*_),n=z(this.long0+Math.asin(Math.sin(y)*Math.sin(w)/Math.cos(d))),r=Math.atan((1-this.es*A*this.sin_p12/Math.sin(d))*Math.tan(d)/(1-this.es)),t.x=n,t.y=r,t)},names:["Azimuthal_Equidistant","aeqd"]};var ks={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var s,i,a,h,e,n,r,o=t.x,M=t.y;return a=z(o-this.long0),s=Math.sin(M),i=Math.cos(M),h=Math.cos(a),((e=this.sin_p14*s+this.cos_p14*i*h)>0||Math.abs(e)<=l)&&(n=1*this.a*i*Math.sin(a),r=this.y0+1*this.a*(this.cos_p14*s-this.sin_p14*i*h)),t.x=n,t.y=r,t},inverse:function(t){var s,i,a,h,n,r,o;return t.x-=this.x0,t.y-=this.y0,s=Math.sqrt(t.x*t.x+t.y*t.y),i=ms(s/this.a),a=Math.sin(i),h=Math.cos(i),r=this.long0,Math.abs(s)<=l?(o=this.lat0,t.x=r,t.y=o,t):(o=ms(h*this.sin_p14+t.y*a*this.cos_p14/s),n=Math.abs(this.lat0)-e,Math.abs(n)<=l?(r=this.lat0>=0?z(this.long0+Math.atan2(t.x,-t.y)):z(this.long0-Math.atan2(-t.x,t.y)),t.x=r,t.y=o,t):(r=z(this.long0+Math.atan2(t.x*a,s*this.cos_p14*h-t.y*this.sin_p14*a)),t.x=r,t.y=o,t))},names:["ortho"]},qs={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Is={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Os(t,s,i,a){var h;return t<l?(a.value=Is.AREA_0,h=0):(h=Math.atan2(s,i),Math.abs(h)<=u?a.value=Is.AREA_0:h>u&&h<=e+u?(a.value=Is.AREA_1,h-=e):h>e+u||h<=-(e+u)?(a.value=Is.AREA_2,h=h>=0?h-m:h+m):(a.value=Is.AREA_3,h+=e)),h}function Rs(t,s){var i=t+s;return i<-m?i+=f:i>+m&&(i-=f),i}var Gs={init:function(){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>=e-u/2?this.face=qs.TOP:this.lat0<=-(e-u/2)?this.face=qs.BOTTOM:Math.abs(this.long0)<=u?this.face=qs.FRONT:Math.abs(this.long0)<=e+u?this.face=this.long0>0?qs.RIGHT:qs.LEFT:this.face=qs.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)},forward:function(t){var s,i,a,h,n,r,o={x:0,y:0},l={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===qs.TOP)h=e-s,i>=u&&i<=e+u?(l.value=Is.AREA_0,a=i-e):i>e+u||i<=-(e+u)?(l.value=Is.AREA_1,a=i>0?i-m:i+m):i>-(e+u)&&i<=-u?(l.value=Is.AREA_2,a=i+e):(l.value=Is.AREA_3,a=i);else if(this.face===qs.BOTTOM)h=e+s,i>=u&&i<=e+u?(l.value=Is.AREA_0,a=-i+e):i<u&&i>=-u?(l.value=Is.AREA_1,a=-i):i<-u&&i>=-(e+u)?(l.value=Is.AREA_2,a=-i-e):(l.value=Is.AREA_3,a=i>0?-i+m:-i-m);else{var M,c,f,p,d,y;this.face===qs.RIGHT?i=Rs(i,+e):this.face===qs.BACK?i=Rs(i,+m):this.face===qs.LEFT&&(i=Rs(i,-e)),p=Math.sin(s),d=Math.cos(s),y=Math.sin(i),M=d*Math.cos(i),c=d*y,f=p,this.face===qs.FRONT?a=Os(h=Math.acos(M),f,c,l):this.face===qs.RIGHT?a=Os(h=Math.acos(c),f,-M,l):this.face===qs.BACK?a=Os(h=Math.acos(-M),f,-c,l):this.face===qs.LEFT?a=Os(h=Math.acos(-c),f,M,l):(h=a=0,l.value=Is.AREA_0)}return r=Math.atan(12/m*(a+Math.acos(Math.sin(a)*Math.cos(u))-e)),n=Math.sqrt((1-Math.cos(h))/(Math.cos(r)*Math.cos(r))/(1-Math.cos(Math.atan(1/Math.cos(a))))),l.value===Is.AREA_1?r+=e:l.value===Is.AREA_2?r+=m:l.value===Is.AREA_3&&(r+=1.5*m),o.x=n*Math.cos(r),o.y=n*Math.sin(r),o.x=o.x*this.a+this.x0,o.y=o.y*this.a+this.y0,t.x=o.x,t.y=o.y,t},inverse:function(t){var s,i,a,h,n,r,o,l,M,c,u,f,p={lam:0,phi:0},d={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)?d.value=Is.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(d.value=Is.AREA_1,s-=e):t.x<0&&-t.x>=Math.abs(t.y)?(d.value=Is.AREA_2,s=s<0?s+m:s-m):(d.value=Is.AREA_3,s+=e),M=m/12*Math.tan(s),n=Math.sin(M)/(Math.cos(M)-1/Math.sqrt(2)),r=Math.atan(n),(o=1-(a=Math.cos(s))*a*(h=Math.tan(i))*h*(1-Math.cos(Math.atan(1/Math.cos(r)))))<-1?o=-1:o>1&&(o=1),this.face===qs.TOP)l=Math.acos(o),p.phi=e-l,d.value===Is.AREA_0?p.lam=r+e:d.value===Is.AREA_1?p.lam=r<0?r+m:r-m:d.value===Is.AREA_2?p.lam=r-e:p.lam=r;else if(this.face===qs.BOTTOM)l=Math.acos(o),p.phi=l-e,d.value===Is.AREA_0?p.lam=-r+e:d.value===Is.AREA_1?p.lam=-r:d.value===Is.AREA_2?p.lam=-r-e:p.lam=r<0?-r-m:-r+m;else{var y,_,v;M=(y=o)*y,_=(M+=(v=M>=1?0:Math.sqrt(1-M)*Math.sin(r))*v)>=1?0:Math.sqrt(1-M),d.value===Is.AREA_1?(M=_,_=-v,v=M):d.value===Is.AREA_2?(_=-_,v=-v):d.value===Is.AREA_3&&(M=_,_=v,v=-M),this.face===qs.RIGHT?(M=y,y=-_,_=M):this.face===qs.BACK?(y=-y,_=-_):this.face===qs.LEFT&&(M=y,y=_,_=-M),p.phi=Math.acos(-v)-e,p.lam=Math.atan2(_,y),this.face===qs.RIGHT?p.lam=Rs(p.lam,-e):this.face===qs.BACK?p.lam=Rs(p.lam,-m):this.face===qs.LEFT&&(p.lam=Rs(p.lam,+e))}return 0!==this.es&&(c=p.phi<0?1:0,u=Math.tan(p.phi),f=this.b/Math.sqrt(u*u+this.one_minus_f_squared),p.phi=Math.atan(Math.sqrt(this.a*this.a-f*f)/(this.one_minus_f*f)),c&&(p.phi=-p.phi)),p.lam+=this.long0,t.x=p.lam,t.y=p.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Ts=[[1,2.2199e-17,-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]],js=[[-5.20417e-18,.0124,1.21431e-18,-8.45284e-11],[.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]],Ls=.8487,zs=1.3523,Ds=c/5,Bs=1/Ds,Us=18,Fs=function(t,s){return t[0]+s*(t[1]+s*(t[2]+s*t[3]))},Qs=function(t,s){return t[1]+s*(2*t[2]+3*s*t[3])};var Ws,Hs={init:function(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"},forward:function(t){var s=z(t.x-this.long0),i=Math.abs(t.y),a=Math.floor(i*Ds);a<0?a=0:a>=Us&&(a=Us-1),i=c*(i-Bs*a);var h={x:Fs(Ts[a],i)*s,y:Fs(js[a],i)};return t.y<0&&(h.y=-h.y),h.x=h.x*this.a*Ls+this.x0,h.y=h.y*this.a*zs+this.y0,h},inverse:function(t){var s={x:(t.x-this.x0)/(this.a*Ls),y:Math.abs(t.y-this.y0)/(this.a*zs)};if(s.y>=1)s.x/=Ts[Us][0],s.y=t.y<0?-e:e;else{var i=Math.floor(s.y*Us);for(i<0?i=0:i>=Us&&(i=Us-1);;)if(js[i][0]>s.y)--i;else{if(!(js[i+1][0]<=s.y))break;++i}var a=js[i],h=5*(s.y-a[0])/(js[i+1][0]-a[0]);h=function(t,s,i,a){for(var h=s;a;--a){var e=t(h);if(h-=e,Math.abs(e)<i)break}return h}(function(t){return(Fs(a,t)-s.y)/Qs(a,t)},h,l,100),s.x/=Fs(Ts[i],h),s.y=(5*i+h)*M,t.y<0&&(s.y=-s.y)}return s.x=z(s.x+this.long0),s},names:["Robinson","robin"]};return ot.defaultDatum="WGS84",ot.Proj=Z,ot.WGS84=new ot.Proj("WGS84"),ot.Point=Pt,ot.toPoint=st,ot.defs=I,ot.transform=ht,ot.mgrs=yt,ot.version="2.5.0",(Ws=ot).Proj.projections.add(It),Ws.Proj.projections.add(zt),Ws.Proj.projections.add(Bt),Ws.Proj.projections.add(Wt),Ws.Proj.projections.add(Ht),Ws.Proj.projections.add(Kt),Ws.Proj.projections.add(Xt),Ws.Proj.projections.add(Jt),Ws.Proj.projections.add(Vt),Ws.Proj.projections.add(es),Ws.Proj.projections.add(fs),Ws.Proj.projections.add(ps),Ws.Proj.projections.add(ds),Ws.Proj.projections.add(_s),Ws.Proj.projections.add(vs),Ws.Proj.projections.add(gs),Ws.Proj.projections.add(bs),Ws.Proj.projections.add(ws),Ws.Proj.projections.add(Cs),Ws.Proj.projections.add(Es),Ws.Proj.projections.add(Ps),Ws.Proj.projections.add(Ns),Ws.Proj.projections.add(Ss),Ws.Proj.projections.add(ks),Ws.Proj.projections.add(Gs),Ws.Proj.projections.add(Hs),ot}

Back to list