!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):t.proj4=s()}(this,function(){"use strict";function k(t,s){if(t[s])return t[s];for(var i,a=Object.keys(t),h=s.toLowerCase().replace(H,""),e=-1;++e<a.length;)if((i=a[e]).toLowerCase().replace(H,"")===h)return t[i]}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=K}function h(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){if("AXIS"===a)return a in s||(s[a]=[]),void s[a].push(t);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 h(s,a,t);default:for(i=-1;++i<t.length;)if(!Array.isArray(t[i]))return n(t,s[a]);return h(s,a,t)}}else s[a]=t;else s[a]=!0}else s[t]=!0}function r(t){return t*it}function o(e){function t(t){return t*(e.to_meter||1)}if("GEOGCS"===e.type?e.projName="longlat":"LOCAL_CS"===e.type?(e.projName="identity",e.local=!0):"object"==typeof e.PROJECTION?e.projName=Object.keys(e.PROJECTION)[0]:e.projName=e.PROJECTION,e.AXIS){for(var s="",i=0,a=e.AXIS.length;i<a;++i){var h=e.AXIS[i][0].toLowerCase();-1!==h.indexOf("north")?s+="n":-1!==h.indexOf("south")?s+="s":-1!==h.indexOf("east")?s+="e":-1!==h.indexOf("west")&&(s+="w")}2===s.length&&(s+="u"),3===s.length&&(e.axis=s)}e.UNIT&&(e.units=e.UNIT.name.toLowerCase(),"metre"===e.units&&(e.units="meter"),e.UNIT.convert&&("GEOGCS"===e.type?e.DATUM&&e.DATUM.SPHEROID&&(e.to_meter=e.UNIT.convert*e.DATUM.SPHEROID.a):e.to_meter=e.UNIT.convert));var n=e.GEOGCS;"GEOGCS"===e.type&&(n=e),n&&(n.DATUM?e.datumCode=n.DATUM.name.toLowerCase():e.datumCode=n.name.toLowerCase(),"d_"===e.datumCode.slice(0,2)&&(e.datumCode=e.datumCode.slice(2)),"new_zealand_geodetic_datum_1949"!==e.datumCode&&"new_zealand_1949"!==e.datumCode||(e.datumCode="nzgd49"),"wgs_1984"!==e.datumCode&&"world_geodetic_system_1984"!==e.datumCode||("Mercator_Auxiliary_Sphere"===e.PROJECTION&&(e.sphere=!0),e.datumCode="wgs84"),"_ferro"===e.datumCode.slice(-6)&&(e.datumCode=e.datumCode.slice(0,-6)),"_jakarta"===e.datumCode.slice(-8)&&(e.datumCode=e.datumCode.slice(0,-8)),~e.datumCode.indexOf("belge")&&(e.datumCode="rnb72"),n.DATUM&&n.DATUM.SPHEROID&&(e.ellps=n.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===e.ellps.toLowerCase().slice(0,13)&&(e.ellps="intl"),e.a=n.DATUM.SPHEROID.a,e.rf=parseFloat(n.DATUM.SPHEROID.rf,10)),n.DATUM&&n.DATUM.TOWGS84&&(e.datum_params=n.DATUM.TOWGS84),~e.datumCode.indexOf("osgb_1936")&&(e.datumCode="osgb36"),~e.datumCode.indexOf("osni_1952")&&(e.datumCode="osni52"),(~e.datumCode.indexOf("tm65")||~e.datumCode.indexOf("geodetic_datum_of_1965"))&&(e.datumCode="ire65"),"ch1903+"===e.datumCode&&(e.datumCode="ch1903"),~e.datumCode.indexOf("israel")&&(e.datumCode="isr93")),e.b&&!isFinite(e.b)&&(e.b=e.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",r],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",r],["x0","false_easting",t],["y0","false_northing",t],["long0","central_meridian",r],["lat0","latitude_of_origin",r],["lat0","standard_parallel_1",r],["lat1","standard_parallel_1",r],["lat2","standard_parallel_2",r],["azimuth","Azimuth"],["alpha","azimuth",r],["srsCode","name"]].forEach(function(t){return s=e,a=(i=t)[0],h=i[1],void(!(a in s)&&h in s&&(s[a]=s[h],3===i.length&&(s[a]=i[2](s[a]))));var s,i,a,h}),e.long0||!e.longc||"Albers_Conic_Equal_Area"!==e.projName&&"Lambert_Azimuthal_Equal_Area"!==e.projName||(e.long0=e.longc),e.lat_ts||!e.lat1||"Stereographic_South_Pole"!==e.projName&&"Polar Stereographic (variant B)"!==e.projName||(e.lat0=r(0<e.lat1?90:-90),e.lat_ts=e.lat1)}function l(t){var s=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?l[t]=J(arguments[1]):l[t]=at(arguments[1]):l[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map(function(t){Array.isArray(t)?l.apply(s,t):l(t)});if("string"==typeof t){if(t in l)return l[t]}else"EPSG"in t?l["EPSG:"+t.EPSG]=t:"ESRI"in t?l["ESRI:"+t.ESRI]=t:"IAU2000"in t?l["IAU2000:"+t.IAU2000]=t:console.log(t);return}}function E(t){if("string"!=typeof t)return t;if(t in l)return l[t];if(a=t,lt.some(function(t){return-1<a.indexOf(t)})){var s=at(t);if(function(t){var s=k(t,"authority");if(s){var i=k(s,"epsg");return i&&-1<Mt.indexOf(i)}}(s))return l["EPSG:3857"];var i=function(t){var s=k(t,"extension");if(s)return k(s,"proj4")}(s);return i?J(i):s}var a;return"+"===t[0]?J(t):void 0}function t(t){return t}function s(t,s){var i=mt.length;return t.names?((mt[i]=t).names.forEach(function(t){ft[t.toLowerCase()]=i}),this):(console.log(s),!0)}function q(t,s){if(!(this instanceof q))return new q(t);s=s||function(t){if(t)throw t};var i,a,h,e,n,r,o,l,M,c,u,f,m,p,d,y,_,x,g,b,v,w,C,P,S,N=E(t);"object"==typeof N&&(i=q.projections.get(N.projName))?(!N.datumCode||"none"===N.datumCode||(a=k(_t,N.datumCode))&&(N.datum_params=a.towgs84?a.towgs84.split(","):null,N.ellps=a.ellipse,N.datumName=a.datumName?a.datumName:N.datumCode),N.k0=N.k0||1,N.axis=N.axis||"enu",N.ellps=N.ellps||"wgs84",b=N.a,v=N.b,w=N.rf,C=N.ellps,P=N.sphere,b||(b=(S=(S=k(dt,C))||yt).a,v=S.b,w=S.rf),w&&!v&&(v=(1-1/w)*b),(0===w||Math.abs(b-v)<D)&&(P=!0,v=b),m=(h={a:b,b:v,rf:w,sphere:P}).a,p=h.b,d=N.R_A,x=((y=m*m)-(_=p*p))/y,g=0,d?(y=(m*=1-x*(R+x*(L+x*T)))*m,x=0):g=Math.sqrt(x),e={es:x,e:g,ep2:(y-_)/_},n=N.datum||(r=N.datumCode,o=N.datum_params,l=h.a,M=h.b,c=e.es,u=e.ep2,(f={}).datum_type=void 0===r||"none"===r?G:A,o&&(f.datum_params=o.map(parseFloat),0===f.datum_params[0]&&0===f.datum_params[1]&&0===f.datum_params[2]||(f.datum_type=I),3<f.datum_params.length&&(0===f.datum_params[3]&&0===f.datum_params[4]&&0===f.datum_params[5]&&0===f.datum_params[6]||(f.datum_type=O,f.datum_params[3]*=j,f.datum_params[4]*=j,f.datum_params[5]*=j,f.datum_params[6]=f.datum_params[6]/1e6+1))),f.a=l,f.b=M,f.es=c,f.ep2=u,f),ct(this,N),ct(this,i),this.a=h.a,this.b=h.b,this.rf=h.rf,this.sphere=h.sphere,this.es=e.es,this.e=e.e,this.ep2=e.ep2,this.datum=n,this.init(),s(null,this)):s(t)}function M(t,s,i){var a,h,e,n,r=t.x,o=t.y,l=t.z?t.z:0;if(o<-z&&-1.001*z<o)o=-z;else if(z<o&&o<1.001*z)o=z;else{if(o<-z)return{x:-1/0,y:-1/0,z:t.z};if(z<o)return{x:1/0,y:1/0,z:t.z}}return r>Math.PI&&(r-=2*Math.PI),h=Math.sin(o),n=Math.cos(o),e=h*h,{x:((a=i/Math.sqrt(1-s*e))+l)*n*Math.cos(r),y:(a+l)*n*Math.sin(r),z:(a*(1-s)+l)*h}}function c(t,s,i,a){var h,e,n,r,o,l,M,c,u,f,m,p,d,y=t.x,_=t.y,x=t.z?t.z:0,g=Math.sqrt(y*y+_*_),b=Math.sqrt(y*y+_*_+x*x);if(g/i<1e-12){if(p=0,b/i<1e-12)return d=-a,{x:t.x,y:t.y,z:t.z}}else p=Math.atan2(_,y);for(h=x/b,l=(e=g/b)*(1-s)*(n=1/Math.sqrt(1-s*(2-s)*e*e)),M=h*n,m=0;m++,r=s*(o=i/Math.sqrt(1-s*M*M))/(o+(d=g*l+x*M-o*(1-s*M*M))),f=(u=h*(n=1/Math.sqrt(1-r*(2-r)*e*e)))*l-(c=e*(1-r)*n)*M,l=c,M=u,1e-24<f*f&&m<30;);return{x:p,y:Math.atan(u/Math.abs(c)),z:d}}function u(t){return t===I||t===O}function i(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 f(t,s,i){var a,h,e;if(Array.isArray(i)&&(i=bt(i)),vt(i),t.datum&&s.datum&&(e=s,((h=t).datum.datum_type===I||h.datum.datum_type===O)&&"WGS84"!==e.datumCode||(e.datum.datum_type===I||e.datum.datum_type===O)&&"WGS84"!==h.datumCode)&&(i=f(t,a=new q("WGS84"),i),t=a),"enu"!==t.axis&&(i=gt(t,!1,i)),"longlat"===t.projName)i={x:i.x*N,y:i.y*N,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;return t.from_greenwich&&(i.x+=t.from_greenwich),i=xt(t.datum,s.datum,i),s.from_greenwich&&(i={x:i.x-s.from_greenwich,y:i.y,z:i.z||0}),"longlat"===s.projName?i={x:i.x*B,y:i.y*B,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})),"enu"!==s.axis?gt(s,!0,i):i}function m(s,i,a){var t,h,e;return Array.isArray(a)?(t=f(s,i,a)||{x:NaN,y:NaN},2<a.length?void 0!==s.name&&"geocent"===s.name||void 0!==i.name&&"geocent"===i.name?"number"==typeof t.z?[t.x,t.y,t.z].concat(a.splice(3)):[t.x,t.y,a[2]].concat(a.splice(3)):[t.x,t.y].concat(a.splice(2)):[t.x,t.y]):(h=f(s,i,a),2===(e=Object.keys(a)).length||e.forEach(function(t){if(void 0!==s.name&&"geocent"===s.name||void 0!==i.name&&"geocent"===i.name){if("x"===t||"y"===t||"z"===t)return}else if("x"===t||"y"===t)return;h[t]=a[t]}),h)}function p(t){return t instanceof q?t:t.oProj?t.oProj:q(t)}function a(s,i,t){s=p(s);var a,h=!1;return void 0===i?(i=s,s=wt,h=!0):void 0===i.x&&!Array.isArray(i)||(t=i,i=s,s=wt,h=!0),i=p(i),t?m(s,i,t):(a={forward:function(t){return m(s,i,t)},inverse:function(t){return m(i,s,t)}},h&&(a.oProj=i),a)}function d(t,s){return s=s||5,i=function(t){var s,i,a,h,e,n,r=t.lat,o=t.lon,l=_(r),M=_(o);n=Math.floor((o+180)/6)+1,180===o&&(n=60),56<=r&&r<64&&3<=o&&o<12&&(n=32),72<=r&&r<84&&(0<=o&&o<9?n=31:9<=o&&o<21?n=33:21<=o&&o<33?n=35:33<=o&&o<42&&(n=37)),e=_(6*(n-1)-180+3),s=6378137/Math.sqrt(1-.00669438*Math.sin(l)*Math.sin(l)),i=Math.tan(l)*Math.tan(l),a=.006739496752268451*Math.cos(l)*Math.cos(l);var c=.9996*s*((h=Math.cos(l)*(M-e))+(1-i+a)*h*h*h/6+(5-18*i+i*i+72*a-.39089081163157013)*h*h*h*h*h/120)+5e5,u=.9996*(6378137*(.9983242984503243*l-.002514607064228144*Math.sin(2*l)+2639046602129982e-21*Math.sin(4*l)-3.418046101696858e-9*Math.sin(6*l))+s*Math.tan(l)*(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));return r<0&&(u+=1e7),{northing:Math.round(u),easting:Math.round(c),zoneNumber:n,zoneLetter:function(t){var s="Z";return t<=84&&72<=t?s="X":t<72&&64<=t?s="W":t<64&&56<=t?s="V":t<56&&48<=t?s="U":t<48&&40<=t?s="T":t<40&&32<=t?s="S":t<32&&24<=t?s="R":t<24&&16<=t?s="Q":t<16&&8<=t?s="P":t<8&&0<=t?s="N":t<0&&-8<=t?s="M":t<-8&&-16<=t?s="L":t<-16&&-24<=t?s="K":t<-24&&-32<=t?s="J":t<-32&&-40<=t?s="H":t<-40&&-48<=t?s="G":t<-48&&-56<=t?s="F":t<-56&&-64<=t?s="E":t<-64&&-72<=t?s="D":t<-72&&-80<=t&&(s="C"),s}(r)}}({lat:t[1],lon:t[0]}),a=s,h="00000"+i.easting,e="00000"+i.northing,i.zoneNumber+i.zoneLetter+function(t,s,i){var a=b(i);return function(t,s,i){var a=i-1,h=Pt.charCodeAt(a),e=St.charCodeAt(a),n=h+t-1,r=e+s,o=!1;return It<n&&(n=n-It+Nt-1,o=!0),(n===kt||h<kt&&kt<n||(kt<n||h<kt)&&o)&&n++,(n===Et||h<Et&&Et<n||(Et<n||h<Et)&&o)&&++n===kt&&n++,It<n&&(n=n-It+Nt-1),o=qt<r&&(r=r-qt+Nt-1,!0),(r===kt||e<kt&&kt<r||(kt<r||e<kt)&&o)&&r++,(r===Et||e<Et&&Et<r||(Et<r||e<Et)&&o)&&++r===kt&&r++,qt<r&&(r=r-qt+Nt-1),String.fromCharCode(n)+String.fromCharCode(r)}(Math.floor(t/1e5),Math.floor(s/1e5)%20,a)}(i.easting,i.northing,i.zoneNumber)+h.substr(h.length-5,a)+e.substr(e.length-5,a);var i,a,h,e}function y(t){var s=g(v(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat]:[(s.left+s.right)/2,(s.top+s.bottom)/2]}function _(t){return t*(Math.PI/180)}function x(t){return t/Math.PI*180}function g(t){var s=t.northing,i=t.easting,a=t.zoneLetter,h=t.zoneNumber;if(h<0||60<h)return null;var e,n,r,o,l,M,c,u,f=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),m=i-5e5,p=s;a<"N"&&(p-=1e7),M=6*(h-1)-180+3,u=(c=p/.9996/6367449.145945056)+(3*f/2-27*f*f*f/32)*Math.sin(2*c)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*c)+151*f*f*f/96*Math.sin(6*c),e=6378137/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=6335439.32722994/Math.pow(1-.00669438*Math.sin(u)*Math.sin(u),1.5),l=m/(.9996*e);var d,y=x(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)),_=M+x(_=(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));return t.accuracy?{top:(d=g({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber})).lat,right:d.lon,bottom:y,left:_}:{lat:y,lon:_}}function b(t){var s=t%Ct;return 0===s&&(s=Ct),s}function v(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(2<=e)throw"MGRSPoint bad conversion from: "+t;h+=s,e++}var n=parseInt(h,10);if(0===e||i<e+3)throw"MGRSPoint bad conversion from: "+t;var r=t.charAt(e++);if(r<="A"||"B"===r||"Y"===r||"Z"<=r||"I"===r||"O"===r)throw"MGRSPoint zone letter "+r+" not handled: "+t;a=t.substring(e,e+=2);for(var o=b(n),l=function(t,s){for(var i=Pt.charCodeAt(s-1),a=1e5,h=!1;i!==t.charCodeAt(0);){if(++i===kt&&i++,i===Et&&i++,It<i){if(h)throw"Bad character: "+t;i=Nt,h=!0}a+=1e5}return a}(a.charAt(0),o),M=function(t,s){if("V"<t)throw"MGRSPoint given invalid Northing "+t;for(var i=St.charCodeAt(s-1),a=0,h=!1;i!==t.charCodeAt(0);){if(++i===kt&&i++,i===Et&&i++,qt<i){if(h)throw"Bad character: "+t;i=Nt,h=!0}a+=1e5}return a}(a.charAt(1),o);M<w(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 0<p&&(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 w(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(0<=s)return s;throw"Invalid zone letter: "+t}function C(t,s,i){if(!(this instanceof C))return new C(t,s,i);var a;Array.isArray(t)?(this.x=t[0],this.y=t[1],this.z=t[2]||0):"object"==typeof t?(this.x=t.x,this.y=t.y,this.z=t.z||0):"string"==typeof t&&void 0===s?(a=t.split(","),this.x=parseFloat(a[0],10),this.y=parseFloat(a[1],10),this.z=parseFloat(a[2],10)||0):(this.x=t,this.y=s,this.z=i||0),console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}function P(t,s,i,a){var h;return t<D?(a.value=Os,h=0):(h=Math.atan2(s,i),Math.abs(h)<=U?a.value=Os:U<h&&h<=z+U?(a.value=As,h-=z):z+U<h||h<=-(z+U)?(a.value=Gs,h=0<=h?h-Q:h+Q):(a.value=js,h+=z)),h}function S(t,s){var i=t+s;return i<-Q?i+=F:+Q<i&&(i-=F),i}var I=1,O=2,A=4,G=5,j=484813681109536e-20,z=Math.PI/2,R=.16666666666666666,L=.04722222222222222,T=.022156084656084655,D=1e-10,N=.017453292519943295,B=57.29577951308232,U=Math.PI/4,F=2*Math.PI,Q=3.14159265359,W={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},X={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},H=/[\s_\-\/\(\)]/g,J=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*N},lat_1:function(t){h.lat1=t*N},lat_2:function(t){h.lat2=t*N},lat_ts:function(t){h.lat_ts=t*N},lon_0:function(t){h.long0=t*N},lon_1:function(t){h.long1=t*N},lon_2:function(t){h.long2=t*N},alpha:function(t){h.alpha=parseFloat(t)*N},lonc:function(t){h.longc=t*N},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=k(X,t);s&&(h.to_meter=s.to_meter)},from_greenwich:function(t){h.from_greenwich=t*N},pm:function(t){var s=k(W,t);h.from_greenwich=(s||parseFloat(t))*N},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},K=1,V=/\s/,Z=/[A-Za-z]/,Y=/[A-Za-z84]/,$=/[,\]]/,tt=/[\d\.E\-\+]/;e.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;V.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case K: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($.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=K)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=K,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},e.prototype.number=function(t){if(!tt.test(t)){if($.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(Y.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=K)}if(!$.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},e.prototype.neutral=function(t){if(Z.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(tt.test(t))return this.word=t,void(this.state=3);if(!$.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 st,it=.017453292519943295,at=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),o(h),h};(st=l)("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),st("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),st("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"),st.WGS84=st["EPSG:4326"],st["EPSG:3785"]=st["EPSG:3857"],st.GOOGLE=st["EPSG:3857"],st["EPSG:900913"]=st["EPSG:3857"],st["EPSG:102113"]=st["EPSG:3857"];function ht(t,s,i){var a=t*s;return i/Math.sqrt(1-a*a)}function et(t){return t<0?-1:1}function nt(t){return Math.abs(t)<=Q?t:t-et(t)*F}function rt(t,s,i){var a=t*i,h=.5*t,a=Math.pow((1-a)/(1+a),h);return Math.tan(.5*(z-s))/a}function ot(t,s){for(var i,a,h=.5*t,e=z-2*Math.atan(s),n=0;n<=15;n++)if(i=t*Math.sin(e),e+=a=z-2*Math.atan(s*Math.pow((1-i)/(1+i),h))-e,Math.abs(a)<=1e-10)return e;return-9999}var lt=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"],Mt=["3857","900913","3785","102113"],ct=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},ut=[{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=ht(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,h,e=t.x,n=t.y;return 90<n*B&&n*B<-90&&180<e*B&&e*B<-180||Math.abs(Math.abs(n)-z)<=D?null:(h=this.sphere?(a=this.x0+this.a*this.k0*nt(e-this.long0),this.y0+this.a*this.k0*Math.log(Math.tan(U+.5*n))):(s=Math.sin(n),i=rt(this.e,n,s),a=this.x0+this.a*this.k0*nt(e-this.long0),this.y0-this.a*this.k0*Math.log(i)),t.x=a,t.y=h,t)},inverse:function(t){var s,i,a=t.x-this.x0,h=t.y-this.y0;if(this.sphere)i=z-2*Math.atan(Math.exp(-h/(this.a*this.k0)));else{var e=Math.exp(-h/(this.a*this.k0));if(-9999===(i=ot(this.e,e)))return null}return s=nt(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:t,inverse:t,names:["longlat","identity"]}],ft={},mt=[],pt={start:function(){ut.forEach(s)},add:s,get:function(t){if(!t)return!1;var s=t.toLowerCase();return void 0!==ft[s]&&mt[ft[s]]?mt[ft[s]]:void 0}},dt={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"}},yt=dt.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};dt.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var _t={wgs84:{towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},ch1903:{towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},ggrs87:{towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},nad83:{towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},nad27:{nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},potsdam:{towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},osni52:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},ire65:{towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},rassadiran:{towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},nzgd49:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},osgb36:{towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},s_jtsk:{towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},beduaram:{towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},gunung_segara:{towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},rnb72:{towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"}};q.projections=pt,q.projections.start();var xt=function(t,s,i){return h=s,((a=t).datum_type!==h.datum_type||a.a!==h.a||5e-11<Math.abs(a.es-h.es)||(a.datum_type===I?a.datum_params[0]!==h.datum_params[0]||a.datum_params[1]!==h.datum_params[1]||a.datum_params[2]!==h.datum_params[2]:a.datum_type===O&&(a.datum_params[0]!==h.datum_params[0]||a.datum_params[1]!==h.datum_params[1]||a.datum_params[2]!==h.datum_params[2]||a.datum_params[3]!==h.datum_params[3]||a.datum_params[4]!==h.datum_params[4]||a.datum_params[5]!==h.datum_params[5]||a.datum_params[6]!==h.datum_params[6])))&&t.datum_type!==G&&s.datum_type!==G&&(t.es!==s.es||t.a!==s.a||u(t.datum_type)||u(s.datum_type))?(i=M(i,t.es,t.a),u(t.datum_type)&&(i=function(t,s,i){if(s===I)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(s===O){var a=i[0],h=i[1],e=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)+h,z:l*(-r*t.x+n*t.y+t.z)+e}}}(i,t.datum_type,t.datum_params)),u(s.datum_type)&&(i=function(t,s,i){if(s===I)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(s===O){var a=i[0],h=i[1],e=i[2],n=i[3],r=i[4],o=i[5],l=i[6],M=(t.x-a)/l,c=(t.y-h)/l,u=(t.z-e)/l;return{x:M+o*c-r*u,y:-o*M+c+n*u,z:r*M-n*c+u}}}(i,s.datum_type,s.datum_params)),c(i,s.es,s.a,s.b)):i;var a,h},gt=function(t,s,i){for(var a,h,e=i.x,n=i.y,r=i.z||0,o={},l=0;l<3;l++)if(!s||2!==l||void 0!==i.z)switch(h=0===l?(a=e,-1!=="ew".indexOf(t.axis[l])?"x":"y"):1===l?(a=n,-1!=="ns".indexOf(t.axis[l])?"y":"x"):(a=r,"z"),t.axis[l]){case"e":case"w":case"n":case"s":o[h]=a;break;case"u":void 0!==i[h]&&(o.z=a);break;case"d":void 0!==i[h]&&(o.z=-a);break;default:return null}return o},bt=function(t){var s={x:t[0],y:t[1]};return 2<t.length&&(s.z=t[2]),3<t.length&&(s.m=t[3]),s},vt=function(t){i(t.x),i(t.y)},wt=q("WGS84"),Ct=6,Pt="AJSAJS",St="AFAFAF",Nt=65,kt=73,Et=79,qt=86,It=90,Ot={forward:d,inverse:function(t){var s=g(v(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat,s.lon,s.lat]:[s.left,s.bottom,s.right,s.top]},toPoint:y};C.fromMGRS=function(t){return new C(y(t))},C.prototype.toMGRS=function(t){return d([this.x,this.y],t)};function At(t){var s=[];s[0]=1-t*(.25+t*(.046875+t*(.01953125+t*ts))),s[1]=t*(.75-t*(.046875+t*(.01953125+t*ts)));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}function Gt(t,s,i,a){return i*=s,s*=s,a[0]*t-i*(a[1]+s*(a[2]+s*(a[3]+s*a[4])))}function jt(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=(Gt(h,n,Math.cos(h),i)-t)*(r*Math.sqrt(r))*a,Math.abs(r)<D)return h}return h}function zt(t){var s=Math.exp(t);return(s-1/s)/2}function Rt(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))}function Lt(t){var s,i,a,h=Math.abs(t);return s=h*(1+h/(Rt(1,h)+1)),h=0==(a=(i=1+s)-1)?s:s*Math.log(i)/a,t<0?-h:h}function Tt(t,s){for(var i,a=2*Math.cos(2*s),h=t.length-1,e=t[h],n=0;0<=--h;)i=a*e-n+t[h],n=e,e=i;return s+i*Math.sin(2*s)}function Dt(t,s,i){for(var a,h,e,n,r=Math.sin(s),o=Math.cos(s),l=zt(i),M=(e=i,((n=Math.exp(e))+1/n)/2),c=2*o*M,u=-2*r*l,f=t.length-1,m=t[f],p=0,d=0,y=0;0<=--f;)a=d,h=p,m=c*(d=m)-a-u*(p=y)+t[f],y=u*d-h+c*p;return[(c=r*M)*m-(u=o*l)*y,c*y+u*m]}function Bt(t,s){return Math.pow((1-t)/(1+t),s)}function Ut(t,s,i,a,h){return t*h-s*Math.sin(2*h)+i*Math.sin(4*h)-a*Math.sin(6*h)}function Ft(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function Qt(t){return.375*t*(1+.25*t*(1+.46875*t))}function Wt(t){return.05859375*t*t*(1+.75*t)}function Xt(t){return t*t*t*(35/3072)}function Ht(t,s,i){var a=s*i;return t/Math.sqrt(1-a*a)}function Jt(t){return Math.abs(t)<z?t:t-et(t)*Math.PI}function Kt(t,s,i,a,h){for(var e,n=t/s,r=0;r<15;r++)if(n+=e=(t-(s*n-i*Math.sin(2*n)+a*Math.sin(4*n)-h*Math.sin(6*n)))/(s-2*i*Math.cos(2*n)+4*a*Math.cos(4*n)-6*h*Math.cos(6*n)),Math.abs(e)<=1e-10)return n;return NaN}function Vt(t,s){var i;return 1e-7<t?(1-t*t)*(s/(1-(i=t*s)*i)-.5/t*Math.log((1-i)/(1+i))):2*s}function Zt(t){return 1<Math.abs(t)&&(t=1<t?1:-1),Math.asin(t)}function Yt(t,s){return t[0]+s*(t[1]+s*(t[2]+s*t[3]))}var $t,ts=.01068115234375,ss={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=At(this.es),this.ml0=Gt(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))},forward:function(t){var s=t.x,i=t.y,a=nt(s-this.long0),h=Math.sin(i),e=Math.cos(i);if(this.es){var n=e*a,r=Math.pow(n,2),o=this.ep2*Math.pow(e,2),l=Math.pow(o,2),M=Math.abs(e)>D?Math.tan(i):0,c=Math.pow(M,2),u=Math.pow(c,2),f=1-this.es*Math.pow(h,2);n/=Math.sqrt(f);var m=Gt(i,h,e,this.en),p=this.a*(this.k0*n*(1+r/6*(1-c+o+r/20*(5-18*c+u+14*o-58*c*o+r/42*(61+179*u-u*c-479*c)))))+this.x0,d=this.a*(this.k0*(m-this.ml0+h*a*n/2*(1+r/12*(5-c+9*o+4*l+r/30*(61+u-58*c+270*o-330*c*o+r/56*(1385+543*u-u*c-3111*c))))))+this.y0}else{var y=e*Math.sin(a);if(Math.abs(Math.abs(y)-1)<D)return 93;if(p=.5*this.a*this.k0*Math.log((1+y)/(1-y))+this.x0,d=e*Math.cos(a)/Math.sqrt(1-Math.pow(y,2)),1<=(y=Math.abs(d))){if(D<y-1)return 93;d=0}else d=Math.acos(d);i<0&&(d=-d),d=this.a*this.k0*(d-this.lat0)+this.y0}return t.x=p,t.y=d,t},inverse:function(t){var s,i,a,h,e,n,r,o,l,M,c,u,f,m,p,d,y,_=(t.x-this.x0)*(1/this.a),x=(t.y-this.y0)*(1/this.a);return f=this.es?(l=this.ml0+x/this.k0,s=jt(l,this.es,this.en),Math.abs(s)<z?(i=Math.sin(s),a=Math.cos(s),h=Math.abs(a)>D?Math.tan(s):0,e=this.ep2*Math.pow(a,2),n=Math.pow(e,2),r=Math.pow(h,2),o=Math.pow(r,2),l=1-this.es*Math.pow(i,2),M=_*Math.sqrt(l)/this.k0,u=s-(l*=h)*(c=Math.pow(M,2))/(1-this.es)*.5*(1-c/12*(5+3*r-9*e*r+e-4*n-c/30*(61+90*r-252*e*r+45*o+46*e-c/56*(1385+3633*r+4095*o+1574*o*r)))),nt(this.long0+M*(1-c/6*(1+2*r+e-c/20*(5+28*r+24*o+8*e*r+6*e-c/42*(61+662*r+1320*o+720*o*r))))/a)):(u=z*et(x),0)):(p=.5*((m=Math.exp(_/this.k0))-1/m),d=this.lat0+x/this.k0,y=Math.cos(d),l=Math.sqrt((1-Math.pow(y,2))/(1+Math.pow(p,2))),u=Math.asin(l),x<0&&(u=-u),0==p&&0===y?0:nt(Math.atan2(p,y)+this.long0)),t.x=f,t.y=u,t},names:["Transverse_Mercator","Transverse Mercator","tmerc"]},is={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+-2854/675*s))-2))),this.cbg[0]=s*(s*(2/3+s*(4/3+s*(-82/45+s*(32/45+4642/4725*s))))-2),i*=s,this.cgb[1]=i*(7/3+s*(s*(-227/45+s*(2704/315+2323/945*s))-1.6)),this.cbg[1]=i*(5/3+s*(-16/15+s*(-13/9+s*(904/315+-1522/945*s)))),i*=s,this.cgb[2]=i*(56/15+s*(-136/35+s*(-1262/105+73814/2835*s))),this.cbg[2]=i*(-26/15+s*(34/21+s*(1.6+-12686/2835*s))),i*=s,this.cgb[3]=i*(4279/630+s*(-332/35+-399572/14175*s)),this.cbg[3]=i*(1237/630+s*(-24832/14175*s-2.4)),i*=s,this.cgb[4]=i*(4174/315+-144838/6237*s),this.cbg[4]=i*(-734/315+109598/31185*s),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+-96199/604800*s))))-.5),this.gtu[0]=s*(.5+s*(-2/3+s*(5/16+s*(41/180+s*(-127/288+7891/37800*s))))),this.utg[1]=i*(-1/48+s*(-1/15+s*(437/1440+s*(-46/105+1118711/3870720*s)))),this.gtu[1]=i*(13/48+s*(s*(557/1440+s*(281/630+-1983433/1935360*s))-.6)),i*=s,this.utg[2]=i*(-17/480+s*(37/840+s*(209/4480+-5569/90720*s))),this.gtu[2]=i*(61/240+s*(-103/140+s*(15061/26880+167603/181440*s))),i*=s,this.utg[3]=i*(-4397/161280+s*(11/504+830251/7257600*s)),this.gtu[3]=i*(49561/161280+s*(-179/168+6601661/7257600*s)),i*=s,this.utg[4]=i*(-4583/161280+108847/3991680*s),this.gtu[4]=i*(34729/80640+-3418889/1995840*s),i*=s,this.utg[5]=-.03233083094085698*i,this.gtu[5]=.6650675310896665*i;var a=Tt(this.cbg,this.lat0);this.Zb=-this.Qn*(a+function(t,s){for(var i,a=2*Math.cos(s),h=t.length-1,e=t[h],n=0;0<=--h;)i=a*e-n+t[h],n=e,e=i;return Math.sin(s)*i}(this.gtu,2*a))},forward:function(t){var s=nt(t.x-this.long0),i=t.y,i=Tt(this.cbg,i),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=Lt(Math.tan(s));var r,o,l=Dt(this.gtu,2*i,2*s);return i+=l[0],s+=l[1],o=Math.abs(s)<=2.623395162778?(r=this.a*(this.Qn*s)+this.x0,this.a*(this.Qn*i+this.Zb)+this.y0):r=1/0,t.x=r,t.y=o,t},inverse:function(t){var s,i,a,h,e,n,r,o=(t.x-this.x0)*(1/this.a),l=(t.y-this.y0)*(1/this.a);return l=(l-this.Zb)/this.Qn,o/=this.Qn,r=Math.abs(o)<=2.623395162778?(l+=(s=Dt(this.utg,2*l,2*o))[0],o+=s[1],o=Math.atan(zt(o)),i=Math.sin(l),a=Math.cos(l),h=Math.sin(o),e=Math.cos(o),l=Math.atan2(i*e,Rt(h,e*a)),o=Math.atan2(h,e*a),n=nt(o+this.long0),Tt(this.cgb,l)):n=1/0,t.x=n,t.y=r,t},names:["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc"]},as={init:function(){var t=function(t,s){if(void 0===t){if((t=Math.floor(30*(nt(s)+Math.PI)/Math.PI)+1)<0)return 0;if(60<t)return 60}return t}(this.zone,this.long0);if(void 0===t)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*N,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,is.init.apply(this),this.forward=is.forward,this.inverse=is.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"},hs={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)*Bt(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)*Bt(this.e*Math.sin(i),this.ratexp))-z,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=20;0<h&&(i=2*Math.atan(a*Bt(this.e*Math.sin(t.y),-.5*this.e))-z,!(Math.abs(i-t.y)<1e-14));--h)t.y=i;return h?(t.x=s,t.y=i,t):null},names:["gauss"]},es={init:function(){hs.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=nt(t.x-this.long0),hs.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,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,n=(s=Math.sqrt(t.x*t.x+t.y*t.y))?(i=2*Math.atan2(s,this.R2),a=Math.sin(i),h=Math.cos(i),e=Math.asin(h*this.sinc0+t.y*a*this.cosc0/s),Math.atan2(t.x*a,s*this.cosc0*h-t.y*this.sinc0*a)):(e=this.phic0,0),t.x=n,t.y=e,hs.inverse.apply(this,[t]),t.x=nt(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]},ns={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)<=D&&(this.k0=.5*(1+et(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=D&&(0<this.lat0?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)<=D&&(this.k0=.5*this.cons*ht(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/rt(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=ht(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-z,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var s,i,a,h,e,n,r=t.x,o=t.y,l=Math.sin(o),M=Math.cos(o),c=nt(r-this.long0);return Math.abs(Math.abs(r-this.long0)-Math.PI)<=D&&Math.abs(o+this.lat0)<=D?(t.x=NaN,t.y=NaN):this.sphere?(s=2*this.k0/(1+this.sinlat0*l+this.coslat0*M*Math.cos(c)),t.x=this.a*s*M*Math.sin(c)+this.x0,t.y=this.a*s*(this.coslat0*l-this.sinlat0*M*Math.cos(c))+this.y0):(i=2*Math.atan(this.ssfn_(o,l,this.e))-z,h=Math.cos(i),a=Math.sin(i),Math.abs(this.coslat0)<=D?(e=rt(this.e,o*this.con,this.con*l),n=2*this.a*this.k0*e/this.cons,t.x=this.x0+n*Math.sin(r-this.long0),t.y=this.y0-this.con*n*Math.cos(r-this.long0)):(Math.abs(this.sinlat0)<D?(s=2*this.a*this.k0/(1+h*Math.cos(c)),t.y=s*a):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*h*Math.cos(c))),t.y=s*(this.cosX0*a-this.sinX0*h*Math.cos(c))+this.y0),t.x=s*h*Math.sin(c)+this.x0)),t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s,i,a,h=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var e=2*Math.atan(h/(2*this.a*this.k0)),n=this.long0,r=this.lat0;return h<=D||(r=Math.asin(Math.cos(e)*this.sinlat0+t.y*Math.sin(e)*this.coslat0/h),n=nt(Math.abs(this.coslat0)<D?0<this.lat0?this.long0+Math.atan2(t.x,-1*t.y):this.long0+Math.atan2(t.x,t.y):this.long0+Math.atan2(t.x*Math.sin(e),h*this.coslat0*Math.cos(e)-t.y*this.sinlat0*Math.sin(e)))),t.x=n,t.y=r,t}if(Math.abs(this.coslat0)<=D){if(h<=D)return r=this.lat0,n=this.long0,t.x=n,t.y=r,t;t.x*=this.con,t.y*=this.con,s=h*this.cons/(2*this.a*this.k0),r=this.con*ot(this.e,s),n=this.con*nt(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else i=2*Math.atan(h*this.cosX0/(2*this.a*this.k0*this.ms1)),n=this.long0,h<=D?a=this.X0:(a=Math.asin(Math.cos(i)*this.sinX0+t.y*Math.sin(i)*this.cosX0/h),n=nt(this.long0+Math.atan2(t.x*Math.sin(i),h*this.cosX0*Math.cos(i)-t.y*this.sinX0*Math.sin(i)))),r=-1*ot(this.e,Math.tan(.5*(z+a)));return t.x=n,t.y=r,t},names:["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],ssfn_:function(t,s,i){return s*=i,Math.tan(.5*(z+t))*Math.pow((1-s)/(1+s),.5*i)}},rs={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;1e-7<Math.abs(l-M);){if(20<++c)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"]},os={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,n,r,o,l,M,c,u,f=rt(this.e,this.lat0,t),m=this.bl/s*Math.sqrt((1-this.es)/(1-i*i));m*m<1&&(m=1),isNaN(this.longc)?(h=rt(this.e,this.lat1,Math.sin(this.lat1)),e=rt(this.e,this.lat2,Math.sin(this.lat2)),0<=this.lat0?this.el=(m+Math.sqrt(m*m-1))*Math.pow(f,this.bl):this.el=(m-Math.sqrt(m*m-1))*Math.pow(f,this.bl),n=Math.pow(h,this.bl),r=Math.pow(e,this.bl),o=.5*((a=this.el/n)-1/a),l=(this.el*this.el-r*n)/(this.el*this.el+r*n),M=(r-n)/(r+n),c=nt(this.long1-this.long2),this.long0=.5*(this.long1+this.long2)-Math.atan(l*Math.tan(.5*this.bl*c)/M)/this.bl,this.long0=nt(this.long0),u=nt(this.long1-this.long0),this.gamma0=Math.atan(Math.sin(this.bl*u)/o),this.alpha=Math.asin(m*Math.sin(this.gamma0))):(a=0<=this.lat0?m+Math.sqrt(m*m-1):m-Math.sqrt(m*m-1),this.el=a*Math.pow(f,this.bl),o=.5*(a-1/a),this.gamma0=Math.asin(Math.sin(this.alpha)/m),this.long0=this.longc-Math.asin(o*Math.tan(this.gamma0))/this.bl),this.no_off?this.uc=0:0<=this.lat0?this.uc=this.al/this.bl*Math.atan2(Math.sqrt(m*m-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(m*m-1),Math.cos(this.alpha))},forward:function(t){var s,i,a,h,e,n,r,o,l,M=t.x,c=t.y,u=nt(M-this.long0);return l=Math.abs(Math.abs(c)-z)<=D?(s=0<c?-1:1,o=this.al/this.bl*Math.log(Math.tan(U+s*this.gamma0*.5)),-1*s*z*this.al/this.bl):(i=rt(this.e,c,Math.sin(c)),h=.5*((a=this.el/Math.pow(i,this.bl))-1/a),e=.5*(a+1/a),n=Math.sin(this.bl*u),r=(h*Math.sin(this.gamma0)-n*Math.cos(this.gamma0))/e,o=Math.abs(Math.abs(r)-1)<=D?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-r)/(1+r))/this.bl,Math.abs(Math.cos(this.bl*u))<=D?this.al*this.bl*u:this.al*Math.atan2(h*Math.cos(this.gamma0)+n*Math.sin(this.gamma0),Math.cos(this.bl*u))/this.bl),this.no_rot?(t.x=this.x0+l,t.y=this.y0+o):(l-=this.uc,t.x=this.x0+o*Math.cos(this.alpha)+l*Math.sin(this.alpha),t.y=this.y0+l*Math.cos(this.alpha)-o*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),e=.5*(a+1/a),n=Math.sin(this.bl*s/this.al),r=(n*Math.cos(this.gamma0)+h*Math.sin(this.gamma0))/e,o=Math.pow(this.el/Math.sqrt((1+r)/(1-r)),1/this.bl);return Math.abs(r-1)<D?(t.x=this.long0,t.y=z):Math.abs(1+r)<D?(t.x=this.long0,t.y=-1*z):(t.y=ot(this.e,o),t.x=nt(this.long0-Math.atan2(h*Math.cos(this.gamma0)-n*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"]},ls={init:function(){var t,s,i,a,h,e,n,r,o,l;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)<D||(t=this.b/this.a,this.e=Math.sqrt(1-t*t),s=Math.sin(this.lat1),i=Math.cos(this.lat1),a=ht(this.e,s,i),h=rt(this.e,this.lat1,s),e=Math.sin(this.lat2),n=Math.cos(this.lat2),r=ht(this.e,e,n),o=rt(this.e,this.lat2,e),l=rt(this.e,this.lat0,Math.sin(this.lat0)),Math.abs(this.lat1-this.lat2)>D?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(l,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)<=D&&(i=et(i)*(z-2*D));var a,h,e=Math.abs(Math.abs(i)-z);if(D<e)a=rt(this.e,i,Math.sin(i)),h=this.a*this.f0*Math.pow(a,this.ns);else{if((e=i*this.ns)<=0)return null;h=0}var n=this.ns*nt(s-this.long0);return t.x=this.k0*(h*Math.sin(n))+this.x0,t.y=this.k0*(this.rh-h*Math.cos(n))+this.y0,t},inverse:function(t){var s,i,a,h,e=(t.x-this.x0)/this.k0,n=this.rh-(t.y-this.y0)/this.k0,r=0<this.ns?(s=Math.sqrt(e*e+n*n),1):(s=-Math.sqrt(e*e+n*n),-1),o=0;if(0!==s&&(o=Math.atan2(r*e,r*n)),0!==s||0<this.ns){if(r=1/this.ns,i=Math.pow(s/(this.a*this.f0),r),-9999===(a=ot(this.e,i)))return null}else a=-z;return h=nt(o/this.ns+this.long0),t.x=h,t.y=a,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]},Ms={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=t.x,i=t.y,a=nt(s-this.long0),h=Math.pow((1+this.e*Math.sin(i))/(1-this.e*Math.sin(i)),this.alfa*this.e/2),e=2*(Math.atan(this.k*Math.pow(Math.tan(i/2+this.s45),this.alfa)/h)-this.s45),n=-a*this.alfa,r=Math.asin(Math.cos(this.ad)*Math.sin(e)+Math.sin(this.ad)*Math.cos(e)*Math.cos(n)),o=Math.asin(Math.cos(e)*Math.sin(n)/Math.cos(r)),l=this.n*o,M=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(r/2+this.s45),this.n);return t.y=M*Math.cos(l),t.x=M*Math.sin(l),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;for(var l=r=0;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,0===r&&l<15;);return 15<=l?null:t},names:["Krovak","krovak"]},cs={init:function(){this.sphere||(this.e0=Ft(this.es),this.e1=Qt(this.es),this.e2=Wt(this.es),this.e3=Xt(this.es),this.ml0=this.a*Ut(this.e0,this.e1,this.e2,this.e3,this.lat0))},forward:function(t){var s,i,a,h,e,n,r,o,l,M=t.x,c=t.y,M=nt(M-this.long0);return l=this.sphere?(o=this.a*Math.asin(Math.cos(c)*Math.sin(M)),this.a*(Math.atan2(Math.tan(c),Math.cos(M))-this.lat0)):(s=Math.sin(c),i=Math.cos(c),a=Ht(this.a,this.e,s),h=Math.tan(c)*Math.tan(c),o=a*(e=M*Math.cos(c))*(1-(n=e*e)*h*(1/6-(8-h+8*(r=this.es*i*i/(1-this.es)))*n/120)),this.a*Ut(this.e0,this.e1,this.e2,this.e3,c)-this.ml0+a*s/i*n*(.5+(5-h+6*r)*n/24)),t.x=o+this.x0,t.y=l+this.y0,t},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s=t.x/this.a,i=t.y/this.a;if(this.sphere)var a=i+this.lat0,h=Math.asin(Math.sin(a)*Math.cos(s)),e=Math.atan2(Math.tan(s),Math.cos(a));else{var n=this.ml0/this.a+i,r=Kt(n,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(r)-z)<=D)return t.x=this.long0,t.y=z,i<0&&(t.y*=-1),t;var o=Ht(this.a,this.e,Math.sin(r)),l=o*o*o/this.a/this.a*(1-this.es),M=Math.pow(Math.tan(r),2),c=s*this.a/o,u=c*c;h=r-o*Math.tan(r)/l*c*c*(.5-(1+3*M)*c*c/24),e=c*(1-u*(M/3+(1+3*M)*M*u/15))/Math.cos(r)}return t.x=nt(e+this.long0),t.y=Jt(h),t},names:["Cassini","Cassini_Soldner","cass"]},us={init:function(){var t,s,i,a,h=Math.abs(this.lat0);if(Math.abs(h-z)<D?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(h)<D?this.mode=this.EQUIT:this.mode=this.OBLIQ,0<this.es)switch(this.qp=Vt(this.e,1),this.mmf=.5/(1-this.es),this.apa=(s=this.es,(a=[])[0]=.3333333333333333*s,i=s*s,a[0]+=.17222222222222222*i,a[1]=.06388888888888888*i,i*=s,a[0]+=.10257936507936508*i,a[1]+=.0664021164021164*i,a[2]=.016415012942191543*i,a),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=Vt(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,e,n,r,o,l,M,c=t.x,u=t.y,c=nt(c-this.long0);if(this.sphere){if(e=Math.sin(u),M=Math.cos(u),a=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if((i=this.mode===this.EQUIT?1+M*a:1+this.sinph0*e+this.cosph0*M*a)<=D)return null;s=(i=Math.sqrt(2/i))*M*Math.sin(c),i*=this.mode===this.EQUIT?e:this.cosph0*e-this.sinph0*M*a}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(a=-a),Math.abs(u+this.lat0)<D)return null;i=U-.5*u,s=(i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)))*Math.sin(c),i*=a}}else{switch(l=o=r=0,a=Math.cos(c),h=Math.sin(c),e=Math.sin(u),n=Vt(this.e,e),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(r=n/this.qp,o=Math.sqrt(1-r*r)),this.mode){case this.OBLIQ:l=1+this.sinb1*r+this.cosb1*o*a;break;case this.EQUIT:l=1+o*a;break;case this.N_POLE:l=z+u,n=this.qp-n;break;case this.S_POLE:l=u-z,n=this.qp+n}if(Math.abs(l)<D)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:l=Math.sqrt(2/l),i=this.mode===this.OBLIQ?this.ymf*l*(this.cosb1*r-this.sinb1*o*a):(l=Math.sqrt(2/(1+o*a)))*r*this.ymf,s=this.xmf*l*o*h;break;case this.N_POLE:case this.S_POLE:0<=n?(s=(l=Math.sqrt(n))*h,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},inverse:function(t){t.x-=this.x0,t.y-=this.y0;var s,i,a,h,e,n,r,o,l,M,c=t.x/this.a,u=t.y/this.a;if(this.sphere){var f=0,m=0,p=Math.sqrt(c*c+u*u);if(1<(i=.5*p))return null;switch(i=2*Math.asin(i),this.mode!==this.OBLIQ&&this.mode!==this.EQUIT||(m=Math.sin(i),f=Math.cos(i)),this.mode){case this.EQUIT:i=Math.abs(p)<=D?0:Math.asin(u*m/p),c*=m,u=f*p;break;case this.OBLIQ:i=Math.abs(p)<=D?this.lat0:Math.asin(f*this.sinph0+u*m*this.cosph0/p),c*=m*this.cosph0,u=(f-Math.sin(i)*this.sinph0)*p;break;case this.N_POLE:u=-u,i=z-i;break;case this.S_POLE:i-=z}s=0!==u||this.mode!==this.EQUIT&&this.mode!==this.OBLIQ?Math.atan2(c,u):0}else{if(r=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(c/=this.dd,u*=this.dd,(n=Math.sqrt(c*c+u*u))<D)return t.x=this.long0,t.y=this.lat0,t;h=2*Math.asin(.5*n/this.rq),a=Math.cos(h),c*=h=Math.sin(h),u=this.mode===this.OBLIQ?(r=a*this.sinb1+u*h*this.cosb1/n,e=this.qp*r,n*this.cosb1*a-u*this.sinb1*h):(r=u*h/n,e=this.qp*r,n*a)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(u=-u),!(e=c*c+u*u))return t.x=this.long0,t.y=this.lat0,t;r=1-e/this.qp,this.mode===this.S_POLE&&(r=-r)}s=Math.atan2(c,u),o=Math.asin(r),l=this.apa,M=o+o,i=o+l[0]*Math.sin(M)+l[1]*Math.sin(M+M)+l[2]*Math.sin(M+M+M)}return t.x=nt(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},fs={init:function(){Math.abs(this.lat1+this.lat2)<D||(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=ht(this.e3,this.sin_po,this.cos_po),this.qs1=Vt(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=ht(this.e3,this.sin_po,this.cos_po),this.qs2=Vt(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=Vt(this.e3,this.sin_po,this.cos_po),Math.abs(this.lat1-this.lat2)>D?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=Vt(this.e3,this.sin_phi,this.cos_phi),h=this.a*Math.sqrt(this.c-this.ns0*a)/this.ns0,e=this.ns0*nt(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,a=0<=this.ns0?(s=Math.sqrt(t.x*t.x+t.y*t.y),1):(s=-Math.sqrt(t.x*t.x+t.y*t.y),-1),(h=0)!==s&&(h=Math.atan2(a*t.x,a*t.y)),a=s*this.ns0/this.a,n=this.sphere?Math.asin((this.c-a*a)/(2*this.ns0)):(i=(this.c-a*a)/this.ns0,this.phi1z(this.e3,i)),e=nt(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=Zt(.5*s);if(t<D)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}},ms={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=t.x,h=t.y,e=nt(a-this.long0),n=Math.sin(h),r=Math.cos(h),o=Math.cos(e),l=0<(s=this.sin_p14*n+this.cos_p14*r*o)||Math.abs(s)<=D?(i=this.x0+this.a*r*Math.sin(e)/s,this.y0+this.a*(this.cos_p14*n-this.sin_p14*r*o)/s):(i=this.x0+this.infinity_dist*r*Math.sin(e),this.y0+this.infinity_dist*(this.cos_p14*n-this.sin_p14*r*o));return t.x=i,t.y=l,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,e=(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=Zt(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),nt(this.long0+e)):(n=this.phic0,0),t.x=e,t.y=n,t},names:["gnom"]},ps={init:function(){this.sphere||(this.k0=ht(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))},forward:function(t){var s,i,a,h=t.x,e=t.y,n=nt(h-this.long0);return a=this.sphere?(i=this.x0+this.a*n*Math.cos(this.lat_ts),this.y0+this.a*Math.sin(e)/Math.cos(this.lat_ts)):(s=Vt(this.e,Math.sin(e)),i=this.x0+this.a*this.k0*n,this.y0+this.a*s*.5/this.k0),t.x=i,t.y=a,t},inverse:function(t){var s,i;return t.x-=this.x0,t.y-=this.y0,this.sphere?(s=nt(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=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*z:z;for(var a,h,e,n,r=Math.asin(.5*s),o=0;o<30;o++)if(h=Math.sin(r),e=Math.cos(r),n=t*h,r+=a=Math.pow(1-n*n,2)/(2*e)*(s/(1-t*t)-h/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),Math.abs(a)<=1e-10)return r;return NaN}(this.e,2*t.y*this.k0/this.a),s=nt(this.long0+t.x/(this.a*this.k0))),t.x=s,t.y=i,t},names:["cea"]},ds={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=nt(s-this.long0),h=Jt(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=nt(this.long0+(s-this.x0)/(this.a*this.rc)),t.y=Jt(this.lat0+(i-this.y0)/this.a),t},names:["Equirectangular","Equidistant_Cylindrical","eqc"]},ys={init:function(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=Ft(this.es),this.e1=Qt(this.es),this.e2=Wt(this.es),this.e3=Xt(this.es),this.ml0=this.a*Ut(this.e0,this.e1,this.e2,this.e3,this.lat0)},forward:function(t){var s,i,a,h=t.x,e=t.y,n=nt(h-this.long0),r=n*Math.sin(e);return a=this.sphere?Math.abs(e)<=D?(i=this.a*n,-1*this.a*this.lat0):(i=this.a*Math.sin(r)/Math.tan(e),this.a*(Jt(e-this.lat0)+(1-Math.cos(r))/Math.tan(e))):Math.abs(e)<=D?(i=this.a*n,-1*this.ml0):(i=(s=Ht(this.a,this.e,Math.sin(e))/Math.tan(e))*Math.sin(r),this.a*Ut(this.e0,this.e1,this.e2,this.e3,e)-this.ml0+s*(1-Math.cos(r))),t.x=i+this.x0,t.y=a+this.y0,t},inverse:function(t){var s,i,a,h,e,n,r,o,l=t.x-this.x0,M=t.y-this.y0;if(this.sphere)if(Math.abs(M+this.a*this.lat0)<=D)s=nt(l/this.a+this.long0),i=0;else{for(var c,u=this.lat0+M/this.a,f=l*l/this.a/this.a+u*u,m=u,p=20;p;--p)if(m+=a=-1*(u*(m*(c=Math.tan(m))+1)-m-.5*(m*m+f)*c)/((m-u)/c-1),Math.abs(a)<=D){i=m;break}s=nt(this.long0+Math.asin(l*Math.tan(m)/this.a)/Math.sin(i))}else if(Math.abs(M+this.ml0)<=D)i=0,s=nt(this.long0+l/this.a);else{for(u=(this.ml0+M)/this.a,f=l*l/this.a/this.a+u*u,m=u,p=20;p;--p)if(o=this.e*Math.sin(m),h=Math.sqrt(1-o*o)*Math.tan(m),e=this.a*Ut(this.e0,this.e1,this.e2,this.e3,m),n=this.e0-2*this.e1*Math.cos(2*m)+4*this.e2*Math.cos(4*m)-6*this.e3*Math.cos(6*m),m-=a=(u*(h*(r=e/this.a)+1)-r-.5*h*(r*r+f))/(this.es*Math.sin(2*m)*(r*r+f-2*u*r)/(4*h)+(u-r)*(h*n-2/Math.sin(2*m))-n),Math.abs(a)<=D){i=m;break}h=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),s=nt(this.long0+Math.asin(l*h/this.a)/Math.sin(i))}return t.x=s,t.y=i,t},names:["Polyconic","poly"]},_s={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){for(var s=t.x,i=t.y-this.lat0,a=s-this.long0,h=i/j*1e-5,e=a,n=1,r=0,o=1;o<=10;o++)n*=h,r+=this.A[o]*n;var l,M=r,c=e,u=1,f=0,m=0,p=0;for(o=1;o<=6;o++)l=f*M+u*c,u=u*M-f*c,f=l,m=m+this.B_re[o]*u-this.B_im[o]*f,p=p+this.B_im[o]*u+this.B_re[o]*f;return t.x=p*this.a+this.x0,t.y=m*this.a+this.y0,t},inverse:function(t){var s,i=t.x,a=t.y,h=i-this.x0,e=(a-this.y0)/this.a,n=h/this.a,r=1,o=0,l=0,M=0;for(y=1;y<=6;y++)s=o*e+r*n,r=r*e-o*n,o=s,l=l+this.C_re[y]*r-this.C_im[y]*o,M=M+this.C_im[y]*r+this.C_re[y]*o;for(var c=0;c<this.iterations;c++){for(var u,f=l,m=M,p=e,d=n,y=2;y<=6;y++)u=m*l+f*M,f=f*l-m*M,m=u,p+=(y-1)*(this.B_re[y]*f-this.B_im[y]*m),d+=(y-1)*(this.B_im[y]*f+this.B_re[y]*m);f=1,m=0;var _=this.B_re[1],x=this.B_im[1];for(y=2;y<=6;y++)u=m*l+f*M,f=f*l-m*M,m=u,_+=y*(this.B_re[y]*f-this.B_im[y]*m),x+=y*(this.B_im[y]*f+this.B_re[y]*m);var g=_*_+x*x,l=(p*_+d*x)/g,M=(d*_-p*x)/g}var b=l,v=M,w=1,C=0;for(y=1;y<=9;y++)w*=b,C+=this.D[y]*w;var P=this.lat0+C*j*1e5,S=this.long0+v;return t.x=S,t.y=P,t},names:["New_Zealand_Map_Grid","nzmg"]},xs={init:function(){},forward:function(t){var s=t.x,i=t.y,a=nt(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=nt(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"]},gs={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=At(this.es)},forward:function(t){var s=t.x,i=t.y,s=nt(s-this.long0);if(this.sphere){if(this.m)for(var a=this.n*Math.sin(i),h=20;h;--h){var e=(this.m*i+Math.sin(i)-a)/(this.m+Math.cos(i));if(i-=e,Math.abs(e)<D)break}else i=1!==this.n?Math.asin(this.n*Math.sin(i)):i;l=this.a*this.C_x*s*(this.m+Math.cos(i)),o=this.a*this.C_y*i}else var n=Math.sin(i),r=Math.cos(i),o=this.a*Gt(i,n,r,this.en),l=this.a*s*r/Math.sqrt(1-this.es*n*n);return t.x=l,t.y=o,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=Zt((this.m*s+Math.sin(s))/this.n):1!==this.n&&(s=Zt(Math.sin(s)/this.n)),a=nt(a+this.long0),s=Jt(s)):(s=jt(t.y/this.a,this.es,this.en),(h=Math.abs(s))<z?(h=Math.sin(s),i=this.long0+t.x*Math.sqrt(1-this.es*h*h)/(this.a*Math.cos(s)),a=nt(i)):h-D<z&&(a=this.long0)),t.x=a,t.y=s,t},names:["Sinusoidal","sinu"]},bs={init:function(){},forward:function(t){for(var s=t.x,i=t.y,a=nt(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)<D)break}h/=2,Math.PI/2-Math.abs(i)<D&&(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),.999999999999<Math.abs(i)&&(i=.999999999999),s=Math.asin(i);var a=nt(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,1<Math.abs(i)&&(i=1);var h=Math.asin(i);return t.x=a,t.y=h,t},names:["Mollweide","moll"]},vs={init:function(){Math.abs(this.lat1+this.lat2)<D||(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=Ft(this.es),this.e1=Qt(this.es),this.e2=Wt(this.es),this.e3=Xt(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=ht(this.e,this.sinphi,this.cosphi),this.ml1=Ut(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<D?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=ht(this.e,this.sinphi,this.cosphi),this.ml2=Ut(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=Ut(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))},forward:function(t){var s,i,a=t.x,h=t.y;i=this.sphere?this.a*(this.g-h):(s=Ut(this.e0,this.e1,this.e2,this.e3,h),this.a*(this.g-s));var e=this.ns*nt(a-this.long0),n=this.x0+i*Math.sin(e),r=this.y0+this.rh-i*Math.cos(e);return t.x=n,t.y=r,t},inverse:function(t){var s,i;t.x-=this.x0,t.y=this.rh-t.y+this.y0,s=0<=this.ns?(i=Math.sqrt(t.x*t.x+t.y*t.y),1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),-1);var a=0;if(0!==i&&(a=Math.atan2(s*t.x,s*t.y)),this.sphere)return n=nt(this.long0+a/this.ns),e=Jt(this.g-i/this.a),t.x=n,t.y=e,t;var h=this.g-i/this.a,e=Kt(h,this.e0,this.e1,this.e2,this.e3),n=nt(this.long0+a/this.ns);return t.x=n,t.y=e,t},names:["Equidistant_Conic","eqdc"]},ws={init:function(){this.R=this.a},forward:function(t){var s,i=t.x,a=t.y,h=nt(i-this.long0);Math.abs(a)<=D&&(s=this.x0+this.R*h,d=this.y0);var e=Zt(2*Math.abs(a/Math.PI));(Math.abs(h)<=D||Math.abs(Math.abs(a)-z)<=D)&&(s=this.x0,d=0<=a?this.y0+Math.PI*this.R*Math.tan(.5*e):this.y0+Math.PI*this.R*-Math.tan(.5*e));var n=.5*Math.abs(Math.PI/h-h/Math.PI),r=n*n,o=Math.sin(e),l=Math.cos(e),M=l/(o+l-1),c=M*M,u=M*(2/o-1),f=u*u,m=Math.PI*this.R*(n*(M-f)+Math.sqrt(r*(M-f)*(M-f)-(f+r)*(c-f)))/(f+r);h<0&&(m=-m),s=this.x0+m;var p=r+M,m=Math.PI*this.R*(u*p-n*Math.sqrt((f+r)*(1+r)-p*p))/(f+r),d=0<=a?this.y0+m:this.y0-m;return t.x=s,t.y=d,t},inverse:function(t){var s,i,a,h,e,n,r,o,l,M,c,u;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,e=(a=t.x/c)*a+(h=t.y/c)*h,c=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)/(l=(n-r*r/3/o)/o)/(M=2*Math.sqrt(-l/3)),1<Math.abs(c)&&(c=0<=c?1:-1),u=Math.acos(c)/3,i=0<=t.y?(-M*Math.cos(u+Math.PI/3)-r/3/o)*Math.PI:-(-M*Math.cos(u+Math.PI/3)-r/3/o)*Math.PI,s=Math.abs(a)<D?this.long0:nt(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"]},Cs={init:function(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)},forward:function(t){var s,i,a,h,e,n,r,o,l,M,c,u,f,m,p,d,y,_,x,g,b,v,w=t.x,C=t.y,P=Math.sin(t.y),S=Math.cos(t.y),N=nt(w-this.long0);return this.sphere?Math.abs(this.sin_p12-1)<=D?(t.x=this.x0+this.a*(z-C)*Math.sin(N),t.y=this.y0-this.a*(z-C)*Math.cos(N)):Math.abs(this.sin_p12+1)<=D?(t.x=this.x0+this.a*(z+C)*Math.sin(N),t.y=this.y0+this.a*(z+C)*Math.cos(N)):(_=this.sin_p12*P+this.cos_p12*S*Math.cos(N),y=(d=Math.acos(_))?d/Math.sin(d):1,t.x=this.x0+this.a*y*S*Math.sin(N),t.y=this.y0+this.a*y*(this.cos_p12*P-this.sin_p12*S*Math.cos(N))):(s=Ft(this.es),i=Qt(this.es),a=Wt(this.es),h=Xt(this.es),Math.abs(this.sin_p12-1)<=D?(e=this.a*Ut(s,i,a,h,z),n=this.a*Ut(s,i,a,h,C),t.x=this.x0+(e-n)*Math.sin(N),t.y=this.y0-(e-n)*Math.cos(N)):Math.abs(this.sin_p12+1)<=D?(e=this.a*Ut(s,i,a,h,z),n=this.a*Ut(s,i,a,h,C),t.x=this.x0+(e+n)*Math.sin(N),t.y=this.y0+(e+n)*Math.cos(N)):(r=P/S,o=Ht(this.a,this.e,this.sin_p12),l=Ht(this.a,this.e,P),M=Math.atan((1-this.es)*r+this.es*o*this.sin_p12/(l*S)),x=0===(c=Math.atan2(Math.sin(N),this.cos_p12*Math.tan(M)-this.sin_p12*Math.cos(N)))?Math.asin(this.cos_p12*Math.sin(M)-this.sin_p12*Math.cos(M)):Math.abs(Math.abs(c)-Math.PI)<=D?-Math.asin(this.cos_p12*Math.sin(M)-this.sin_p12*Math.cos(M)):Math.asin(Math.sin(N)*Math.cos(M)/Math.sin(c)),u=this.e*this.sin_p12/Math.sqrt(1-this.es),d=o*x*(1-(g=x*x)*(p=(f=this.e*this.cos_p12*Math.cos(c)/Math.sqrt(1-this.es))*f)*(1-p)/6+(b=g*x)/8*(m=u*f)*(1-2*p)+(v=b*x)/120*(p*(4-7*p)-3*u*u*(1-7*p))-v*x/48*m),t.x=this.x0+d*Math.sin(c),t.y=this.y0+d*Math.cos(c))),t},inverse:function(t){var s,i,a,h,e,n,r,o,l,M,c,u,f,m,p,d,y,_,x,g,b,v,w;if(t.x-=this.x0,t.y-=this.y0,this.sphere){if((s=Math.sqrt(t.x*t.x+t.y*t.y))>2*z*this.a)return;return i=s/this.a,a=Math.sin(i),h=Math.cos(i),e=this.long0,Math.abs(s)<=D?n=this.lat0:(n=Zt(h*this.sin_p12+t.y*a*this.cos_p12/s),r=Math.abs(this.lat0)-z,e=nt(Math.abs(r)<=D?0<=this.lat0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y):this.long0+Math.atan2(t.x*a,s*this.cos_p12*h-t.y*this.sin_p12*a))),t.x=e,t.y=n,t}return o=Ft(this.es),l=Qt(this.es),M=Wt(this.es),c=Xt(this.es),Math.abs(this.sin_p12-1)<=D?(u=this.a*Ut(o,l,M,c,z),s=Math.sqrt(t.x*t.x+t.y*t.y),n=Kt((u-s)/this.a,o,l,M,c),e=nt(this.long0+Math.atan2(t.x,-1*t.y))):Math.abs(this.sin_p12+1)<=D?(u=this.a*Ut(o,l,M,c,z),s=Math.sqrt(t.x*t.x+t.y*t.y),n=Kt((s-u)/this.a,o,l,M,c),e=nt(this.long0+Math.atan2(t.x,t.y))):(s=Math.sqrt(t.x*t.x+t.y*t.y),p=Math.atan2(t.x,t.y),f=Ht(this.a,this.e,this.sin_p12),d=Math.cos(p),_=-(y=this.e*this.cos_p12*d)*y/(1-this.es),x=3*this.es*(1-_)*this.sin_p12*this.cos_p12*d/(1-this.es),v=1-_*(b=(g=s/f)-_*(1+_)*Math.pow(g,3)/6-x*(1+3*_)*Math.pow(g,4)/24)*b/2-g*b*b*b/6,m=Math.asin(this.sin_p12*Math.cos(b)+this.cos_p12*Math.sin(b)*d),e=nt(this.long0+Math.asin(Math.sin(p)*Math.sin(b)/Math.cos(m))),w=Math.sin(m),n=Math.atan2((w-this.es*v*this.sin_p12)*Math.tan(m),w*(1-this.es))),t.x=e,t.y=n,t},names:["Azimuthal_Equidistant","aeqd"]},Ps={init:function(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)},forward:function(t){var s,i,a,h=t.x,e=t.y,n=nt(h-this.long0),r=Math.sin(e),o=Math.cos(e),l=Math.cos(n);return(0<(s=this.sin_p14*r+this.cos_p14*o*l)||Math.abs(s)<=D)&&(i=this.a*o*Math.sin(n),a=this.y0+this.a*(this.cos_p14*r-this.sin_p14*o*l)),t.x=i,t.y=a,t},inverse:function(t){var s,i,a,h,e,n,r;return t.x-=this.x0,t.y-=this.y0,s=Math.sqrt(t.x*t.x+t.y*t.y),i=Zt(s/this.a),a=Math.sin(i),h=Math.cos(i),n=this.long0,Math.abs(s)<=D?r=this.lat0:(r=Zt(h*this.sin_p14+t.y*a*this.cos_p14/s),e=Math.abs(this.lat0)-z,n=Math.abs(e)<=D?nt(0<=this.lat0?this.long0+Math.atan2(t.x,-t.y):this.long0-Math.atan2(-t.x,t.y)):nt(this.long0+Math.atan2(t.x*a,s*this.cos_p14*h-t.y*this.sin_p14*a))),t.x=n,t.y=r,t},names:["ortho"]},Ss=1,Ns=2,ks=3,Es=4,qs=5,Is=6,Os=1,As=2,Gs=3,js=4,zs={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>=z-U/2?this.face=qs:this.lat0<=-(z-U/2)?this.face=Is:Math.abs(this.long0)<=U?this.face=Ss:Math.abs(this.long0)<=z+U?this.face=0<this.long0?Ns:Es:this.face=ks,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,e,n,r,o,l,M,c,u,f={x:0,y:0},m={value:0};return 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?(h=z-s,a=U<=i&&i<=z+U?(m.value=Os,i-z):z+U<i||i<=-(z+U)?(m.value=As,0<i?i-Q:i+Q):-(z+U)<i&&i<=-U?(m.value=Gs,i+z):(m.value=js,i)):this.face===Is?(h=z+s,a=U<=i&&i<=z+U?(m.value=Os,z-i):i<U&&-U<=i?(m.value=As,-i):i<-U&&-(z+U)<=i?(m.value=Gs,-i-z):(m.value=js,0<i?Q-i:-i-Q)):(this.face===Ns?i=S(i,+z):this.face===ks?i=S(i,+Q):this.face===Es&&(i=S(i,-z)),M=Math.sin(s),c=Math.cos(s),u=Math.sin(i),r=c*Math.cos(i),o=c*u,l=M,this.face===Ss?a=P(h=Math.acos(r),l,o,m):this.face===Ns?a=P(h=Math.acos(o),l,-r,m):this.face===ks?a=P(h=Math.acos(-r),l,-o,m):this.face===Es?a=P(h=Math.acos(-o),l,r,m):(h=a=0,m.value=Os)),n=Math.atan(12/Q*(a+Math.acos(Math.sin(a)*Math.cos(U))-z)),e=Math.sqrt((1-Math.cos(h))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(a))))),m.value===As?n+=z:m.value===Gs?n+=Q:m.value===js&&(n+=1.5*Q),f.x=e*Math.cos(n),f.y=e*Math.sin(n),f.x=f.x*this.a+this.x0,f.y=f.y*this.a+this.y0,t.x=f.x,t.y=f.y,t},inverse:function(t){var s,i,a,h,e,n,r,o,l,M,c,u,f,m,p,d={lam:0,phi:0},y={value:0};return 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),0<=t.x&&t.x>=Math.abs(t.y)?y.value=Os:0<=t.y&&t.y>=Math.abs(t.x)?(y.value=As,s-=z):t.x<0&&-t.x>=Math.abs(t.y)?(y.value=Gs,s=s<0?s+Q:s-Q):(y.value=js,s+=z),c=Q/12*Math.tan(s),e=Math.sin(c)/(Math.cos(c)-1/Math.sqrt(2)),n=Math.atan(e),(r=1-(a=Math.cos(s))*a*(h=Math.tan(i))*h*(1-Math.cos(Math.atan(1/Math.cos(n)))))<-1?r=-1:1<r&&(r=1),this.face===qs?(o=Math.acos(r),d.phi=z-o,y.value===Os?d.lam=n+z:y.value===As?d.lam=n<0?n+Q:n-Q:y.value===Gs?d.lam=n-z:d.lam=n):this.face===Is?(o=Math.acos(r),d.phi=o-z,y.value===Os?d.lam=z-n:y.value===As?d.lam=-n:y.value===Gs?d.lam=-n-z:d.lam=n<0?-n-Q:Q-n):(c=(l=r)*l,u=1<=(c+=(M=1<=c?0:Math.sqrt(1-c)*Math.sin(n))*M)?0:Math.sqrt(1-c),y.value===As?(c=u,u=-M,M=c):y.value===Gs?(u=-u,M=-M):y.value===js&&(c=u,u=M,M=-c),this.face===Ns?(c=l,l=-u,u=c):this.face===ks?(l=-l,u=-u):this.face===Es&&(c=l,l=u,u=-c),d.phi=Math.acos(-M)-z,d.lam=Math.atan2(u,l),this.face===Ns?d.lam=S(d.lam,-z):this.face===ks?d.lam=S(d.lam,-Q):this.face===Es&&(d.lam=S(d.lam,+z))),0!==this.es&&(f=d.phi<0?1:0,m=Math.tan(d.phi),p=this.b/Math.sqrt(m*m+this.one_minus_f_squared),d.phi=Math.atan(Math.sqrt(this.a*this.a-p*p)/(this.one_minus_f*p)),f&&(d.phi=-d.phi)),d.lam+=this.long0,t.x=d.lam,t.y=d.phi,t},names:["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"]},Rs=[[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]],Ls=[[-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]],Ts=B/5,Ds=1/Ts,Bs={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=nt(t.x-this.long0),i=Math.abs(t.y),a=Math.floor(i*Ts);a<0?a=0:18<=a&&(a=17);var h={x:Yt(Rs[a],i=B*(i-Ds*a))*s,y:Yt(Ls[a],i)};return t.y<0&&(h.y=-h.y),h.x=h.x*this.a*.8487+this.x0,h.y=h.y*this.a*1.3523+this.y0,h},inverse:function(t){var a={x:(t.x-this.x0)/(.8487*this.a),y:Math.abs(t.y-this.y0)/(1.3523*this.a)};if(1<=a.y)a.x/=Rs[18][0],a.y=t.y<0?-z:z;else{var s=Math.floor(18*a.y);for(s<0?s=0:18<=s&&(s=17);;)if(Ls[s][0]>a.y)--s;else{if(!(Ls[s+1][0]<=a.y))break;++s}var h=Ls[s],i=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(Yt(h,t)-a.y)/(i=t,(s=h)[1]+i*(2*s[2]+3*i*s[3]));var s,i},i=5*(a.y-h[0])/(Ls[s+1][0]-h[0]),D,100);a.x/=Yt(Rs[s],i),a.y=(5*s+i)*N,t.y<0&&(a.y=-a.y)}return a.x=nt(a.x+this.long0),a},names:["Robinson","robin"]},Us={init:function(){this.name="geocent"},forward:function(t){return M(t,this.es,this.a)},inverse:function(t){return c(t,this.es,this.a,this.b)},names:["Geocentric","geocentric","geocent","Geocent"]};return a.defaultDatum="WGS84",a.Proj=q,a.WGS84=new a.Proj("WGS84"),a.Point=C,a.toPoint=bt,a.defs=l,a.transform=f,a.mgrs=Ot,a.version="2.6.2",($t=a).Proj.projections.add(ss),$t.Proj.projections.add(is),$t.Proj.projections.add(as),$t.Proj.projections.add(es),$t.Proj.projections.add(ns),$t.Proj.projections.add(rs),$t.Proj.projections.add(os),$t.Proj.projections.add(ls),$t.Proj.projections.add(Ms),$t.Proj.projections.add(cs),$t.Proj.projections.add(us),$t.Proj.projections.add(fs),$t.Proj.projections.add(ms),$t.Proj.projections.add(ps),$t.Proj.projections.add(ds),$t.Proj.projections.add(ys),$t.Proj.projections.add(_s),$t.Proj.projections.add(xs),$t.Proj.projections.add(gs),$t.Proj.projections.add(bs),$t.Proj.projections.add(vs),$t.Proj.projections.add(ws),$t.Proj.projections.add(Cs),$t.Proj.projections.add(Ps),$t.Proj.projections.add(zs),$t.Proj.projections.add(Bs),$t.Proj.projections.add(Us),a});