brc-atlas-bigr
Version:
Utility functions for dealing with grid reference systems used in the British Isles.
1 lines • 89.4 kB
JavaScript
!function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports):"function"==typeof define&&define.amd?define(["exports"],s):s((t="undefined"!=typeof globalThis?globalThis:t||self).bigr={})}(this,(function(t){"use strict";var s=[{GridRef:"SV",x:0,y:0,proj:"gb"},{GridRef:"NL",x:0,y:7,proj:"gb"},{GridRef:"NF",x:0,y:8,proj:"gb"},{GridRef:"NA",x:0,y:9,proj:"gb"},{GridRef:"SW",x:1,y:0,proj:"gb"},{GridRef:"SR",x:1,y:1,proj:"gb"},{GridRef:"SM",x:1,y:2,proj:"gb"},{GridRef:"NW",x:1,y:5,proj:"gb"},{GridRef:"NR",x:1,y:6,proj:"gb"},{GridRef:"NM",x:1,y:7,proj:"gb"},{GridRef:"NG",x:1,y:8,proj:"gb"},{GridRef:"NB",x:1,y:9,proj:"gb"},{GridRef:"HW",x:1,y:10,proj:"gb"},{GridRef:"SX",x:2,y:0,proj:"gb"},{GridRef:"SS",x:2,y:1,proj:"gb"},{GridRef:"SN",x:2,y:2,proj:"gb"},{GridRef:"SH",x:2,y:3,proj:"gb"},{GridRef:"SC",x:2,y:4,proj:"gb"},{GridRef:"NX",x:2,y:5,proj:"gb"},{GridRef:"NS",x:2,y:6,proj:"gb"},{GridRef:"NN",x:2,y:7,proj:"gb"},{GridRef:"NH",x:2,y:8,proj:"gb"},{GridRef:"NC",x:2,y:9,proj:"gb"},{GridRef:"HX",x:2,y:10,proj:"gb"},{GridRef:"SY",x:3,y:0,proj:"gb"},{GridRef:"ST",x:3,y:1,proj:"gb"},{GridRef:"SO",x:3,y:2,proj:"gb"},{GridRef:"SJ",x:3,y:3,proj:"gb"},{GridRef:"SD",x:3,y:4,proj:"gb"},{GridRef:"NY",x:3,y:5,proj:"gb"},{GridRef:"NT",x:3,y:6,proj:"gb"},{GridRef:"NO",x:3,y:7,proj:"gb"},{GridRef:"NJ",x:3,y:8,proj:"gb"},{GridRef:"ND",x:3,y:9,proj:"gb"},{GridRef:"HY",x:3,y:10,proj:"gb"},{GridRef:"HT",x:3,y:11,proj:"gb"},{GridRef:"SZ",x:4,y:0,proj:"gb"},{GridRef:"SU",x:4,y:1,proj:"gb"},{GridRef:"SP",x:4,y:2,proj:"gb"},{GridRef:"SK",x:4,y:3,proj:"gb"},{GridRef:"SE",x:4,y:4,proj:"gb"},{GridRef:"NZ",x:4,y:5,proj:"gb"},{GridRef:"NU",x:4,y:6,proj:"gb"},{GridRef:"NK",x:4,y:8,proj:"gb"},{GridRef:"HZ",x:4,y:10,proj:"gb"},{GridRef:"HU",x:4,y:11,proj:"gb"},{GridRef:"HP",x:4,y:12,proj:"gb"},{GridRef:"TV",x:5,y:0,proj:"gb"},{GridRef:"TQ",x:5,y:1,proj:"gb"},{GridRef:"TL",x:5,y:2,proj:"gb"},{GridRef:"TF",x:5,y:3,proj:"gb"},{GridRef:"TA",x:5,y:4,proj:"gb"},{GridRef:"OV",x:5,y:5,proj:"gb"},{GridRef:"TR",x:6,y:1,proj:"gb"},{GridRef:"TM",x:6,y:2,proj:"gb"},{GridRef:"TG",x:6,y:3,proj:"gb"},{GridRef:"V",x:0,y:0,proj:"ir"},{GridRef:"Q",x:0,y:1,proj:"ir"},{GridRef:"L",x:0,y:2,proj:"ir"},{GridRef:"F",x:0,y:3,proj:"ir"},{GridRef:"A",x:0,y:4,proj:"ir"},{GridRef:"W",x:1,y:0,proj:"ir"},{GridRef:"R",x:1,y:1,proj:"ir"},{GridRef:"M",x:1,y:2,proj:"ir"},{GridRef:"G",x:1,y:3,proj:"ir"},{GridRef:"B",x:1,y:4,proj:"ir"},{GridRef:"X",x:2,y:0,proj:"ir"},{GridRef:"S",x:2,y:1,proj:"ir"},{GridRef:"N",x:2,y:2,proj:"ir"},{GridRef:"H",x:2,y:3,proj:"ir"},{GridRef:"C",x:2,y:4,proj:"ir"},{GridRef:"Y",x:3,y:0,proj:"ir"},{GridRef:"T",x:3,y:1,proj:"ir"},{GridRef:"O",x:3,y:2,proj:"ir"},{GridRef:"J",x:3,y:3,proj:"ir"},{GridRef:"D",x:3,y:4,proj:"ir"},{GridRef:"Z",x:4,y:0,proj:"ir"},{GridRef:"U",x:4,y:1,proj:"ir"},{GridRef:"P",x:4,y:2,proj:"ir"},{GridRef:"K",x:4,y:3,proj:"ir"},{GridRef:"E",x:4,y:4,proj:"ir"},{GridRef:"WV",x:5,y:54,proj:"ci"},{GridRef:"WA",x:5,y:55,proj:"ci"}],i=s.reduce((function(t,s){return t[s.GridRef]={x:s.x,y:s.y,proj:s.proj},t}),{});function a(t){throw"The value '".concat(t,"' is not recognised as a valid grid reference.")}function h(t){var s=RegExp("^[a-zA-Z]{1,2}$"),h=RegExp("^[a-zA-Z]{1,2}[0-9]{2}$"),e=RegExp("^[a-zA-Z]{1,2}[0-9]{2}[SsNn][WwEe]$"),r=RegExp("^[a-zA-Z]{1,2}[0-9]{2}[a-np-zA-NP-Z]$"),n=RegExp("^[a-zA-Z]{1,2}[0-9]{4}$"),o=RegExp("^[a-zA-Z]{1,2}[0-9]{6}$"),l=RegExp("^[a-zA-Z]{1,2}[0-9]{8}$"),c=RegExp("^[a-zA-Z]{1,2}[0-9]{10}$"),u=t.match(/^[A-Za-z]+/);u||a(t);var M=u[0].toUpperCase(),f=i[M];f||a(t);var p={precision:null,prefix:M,projection:f.proj};return s.test(t)?p.precision=1e5:h.test(t)?p.precision=1e4:e.test(t)?p.precision=5e3:r.test(t)?p.precision=2e3:n.test(t)?p.precision=1e3:o.test(t)?p.precision=100:l.test(t)?p.precision=10:c.test(t)?p.precision=1:a(t),p}function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var r=484813681109536e-20,n=Math.PI/2,o=.017453292519943295,l=57.29577951308232,c=Math.PI/4,u=2*Math.PI,M=3.14159265359,f={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},p={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},d=/[\s_\-\/\(\)]/g;function y(t,s){if(t[s])return t[s];for(var i,a=Object.keys(t),h=s.toLowerCase().replace(d,""),e=-1;++e<a.length;)if((i=a[e]).toLowerCase().replace(d,"")===h)return t[i]}function m(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}),{}),r={proj:"projName",datum:"datumCode",rf:function(t){h.rf=parseFloat(t)},lat_0:function(t){h.lat0=t*o},lat_1:function(t){h.lat1=t*o},lat_2:function(t){h.lat2=t*o},lat_ts:function(t){h.lat_ts=t*o},lon_0:function(t){h.long0=t*o},lon_1:function(t){h.long1=t*o},lon_2:function(t){h.long2=t*o},alpha:function(t){h.alpha=parseFloat(t)*o},lonc:function(t){h.longc=t*o},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=y(p,t);s&&(h.to_meter=s.to_meter)},from_greenwich:function(t){h.from_greenwich=t*o},pm:function(t){var s=y(f,t);h.from_greenwich=(s||parseFloat(t))*o},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 r?"function"==typeof(a=r[s])?a(i):h[a]=i:h[s]=i;return"string"==typeof h.datumCode&&"WGS84"!==h.datumCode&&(h.datumCode=h.datumCode.toLowerCase()),h}var x=/\s/,g=/[A-Za-z]/,_=/[A-Za-z84]/,b=/[,\]]/,v=/[\d\.E\-\+]/;function j(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=1}function w(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=t.shift();if("PARAMETER"===i&&(i=t.shift()),1===t.length)return Array.isArray(t[0])?(s[i]={},void N(t[0],s[i])):void(s[i]=t[0]);if(t.length)if("TOWGS84"!==i){if("AXIS"===i)return i in s||(s[i]=[]),void s[i].push(t);var a;switch(Array.isArray(i)||(s[i]={}),i){case"UNIT":case"PRIMEM":case"VERT_DATUM":return s[i]={name:t[0].toLowerCase(),convert:t[1]},void(3===t.length&&N(t[2],s[i]));case"SPHEROID":case"ELLIPSOID":return s[i]={name:t[0],a:t[1],rf:t[2]},void(4===t.length&&N(t[3],s[i]));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 w(s,i,t);default:for(a=-1;++a<t.length;)if(!Array.isArray(t[a]))return N(t,s[i]);return w(s,i,t)}}else s[i]=t;else s[i]=!0}else s[t]=!0}j.prototype.readCharicter=function(){var t=this.text[this.place++];if(4!==this.state)for(;x.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case 1: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}},j.prototype.afterquote=function(t){if('"'===t)return this.word+='"',void(this.state=4);if(b.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)},j.prototype.afterItem=function(t){return","===t?(null!==this.word&&this.currentObject.push(this.word),this.word=null,void(this.state=1)):"]"===t?(this.level--,null!==this.word&&(this.currentObject.push(this.word),this.word=null),this.state=1,this.currentObject=this.stack.pop(),void(this.currentObject||(this.state=-1))):void 0},j.prototype.number=function(t){if(!v.test(t)){if(b.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},j.prototype.quoted=function(t){'"'!==t?this.word+=t:this.state=5},j.prototype.keyword=function(t){if(_.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=1)}if(!b.test(t))throw new Error("havn't handled \""+t+'" in keyword yet, index '+this.place);this.afterItem(t)}},j.prototype.neutral=function(t){if(g.test(t))return this.word=t,void(this.state=2);if('"'===t)return this.word="",void(this.state=4);if(v.test(t))return this.word=t,void(this.state=3);if(!b.test(t))throw new Error("havn't handled \""+t+'" in neutral yet, index '+this.place);this.afterItem(t)},j.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)};function S(t){return.017453292519943295*t}function G(t){var s=new j(t).output(),i=s.shift(),a=s.shift();s.unshift(["name",a]),s.unshift(["type",i]);var h={};return N(s,h),function(t){if("GEOGCS"===t.type?t.projName="longlat":"LOCAL_CS"===t.type?(t.projName="identity",t.local=!0):"object"===e(t.PROJECTION)?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var s="",i=0,a=t.AXIS.length;i<a;++i){var h=t.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&&(t.axis=s)}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 r=t.GEOGCS;function n(s){return s*(t.to_meter||1)}"GEOGCS"===t.type&&(r=t),r&&(r.DATUM?t.datumCode=r.DATUM.name.toLowerCase():t.datumCode=r.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&&"world_geodetic_system_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"),r.DATUM&&r.DATUM.SPHEROID&&(t.ellps=r.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),"international"===t.ellps.toLowerCase().slice(0,13)&&(t.ellps="intl"),t.a=r.DATUM.SPHEROID.a,t.rf=parseFloat(r.DATUM.SPHEROID.rf,10)),r.DATUM&&r.DATUM.TOWGS84&&(t.datum_params=r.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",S],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",S],["x0","false_easting",n],["y0","false_northing",n],["long0","central_meridian",S],["lat0","latitude_of_origin",S],["lat0","standard_parallel_1",S],["lat1","standard_parallel_1",S],["lat2","standard_parallel_2",S],["azimuth","Azimuth"],["alpha","azimuth",S],["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=S(t.lat1>0?90:-90),t.lat_ts=t.lat1)}(h),h}function C(t){var s=this;if(2===arguments.length){var i=arguments[1];"string"==typeof i?"+"===i.charAt(0)?C[t]=m(arguments[1]):C[t]=G(arguments[1]):C[t]=i}else if(1===arguments.length){if(Array.isArray(t))return t.map((function(t){Array.isArray(t)?C.apply(s,t):C(t)}));if("string"==typeof t){if(t in C)return C[t]}else"EPSG"in t?C["EPSG:"+t.EPSG]=t:"ESRI"in t?C["ESRI:"+t.ESRI]=t:"IAU2000"in t?C["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"]}(C);var R=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];var P=["3857","900913","3785","102113"];function E(t){if(!function(t){return"string"==typeof t}(t))return t;if(function(t){return t in C}(t))return C[t];if(function(t){return R.some((function(s){return t.indexOf(s)>-1}))}(t)){var s=G(t);if(function(t){var s=y(t,"authority");if(s){var i=y(s,"epsg");return i&&P.indexOf(i)>-1}}(s))return C["EPSG:3857"];var i=function(t){var s=y(t,"extension");if(s)return y(s,"proj4")}(s);return i?m(i):s}return function(t){return"+"===t[0]}(t)?m(t):void 0}function k(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}function q(t,s,i){var a=t*s;return i/Math.sqrt(1-a*a)}function A(t){return t<0?-1:1}function I(t){return Math.abs(t)<=M?t:t-A(t)*u}function O(t,s,i){var a=t*i,h=.5*t;return a=Math.pow((1-a)/(1+a),h),Math.tan(.5*(n-s))/a}function z(t,s){for(var i,a,h=.5*t,e=n-2*Math.atan(s),r=0;r<=15;r++)if(i=t*Math.sin(e),e+=a=n-2*Math.atan(s*Math.pow((1-i)/(1+i),h))-e,Math.abs(a)<=1e-10)return e;return-9999}function T(t){return t}var L=[{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=q(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*l>90&&h*l<-90&&a*l>180&&a*l<-180)return null;if(Math.abs(Math.abs(h)-n)<=1e-10)return null;if(this.sphere)s=this.x0+this.a*this.k0*I(a-this.long0),i=this.y0+this.a*this.k0*Math.log(Math.tan(c+.5*h));else{var e=Math.sin(h),r=O(this.e,h,e);s=this.x0+this.a*this.k0*I(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=n-2*Math.atan(Math.exp(-h/(this.a*this.k0)));else{var e=Math.exp(-h/(this.a*this.k0));if(-9999===(i=z(this.e,e)))return null}return s=I(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"]}],D={},U=[];function B(t,s){var i=U.length;return t.names?(U[i]=t,t.names.forEach((function(t){D[t.toLowerCase()]=i})),this):(console.log(s),!0)}var F={start:function(){L.forEach(B)},add:B,get:function(t){if(!t)return!1;var s=t.toLowerCase();return void 0!==D[s]&&U[D[s]]?U[D[s]]:void 0}},W={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"}},Q=W.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};W.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};var H={};function X(t,s){if(!(this instanceof X))return new X(t);s=s||function(t){if(t)throw t};var i=E(t);if("object"===e(i)){var a=X.projections.get(i.projName);if(a){if(i.datumCode&&"none"!==i.datumCode){var h=y(H,i.datumCode);h&&(i.datum_params=h.towgs84?h.towgs84.split(","):null,i.ellps=h.ellipse,i.datumName=h.datumName?h.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84";var n,o,l,c,u,M,f,p=function(t,s,i,a,h){if(!t){var e=y(W,a);e||(e=Q),t=e.a,s=e.b,i=e.rf}return i&&!s&&(s=(1-1/i)*t),(0===i||Math.abs(t-s)<1e-10)&&(h=!0,s=t),{a:t,b:s,rf:i,sphere:h}}(i.a,i.b,i.rf,i.ellps,i.sphere),d=(n=p.a,o=p.b,p.rf,l=i.R_A,M=((c=n*n)-(u=o*o))/c,f=0,l?(c=(n*=1-M*(.16666666666666666+M*(.04722222222222222+.022156084656084655*M)))*n,M=0):f=Math.sqrt(M),{es:M,e:f,ep2:(c-u)/u}),m=i.datum||function(t,s,i,a,h,e){var n={};return n.datum_type=void 0===t||"none"===t?5:4,s&&(n.datum_params=s.map(parseFloat),0===n.datum_params[0]&&0===n.datum_params[1]&&0===n.datum_params[2]||(n.datum_type=1),n.datum_params.length>3&&(0===n.datum_params[3]&&0===n.datum_params[4]&&0===n.datum_params[5]&&0===n.datum_params[6]||(n.datum_type=2,n.datum_params[3]*=r,n.datum_params[4]*=r,n.datum_params[5]*=r,n.datum_params[6]=n.datum_params[6]/1e6+1))),n.a=i,n.b=a,n.es=h,n.ep2=e,n}(i.datumCode,i.datum_params,p.a,p.b,d.es,d.ep2);k(this,i),k(this,a),this.a=p.a,this.b=p.b,this.rf=p.rf,this.sphere=p.sphere,this.es=d.es,this.e=d.e,this.ep2=d.ep2,this.datum=m,this.init(),s(null,this)}else s(t)}else s(t)}function Z(t,s,i){var a,h,e,r,o=t.x,l=t.y,c=t.z?t.z:0;if(l<-n&&l>-1.001*n)l=-n;else if(l>n&&l<1.001*n)l=n;else{if(l<-n)return{x:-1/0,y:-1/0,z:t.z};if(l>n)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),e=h*h,{x:((a=i/Math.sqrt(1-s*e))+c)*r*Math.cos(o),y:(a+c)*r*Math.sin(o),z:(a*(1-s)+c)*h}}function J(t,s,i,a){var h,e,r,o,l,c,u,M,f,p,d,y,m,x,g,_=t.x,b=t.y,v=t.z?t.z:0;if(h=Math.sqrt(_*_+b*b),e=Math.sqrt(_*_+b*b+v*v),h/i<1e-12){if(x=0,e/i<1e-12)return n,g=-a,{x:t.x,y:t.y,z:t.z}}else x=Math.atan2(b,_);r=v/e,M=(o=h/e)*(1-s)*(l=1/Math.sqrt(1-s*(2-s)*o*o)),f=r*l,m=0;do{m++,c=s*(u=i/Math.sqrt(1-s*f*f))/(u+(g=h*M+v*f-u*(1-s*f*f))),y=(d=r*(l=1/Math.sqrt(1-c*(2-c)*o*o)))*M-(p=o*(1-c)*l)*f,M=p,f=d}while(y*y>1e-24&&m<30);return{x:x,y:Math.atan(d/Math.abs(p)),z:g}}function V(t){return 1===t||2===t}function K(t,s,i){return function(t,s){return t.datum_type===s.datum_type&&(!(t.a!==s.a||Math.abs(t.es-s.es)>5e-11)&&(1===t.datum_type?t.datum_params[0]===s.datum_params[0]&&t.datum_params[1]===s.datum_params[1]&&t.datum_params[2]===s.datum_params[2]:2!==t.datum_type||t.datum_params[0]===s.datum_params[0]&&t.datum_params[1]===s.datum_params[1]&&t.datum_params[2]===s.datum_params[2]&&t.datum_params[3]===s.datum_params[3]&&t.datum_params[4]===s.datum_params[4]&&t.datum_params[5]===s.datum_params[5]&&t.datum_params[6]===s.datum_params[6]))}(t,s)||5===t.datum_type||5===s.datum_type?i:t.es!==s.es||t.a!==s.a||V(t.datum_type)||V(s.datum_type)?(i=Z(i,t.es,t.a),V(t.datum_type)&&(i=function(t,s,i){if(1===s)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(2===s){var a=i[0],h=i[1],e=i[2],r=i[3],n=i[4],o=i[5],l=i[6];return{x:l*(t.x-o*t.y+n*t.z)+a,y:l*(o*t.x+t.y-r*t.z)+h,z:l*(-n*t.x+r*t.y+t.z)+e}}}(i,t.datum_type,t.datum_params)),V(s.datum_type)&&(i=function(t,s,i){if(1===s)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(2===s){var a=i[0],h=i[1],e=i[2],r=i[3],n=i[4],o=i[5],l=i[6],c=(t.x-a)/l,u=(t.y-h)/l,M=(t.z-e)/l;return{x:c+o*u-n*M,y:-o*c+u+r*M,z:n*c-r*u+M}}}(i,s.datum_type,s.datum_params)),J(i,s.es,s.a,s.b)):i}function $(t,s,i){var a,h,e,r=i.x,n=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=r,h=-1!=="ew".indexOf(t.axis[e])?"x":"y"):1===e?(a=n,h=-1!=="ns".indexOf(t.axis[e])?"y":"x"):(a=o,h="z"),t.axis[e]){case"e":case"w":case"n":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}function Y(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}function tt(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 st(t,s,i){var a;if(Array.isArray(i)&&(i=Y(i)),function(t){tt(t.x),tt(t.y)}(i),t.datum&&s.datum&&function(t,s){return(1===t.datum.datum_type||2===t.datum.datum_type)&&"WGS84"!==s.datumCode||(1===s.datum.datum_type||2===s.datum.datum_type)&&"WGS84"!==t.datumCode}(t,s)&&(i=st(t,a=new X("WGS84"),i),t=a),"enu"!==t.axis&&(i=$(t,!1,i)),"longlat"===t.projName)i={x:i.x*o,y:i.y*o,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=K(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*l,y:i.y*l,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?$(s,!0,i):i}H.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"},H.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"},H.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"},H.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"},H.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"},H.potsdam={towgs84:"606.0,23.0,413.0",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},H.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},H.hermannskogel={towgs84:"653.0,-212.0,449.0",ellipse:"bessel",datumName:"Hermannskogel"},H.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"},H.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"},H.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"},H.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"},H.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"},H.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"},H.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"},H.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"},H.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"},X.projections=F,X.projections.start();var it=X("WGS84");function at(t,s,i){var a,h,e;return Array.isArray(i)?(a=st(t,s,i)||{x:NaN,y:NaN},i.length>2?void 0!==t.name&&"geocent"===t.name||void 0!==s.name&&"geocent"===s.name?"number"==typeof a.z?[a.x,a.y,a.z].concat(i.splice(3)):[a.x,a.y,i[2]].concat(i.splice(3)):[a.x,a.y].concat(i.splice(2)):[a.x,a.y]):(h=st(t,s,i),2===(e=Object.keys(i)).length||e.forEach((function(a){if(void 0!==t.name&&"geocent"===t.name||void 0!==s.name&&"geocent"===s.name){if("x"===a||"y"===a||"z"===a)return}else if("x"===a||"y"===a)return;h[a]=i[a]})),h)}function ht(t){return t instanceof X?t:t.oProj?t.oProj:X(t)}function et(t,s,i){t=ht(t);var a,h=!1;return void 0===s?(s=t,t=it,h=!0):(void 0!==s.x||Array.isArray(s))&&(i=s,s=t,t=it,h=!0),s=ht(s),i?at(t,s,i):(a={forward:function(i){return at(t,s,i)},inverse:function(i){return at(s,t,i)}},h&&(a.oProj=s),a)}var rt=65,nt=73,ot=79,lt={forward:ct,inverse:function(t){var s=pt(mt(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:ut};function ct(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,p=t.northing,d=t.zoneNumber,y=yt(d),m=Math.floor(f/1e5),x=Math.floor(p/1e5)%20,h=m,e=x,r=y,n=r-1,o="AJSAJS".charCodeAt(n),l="AFAFAF".charCodeAt(n),c=o+h-1,u=l+e,M=!1,c>90&&(c=c-90+rt-1,M=!0),(c===nt||o<nt&&c>nt||(c>nt||o<nt)&&M)&&c++,(c===ot||o<ot&&c>ot||(c>ot||o<ot)&&M)&&++c===nt&&c++,c>90&&(c=c-90+rt-1),u>86?(u=u-86+rt-1,M=!0):M=!1,(u===nt||l<nt&&u>nt||(u>nt||l<nt)&&M)&&u++,(u===ot||l<ot&&u>ot||(u>ot||l<ot)&&M)&&++u===nt&&u++,u>86&&(u=u-86+rt-1),String.fromCharCode(c)+String.fromCharCode(u))+i.substr(i.length-5,s)+a.substr(a.length-5,s);var h,e,r,n,o,l,c,u,M;var f,p,d,y,m,x}(function(t){var s,i,a,h,e,r,n,o=t.lat,l=t.lon,c=6378137,u=Mt(o),M=Mt(l);n=Math.floor((l+180)/6)+1,180===l&&(n=60);o>=56&&o<64&&l>=3&&l<12&&(n=32);o>=72&&o<84&&(l>=0&&l<9?n=31:l>=9&&l<21?n=33:l>=21&&l<33?n=35:l>=33&&l<42&&(n=37));r=Mt(6*(n-1)-180+3),.006739496752268451,s=c/Math.sqrt(1-.00669438*Math.sin(u)*Math.sin(u)),i=Math.tan(u)*Math.tan(u),a=.006739496752268451*Math.cos(u)*Math.cos(u),h=Math.cos(u)*(M-r),e=c*(.9983242984503243*u-.002514607064228144*Math.sin(2*u)+2639046602129982e-21*Math.sin(4*u)-3.418046101696858e-9*Math.sin(6*u));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,p=.9996*(e+s*Math.tan(u)*(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&&(p+=1e7);return{northing:Math.round(p),easting:Math.round(f),zoneNumber:n,zoneLetter:dt(o)}}({lat:t[1],lon:t[0]}),s)}function ut(t){var s=pt(mt(t.toUpperCase()));return s.lat&&s.lon?[s.lon,s.lat]:[(s.left+s.right)/2,(s.top+s.bottom)/2]}function Mt(t){return t*(Math.PI/180)}function ft(t){return t/Math.PI*180}function pt(t){var s=t.northing,i=t.easting,a=t.zoneLetter,h=t.zoneNumber;if(h<0||h>60)return null;var e,r,n,o,l,c,u,M,f=6378137,p=(1-Math.sqrt(.99330562))/(1+Math.sqrt(.99330562)),d=i-5e5,y=s;a<"N"&&(y-=1e7),c=6*(h-1)-180+3,M=(u=y/.9996/6367449.145945056)+(3*p/2-27*p*p*p/32)*Math.sin(2*u)+(21*p*p/16-55*p*p*p*p/32)*Math.sin(4*u)+151*p*p*p/96*Math.sin(6*u),e=f/Math.sqrt(1-.00669438*Math.sin(M)*Math.sin(M)),r=Math.tan(M)*Math.tan(M),n=.006739496752268451*Math.cos(M)*Math.cos(M),o=.99330562*f/Math.pow(1-.00669438*Math.sin(M)*Math.sin(M),1.5),l=d/(.9996*e);var m=M-e*Math.tan(M)/o*(l*l/2-(5+3*r+10*n-4*n*n-.06065547077041606)*l*l*l*l/24+(61+90*r+298*n+45*r*r-1.6983531815716497-3*n*n)*l*l*l*l*l*l/720);m=ft(m);var x,g=(l-(1+2*r+n)*l*l*l/6+(5-2*n+28*r-3*n*n+.05391597401814761+24*r*r)*l*l*l*l*l/120)/Math.cos(M);if(g=c+ft(g),t.accuracy){var _=pt({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});x={top:_.lat,right:_.lon,bottom:m,left:g}}else x={lat:m,lon:g};return x}function dt(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 yt(t){var s=t%6;return 0===s&&(s=6),s}function mt(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 r=parseInt(h,10);if(0===e||e+3>i)throw"MGRSPoint bad conversion from: "+t;var n=t.charAt(e++);if(n<="A"||"B"===n||"Y"===n||n>="Z"||"I"===n||"O"===n)throw"MGRSPoint zone letter "+n+" not handled: "+t;a=t.substring(e,e+=2);for(var o=yt(r),l=function(t,s){var i="AJSAJS".charCodeAt(s-1),a=1e5,h=!1;for(;i!==t.charCodeAt(0);){if(++i===nt&&i++,i===ot&&i++,i>90){if(h)throw"Bad character: "+t;i=rt,h=!0}a+=1e5}return a}(a.charAt(0),o),c=function(t,s){if(t>"V")throw"MGRSPoint given invalid Northing "+t;var i="AFAFAF".charCodeAt(s-1),a=0,h=!1;for(;i!==t.charCodeAt(0);){if(++i===nt&&i++,i===ot&&i++,i>86){if(h)throw"Bad character: "+t;i=rt,h=!0}a+=1e5}return a}(a.charAt(1),o);c<xt(n);)c+=2e6;var u=i-e;if(u%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 M,f,p,d=u/2,y=0,m=0;return d>0&&(M=1e5/Math.pow(10,d),f=t.substring(e,e+d),y=parseFloat(f)*M,p=t.substring(e+d),m=parseFloat(p)*M),{easting:y+l,northing:m+c,zoneLetter:n,zoneNumber:r,accuracy:M}}function xt(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 gt(t,s,i){if(!(this instanceof gt))return new gt(t,s,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if("object"===e(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")}gt.fromMGRS=function(t){return new gt(ut(t))},gt.prototype.toMGRS=function(t){return ct([this.x,this.y],t)};var _t=.01068115234375;function bt(t){var s=[];s[0]=1-t*(.25+t*(.046875+t*(.01953125+t*_t))),s[1]=t*(.75-t*(.046875+t*(.01953125+t*_t)));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 vt(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 r=Math.sin(h),n=1-s*r*r;if(h-=n=(vt(h,r,Math.cos(h),i)-t)*(n*Math.sqrt(n))*a,Math.abs(n)<1e-10)return h}return h}var wt={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=bt(this.es),this.ml0=vt(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,r=I(h-this.long0),n=Math.sin(e),o=Math.cos(e);if(this.es){var l=o*r,c=Math.pow(l,2),u=this.ep2*Math.pow(o,2),M=Math.pow(u,2),f=Math.abs(o)>1e-10?Math.tan(e):0,p=Math.pow(f,2),d=Math.pow(p,2);s=1-this.es*Math.pow(n,2),l/=Math.sqrt(s);var y=vt(e,n,o,this.en);i=this.a*(this.k0*l*(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+n*r*l/2*(1+c/12*(5-p+9*u+4*M+c/30*(61+d-58*p+270*u-330*p*u+c/56*(1385+543*d-d*p-3111*p))))))+this.y0}else{var m=o*Math.sin(r);if(Math.abs(Math.abs(m)-1)<1e-10)return 93;if(i=.5*this.a*this.k0*Math.log((1+m)/(1-m))+this.x0,a=o*Math.cos(r)/Math.sqrt(1-Math.pow(m,2)),(m=Math.abs(a))>=1){if(m-1>1e-10)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,e=(t.x-this.x0)*(1/this.a),r=(t.y-this.y0)*(1/this.a);if(this.es)if(i=jt(s=this.ml0+r/this.k0,this.es,this.en),Math.abs(i)<n){var o=Math.sin(i),l=Math.cos(i),c=Math.abs(l)>1e-10?Math.tan(i):0,u=this.ep2*Math.pow(l,2),M=Math.pow(u,2),f=Math.pow(c,2),p=Math.pow(f,2);s=1-this.es*Math.pow(o,2);var d=e*Math.sqrt(s)/this.k0,y=Math.pow(d,2);a=i-(s*=c)*y/(1-this.es)*.5*(1-y/12*(5+3*f-9*u*f+u-4*M-y/30*(61+90*f-252*u*f+45*p+46*u-y/56*(1385+3633*f+4095*p+1574*p*f)))),h=I(this.long0+d*(1-y/6*(1+2*f+u-y/20*(5+28*f+24*p+8*u*f+6*u-y/42*(61+662*f+1320*p+720*p*f))))/l)}else a=n*A(r),h=0;else{var m=Math.exp(e/this.k0),x=.5*(m-1/m),g=this.lat0+r/this.k0,_=Math.cos(g);s=Math.sqrt((1-Math.pow(_,2))/(1+Math.pow(x,2))),a=Math.asin(s),r<0&&(a=-a),h=0===x&&0===_?0:I(Math.atan2(x,_)+this.long0)}return t.x=h,t.y=a,t},names:["Transverse_Mercator","Transverse Mercator","tmerc"]};function Nt(t){var s=Math.exp(t);return s=(s-1/s)/2}function St(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 Gt(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/(St(1,s)+1))),t<0?-s:s}function Ct(t,s){for(var i,a=2*Math.cos(2*s),h=t.length-1,e=t[h],r=0;--h>=0;)i=a*e-r+t[h],r=e,e=i;return s+i*Math.sin(2*s)}function Rt(t,s,i){for(var a,h,e=Math.sin(s),r=Math.cos(s),n=Nt(i),o=function(t){var s=Math.exp(t);return s=(s+1/s)/2}(i),l=2*r*o,c=-2*e*n,u=t.length-1,M=t[u],f=0,p=0,d=0;--u>=0;)a=p,h=f,M=l*(p=M)-a-c*(f=d)+t[u],d=c*p-h+l*f;return[(l=e*o)*M-(c=r*n)*d,l*d+c*M]}var Pt={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*(1/4+i*(1/64+i/256))),this.utg[0]=s*(s*(2/3+s*(-37/96+s*(1/360+s*(81/512+s*(-96199/604800)))))-.5),this.gtu[0]=s*(.5+s*(-2/3+s*(5/16+s*(41/180+s*(-127/288+s*(7891/37800)))))),this.utg[1]=i*(-1/48+s*(-1/15+s*(437/1440+s*(-46/105+s*(1118711/3870720))))),this.gtu[1]=i*(13/48+s*(s*(557/1440+s*(281/630+s*(-1983433/1935360)))-.6)),i*=s,this.utg[2]=i*(-17/480+s*(37/840+s*(209/4480+s*(-5569/90720)))),this.gtu[2]=i*(61/240+s*(-103/140+s*(15061/26880+s*(167603/181440)))),i*=s,this.utg[3]=i*(-4397/161280+s*(11/504+s*(830251/7257600))),this.gtu[3]=i*(49561/161280+s*(-179/168+s*(6601661/7257600))),i*=s,this.utg[4]=i*(-4583/161280+s*(108847/3991680)),this.gtu[4]=i*(34729/80640+s*(-3418889/1995840)),i*=s,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=.6650675310896665*i;var a=Ct(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],r=0;--h>=0;)i=a*e-r+t[h],r=e,e=i;return Math.sin(s)*i}(this.gtu,2*a))},forward:function(t){var s=I(t.x-this.long0),i=t.y;i=Ct(this.cbg,i);var a=Math.sin(i),h=Math.cos(i),e=Math.sin(s),r=Math.cos(s);i=Math.atan2(a,r*h),s=Math.atan2(e*h,St(a,h*r)),s=Gt(Math.tan(s));var n,o,l=Rt(this.gtu,2*i,2*s);return i+=l[0],s+=l[1],Math.abs(s)<=2.623395162778?(n=this.a*(this.Qn*s)+this.x0,o=this.a*(this.Qn*i+this.Zb)+this.y0):(n=1/0,o=1/0),t.x=n,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=Rt(this.utg,2*h,2*a);h+=e[0],a+=e[1],a=Math.atan(Nt(a));var r=Math.sin(h),n=Math.cos(h),o=Math.sin(a),l=Math.cos(a);h=Math.atan2(r*l,St(o,l*n)),s=I((a=Math.atan2(o,l*n))+this.long0),i=Ct(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"]};var Et={init:function(){var t=function(t,s){if(void 0===t){if((t=Math.floor(30*(I(s)+Math.PI)/Math.PI)+1)<0)return 0;if(t>60)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)*o,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,Pt.init.apply(this),this.forward=Pt.forward,this.inverse=Pt.inverse},names:["Universal Transverse Mercator System","utm"],dependsOn:"etmerc"};function kt(t,s){return Math.pow((1-t)/(1+t),s)}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+c)/(Math.pow(Math.tan(.5*this.lat0+c),this.C)*kt(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+c),this.C)*kt(this.e*Math.sin(i),this.ratexp))-n,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+c)/this.K,1/this.C),h=20;h>0&&(i=2*Math.atan(a*kt(this.e*Math.sin(t.y),-.5*this.e))-n,!(Math.abs(i-t.y)<1e-14));--h)t.y=i;return h?(t.x=s,t.y=i,t):null},names:["gauss"]};var At={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=I(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 r=2*Math.atan2(e,this.R2);s=Math.sin(r),i=Math.cos(r),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=I(t.x+this.long0),t},names:["Stereographic_North_Pole","Oblique_Stereographic","Polar_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"]};var It={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)<=1e-10&&(this.k0=.5*(1+A(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=1e-10&&(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)<=1e-10&&(this.k0=.5*this.cons*q(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/O(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=q(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-n,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))},forward:function(t){var s,i,a,h,e,r,o=t.x,l=t.y,c=Math.sin(l),u=Math.cos(l),M=I(o-this.long0);return Math.abs(Math.abs(o-this.long0)-Math.PI)<=1e-10&&Math.abs(l+this.lat0)<=1e-10?(t.x=NaN,t.y=NaN,t):this.sphere?(s=2*this.k0/(1+this.sinlat0*c+this.coslat0*u*Math.cos(M)),t.x=this.a*s*u*Math.sin(M)+this.x0,t.y=this.a*s*(this.coslat0*c-this.sinlat0*u*Math.cos(M))+this.y0,t):(i=2*Math.atan(this.ssfn_(l,c,this.e))-n,h=Math.cos(i),a=Math.sin(i),Math.abs(this.coslat0)<=1e-10?(e=O(this.e,l*this.con,this.con*c),r=2*this.a*this.k0*e/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)<1e-10?(s=2*this.a*this.k0/(1+h*Math.cos(M)),t.y=s*a):(s=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*a+this.cosX0*h*Math.cos(M))),t.y=s*(this.cosX0*a-this.sinX0*h*Math.cos(M))+this.y0),t.x=s*h*Math.sin(M)+this.x0,t))},inverse:function(t){var s,i,a,h,e;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<=1e-10?(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)<1e-10?this.lat0>0?I(this.long0+Math.atan2(t.x,-1*t.y)):I(this.long0+Math.atan2(t.x,t.y)):I(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)<=1e-10){if(r<=1e-10)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*z(this.e,a),s=this.con*I(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<=1e-10?e=this.X0:(e=Math.asin(Math.cos(h)*this.sinX0+t.y*Math.sin(h)*this.cosX0/r),s=I(this.long0+Math.atan2(t.x*Math.sin(h),r*this.cosX0*Math.cos(h)-t.y*this.sinX0*Math.sin(h)))),i=-1*z(this.e,Math.tan(.5*(n+e)));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*(n+t))*Math.pow((1-s)/(1+s),.5*i)}};var Ot={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 r=Math.log(Math.tan(Math.PI/4+this.b0/2)),n=Math.log(Math.tan(Math.PI/4+t/2)),o=Math.log((1+e*s)/(1-e*s));this.K=r-this.alpha*n+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),r=Math.atan(Math.sin(e)/(Math.sin(this.b0)*Math.tan(h)+Math.cos(this.b0)*Math.cos(e))),n=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(n))/(1-Math.sin(n)))+this.y0,t.x=this.R*r+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)),r=Math.atan(Math.sin(a)/(Math.cos(this.b0)*Math.cos(a)-Math.sin(this.b0)*Math.tan(h))),n=this.lambda0+r/this.alpha,o=0,l=e,c=-1e3,u=0;Math.abs(l-c)>1e-7;){if(++u>20)return;o=1/this.alpha*(Math.log(Math.tan(Math.PI/4+e/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(l))/2)),c=l,l=2*Math.atan(Math.exp(o))-Math.PI/2}return t.x=n,t.y=l,t},names:["somerc"]};var zt={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=O(this.e,this.lat0,t),r=this.bl/s*Math.sqrt((1-this.es)/(1-i*i));if(r*r<1&&(r=1),isNaN(this.longc)){var n=O(this.e,this.lat1,Math.sin(this.lat1)),o=O(this.e,this.lat2,Math.sin(this.lat2));this.lat0>=0?this.el=(r+Math.sqrt(r*r-1))*Math.pow(e,this.bl):this.el=(r-Math.sqrt(r*r-1))*Math.pow(e,this.bl);var l=Math.pow(n,this.bl),c=Math.pow(o,this.bl);h=.5*((a=this.el/l)-1/a);var u=(this.el*this.el-c*l)/(this.el*this.el+c*l),M=(c-l)/(c+l),f=I(this.long1-this.long2);this.long0=.5*(this.long1+this.long2)-Math.atan(u*Math.tan(.5*this.bl*f)/M)/this.bl,this.long0=I(this.long0);var p=I(this.long1-this.long0);this.gamma0=Math.atan(Math.sin(this.bl*p)/h),this.alpha=Math.asin(r*Math.sin(this.gamma0))}else a=this.lat0>=0?r+Math.sqrt(r*r-1):r-Math.sqrt(r*r-1),this.el=a*Math.pow(e,this.bl),h=.5*(a-1/a),this.gamma0=Math.asin(Math.sin(this.alpha)/r),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(r*r-1),Math.cos(this.alpha)):this.uc=-1*this.al/this.bl*Math.atan2(Math.sqrt(r*r-1),Math.cos(this.alpha))},forward:function(t){var s,i,a,h=t.x,e=t.y,r=I(h-this.long0);if(Math.abs(Math.abs(e)-n)<=1e-10)a=e>0?-1:1,i=this.al/this.bl*Math.log(Math.tan(c+a*this.gamma0*.5)),s=-1*a*n*this.al/this.bl;else{var o=O(this.e,e,Math.sin(e)),l=this.el/Math.pow(o,this.bl),u=.5*(l-1/l),M=.5*(l+1/l),f=Math.sin(this.bl*r),p=(u*Math.sin(this.gamma0)-f*Math.cos(this.gamma0))/M;i=Math.abs(Math.abs(p)-1)<=1e-10?Number.POSITIVE_INFINITY:.5*this.al*Math.log((1-p)/(1+p))/this.bl,s=Math.abs(Math.cos(this.bl*r))<=1e-10?this.al*this.bl*r:this.al*Math.atan2(u*Math.cos(this.gamma0)+f*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),e=.5*(a+1/a),r=Math.sin(this.bl*s/this.al),o=(r*Math.cos(this.gamma0)+h*Math.sin(this.gamma0))/e,l=Math.pow(this.el/Math.sqrt((1+o)/(1-o)),1/this.bl);return Math.abs(o-1)<1e-10?(t.x=this.long0,t.y=n):Math.abs(o+1)<1e-10?(t.x=this.long0,t.y=-1*n):(t.y=z(this.e,l),t.x=I(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 Tt={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)<1e-10)){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=q(this.e,s,i),h=O(this.e,this.lat1,s),e=Math.sin(this.lat2),r=Math.cos(this.lat2),n=q(this.e,e,r),o=O(this.e,this.lat2,e),l=O(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>1e-10?this.ns=Math.log(a/n)/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)<=1e-10&&(i=A(i)*(n-2e-10));var a,h,e=Math.abs(Math.abs(i)-n);if(e>1e-10)a=O(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 r=this.ns*I(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,e,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=z(this.e,a)))return null}else h=-n;return e=I(l/this.ns+this.long0),t.x=e,t.y=h,t},names:["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_2SP","lcc"]};var Lt={init:function(){this.a=6377397.155,this.es=.