@naivemap/maplibre-gl-image-layer 0.0.1-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/ImageLayer.d.ts +65 -0
- package/dist/arrugator/Arrugator.d.ts +18 -0
- package/dist/arrugator/index.d.ts +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +17683 -0
- package/dist/index.umd.cjs +79 -0
- package/dist/shaders/image.fragment.glsl.d.ts +2 -0
- package/dist/shaders/image.vertex.glsl.d.ts +2 -0
- package/dist/shaders/mask.fragment.glsl.d.ts +2 -0
- package/dist/shaders/mask.vertex.glsl.d.ts +2 -0
- package/package.json +47 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
(function(bt,wt){typeof exports=="object"&&typeof module<"u"?module.exports=wt():typeof define=="function"&&define.amd?define(wt):(bt=typeof globalThis<"u"?globalThis:bt||self,bt.ImageLayer=wt())})(this,function(){"use strict";function bt(t,e,i=2){const s=e&&e.length,a=s?e[0]*i:t.length;let r=wt(t,0,a,i,!0);const o=[];if(!r||r.next===r.prev)return o;let n,h,f;if(s&&(r=lr(t,e,r,i)),t.length>80*i){n=1/0,h=1/0;let u=-1/0,c=-1/0;for(let l=i;l<a;l+=i){const m=t[l],_=t[l+1];m<n&&(n=m),_<h&&(h=_),m>u&&(u=m),_>c&&(c=_)}f=Math.max(u-n,c-h),f=f!==0?32767/f:0}return qt(r,o,i,n,h,f,0),o}function wt(t,e,i,s,a){let r;if(a===Er(t,e,i,s)>0)for(let o=e;o<i;o+=s)r=is(o/s|0,t[o],t[o+1],r);else for(let o=i-s;o>=e;o-=s)r=is(o/s|0,t[o],t[o+1],r);return r&&At(r,r.next)&&(Ht(r),r=r.next),r}function dt(t,e){if(!t)return t;e||(e=t);let i=t,s;do if(s=!1,!i.steiner&&(At(i,i.next)||R(i.prev,i,i.next)===0)){if(Ht(i),i=e=i.prev,i===i.next)break;s=!0}else i=i.next;while(s||i!==e);return e}function qt(t,e,i,s,a,r,o){if(!t)return;!o&&r&&dr(t,s,a,r);let n=t;for(;t.prev!==t.next;){const h=t.prev,f=t.next;if(r?or(t,s,a,r):nr(t)){e.push(h.i,t.i,f.i),Ht(t),t=f.next,n=f.next;continue}if(t=f,t===n){o?o===1?(t=hr(dt(t),e),qt(t,e,i,s,a,r,2)):o===2&&fr(t,e,i,s,a,r):qt(dt(t),e,i,s,a,r,1);break}}}function nr(t){const e=t.prev,i=t,s=t.next;if(R(e,i,s)>=0)return!1;const a=e.x,r=i.x,o=s.x,n=e.y,h=i.y,f=s.y,u=Math.min(a,r,o),c=Math.min(n,h,f),l=Math.max(a,r,o),m=Math.max(n,h,f);let _=s.next;for(;_!==e;){if(_.x>=u&&_.x<=l&&_.y>=c&&_.y<=m&&jt(a,n,r,h,o,f,_.x,_.y)&&R(_.prev,_,_.next)>=0)return!1;_=_.next}return!0}function or(t,e,i,s){const a=t.prev,r=t,o=t.next;if(R(a,r,o)>=0)return!1;const n=a.x,h=r.x,f=o.x,u=a.y,c=r.y,l=o.y,m=Math.min(n,h,f),_=Math.min(u,c,l),d=Math.max(n,h,f),y=Math.max(u,c,l),v=Je(m,_,e,i,s),S=Je(d,y,e,i,s);let M=t.prevZ,P=t.nextZ;for(;M&&M.z>=v&&P&&P.z<=S;){if(M.x>=m&&M.x<=d&&M.y>=_&&M.y<=y&&M!==a&&M!==o&&jt(n,u,h,c,f,l,M.x,M.y)&&R(M.prev,M,M.next)>=0||(M=M.prevZ,P.x>=m&&P.x<=d&&P.y>=_&&P.y<=y&&P!==a&&P!==o&&jt(n,u,h,c,f,l,P.x,P.y)&&R(P.prev,P,P.next)>=0))return!1;P=P.nextZ}for(;M&&M.z>=v;){if(M.x>=m&&M.x<=d&&M.y>=_&&M.y<=y&&M!==a&&M!==o&&jt(n,u,h,c,f,l,M.x,M.y)&&R(M.prev,M,M.next)>=0)return!1;M=M.prevZ}for(;P&&P.z<=S;){if(P.x>=m&&P.x<=d&&P.y>=_&&P.y<=y&&P!==a&&P!==o&&jt(n,u,h,c,f,l,P.x,P.y)&&R(P.prev,P,P.next)>=0)return!1;P=P.nextZ}return!0}function hr(t,e){let i=t;do{const s=i.prev,a=i.next.next;!At(s,a)&&ts(s,i,i.next,a)&&Vt(s,a)&&Vt(a,s)&&(e.push(s.i,i.i,a.i),Ht(i),Ht(i.next),i=t=a),i=i.next}while(i!==t);return dt(i)}function fr(t,e,i,s,a,r){let o=t;do{let n=o.next.next;for(;n!==o.prev;){if(o.i!==n.i&&vr(o,n)){let h=es(o,n);o=dt(o,o.next),h=dt(h,h.next),qt(o,e,i,s,a,r,0),qt(h,e,i,s,a,r,0);return}n=n.next}o=o.next}while(o!==t)}function lr(t,e,i,s){const a=[];for(let r=0,o=e.length;r<o;r++){const n=e[r]*s,h=r<o-1?e[r+1]*s:t.length,f=wt(t,n,h,s,!1);f===f.next&&(f.steiner=!0),a.push(gr(f))}a.sort(cr);for(let r=0;r<a.length;r++)i=ur(a[r],i);return i}function cr(t,e){let i=t.x-e.x;if(i===0&&(i=t.y-e.y,i===0)){const s=(t.next.y-t.y)/(t.next.x-t.x),a=(e.next.y-e.y)/(e.next.x-e.x);i=s-a}return i}function ur(t,e){const i=_r(t,e);if(!i)return e;const s=es(i,t);return dt(s,s.next),dt(i,i.next)}function _r(t,e){let i=e;const s=t.x,a=t.y;let r=-1/0,o;if(At(t,i))return i;do{if(At(t,i.next))return i.next;if(a<=i.y&&a>=i.next.y&&i.next.y!==i.y){const c=i.x+(a-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(c<=s&&c>r&&(r=c,o=i.x<i.next.x?i:i.next,c===s))return o}i=i.next}while(i!==e);if(!o)return null;const n=o,h=o.x,f=o.y;let u=1/0;i=o;do{if(s>=i.x&&i.x>=h&&s!==i.x&&Ji(a<f?s:r,a,h,f,a<f?r:s,a,i.x,i.y)){const c=Math.abs(a-i.y)/(s-i.x);Vt(i,t)&&(c<u||c===u&&(i.x>o.x||i.x===o.x&&mr(o,i)))&&(o=i,u=c)}i=i.next}while(i!==n);return o}function mr(t,e){return R(t.prev,t,e.prev)<0&&R(e.next,t,t.next)<0}function dr(t,e,i,s){let a=t;do a.z===0&&(a.z=Je(a.x,a.y,e,i,s)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,yr(a)}function yr(t){let e,i=1;do{let s=t,a;t=null;let r=null;for(e=0;s;){e++;let o=s,n=0;for(let f=0;f<i&&(n++,o=o.nextZ,!!o);f++);let h=i;for(;n>0||h>0&&o;)n!==0&&(h===0||!o||s.z<=o.z)?(a=s,s=s.nextZ,n--):(a=o,o=o.nextZ,h--),r?r.nextZ=a:t=a,a.prevZ=r,r=a;s=o}r.nextZ=null,i*=2}while(e>1);return t}function Je(t,e,i,s,a){return t=(t-i)*a|0,e=(e-s)*a|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function gr(t){let e=t,i=t;do(e.x<i.x||e.x===i.x&&e.y<i.y)&&(i=e),e=e.next;while(e!==t);return i}function Ji(t,e,i,s,a,r,o,n){return(a-o)*(e-n)>=(t-o)*(r-n)&&(t-o)*(s-n)>=(i-o)*(e-n)&&(i-o)*(r-n)>=(a-o)*(s-n)}function jt(t,e,i,s,a,r,o,n){return!(t===o&&e===n)&&Ji(t,e,i,s,a,r,o,n)}function vr(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Mr(t,e)&&(Vt(t,e)&&Vt(e,t)&&xr(t,e)&&(R(t.prev,t,e.prev)||R(t,e.prev,e))||At(t,e)&&R(t.prev,t,t.next)>0&&R(e.prev,e,e.next)>0)}function R(t,e,i){return(e.y-t.y)*(i.x-e.x)-(e.x-t.x)*(i.y-e.y)}function At(t,e){return t.x===e.x&&t.y===e.y}function ts(t,e,i,s){const a=xe(R(t,e,i)),r=xe(R(t,e,s)),o=xe(R(i,s,t)),n=xe(R(i,s,e));return!!(a!==r&&o!==n||a===0&&Me(t,i,e)||r===0&&Me(t,s,e)||o===0&&Me(i,t,s)||n===0&&Me(i,e,s))}function Me(t,e,i){return e.x<=Math.max(t.x,i.x)&&e.x>=Math.min(t.x,i.x)&&e.y<=Math.max(t.y,i.y)&&e.y>=Math.min(t.y,i.y)}function xe(t){return t>0?1:t<0?-1:0}function Mr(t,e){let i=t;do{if(i.i!==t.i&&i.next.i!==t.i&&i.i!==e.i&&i.next.i!==e.i&&ts(i,i.next,t,e))return!0;i=i.next}while(i!==t);return!1}function Vt(t,e){return R(t.prev,t,t.next)<0?R(t,e,t.next)>=0&&R(t,t.prev,e)>=0:R(t,e,t.prev)<0||R(t,t.next,e)<0}function xr(t,e){let i=t,s=!1;const a=(t.x+e.x)/2,r=(t.y+e.y)/2;do i.y>r!=i.next.y>r&&i.next.y!==i.y&&a<(i.next.x-i.x)*(r-i.y)/(i.next.y-i.y)+i.x&&(s=!s),i=i.next;while(i!==t);return s}function es(t,e){const i=ti(t.i,t.x,t.y),s=ti(e.i,e.x,e.y),a=t.next,r=e.prev;return t.next=e,e.prev=t,i.next=a,a.prev=i,s.next=i,i.prev=s,r.next=s,s.prev=r,s}function is(t,e,i,s){const a=ti(t,e,i);return s?(a.next=s.next,a.prev=s,s.next.prev=a,s.next=a):(a.prev=a,a.next=a),a}function Ht(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ti(t,e,i){return{i:t,x:e,y:i,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Er(t,e,i,s){let a=0;for(let r=e,o=i-s;r<i;r+=s)a+=(t[o]-t[r])*(t[r+1]+t[o+1]),o=r;return a}function ss(t){const e=[],i=[],s=t[0][0].length;let a=0,r=0;for(const o of t){for(const n of o)for(let h=0;h<s;h++)e.push(n[h]);r&&(a+=r,i.push(a)),r=o.length}return{vertices:e,holes:i,dimensions:s}}/* @license twgl.js 5.5.4 Copyright (c) 2015, Gregg Tavares All Rights Reserved.
|
|
2
|
+
Available via the MIT license.
|
|
3
|
+
see: http://github.com/greggman/twgl.js for details */const ei=5120,Wt=5121,ii=5122,si=5123,ai=5124,ri=5125,ni=5126,Sr=32819,Pr=32820,br=33635,wr=5131,Ar=33640,Gr=35899,Ir=35902,Tr=36269,Nr=34042,as={};{const t=as;t[ei]=Int8Array,t[Wt]=Uint8Array,t[ii]=Int16Array,t[si]=Uint16Array,t[ai]=Int32Array,t[ri]=Uint32Array,t[ni]=Float32Array,t[Sr]=Uint16Array,t[Pr]=Uint16Array,t[br]=Uint16Array,t[wr]=Uint16Array,t[Ar]=Uint32Array,t[Gr]=Uint32Array,t[Ir]=Uint32Array,t[Tr]=Uint32Array,t[Nr]=Uint32Array}function oi(t){if(t instanceof Int8Array)return ei;if(t instanceof Uint8Array||t instanceof Uint8ClampedArray)return Wt;if(t instanceof Int16Array)return ii;if(t instanceof Uint16Array)return si;if(t instanceof Int32Array)return ai;if(t instanceof Uint32Array)return ri;if(t instanceof Float32Array)return ni;throw new Error("unsupported typed array type")}function rs(t){if(t===Int8Array)return ei;if(t===Uint8Array||t===Uint8ClampedArray)return Wt;if(t===Int16Array)return ii;if(t===Uint16Array)return si;if(t===Int32Array)return ai;if(t===Uint32Array)return ri;if(t===Float32Array)return ni;throw new Error("unsupported typed array type")}function ns(t){const e=as[t];if(!e)throw new Error("unknown gl type");return e}const Ee=typeof SharedArrayBuffer<"u"?function(e){return e&&e.buffer&&(e.buffer instanceof ArrayBuffer||e.buffer instanceof SharedArrayBuffer)}:function(e){return e&&e.buffer&&e.buffer instanceof ArrayBuffer};function os(...t){console.error(...t)}const hs=new Map;function hi(t,e){if(!t||typeof t!="object")return!1;let i=hs.get(e);i||(i=new WeakMap,hs.set(e,i));let s=i.get(t);if(s===void 0){const a=Object.prototype.toString.call(t);s=a.substring(8,a.length-1)===e,i.set(t,s)}return s}function Rr(t,e){return typeof WebGLBuffer<"u"&&hi(e,"WebGLBuffer")}function fs(t,e){return typeof WebGLTexture<"u"&&hi(e,"WebGLTexture")}function pr(t,e){return typeof WebGLSampler<"u"&&hi(e,"WebGLSampler")}const ls=35044,yt=34962,Cr=34963,Fr=34660,Or=5120,Lr=5121,Ur=5122,Dr=5123,Br=5124,kr=5125,cs=5126,us={attribPrefix:""};function $r(t,e,i,s,a){t.bindBuffer(e,i),t.bufferData(e,s,a||ls)}function _s(t,e,i,s){if(Rr(t,e))return e;i=i||yt;const a=t.createBuffer();return $r(t,i,a,e,s),a}function ms(t){return t==="indices"}function zr(t){return t===Int8Array||t===Uint8Array}function qr(t){return t.length?t:t.data}const jr=/coord|texture/i,Vr=/color|colour/i;function Hr(t,e){let i;if(jr.test(t)?i=2:Vr.test(t)?i=4:i=3,e%i>0)throw new Error(`Can not guess numComponents for attribute '${t}'. Tried ${i} but ${e} values is not evenly divisible by ${i}. You should specify it.`);return i}function Wr(t,e,i){return t.numComponents||t.size||Hr(e,i||qr(t).length)}function ds(t,e){if(Ee(t))return t;if(Ee(t.data))return t.data;Array.isArray(t)&&(t={data:t});let i=t.type?fi(t.type):void 0;return i||(ms(e)?i=Uint16Array:i=Float32Array),new i(t.data)}function Xr(t){return typeof t=="number"?t:t?rs(t):cs}function fi(t){return typeof t=="number"?ns(t):t||Float32Array}function Kr(t,e){return{buffer:e.buffer,numValues:2*3*4,type:Xr(e.type),arrayType:fi(e.type)}}function Qr(t,e){const i=e.data||e,s=fi(e.type),a=i*s.BYTES_PER_ELEMENT,r=t.createBuffer();return t.bindBuffer(yt,r),t.bufferData(yt,a,e.drawType||ls),{buffer:r,numValues:i,type:rs(s),arrayType:s}}function Zr(t,e,i){const s=ds(e,i);return{arrayType:s.constructor,buffer:_s(t,s,void 0,e.drawType),type:oi(s),numValues:0}}function Yr(t,e){const i={};return Object.keys(e).forEach(function(s){if(!ms(s)){const a=e[s],r=a.attrib||a.name||a.attribName||us.attribPrefix+s;if(a.value){if(!Array.isArray(a.value)&&!Ee(a.value))throw new Error("array.value is not array or typedarray");i[r]={value:a.value}}else{let o;a.buffer&&a.buffer instanceof WebGLBuffer?o=Kr:typeof a=="number"||typeof a.data=="number"?o=Qr:o=Zr;const{buffer:n,type:h,numValues:f,arrayType:u}=o(t,a,s),c=a.normalize!==void 0?a.normalize:zr(u),l=Wr(a,s,f);i[r]={buffer:n,numComponents:l,type:h,normalize:c,stride:a.stride||0,offset:a.offset||0,divisor:a.divisor===void 0?void 0:a.divisor,drawType:a.drawType}}}}),t.bindBuffer(yt,null),i}function Jr(t,e){return e===Or||e===Lr?1:e===Ur||e===Dr?2:e===Br||e===kr||e===cs?4:0}const li=["position","positions","a_position"];function tn(t,e){let i,s;for(s=0;s<li.length&&(i=li[s],!(i in e||(i=us.attribPrefix+i,i in e)));++s);s===li.length&&(i=Object.keys(e)[0]);const a=e[i];if(!a.buffer)return 1;t.bindBuffer(yt,a.buffer);const r=t.getBufferParameter(yt,Fr);t.bindBuffer(yt,null);const o=Jr(t,a.type),n=r/o,h=a.numComponents||a.size,f=n/h;if(f%1!==0)throw new Error(`numComponents ${h} not correct for length ${length}`);return f}function ci(t,e,i){const s=Yr(t,e),a=Object.assign({},i||{});a.attribs=Object.assign({},i?i.attribs:{},s);const r=e.indices;if(r){const o=ds(r,"indices");a.indices=_s(t,o,Cr),a.numElements=o.length,a.elementType=oi(o)}else a.numElements||(a.numElements=tn(t,a.attribs));return a}function Xt(t){return!!t.texStorage2D}const ys=function(){const t={},e={};function i(s){const a=s.constructor.name;if(!t[a]){for(const r in s)if(typeof s[r]=="number"){const o=e[s[r]];e[s[r]]=o?`${o} | ${r}`:r}t[a]=!0}}return function(a,r){return i(a),e[r]||(typeof r=="number"?`0x${r.toString(16)}`:r)}}(),at={textureColor:new Uint8Array([128,192,255,255]),textureOptions:{},crossOrigin:void 0},Kt=Ee,gs=function(){let t;return function(){return t=t||(typeof document<"u"&&document.createElement?document.createElement("canvas").getContext("2d"):null),t}}(),vs=6406,tt=6407,p=6408,Ms=6409,xs=6410,Qt=6402,Es=34041,Se=33071,en=9728,sn=9729,rt=3553,nt=34067,gt=32879,vt=35866,ui=34069,an=34070,rn=34071,nn=34072,on=34073,hn=34074,_i=10241,mi=10240,Pe=10242,be=10243,Ss=32882,fn=33082,ln=33083,cn=33084,un=33085,_n=34892,mn=34893,di=3317,Ps=3314,bs=32878,ws=3316,As=3315,Gs=32877,dn=37443,yn=37441,gn=37440,vn=33321,Mn=36756,xn=33325,En=33326,Sn=33330,Pn=33329,bn=33338,wn=33337,An=33340,Gn=33339,In=33323,Tn=36757,Nn=33327,Rn=33328,pn=33336,Cn=33335,Fn=33332,On=33331,Ln=33334,Un=33333,Dn=32849,Bn=35905,kn=36194,$n=36758,zn=35898,qn=35901,jn=34843,Vn=34837,Hn=36221,Wn=36239,Xn=36215,Kn=36233,Qn=36209,Zn=36227,Yn=32856,Jn=35907,to=36759,eo=32855,io=32854,so=32857,ao=34842,ro=34836,no=36220,oo=36238,ho=36975,fo=36214,lo=36232,co=36226,uo=36208,_o=33189,mo=33190,yo=36012,go=36013,vo=35056,ot=5120,N=5121,we=5122,Gt=5123,Ae=5124,Mt=5125,D=5126,Is=32819,Ts=32820,Ns=33635,Q=5131,Zt=36193,yi=33640,Mo=35899,xo=35902,Eo=36269,So=34042,Ge=33319,It=33320,Ie=6403,Tt=36244,Nt=36248,xt=36249;let gi;function Te(t){if(!gi){const e={};e[vs]={textureFormat:vs,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[N,Q,Zt,D]},e[Ms]={textureFormat:Ms,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1,2,2,4],type:[N,Q,Zt,D]},e[xs]={textureFormat:xs,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2,4,4,8],type:[N,Q,Zt,D]},e[tt]={textureFormat:tt,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,6,6,12,2],type:[N,Q,Zt,D,Ns]},e[p]={textureFormat:p,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,8,8,16,2,2],type:[N,Q,Zt,D,Is,Ts]},e[Qt]={textureFormat:Qt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Mt,Gt]},e[vn]={textureFormat:Ie,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[1],type:[N]},e[Mn]={textureFormat:Ie,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[1],type:[ot]},e[xn]={textureFormat:Ie,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4,2],type:[D,Q]},e[En]={textureFormat:Ie,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[4],type:[D]},e[Sn]={textureFormat:Tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[N]},e[Pn]={textureFormat:Tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[1],type:[ot]},e[Fn]={textureFormat:Tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[Gt]},e[On]={textureFormat:Tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[we]},e[Ln]={textureFormat:Tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Mt]},e[Un]={textureFormat:Tt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Ae]},e[In]={textureFormat:Ge,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[2],type:[N]},e[Tn]={textureFormat:Ge,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[2],type:[ot]},e[Nn]={textureFormat:Ge,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[8,4],type:[D,Q]},e[Rn]={textureFormat:Ge,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[8],type:[D]},e[pn]={textureFormat:It,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[N]},e[Cn]={textureFormat:It,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2],type:[ot]},e[bn]={textureFormat:It,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Gt]},e[wn]={textureFormat:It,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[we]},e[An]={textureFormat:It,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Mt]},e[Gn]={textureFormat:It,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Ae]},e[Dn]={textureFormat:tt,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3],type:[N]},e[Bn]={textureFormat:tt,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[N]},e[kn]={textureFormat:tt,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[3,2],type:[N,Ns]},e[$n]={textureFormat:tt,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[3],type:[ot]},e[zn]={textureFormat:tt,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[D,Q,Mo]},e[qn]={textureFormat:tt,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6,4],type:[D,Q,xo]},e[jn]={textureFormat:tt,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[12,6],type:[D,Q]},e[Vn]={textureFormat:tt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[D]},e[Hn]={textureFormat:Nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[N]},e[Wn]={textureFormat:Nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[3],type:[ot]},e[Xn]={textureFormat:Nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[Gt]},e[Kn]={textureFormat:Nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[6],type:[we]},e[Qn]={textureFormat:Nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Mt]},e[Zn]={textureFormat:Nt,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[12],type:[Ae]},e[Yn]={textureFormat:p,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[N]},e[Jn]={textureFormat:p,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[N]},e[to]={textureFormat:p,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[4],type:[ot]},e[eo]={textureFormat:p,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2,4],type:[N,Ts,yi]},e[io]={textureFormat:p,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4,2],type:[N,Is]},e[so]={textureFormat:p,colorRenderable:!0,textureFilterable:!0,bytesPerElement:[4],type:[yi]},e[ao]={textureFormat:p,colorRenderable:!1,textureFilterable:!0,bytesPerElement:[16,8],type:[D,Q]},e[ro]={textureFormat:p,colorRenderable:!1,textureFilterable:!1,bytesPerElement:[16],type:[D]},e[no]={textureFormat:xt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[N]},e[oo]={textureFormat:xt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[ot]},e[ho]={textureFormat:xt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[yi]},e[fo]={textureFormat:xt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[Gt]},e[lo]={textureFormat:xt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[8],type:[we]},e[co]={textureFormat:xt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Ae]},e[uo]={textureFormat:xt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[16],type:[Mt]},e[_o]={textureFormat:Qt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[2,4],type:[Gt,Mt]},e[mo]={textureFormat:Qt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Mt]},e[yo]={textureFormat:Qt,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[D]},e[vo]={textureFormat:Es,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[So]},e[go]={textureFormat:Es,colorRenderable:!0,textureFilterable:!1,bytesPerElement:[4],type:[Eo]},Object.keys(e).forEach(function(i){const s=e[i];s.bytesPerElementMap={},s.bytesPerElement.forEach(function(a,r){const o=s.type[r];s.bytesPerElementMap[o]=a})}),gi=e}return gi[t]}function Po(t,e){const i=Te(t);if(!i)throw"unknown internal format";const s=i.bytesPerElementMap[e];if(s===void 0)throw"unknown internal format";return s}function Yt(t){const e=Te(t);if(!e)throw"unknown internal format";return{format:e.textureFormat,type:e.type[0]}}function Rs(t){return(t&t-1)===0}function bo(t,e,i,s){if(!Xt(t))return Rs(e)&&Rs(i);const a=Te(s);if(!a)throw"unknown internal format";return a.colorRenderable&&a.textureFilterable}function wo(t){const e=Te(t);if(!e)throw"unknown internal format";return e.textureFilterable}function Ao(t,e,i){return Kt(e)?oi(e):i||N}function Ne(t,e,i,s,a){if(a%1!==0)throw"can't guess dimensions";if(!i&&!s){const r=Math.sqrt(a/(e===nt?6:1));r%1===0?(i=r,s=r):(i=a,s=1)}else if(s){if(!i&&(i=a/s,i%1))throw"can't guess dimensions"}else if(s=a/i,s%1)throw"can't guess dimensions";return{width:i,height:s}}function Rt(t,e){e.colorspaceConversion!==void 0&&t.pixelStorei(dn,e.colorspaceConversion),e.premultiplyAlpha!==void 0&&t.pixelStorei(yn,e.premultiplyAlpha),e.flipY!==void 0&&t.pixelStorei(gn,e.flipY)}function ps(t){t.pixelStorei(di,4),Xt(t)&&(t.pixelStorei(Ps,0),t.pixelStorei(bs,0),t.pixelStorei(ws,0),t.pixelStorei(As,0),t.pixelStorei(Gs,0))}function Go(t,e,i,s){s.minMag&&(i.call(t,e,_i,s.minMag),i.call(t,e,mi,s.minMag)),s.min&&i.call(t,e,_i,s.min),s.mag&&i.call(t,e,mi,s.mag),s.wrap&&(i.call(t,e,Pe,s.wrap),i.call(t,e,be,s.wrap),(e===gt||pr(t,e))&&i.call(t,e,Ss,s.wrap)),s.wrapR&&i.call(t,e,Ss,s.wrapR),s.wrapS&&i.call(t,e,Pe,s.wrapS),s.wrapT&&i.call(t,e,be,s.wrapT),s.minLod!==void 0&&i.call(t,e,fn,s.minLod),s.maxLod!==void 0&&i.call(t,e,ln,s.maxLod),s.baseLevel!==void 0&&i.call(t,e,cn,s.baseLevel),s.maxLevel!==void 0&&i.call(t,e,un,s.maxLevel),s.compareFunc!==void 0&&i.call(t,e,mn,s.compareFunc),s.compareMode!==void 0&&i.call(t,e,_n,s.compareMode)}function Cs(t,e,i){const s=i.target||rt;t.bindTexture(s,e),Go(t,s,t.texParameteri,i)}function Io(t){return t=t||at.textureColor,Kt(t)?t:new Uint8Array([t[0]*255,t[1]*255,t[2]*255,t[3]*255])}function vi(t,e,i,s,a,r){i=i||at.textureOptions,r=r||p;const o=i.target||rt;if(s=s||i.width,a=a||i.height,t.bindTexture(o,e),bo(t,s,a,r))t.generateMipmap(o);else{const n=wo(r)?sn:en;t.texParameteri(o,_i,n),t.texParameteri(o,mi,n),t.texParameteri(o,Pe,Se),t.texParameteri(o,be,Se)}}function Jt(t){return t.auto===!0||t.auto===void 0&&t.level===void 0}function Mi(t,e){return e=e||{},e.cubeFaceOrder||[ui,an,rn,nn,on,hn]}function xi(t,e){const s=Mi(t,e).map(function(a,r){return{face:a,ndx:r}});return s.sort(function(a,r){return a.face-r.face}),s}function Fs(t,e,i,s){s=s||at.textureOptions;const a=s.target||rt,r=s.level||0;let o=i.width,n=i.height;const h=s.internalFormat||s.format||p,f=Yt(h),u=s.format||f.format,c=s.type||f.type;if(Rt(t,s),t.bindTexture(a,e),a===nt){const l=i.width,m=i.height;let _,d;if(l/6===m)_=m,d=[0,0,1,0,2,0,3,0,4,0,5,0];else if(m/6===l)_=l,d=[0,0,0,1,0,2,0,3,0,4,0,5];else if(l/3===m/2)_=l/3,d=[0,0,1,0,2,0,0,1,1,1,2,1];else if(l/2===m/3)_=l/2,d=[0,0,1,0,0,1,1,1,0,2,1,2];else throw"can't figure out cube map from element: "+(i.src?i.src:i.nodeName);const y=gs();y?(y.canvas.width=_,y.canvas.height=_,o=_,n=_,xi(t,s).forEach(function(v){const S=d[v.ndx*2+0]*_,M=d[v.ndx*2+1]*_;y.drawImage(i,S,M,_,_,0,0,_,_),t.texImage2D(v.face,r,h,u,c,y.canvas)}),y.canvas.width=1,y.canvas.height=1):typeof createImageBitmap<"u"&&(o=_,n=_,xi(t,s).forEach(function(v){const S=d[v.ndx*2+0]*_,M=d[v.ndx*2+1]*_;t.texImage2D(v.face,r,h,_,_,0,u,c,null),createImageBitmap(i,S,M,_,_,{premultiplyAlpha:"none",colorSpaceConversion:"none"}).then(function(P){Rt(t,s),t.bindTexture(a,e),t.texImage2D(v.face,r,h,u,c,P),Jt(s)&&vi(t,e,s,o,n,h)})}))}else if(a===gt||a===vt){const l=Math.min(i.width,i.height),m=Math.max(i.width,i.height),_=m/l;if(_%1!==0)throw"can not compute 3D dimensions of element";const d=i.width===m?1:0,y=i.height===m?1:0;t.pixelStorei(di,1),t.pixelStorei(Ps,i.width),t.pixelStorei(bs,0),t.pixelStorei(Gs,0),t.texImage3D(a,r,h,l,l,l,0,u,c,null);for(let v=0;v<_;++v){const S=v*l*d,M=v*l*y;t.pixelStorei(ws,S),t.pixelStorei(As,M),t.texSubImage3D(a,r,0,0,v,l,l,1,u,c,i)}ps(t)}else t.texImage2D(a,r,h,u,c,i);Jt(s)&&vi(t,e,s,o,n,h),Cs(t,e,s)}function te(){}function To(t){if(typeof document<"u"){const e=document.createElement("a");return e.href=t,e.hostname===location.hostname&&e.port===location.port&&e.protocol===location.protocol}else{const e=new URL(location.href).origin;return new URL(t,location.href).origin===e}}function No(t,e){return e===void 0&&!To(t)?"anonymous":e}function Ro(t,e,i){i=i||te;let s;if(e=e!==void 0?e:at.crossOrigin,e=No(t,e),typeof Image<"u"){s=new Image,e!==void 0&&(s.crossOrigin=e);const a=function(){s.removeEventListener("error",r),s.removeEventListener("load",o),s=null},r=function(){const h="couldn't load image: "+t;os(h),i(h,s),a()},o=function(){i(null,s),a()};return s.addEventListener("error",r),s.addEventListener("load",o),s.src=t,s}else if(typeof ImageBitmap<"u"){let a,r;const o=function(){i(a,r)},n={};e&&(n.mode="cors"),fetch(t,n).then(function(h){if(!h.ok)throw h;return h.blob()}).then(function(h){return createImageBitmap(h,{premultiplyAlpha:"none",colorSpaceConversion:"none"})}).then(function(h){r=h,setTimeout(o)}).catch(function(h){a=h,setTimeout(o)}),s=null}return s}function Os(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof ImageData<"u"&&t instanceof ImageData||typeof HTMLElement<"u"&&t instanceof HTMLElement}function Ei(t,e,i){return Os(t)?(setTimeout(function(){i(null,t)}),t):Ro(t,e,i)}function Si(t,e,i){i=i||at.textureOptions;const s=i.target||rt;if(t.bindTexture(s,e),i.color===!1)return;const a=Io(i.color);if(s===nt)for(let r=0;r<6;++r)t.texImage2D(ui+r,0,p,1,1,0,p,N,a);else s===gt||s===vt?t.texImage3D(s,0,p,1,1,1,0,p,N,a):t.texImage2D(s,0,p,1,1,0,p,N,a)}function po(t,e,i,s){return s=s||te,i=i||at.textureOptions,Si(t,e,i),i=Object.assign({},i),Ei(i.src,i.crossOrigin,function(r,o){r?s(r,e,o):(Fs(t,e,o,i),s(null,e,o))})}function Co(t,e,i,s){s=s||te;const a=i.src;if(a.length!==6)throw"there must be 6 urls for a cubemap";const r=i.level||0,o=i.internalFormat||i.format||p,n=Yt(o),h=i.format||n.format,f=i.type||N,u=i.target||rt;if(u!==nt)throw"target must be TEXTURE_CUBE_MAP";Si(t,e,i),i=Object.assign({},i);let c=6;const l=[],m=Mi(t,i);let _;function d(y){return function(v,S){--c,v?l.push(v):S.width!==S.height?l.push("cubemap face img is not a square: "+S.src):(Rt(t,i),t.bindTexture(u,e),c===5?Mi().forEach(function(M){t.texImage2D(M,r,o,h,f,S)}):t.texImage2D(y,r,o,h,f,S),Jt(i)&&t.generateMipmap(u)),c===0&&s(l.length?l:void 0,e,_)}}_=a.map(function(y,v){return Ei(y,i.crossOrigin,d(m[v]))})}function Fo(t,e,i,s){s=s||te;const a=i.src,r=i.internalFormat||i.format||p,o=Yt(r),n=i.format||o.format,h=i.type||N,f=i.target||vt;if(f!==gt&&f!==vt)throw"target must be TEXTURE_3D or TEXTURE_2D_ARRAY";Si(t,e,i),i=Object.assign({},i);let u=a.length;const c=[];let l;const m=i.level||0;let _=i.width,d=i.height;const y=a.length;let v=!0;function S(M){return function(P,w){if(--u,P)c.push(P);else{if(Rt(t,i),t.bindTexture(f,e),v){v=!1,_=i.width||w.width,d=i.height||w.height,t.texImage3D(f,m,r,_,d,y,0,n,h,null);for(let A=0;A<y;++A)t.texSubImage3D(f,m,0,0,A,_,d,1,n,h,w)}else{let A=w,G;(w.width!==_||w.height!==d)&&(G=gs(),A=G.canvas,G.canvas.width=_,G.canvas.height=d,G.drawImage(w,0,0,_,d)),t.texSubImage3D(f,m,0,0,M,_,d,1,n,h,A),G&&A===G.canvas&&(G.canvas.width=0,G.canvas.height=0)}Jt(i)&&t.generateMipmap(f)}u===0&&s(c.length?c:void 0,e,l)}}l=a.map(function(M,P){return Ei(M,i.crossOrigin,S(P))})}function Oo(t,e,i,s){s=s||at.textureOptions;const a=s.target||rt;t.bindTexture(a,e);let r=s.width,o=s.height,n=s.depth;const h=s.level||0,f=s.internalFormat||s.format||p,u=Yt(f),c=s.format||u.format,l=s.type||Ao(t,i,u.type);if(Kt(i))i instanceof Uint8ClampedArray&&(i=new Uint8Array(i.buffer));else{const y=ns(l);i=new y(i)}const m=Po(f,l),_=i.byteLength/m;if(_%1)throw"length wrong size for format: "+ys(t,c);let d;if(a===gt||a===vt)if(!r&&!o&&!n){const y=Math.cbrt(_);if(y%1!==0)throw"can't guess cube size of array of numElements: "+_;r=y,o=y,n=y}else r&&(!o||!n)?(d=Ne(t,a,o,n,_/r),o=d.width,n=d.height):o&&(!r||!n)?(d=Ne(t,a,r,n,_/o),r=d.width,n=d.height):(d=Ne(t,a,r,o,_/n),r=d.width,o=d.height);else d=Ne(t,a,r,o,_),r=d.width,o=d.height;if(ps(t),t.pixelStorei(di,s.unpackAlignment||1),Rt(t,s),a===nt){const y=m/i.BYTES_PER_ELEMENT,v=_/6*y;xi(t,s).forEach(S=>{const M=v*S.ndx,P=i.subarray(M,M+v);t.texImage2D(S.face,h,f,r,o,0,c,l,P)})}else a===gt||a===vt?t.texImage3D(a,h,f,r,o,n,0,c,l,i):t.texImage2D(a,h,f,r,o,0,c,l,i);return{width:r,height:o,depth:n,type:l}}function Lo(t,e,i){const s=i.target||rt;t.bindTexture(s,e);const a=i.level||0,r=i.internalFormat||i.format||p,o=Yt(r),n=i.format||o.format,h=i.type||o.type;if(Rt(t,i),s===nt)for(let f=0;f<6;++f)t.texImage2D(ui+f,a,r,i.width,i.height,0,n,h,null);else s===gt||s===vt?t.texImage3D(s,a,r,i.width,i.height,i.depth,0,n,h,null):t.texImage2D(s,a,r,i.width,i.height,0,n,h,null)}function Uo(t,e,i){i=i||te,e=e||at.textureOptions;const s=t.createTexture(),a=e.target||rt;let r=e.width||1,o=e.height||1;const n=e.internalFormat||p;t.bindTexture(a,s),a===nt&&(t.texParameteri(a,Pe,Se),t.texParameteri(a,be,Se));let h=e.src;if(h)if(typeof h=="function"&&(h=h(t,e)),typeof h=="string")po(t,s,e,i);else if(Kt(h)||Array.isArray(h)&&(typeof h[0]=="number"||Array.isArray(h[0])||Kt(h[0]))){const f=Oo(t,s,h,e);r=f.width,o=f.height}else Array.isArray(h)&&(typeof h[0]=="string"||Os(h[0]))?a===nt?Co(t,s,e,i):Fo(t,s,e,i):(Fs(t,s,h,e),r=h.width,o=h.height);else Lo(t,s,e);return Jt(e)&&vi(t,s,e,r,o,n),Cs(t,s,e),s}const Pi=os;function Ls(t){return typeof document<"u"&&document.getElementById?document.getElementById(t):null}const Re=33984,pe=34962,Do=34963,Bo=35713,ko=35714,$o=35632,zo=35633,qo=35981,Us=35718,jo=35721,Vo=35971,Ho=35382,Wo=35396,Xo=35398,Ko=35392,Qo=35395,Ce=5126,Ds=35664,Bs=35665,ks=35666,bi=5124,$s=35667,zs=35668,qs=35669,js=35670,Vs=35671,Hs=35672,Ws=35673,Xs=35674,Ks=35675,Qs=35676,Zo=35678,Yo=35680,Jo=35679,th=35682,eh=35685,ih=35686,sh=35687,ah=35688,rh=35689,nh=35690,oh=36289,hh=36292,fh=36293,wi=5125,Zs=36294,Ys=36295,Js=36296,lh=36298,ch=36299,uh=36300,_h=36303,mh=36306,dh=36307,yh=36308,gh=36311,Fe=3553,Oe=34067,Ai=32879,Le=35866,b={};function ta(t,e){return b[e].bindPoint}function vh(t,e){return function(i){t.uniform1f(e,i)}}function Mh(t,e){return function(i){t.uniform1fv(e,i)}}function xh(t,e){return function(i){t.uniform2fv(e,i)}}function Eh(t,e){return function(i){t.uniform3fv(e,i)}}function Sh(t,e){return function(i){t.uniform4fv(e,i)}}function ea(t,e){return function(i){t.uniform1i(e,i)}}function ia(t,e){return function(i){t.uniform1iv(e,i)}}function sa(t,e){return function(i){t.uniform2iv(e,i)}}function aa(t,e){return function(i){t.uniform3iv(e,i)}}function ra(t,e){return function(i){t.uniform4iv(e,i)}}function Ph(t,e){return function(i){t.uniform1ui(e,i)}}function bh(t,e){return function(i){t.uniform1uiv(e,i)}}function wh(t,e){return function(i){t.uniform2uiv(e,i)}}function Ah(t,e){return function(i){t.uniform3uiv(e,i)}}function Gh(t,e){return function(i){t.uniform4uiv(e,i)}}function Ih(t,e){return function(i){t.uniformMatrix2fv(e,!1,i)}}function Th(t,e){return function(i){t.uniformMatrix3fv(e,!1,i)}}function Nh(t,e){return function(i){t.uniformMatrix4fv(e,!1,i)}}function Rh(t,e){return function(i){t.uniformMatrix2x3fv(e,!1,i)}}function ph(t,e){return function(i){t.uniformMatrix3x2fv(e,!1,i)}}function Ch(t,e){return function(i){t.uniformMatrix2x4fv(e,!1,i)}}function Fh(t,e){return function(i){t.uniformMatrix4x2fv(e,!1,i)}}function Oh(t,e){return function(i){t.uniformMatrix3x4fv(e,!1,i)}}function Lh(t,e){return function(i){t.uniformMatrix4x3fv(e,!1,i)}}function $(t,e,i,s){const a=ta(t,e);return Xt(t)?function(r){let o,n;!r||fs(t,r)?(o=r,n=null):(o=r.texture,n=r.sampler),t.uniform1i(s,i),t.activeTexture(Re+i),t.bindTexture(a,o),t.bindSampler(i,n)}:function(r){t.uniform1i(s,i),t.activeTexture(Re+i),t.bindTexture(a,r)}}function z(t,e,i,s,a){const r=ta(t,e),o=new Int32Array(a);for(let n=0;n<a;++n)o[n]=i+n;return Xt(t)?function(n){t.uniform1iv(s,o),n.forEach(function(h,f){t.activeTexture(Re+o[f]);let u,c;!h||fs(t,h)?(u=h,c=null):(u=h.texture,c=h.sampler),t.bindSampler(i,c),t.bindTexture(r,u)})}:function(n){t.uniform1iv(s,o),n.forEach(function(h,f){t.activeTexture(Re+o[f]),t.bindTexture(r,h)})}}b[Ce]={Type:Float32Array,size:4,setter:vh,arraySetter:Mh},b[Ds]={Type:Float32Array,size:8,setter:xh,cols:2},b[Bs]={Type:Float32Array,size:12,setter:Eh,cols:3},b[ks]={Type:Float32Array,size:16,setter:Sh,cols:4},b[bi]={Type:Int32Array,size:4,setter:ea,arraySetter:ia},b[$s]={Type:Int32Array,size:8,setter:sa,cols:2},b[zs]={Type:Int32Array,size:12,setter:aa,cols:3},b[qs]={Type:Int32Array,size:16,setter:ra,cols:4},b[wi]={Type:Uint32Array,size:4,setter:Ph,arraySetter:bh},b[Zs]={Type:Uint32Array,size:8,setter:wh,cols:2},b[Ys]={Type:Uint32Array,size:12,setter:Ah,cols:3},b[Js]={Type:Uint32Array,size:16,setter:Gh,cols:4},b[js]={Type:Uint32Array,size:4,setter:ea,arraySetter:ia},b[Vs]={Type:Uint32Array,size:8,setter:sa,cols:2},b[Hs]={Type:Uint32Array,size:12,setter:aa,cols:3},b[Ws]={Type:Uint32Array,size:16,setter:ra,cols:4},b[Xs]={Type:Float32Array,size:32,setter:Ih,rows:2,cols:2},b[Ks]={Type:Float32Array,size:48,setter:Th,rows:3,cols:3},b[Qs]={Type:Float32Array,size:64,setter:Nh,rows:4,cols:4},b[eh]={Type:Float32Array,size:32,setter:Rh,rows:2,cols:3},b[ih]={Type:Float32Array,size:32,setter:Ch,rows:2,cols:4},b[sh]={Type:Float32Array,size:48,setter:ph,rows:3,cols:2},b[ah]={Type:Float32Array,size:48,setter:Oh,rows:3,cols:4},b[rh]={Type:Float32Array,size:64,setter:Fh,rows:4,cols:2},b[nh]={Type:Float32Array,size:64,setter:Lh,rows:4,cols:3},b[Zo]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Fe},b[Yo]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Oe},b[Jo]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Ai},b[th]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Fe},b[oh]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Le},b[hh]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Le},b[fh]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Oe},b[lh]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Fe},b[ch]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Ai},b[uh]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Oe},b[_h]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Le},b[mh]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Fe},b[dh]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Ai},b[yh]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Oe},b[gh]={Type:null,size:0,setter:$,arraySetter:z,bindPoint:Le};function Ue(t,e){return function(i){if(i.value)switch(t.disableVertexAttribArray(e),i.value.length){case 4:t.vertexAttrib4fv(e,i.value);break;case 3:t.vertexAttrib3fv(e,i.value);break;case 2:t.vertexAttrib2fv(e,i.value);break;case 1:t.vertexAttrib1fv(e,i.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else t.bindBuffer(pe,i.buffer),t.enableVertexAttribArray(e),t.vertexAttribPointer(e,i.numComponents||i.size,i.type||Ce,i.normalize||!1,i.stride||0,i.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(e,i.divisor||0)}}function ht(t,e){return function(i){if(i.value)if(t.disableVertexAttribArray(e),i.value.length===4)t.vertexAttrib4iv(e,i.value);else throw new Error("The length of an integer constant value must be 4!");else t.bindBuffer(pe,i.buffer),t.enableVertexAttribArray(e),t.vertexAttribIPointer(e,i.numComponents||i.size,i.type||bi,i.stride||0,i.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(e,i.divisor||0)}}function De(t,e){return function(i){if(i.value)if(t.disableVertexAttribArray(e),i.value.length===4)t.vertexAttrib4uiv(e,i.value);else throw new Error("The length of an unsigned integer constant value must be 4!");else t.bindBuffer(pe,i.buffer),t.enableVertexAttribArray(e),t.vertexAttribIPointer(e,i.numComponents||i.size,i.type||wi,i.stride||0,i.offset||0),t.vertexAttribDivisor&&t.vertexAttribDivisor(e,i.divisor||0)}}function Gi(t,e,i){const s=i.size,a=i.count;return function(r){t.bindBuffer(pe,r.buffer);const o=r.size||r.numComponents||s,n=o/a,h=r.type||Ce,u=b[h].size*o,c=r.normalize||!1,l=r.offset||0,m=u/a;for(let _=0;_<a;++_)t.enableVertexAttribArray(e+_),t.vertexAttribPointer(e+_,n,h,c,u,l+m*_),t.vertexAttribDivisor&&t.vertexAttribDivisor(e+_,r.divisor||0)}}const O={};O[Ce]={size:4,setter:Ue},O[Ds]={size:8,setter:Ue},O[Bs]={size:12,setter:Ue},O[ks]={size:16,setter:Ue},O[bi]={size:4,setter:ht},O[$s]={size:8,setter:ht},O[zs]={size:12,setter:ht},O[qs]={size:16,setter:ht},O[wi]={size:4,setter:De},O[Zs]={size:8,setter:De},O[Ys]={size:12,setter:De},O[Js]={size:16,setter:De},O[js]={size:4,setter:ht},O[Vs]={size:8,setter:ht},O[Hs]={size:12,setter:ht},O[Ws]={size:16,setter:ht},O[Xs]={size:4,setter:Gi,count:2},O[Ks]={size:9,setter:Gi,count:3},O[Qs]={size:16,setter:Gi,count:4};const Uh=/ERROR:\s*\d+:(\d+)/gi;function Dh(t,e="",i=0){const s=[...e.matchAll(Uh)],a=new Map(s.map((r,o)=>{const n=parseInt(r[1]),h=s[o+1],f=h?h.index:e.length,u=e.substring(r.index,f);return[n-1,u]}));return t.split(`
|
|
4
|
+
`).map((r,o)=>{const n=a.get(o);return`${o+1+i}: ${r}${n?`
|
|
5
|
+
|
|
6
|
+
^^^ ${n}`:""}`}).join(`
|
|
7
|
+
`)}const na=/^[ \t]*\n/;function oa(t){let e=0;return na.test(t)&&(e=1,t=t.replace(na,"")),{lineOffset:e,shaderSource:t}}function Bh(t,e){return t.errorCallback(e),t.callback&&setTimeout(()=>{t.callback(`${e}
|
|
8
|
+
${t.errors.join(`
|
|
9
|
+
`)}`)}),null}function kh(t,e,i,s){if(s=s||Pi,!t.getShaderParameter(i,Bo)){const r=t.getShaderInfoLog(i),{lineOffset:o,shaderSource:n}=oa(t.getShaderSource(i)),h=`${Dh(n,r,o)}
|
|
10
|
+
Error compiling ${ys(t,e)}: ${r}`;return s(h),h}return""}function Ii(t,e,i){let s,a,r;if(typeof e=="function"&&(i=e,e=void 0),typeof t=="function")i=t,t=void 0;else if(t&&!Array.isArray(t)){const f=t;i=f.errorCallback,t=f.attribLocations,s=f.transformFeedbackVaryings,a=f.transformFeedbackMode,r=f.callback}const o=i||Pi,n=[],h={errorCallback(f,...u){n.push(f),o(f,...u)},transformFeedbackVaryings:s,transformFeedbackMode:a,callback:r,errors:n};{let f={};Array.isArray(t)?t.forEach(function(u,c){f[u]=e?e[c]:c}):f=t||{},h.attribLocations=f}return h}const $h=["VERTEX_SHADER","FRAGMENT_SHADER"];function zh(t,e){if(e.indexOf("frag")>=0)return $o;if(e.indexOf("vert")>=0)return zo}function qh(t,e,i){const s=t.getAttachedShaders(e);for(const a of s)i.has(a)&&t.deleteShader(a);t.deleteProgram(e)}const jh=(t=0)=>new Promise(e=>setTimeout(e,t));function Vh(t,e,i){const s=t.createProgram(),{attribLocations:a,transformFeedbackVaryings:r,transformFeedbackMode:o}=Ii(i);for(let n=0;n<e.length;++n){let h=e[n];if(typeof h=="string"){const f=Ls(h),u=f?f.text:h;let c=t[$h[n]];f&&f.type&&(c=zh(t,f.type)||c),h=t.createShader(c),t.shaderSource(h,oa(u).shaderSource),t.compileShader(h),t.attachShader(s,h)}}Object.entries(a).forEach(([n,h])=>t.bindAttribLocation(s,h,n));{let n=r;n&&(n.attribs&&(n=n.attribs),Array.isArray(n)||(n=Object.keys(n)),t.transformFeedbackVaryings(s,n,o||qo))}return t.linkProgram(s),s}function Hh(t,e,i,s,a){const r=Ii(i,s,a),o=new Set(e),n=Vh(t,e,r);function h(f,u){const c=Xh(f,u,r.errorCallback);return c&&qh(f,u,o),c}if(r.callback){Wh(t,n).then(()=>{const f=h(t,n);r.callback(f,f?void 0:n)});return}return h(t,n)?void 0:n}async function Wh(t,e){const i=t.getExtension("KHR_parallel_shader_compile"),s=i?(r,o)=>r.getProgramParameter(o,i.COMPLETION_STATUS_KHR):()=>!0;let a=0;do await jh(a),a=1e3/60;while(!s(t,e))}function Xh(t,e,i){if(i=i||Pi,!t.getProgramParameter(e,ko)){const a=t.getProgramInfoLog(e);i(`Error in program linking: ${a}`);const o=t.getAttachedShaders(e).map(n=>kh(t,t.getShaderParameter(n,t.SHADER_TYPE),n,i));return`${a}
|
|
11
|
+
${o.filter(n=>n).join(`
|
|
12
|
+
`)}`}}function Kh(t,e,i,s,a){return Hh(t,e,i,s,a)}function ha(t){const e=t.name;return e.startsWith("gl_")||e.startsWith("webgl_")}const Qh=/(\.|\[|]|\w+)/g,Zh=t=>t>="0"&&t<="9";function Yh(t,e,i,s){const a=t.split(Qh).filter(n=>n!=="");let r=0,o="";for(;;){const n=a[r++];o+=n;const h=Zh(n[0]),f=h?parseInt(n):n;if(h&&(o+=a[r++]),r===a.length){i[f]=e;break}else{const c=a[r++],l=c==="[",m=i[f]||(l?[]:{});i[f]=m,i=m,s[o]=s[o]||function(_){return function(d){fa(_,d)}}(m),o+=c}}}function Jh(t,e){let i=0;function s(n,h,f){const u=h.name.endsWith("[0]"),c=h.type,l=b[c];if(!l)throw new Error(`unknown type: 0x${c.toString(16)}`);let m;if(l.bindPoint){const _=i;i+=h.size,u?m=l.arraySetter(t,c,_,f,h.size):m=l.setter(t,c,_,f,h.size)}else l.arraySetter&&u?m=l.arraySetter(t,f):m=l.setter(t,f);return m.location=f,m}const a={},r={},o=t.getProgramParameter(e,Us);for(let n=0;n<o;++n){const h=t.getActiveUniform(e,n);if(ha(h))continue;let f=h.name;f.endsWith("[0]")&&(f=f.substr(0,f.length-3));const u=t.getUniformLocation(e,h.name);if(u){const c=s(e,h,u);a[f]=c,Yh(f,c,r,a)}}return a}function t0(t,e){const i={},s=t.getProgramParameter(e,Vo);for(let a=0;a<s;++a){const r=t.getTransformFeedbackVarying(e,a);i[r.name]={index:a,type:r.type,size:r.size}}return i}function e0(t,e){const i=t.getProgramParameter(e,Us),s=[],a=[];for(let n=0;n<i;++n){a.push(n),s.push({});const h=t.getActiveUniform(e,n);s[n].name=h.name}[["UNIFORM_TYPE","type"],["UNIFORM_SIZE","size"],["UNIFORM_BLOCK_INDEX","blockNdx"],["UNIFORM_OFFSET","offset"]].forEach(function(n){const h=n[0],f=n[1];t.getActiveUniforms(e,a,t[h]).forEach(function(u,c){s[c][f]=u})});const r={},o=t.getProgramParameter(e,Ho);for(let n=0;n<o;++n){const h=t.getActiveUniformBlockName(e,n),f={index:t.getUniformBlockIndex(e,h),usedByVertexShader:t.getActiveUniformBlockParameter(e,n,Wo),usedByFragmentShader:t.getActiveUniformBlockParameter(e,n,Xo),size:t.getActiveUniformBlockParameter(e,n,Ko),uniformIndices:t.getActiveUniformBlockParameter(e,n,Qo)};f.used=f.usedByVertexShader||f.usedByFragmentShader,r[h]=f}return{blockSpecs:r,uniformData:s}}function fa(t,e){for(const i in e){const s=t[i];typeof s=="function"?s(e[i]):fa(t[i],e[i])}}function Ti(t,...e){const i=t.uniformSetters||t,s=e.length;for(let a=0;a<s;++a){const r=e[a];if(Array.isArray(r)){const o=r.length;for(let n=0;n<o;++n)Ti(i,r[n])}else for(const o in r){const n=i[o];n&&n(r[o])}}}function i0(t,e){const i={},s=t.getProgramParameter(e,jo);for(let a=0;a<s;++a){const r=t.getActiveAttrib(e,a);if(ha(r))continue;const o=t.getAttribLocation(e,r.name),n=O[r.type],h=n.setter(t,o,n);h.location=o,i[r.name]=h}return i}function s0(t,e){for(const i in e){const s=t[i];s&&s(e[i])}}function la(t,e,i){i.vertexArrayObject?t.bindVertexArray(i.vertexArrayObject):(s0(e.attribSetters||e,i.attribs),i.indices&&t.bindBuffer(Do,i.indices))}function ca(t,e){const i=Jh(t,e),s=i0(t,e),a={program:e,uniformSetters:i,attribSetters:s};return Xt(t)&&(a.uniformBlockSpec=e0(t,e),a.transformFeedbackInfo=t0(t,e)),a}const a0=/\s|{|}|;/;function Ni(t,e,i,s,a){const r=Ii(i,s,a),o=[];if(e=e.map(function(f){if(!a0.test(f)){const u=Ls(f);if(u)f=u.text;else{const c=`no element with id: ${f}`;r.errorCallback(c),o.push(c)}}return f}),o.length)return Bh(r,"");const n=r.callback;n&&(r.callback=(f,u)=>{n(f,f?void 0:ca(t,u))});const h=Kh(t,e,r);return h?ca(t,h):null}function r0(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");for(var e=1;e<=60;++e)t("EPSG:"+(32600+e),"+proj=utm +zone="+e+" +datum=WGS84 +units=m"),t("EPSG:"+(32700+e),"+proj=utm +zone="+e+" +south +datum=WGS84 +units=m");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"]}var Et=1,St=2,pt=3,n0=4,Ri=5,ua=6378137,o0=6356752314e-3,_a=.0066943799901413165,ee=484813681109536e-20,g=Math.PI/2,h0=.16666666666666666,f0=.04722222222222222,l0=.022156084656084655,x=1e-10,U=.017453292519943295,et=57.29577951308232,I=Math.PI/4,ie=Math.PI*2,F=3.14159265359,V={};V.greenwich=0,V.lisbon=-9.131906111111,V.paris=2.337229166667,V.bogota=-74.080916666667,V.madrid=-3.687938888889,V.rome=12.452333333333,V.bern=7.439583333333,V.jakarta=106.807719444444,V.ferro=-17.666666666667,V.brussels=4.367975,V.stockholm=18.058277777778,V.athens=23.7163375,V.oslo=10.722916666667;const c0={mm:{to_meter:.001},cm:{to_meter:.01},ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937},fath:{to_meter:1.8288},kmi:{to_meter:1852},"us-ch":{to_meter:20.1168402336805},"us-mi":{to_meter:1609.34721869444},km:{to_meter:1e3},"ind-ft":{to_meter:.30479841},"ind-yd":{to_meter:.91439523},mi:{to_meter:1609.344},yd:{to_meter:.9144},ch:{to_meter:20.1168},link:{to_meter:.201168},dm:{to_meter:.1},in:{to_meter:.0254},"ind-ch":{to_meter:20.11669506},"us-in":{to_meter:.025400050800101},"us-yd":{to_meter:.914401828803658}};var ma=/[\s_\-\/\(\)]/g;function ft(t,e){if(t[e])return t[e];for(var i=Object.keys(t),s=e.toLowerCase().replace(ma,""),a=-1,r,o;++a<i.length;)if(r=i[a],o=r.toLowerCase().replace(ma,""),o===s)return t[r]}function pi(t){var e={},i=t.split("+").map(function(n){return n.trim()}).filter(function(n){return n}).reduce(function(n,h){var f=h.split("=");return f.push(!0),n[f[0].toLowerCase()]=f[1],n},{}),s,a,r,o={proj:"projName",datum:"datumCode",rf:function(n){e.rf=parseFloat(n)},lat_0:function(n){e.lat0=n*U},lat_1:function(n){e.lat1=n*U},lat_2:function(n){e.lat2=n*U},lat_ts:function(n){e.lat_ts=n*U},lon_0:function(n){e.long0=n*U},lon_1:function(n){e.long1=n*U},lon_2:function(n){e.long2=n*U},alpha:function(n){e.alpha=parseFloat(n)*U},gamma:function(n){e.rectified_grid_angle=parseFloat(n)*U},lonc:function(n){e.longc=n*U},x_0:function(n){e.x0=parseFloat(n)},y_0:function(n){e.y0=parseFloat(n)},k_0:function(n){e.k0=parseFloat(n)},k:function(n){e.k0=parseFloat(n)},a:function(n){e.a=parseFloat(n)},b:function(n){e.b=parseFloat(n)},r:function(n){e.a=e.b=parseFloat(n)},r_a:function(){e.R_A=!0},zone:function(n){e.zone=parseInt(n,10)},south:function(){e.utmSouth=!0},towgs84:function(n){e.datum_params=n.split(",").map(function(h){return parseFloat(h)})},to_meter:function(n){e.to_meter=parseFloat(n)},units:function(n){e.units=n;var h=ft(c0,n);h&&(e.to_meter=h.to_meter)},from_greenwich:function(n){e.from_greenwich=n*U},pm:function(n){var h=ft(V,n);e.from_greenwich=(h||parseFloat(n))*U},nadgrids:function(n){n==="@null"?e.datumCode="none":e.nadgrids=n},axis:function(n){var h="ewnsud";n.length===3&&h.indexOf(n.substr(0,1))!==-1&&h.indexOf(n.substr(1,1))!==-1&&h.indexOf(n.substr(2,1))!==-1&&(e.axis=n)},approx:function(){e.approx=!0}};for(s in i)a=i[s],s in o?(r=o[s],typeof r=="function"?r(a):e[r]=a):e[s]=a;return typeof e.datumCode=="string"&&e.datumCode!=="WGS84"&&(e.datumCode=e.datumCode.toLowerCase()),e}class da{static getId(e){const i=e.find(s=>Array.isArray(s)&&s[0]==="ID");return i&&i.length>=3?{authority:i[1],code:parseInt(i[2],10)}:null}static convertUnit(e,i="unit"){if(!e||e.length<3)return{type:i,name:"unknown",conversion_factor:null};const s=e[1],a=parseFloat(e[2])||null,r=e.find(n=>Array.isArray(n)&&n[0]==="ID"),o=r?{authority:r[1],code:parseInt(r[2],10)}:null;return{type:i,name:s,conversion_factor:a,id:o}}static convertAxis(e){const i=e[1]||"Unknown";let s;const a=i.match(/^\((.)\)$/);if(a){const f=a[1].toUpperCase();if(f==="E")s="east";else if(f==="N")s="north";else if(f==="U")s="up";else throw new Error(`Unknown axis abbreviation: ${f}`)}else s=e[2]?e[2].toLowerCase():"unknown";const r=e.find(f=>Array.isArray(f)&&f[0]==="ORDER"),o=r?parseInt(r[1],10):null,n=e.find(f=>Array.isArray(f)&&(f[0]==="LENGTHUNIT"||f[0]==="ANGLEUNIT"||f[0]==="SCALEUNIT")),h=this.convertUnit(n);return{name:i,direction:s,unit:h,order:o}}static extractAxes(e){return e.filter(i=>Array.isArray(i)&&i[0]==="AXIS").map(i=>this.convertAxis(i)).sort((i,s)=>(i.order||0)-(s.order||0))}static convert(e,i={}){switch(e[0]){case"PROJCRS":i.type="ProjectedCRS",i.name=e[1],i.base_crs=e.find(l=>Array.isArray(l)&&l[0]==="BASEGEOGCRS")?this.convert(e.find(l=>Array.isArray(l)&&l[0]==="BASEGEOGCRS")):null,i.conversion=e.find(l=>Array.isArray(l)&&l[0]==="CONVERSION")?this.convert(e.find(l=>Array.isArray(l)&&l[0]==="CONVERSION")):null;const s=e.find(l=>Array.isArray(l)&&l[0]==="CS");s&&(i.coordinate_system={type:s[1],axis:this.extractAxes(e)});const a=e.find(l=>Array.isArray(l)&&l[0]==="LENGTHUNIT");if(a){const l=this.convertUnit(a);i.coordinate_system.unit=l}i.id=this.getId(e);break;case"BASEGEOGCRS":case"GEOGCRS":i.type="GeographicCRS",i.name=e[1];const r=e.find(l=>Array.isArray(l)&&(l[0]==="DATUM"||l[0]==="ENSEMBLE"));if(r){const l=this.convert(r);r[0]==="ENSEMBLE"?i.datum_ensemble=l:i.datum=l;const m=e.find(_=>Array.isArray(_)&&_[0]==="PRIMEM");m&&m[1]!=="Greenwich"&&(l.prime_meridian={name:m[1],longitude:parseFloat(m[2])})}i.coordinate_system={type:"ellipsoidal",axis:this.extractAxes(e)},i.id=this.getId(e);break;case"DATUM":i.type="GeodeticReferenceFrame",i.name=e[1],i.ellipsoid=e.find(l=>Array.isArray(l)&&l[0]==="ELLIPSOID")?this.convert(e.find(l=>Array.isArray(l)&&l[0]==="ELLIPSOID")):null;break;case"ENSEMBLE":i.type="DatumEnsemble",i.name=e[1],i.members=e.filter(l=>Array.isArray(l)&&l[0]==="MEMBER").map(l=>({type:"DatumEnsembleMember",name:l[1],id:this.getId(l)}));const o=e.find(l=>Array.isArray(l)&&l[0]==="ENSEMBLEACCURACY");o&&(i.accuracy=parseFloat(o[1]));const n=e.find(l=>Array.isArray(l)&&l[0]==="ELLIPSOID");n&&(i.ellipsoid=this.convert(n)),i.id=this.getId(e);break;case"ELLIPSOID":i.type="Ellipsoid",i.name=e[1],i.semi_major_axis=parseFloat(e[2]),i.inverse_flattening=parseFloat(e[3]),e.find(l=>Array.isArray(l)&&l[0]==="LENGTHUNIT")&&this.convert(e.find(l=>Array.isArray(l)&&l[0]==="LENGTHUNIT"),i);break;case"CONVERSION":i.type="Conversion",i.name=e[1],i.method=e.find(l=>Array.isArray(l)&&l[0]==="METHOD")?this.convert(e.find(l=>Array.isArray(l)&&l[0]==="METHOD")):null,i.parameters=e.filter(l=>Array.isArray(l)&&l[0]==="PARAMETER").map(l=>this.convert(l));break;case"METHOD":i.type="Method",i.name=e[1],i.id=this.getId(e);break;case"PARAMETER":i.type="Parameter",i.name=e[1],i.value=parseFloat(e[2]),i.unit=this.convertUnit(e.find(l=>Array.isArray(l)&&(l[0]==="LENGTHUNIT"||l[0]==="ANGLEUNIT"||l[0]==="SCALEUNIT"))),i.id=this.getId(e);break;case"BOUNDCRS":i.type="BoundCRS";const h=e.find(l=>Array.isArray(l)&&l[0]==="SOURCECRS");if(h){const l=h.find(m=>Array.isArray(m));i.source_crs=l?this.convert(l):null}const f=e.find(l=>Array.isArray(l)&&l[0]==="TARGETCRS");if(f){const l=f.find(m=>Array.isArray(m));i.target_crs=l?this.convert(l):null}const u=e.find(l=>Array.isArray(l)&&l[0]==="ABRIDGEDTRANSFORMATION");u?i.transformation=this.convert(u):i.transformation=null;break;case"ABRIDGEDTRANSFORMATION":if(i.type="Transformation",i.name=e[1],i.method=e.find(l=>Array.isArray(l)&&l[0]==="METHOD")?this.convert(e.find(l=>Array.isArray(l)&&l[0]==="METHOD")):null,i.parameters=e.filter(l=>Array.isArray(l)&&(l[0]==="PARAMETER"||l[0]==="PARAMETERFILE")).map(l=>{if(l[0]==="PARAMETER")return this.convert(l);if(l[0]==="PARAMETERFILE")return{name:l[1],value:l[2],id:{authority:"EPSG",code:8656}}}),i.parameters.length===7){const l=i.parameters[6];l.name==="Scale difference"&&(l.value=Math.round((l.value-1)*1e12)/1e6)}i.id=this.getId(e);break;case"AXIS":i.coordinate_system||(i.coordinate_system={type:"unspecified",axis:[]}),i.coordinate_system.axis.push(this.convertAxis(e));break;case"LENGTHUNIT":const c=this.convertUnit(e,"LinearUnit");i.coordinate_system&&i.coordinate_system.axis&&i.coordinate_system.axis.forEach(l=>{l.unit||(l.unit=c)}),c.conversion_factor&&c.conversion_factor!==1&&i.semi_major_axis&&(i.semi_major_axis={value:i.semi_major_axis,unit:c});break;default:i.keyword=e[0];break}return i}}class u0 extends da{static convert(e,i={}){return super.convert(e,i),i.coordinate_system&&i.coordinate_system.subtype==="Cartesian"&&delete i.coordinate_system,i.usage&&delete i.usage,i}}class _0 extends da{static convert(e,i={}){super.convert(e,i);const s=e.find(r=>Array.isArray(r)&&r[0]==="CS");s&&(i.coordinate_system={subtype:s[1],axis:this.extractAxes(e)});const a=e.find(r=>Array.isArray(r)&&r[0]==="USAGE");if(a){const r=a.find(h=>Array.isArray(h)&&h[0]==="SCOPE"),o=a.find(h=>Array.isArray(h)&&h[0]==="AREA"),n=a.find(h=>Array.isArray(h)&&h[0]==="BBOX");i.usage={},r&&(i.usage.scope=r[1]),o&&(i.usage.area=o[1]),n&&(i.usage.bbox=n.slice(1))}return i}}function m0(t){return t.find(e=>Array.isArray(e)&&e[0]==="USAGE")?"2019":(t.find(e=>Array.isArray(e)&&e[0]==="CS")||t[0]==="BOUNDCRS"||t[0]==="PROJCRS"||t[0]==="GEOGCRS","2015")}function d0(t){return(m0(t)==="2019"?_0:u0).convert(t)}function y0(t){const e=t.toUpperCase();return e.includes("PROJCRS")||e.includes("GEOGCRS")||e.includes("BOUNDCRS")||e.includes("VERTCRS")||e.includes("LENGTHUNIT")||e.includes("ANGLEUNIT")||e.includes("SCALEUNIT")?"WKT2":(e.includes("PROJCS")||e.includes("GEOGCS")||e.includes("LOCAL_CS")||e.includes("VERT_CS")||e.includes("UNIT"),"WKT1")}var se=1,ya=2,ga=3,Be=4,va=5,Ci=-1,g0=/\s/,v0=/[A-Za-z]/,M0=/[A-Za-z84_]/,ke=/[,\]]/,Ma=/[\d\.E\-\+]/;function st(t){if(typeof t!="string")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=se}st.prototype.readCharicter=function(){var t=this.text[this.place++];if(this.state!==Be)for(;g0.test(t);){if(this.place>=this.text.length)return;t=this.text[this.place++]}switch(this.state){case se:return this.neutral(t);case ya:return this.keyword(t);case Be:return this.quoted(t);case va:return this.afterquote(t);case ga:return this.number(t);case Ci:return}},st.prototype.afterquote=function(t){if(t==='"'){this.word+='"',this.state=Be;return}if(ke.test(t)){this.word=this.word.trim(),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in afterquote yet, index '+this.place)},st.prototype.afterItem=function(t){if(t===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=se;return}if(t==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=se,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Ci);return}},st.prototype.number=function(t){if(Ma.test(t)){this.word+=t;return}if(ke.test(t)){this.word=parseFloat(this.word),this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in number yet, index '+this.place)},st.prototype.quoted=function(t){if(t==='"'){this.state=va;return}this.word+=t},st.prototype.keyword=function(t){if(M0.test(t)){this.word+=t;return}if(t==="["){var e=[];e.push(this.word),this.level++,this.root===null?this.root=e:this.currentObject.push(e),this.stack.push(this.currentObject),this.currentObject=e,this.state=se;return}if(ke.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in keyword yet, index '+this.place)},st.prototype.neutral=function(t){if(v0.test(t)){this.word=t,this.state=ya;return}if(t==='"'){this.word="",this.state=Be;return}if(Ma.test(t)){this.word=t,this.state=ga;return}if(ke.test(t)){this.afterItem(t);return}throw new Error(`havn't handled "`+t+'" in neutral yet, index '+this.place)},st.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===Ci)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function x0(t){var e=new st(t);return e.output()}function Fi(t,e,i){Array.isArray(e)&&(i.unshift(e),e=null);var s=e?{}:t,a=i.reduce(function(r,o){return Ct(o,r),r},s);e&&(t[e]=a)}function Ct(t,e){if(!Array.isArray(t)){e[t]=!0;return}var i=t.shift();if(i==="PARAMETER"&&(i=t.shift()),t.length===1){if(Array.isArray(t[0])){e[i]={},Ct(t[0],e[i]);return}e[i]=t[0];return}if(!t.length){e[i]=!0;return}if(i==="TOWGS84"){e[i]=t;return}if(i==="AXIS"){i in e||(e[i]=[]),e[i].push(t);return}Array.isArray(i)||(e[i]={});var s;switch(i){case"UNIT":case"PRIMEM":case"VERT_DATUM":e[i]={name:t[0].toLowerCase(),convert:t[1]},t.length===3&&Ct(t[2],e[i]);return;case"SPHEROID":case"ELLIPSOID":e[i]={name:t[0],a:t[1],rf:t[2]},t.length===4&&Ct(t[3],e[i]);return;case"EDATUM":case"ENGINEERINGDATUM":case"LOCAL_DATUM":case"DATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":t[0]=["name",t[0]],Fi(e,i,t);return;case"COMPD_CS":case"COMPOUNDCRS":case"FITTED_CS":case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"ENGCRS":case"ENGINEERINGCRS":t[0]=["name",t[0]],Fi(e,i,t),e[i].type=i;return;default:for(s=-1;++s<t.length;)if(!Array.isArray(t[s]))return Ct(t,e[i]);return Fi(e,i,t)}}var E0=.017453292519943295;function Z(t){return t*E0}function xa(t){const e=(t.projName||"").toLowerCase().replace(/_/g," ");!t.long0&&t.longc&&(e==="albers conic equal area"||e==="lambert azimuthal equal area")&&(t.long0=t.longc),!t.lat_ts&&t.lat1&&(e==="stereographic south pole"||e==="polar stereographic (variant b)")?(t.lat0=Z(t.lat1>0?90:-90),t.lat_ts=t.lat1,delete t.lat1):!t.lat_ts&&t.lat0&&(e==="polar stereographic"||e==="polar stereographic (variant a)")&&(t.lat_ts=t.lat0,t.lat0=Z(t.lat0>0?90:-90),delete t.lat1)}function Ea(t){let e={units:null,to_meter:void 0};return typeof t=="string"?(e.units=t.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.units==="meter"&&(e.to_meter=1)):t&&t.name&&(e.units=t.name.toLowerCase(),e.units==="metre"&&(e.units="meter"),e.to_meter=t.conversion_factor),e}function Sa(t){return typeof t=="object"?t.value*t.unit.conversion_factor:t}function Pa(t,e){t.ellipsoid.radius?(e.a=t.ellipsoid.radius,e.rf=0):(e.a=Sa(t.ellipsoid.semi_major_axis),t.ellipsoid.inverse_flattening!==void 0?e.rf=t.ellipsoid.inverse_flattening:t.ellipsoid.semi_major_axis!==void 0&&t.ellipsoid.semi_minor_axis!==void 0&&(e.rf=e.a/(e.a-Sa(t.ellipsoid.semi_minor_axis))))}function $e(t,e={}){return!t||typeof t!="object"?t:t.type==="BoundCRS"?($e(t.source_crs,e),t.transformation&&(t.transformation.method&&t.transformation.method.name==="NTv2"?e.nadgrids=t.transformation.parameters[0].value:e.datum_params=t.transformation.parameters.map(i=>i.value)),e):(Object.keys(t).forEach(i=>{const s=t[i];if(s!==null)switch(i){case"name":if(e.srsCode)break;e.name=s,e.srsCode=s;break;case"type":s==="GeographicCRS"?e.projName="longlat":s==="ProjectedCRS"&&t.conversion&&t.conversion.method&&(e.projName=t.conversion.method.name);break;case"datum":case"datum_ensemble":s.ellipsoid&&(e.ellps=s.ellipsoid.name,Pa(s,e)),s.prime_meridian&&(e.from_greenwich=s.prime_meridian.longitude*Math.PI/180);break;case"ellipsoid":e.ellps=s.name,Pa(s,e);break;case"prime_meridian":e.long0=(s.longitude||0)*Math.PI/180;break;case"coordinate_system":if(s.axis){if(e.axis=s.axis.map(a=>{const r=a.direction;if(r==="east")return"e";if(r==="north")return"n";if(r==="west")return"w";if(r==="south")return"s";throw new Error(`Unknown axis direction: ${r}`)}).join("")+"u",s.unit){const{units:a,to_meter:r}=Ea(s.unit);e.units=a,e.to_meter=r}else if(s.axis[0]&&s.axis[0].unit){const{units:a,to_meter:r}=Ea(s.axis[0].unit);e.units=a,e.to_meter=r}}break;case"id":s.authority&&s.code&&(e.title=s.authority+":"+s.code);break;case"conversion":s.method&&s.method.name&&(e.projName=s.method.name),s.parameters&&s.parameters.forEach(a=>{const r=a.name.toLowerCase().replace(/\s+/g,"_"),o=a.value;a.unit&&a.unit.conversion_factor?e[r]=o*a.unit.conversion_factor:a.unit==="degree"?e[r]=o*Math.PI/180:e[r]=o});break;case"unit":s.name&&(e.units=s.name.toLowerCase(),e.units==="metre"&&(e.units="meter")),s.conversion_factor&&(e.to_meter=s.conversion_factor);break;case"base_crs":$e(s,e),e.datumCode=s.id?s.id.authority+"_"+s.id.code:s.name;break}}),e.latitude_of_false_origin!==void 0&&(e.lat0=e.latitude_of_false_origin),e.longitude_of_false_origin!==void 0&&(e.long0=e.longitude_of_false_origin),e.latitude_of_standard_parallel!==void 0&&(e.lat0=e.latitude_of_standard_parallel,e.lat1=e.latitude_of_standard_parallel),e.latitude_of_1st_standard_parallel!==void 0&&(e.lat1=e.latitude_of_1st_standard_parallel),e.latitude_of_2nd_standard_parallel!==void 0&&(e.lat2=e.latitude_of_2nd_standard_parallel),e.latitude_of_projection_centre!==void 0&&(e.lat0=e.latitude_of_projection_centre),e.longitude_of_projection_centre!==void 0&&(e.longc=e.longitude_of_projection_centre),e.easting_at_false_origin!==void 0&&(e.x0=e.easting_at_false_origin),e.northing_at_false_origin!==void 0&&(e.y0=e.northing_at_false_origin),e.latitude_of_natural_origin!==void 0&&(e.lat0=e.latitude_of_natural_origin),e.longitude_of_natural_origin!==void 0&&(e.long0=e.longitude_of_natural_origin),e.longitude_of_origin!==void 0&&(e.long0=e.longitude_of_origin),e.false_easting!==void 0&&(e.x0=e.false_easting),e.easting_at_projection_centre&&(e.x0=e.easting_at_projection_centre),e.false_northing!==void 0&&(e.y0=e.false_northing),e.northing_at_projection_centre&&(e.y0=e.northing_at_projection_centre),e.standard_parallel_1!==void 0&&(e.lat1=e.standard_parallel_1),e.standard_parallel_2!==void 0&&(e.lat2=e.standard_parallel_2),e.scale_factor_at_natural_origin!==void 0&&(e.k0=e.scale_factor_at_natural_origin),e.scale_factor_at_projection_centre!==void 0&&(e.k0=e.scale_factor_at_projection_centre),e.scale_factor_on_pseudo_standard_parallel!==void 0&&(e.k0=e.scale_factor_on_pseudo_standard_parallel),e.azimuth!==void 0&&(e.alpha=e.azimuth),e.azimuth_at_projection_centre!==void 0&&(e.alpha=e.azimuth_at_projection_centre),e.angle_from_rectified_to_skew_grid&&(e.rectified_grid_angle=e.angle_from_rectified_to_skew_grid),xa(e),e)}var S0=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function P0(t,e){var i=e[0],s=e[1];!(i in t)&&s in t&&(t[i]=t[s],e.length===3&&(t[i]=e[2](t[i])))}function ba(t){for(var e=Object.keys(t),i=0,s=e.length;i<s;++i){var a=e[i];S0.indexOf(a)!==-1&&b0(t[a]),typeof t[a]=="object"&&ba(t[a])}}function b0(t){if(t.AUTHORITY){var e=Object.keys(t.AUTHORITY)[0];e&&e in t.AUTHORITY&&(t.title=e+":"+t.AUTHORITY[e])}if(t.type==="GEOGCS"?t.projName="longlat":t.type==="LOCAL_CS"?(t.projName="identity",t.local=!0):typeof t.PROJECTION=="object"?t.projName=Object.keys(t.PROJECTION)[0]:t.projName=t.PROJECTION,t.AXIS){for(var i="",s=0,a=t.AXIS.length;s<a;++s){var r=[t.AXIS[s][0].toLowerCase(),t.AXIS[s][1].toLowerCase()];r[0].indexOf("north")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="north"?i+="n":r[0].indexOf("south")!==-1||(r[0]==="y"||r[0]==="lat")&&r[1]==="south"?i+="s":r[0].indexOf("east")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="east"?i+="e":(r[0].indexOf("west")!==-1||(r[0]==="x"||r[0]==="lon")&&r[1]==="west")&&(i+="w")}i.length===2&&(i+="u"),i.length===3&&(t.axis=i)}t.UNIT&&(t.units=t.UNIT.name.toLowerCase(),t.units==="metre"&&(t.units="meter"),t.UNIT.convert&&(t.type==="GEOGCS"?t.DATUM&&t.DATUM.SPHEROID&&(t.to_meter=t.UNIT.convert*t.DATUM.SPHEROID.a):t.to_meter=t.UNIT.convert));var o=t.GEOGCS;t.type==="GEOGCS"&&(o=t),o&&(o.DATUM?t.datumCode=o.DATUM.name.toLowerCase():t.datumCode=o.name.toLowerCase(),t.datumCode.slice(0,2)==="d_"&&(t.datumCode=t.datumCode.slice(2)),t.datumCode==="new_zealand_1949"&&(t.datumCode="nzgd49"),(t.datumCode==="wgs_1984"||t.datumCode==="world_geodetic_system_1984")&&(t.PROJECTION==="Mercator_Auxiliary_Sphere"&&(t.sphere=!0),t.datumCode="wgs84"),t.datumCode==="belge_1972"&&(t.datumCode="rnb72"),o.DATUM&&o.DATUM.SPHEROID&&(t.ellps=o.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),t.ellps.toLowerCase().slice(0,13)==="international"&&(t.ellps="intl"),t.a=o.DATUM.SPHEROID.a,t.rf=parseFloat(o.DATUM.SPHEROID.rf,10)),o.DATUM&&o.DATUM.TOWGS84&&(t.datum_params=o.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"),t.datumCode==="ch1903+"&&(t.datumCode="ch1903"),~t.datumCode.indexOf("israel")&&(t.datumCode="isr93")),t.b&&!isFinite(t.b)&&(t.b=t.a),t.rectified_grid_angle&&(t.rectified_grid_angle=Z(t.rectified_grid_angle));function n(u){var c=t.to_meter||1;return u*c}var h=function(u){return P0(t,u)},f=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",Z],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",Z],["x0","false_easting",n],["y0","false_northing",n],["long0","central_meridian",Z],["lat0","latitude_of_origin",Z],["lat0","standard_parallel_1",Z],["lat1","standard_parallel_1",Z],["lat2","standard_parallel_2",Z],["azimuth","Azimuth"],["alpha","azimuth",Z],["srsCode","name"]];f.forEach(h),xa(t)}function Oi(t){if(typeof t=="object")return $e(t);const e=y0(t);var i=x0(t);if(e==="WKT2"){const r=d0(i);return $e(r)}var s=i[0],a={};return Ct(i,a),ba(a),a[s]}function q(t){var e=this;if(arguments.length===2){var i=arguments[1];typeof i=="string"?i.charAt(0)==="+"?q[t]=pi(arguments[1]):q[t]=Oi(arguments[1]):q[t]=i}else if(arguments.length===1){if(Array.isArray(t))return t.map(function(s){return Array.isArray(s)?q.apply(e,s):q(s)});if(typeof t=="string"){if(t in q)return q[t]}else"EPSG"in t?q["EPSG:"+t.EPSG]=t:"ESRI"in t?q["ESRI:"+t.ESRI]=t:"IAU2000"in t?q["IAU2000:"+t.IAU2000]=t:console.log(t);return}}r0(q);function w0(t){return typeof t=="string"}function A0(t){return t in q}function G0(t){return t.indexOf("+")!==0&&t.indexOf("[")!==-1||typeof t=="object"&&!("srsCode"in t)}var I0=["3857","900913","3785","102113"];function T0(t){var e=ft(t,"authority");if(e){var i=ft(e,"epsg");return i&&I0.indexOf(i)>-1}}function N0(t){var e=ft(t,"extension");if(e)return ft(e,"proj4")}function R0(t){return t[0]==="+"}function p0(t){if(w0(t)){if(A0(t))return q[t];if(G0(t)){var e=Oi(t);if(T0(e))return q["EPSG:3857"];var i=N0(e);return i?pi(i):e}if(R0(t))return pi(t)}else return"projName"in t?t:Oi(t)}function wa(t,e){t=t||{};var i,s;if(!e)return t;for(s in e)i=e[s],i!==void 0&&(t[s]=i);return t}function it(t,e,i){var s=t*e;return i/Math.sqrt(1-s*s)}function ae(t){return t<0?-1:1}function E(t){return Math.abs(t)<=F?t:t-ae(t)*ie}function Y(t,e,i){var s=t*i,a=.5*t;return s=Math.pow((1-s)/(1+s),a),Math.tan(.5*(g-e))/s}function re(t,e){for(var i=.5*t,s,a,r=g-2*Math.atan(e),o=0;o<=15;o++)if(s=t*Math.sin(r),a=g-2*Math.atan(e*Math.pow((1-s)/(1+s),i))-r,r+=a,Math.abs(a)<=1e-10)return r;return-9999}function C0(){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=it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function F0(t){var e=t.x,i=t.y;if(i*et>90&&i*et<-90&&e*et>180&&e*et<-180)return null;var s,a;if(Math.abs(Math.abs(i)-g)<=x)return null;if(this.sphere)s=this.x0+this.a*this.k0*E(e-this.long0),a=this.y0+this.a*this.k0*Math.log(Math.tan(I+.5*i));else{var r=Math.sin(i),o=Y(this.e,i,r);s=this.x0+this.a*this.k0*E(e-this.long0),a=this.y0-this.a*this.k0*Math.log(o)}return t.x=s,t.y=a,t}function O0(t){var e=t.x-this.x0,i=t.y-this.y0,s,a;if(this.sphere)a=g-2*Math.atan(Math.exp(-i/(this.a*this.k0)));else{var r=Math.exp(-i/(this.a*this.k0));if(a=re(this.e,r),a===-9999)return null}return s=E(this.long0+e/(this.a*this.k0)),t.x=s,t.y=a,t}var L0=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","Mercator_Variant_A","merc"];const U0={init:C0,forward:F0,inverse:O0,names:L0};function D0(){}function Aa(t){return t}var B0=["longlat","identity"],k0=[U0,{init:D0,forward:Aa,inverse:Aa,names:B0}],Pt={},Ft=[];function Ga(t,e){var i=Ft.length;return t.names?(Ft[i]=t,t.names.forEach(function(s){Pt[s.toLowerCase()]=i}),this):(console.log(e),!0)}function Ia(t){return t.replace(/[-\(\)\s]+/g," ").trim().replace(/ /g,"_")}function $0(t){if(!t)return!1;var e=t.toLowerCase();if(typeof Pt[e]<"u"&&Ft[Pt[e]]||(e=Ia(e),e in Pt&&Ft[Pt[e]]))return Ft[Pt[e]]}function z0(){k0.forEach(Ga)}const q0={start:z0,add:Ga,get:$0};var Ta={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:6377563396e-3,b:635625691e-2,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:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"},andrae:{a:637710443e-2,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:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"},bess_nam:{a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"},clrk66:{a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"},clrk80:{a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."},clrk80ign:{a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"},clrk58:{a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"},CPM:{a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"},delmbr:{a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"},engelis:{a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"},evrst30:{a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"},evrst48:{a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"},evrst56:{a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"},evrst69:{a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"},evrstSS:{a:6377298556e-3,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:63781575e-1,b:63567722e-1,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:63567733205e-4,ellipseName:"Southeast Asia"},walbeck:{a:6376896,b:63558348467e-4,ellipseName:"Walbeck"},WGS60:{a:6378165,rf:298.3,ellipseName:"WGS 60"},WGS66:{a:6378145,rf:298.25,ellipseName:"WGS 66"},WGS7:{a:6378135,rf:298.26,ellipseName:"WGS 72"},WGS84:{a:6378137,rf:298.257223563,ellipseName:"WGS 84"},sphere:{a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"}};const j0=Ta.WGS84;function V0(t,e,i,s){var a=t*t,r=e*e,o=(a-r)/a,n=0;s?(t*=1-o*(h0+o*(f0+o*l0)),a=t*t,o=0):n=Math.sqrt(o);var h=(a-r)/r;return{es:o,e:n,ep2:h}}function H0(t,e,i,s,a){if(!t){var r=ft(Ta,s);r||(r=j0),t=r.a,e=r.b,i=r.rf}return i&&!e&&(e=(1-1/i)*t),(i===0||Math.abs(t-e)<x)&&(a=!0,e=t),{a:t,b:e,rf:i,sphere:a}}var ze={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:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"},carthage:{towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"},hermannskogel:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"},mgi:{towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Militar-Geographische Institut"},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:"Ordnance Survey of Great Britain 1936"},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"},EPSG_5451:{towgs84:"6.41,-49.05,-11.28,1.5657,0.5242,6.9718,-5.7649"},IGNF_LURESG:{towgs84:"-192.986,13.673,-39.309,-0.4099,-2.9332,2.6881,0.43"},EPSG_4614:{towgs84:"-119.4248,-303.65872,-11.00061,1.164298,0.174458,1.096259,3.657065"},EPSG_4615:{towgs84:"-494.088,-312.129,279.877,-1.423,-1.013,1.59,-0.748"},ESRI_37241:{towgs84:"-76.822,257.457,-12.817,2.136,-0.033,-2.392,-0.031"},ESRI_37249:{towgs84:"-440.296,58.548,296.265,1.128,10.202,4.559,-0.438"},ESRI_37245:{towgs84:"-511.151,-181.269,139.609,1.05,2.703,1.798,3.071"},EPSG_4178:{towgs84:"24.9,-126.4,-93.2,-0.063,-0.247,-0.041,1.01"},EPSG_4622:{towgs84:"-472.29,-5.63,-304.12,0.4362,-0.8374,0.2563,1.8984"},EPSG_4625:{towgs84:"126.93,547.94,130.41,-2.7867,5.1612,-0.8584,13.8227"},EPSG_5252:{towgs84:"0.023,0.036,-0.068,0.00176,0.00912,-0.01136,0.00439"},EPSG_4314:{towgs84:"597.1,71.4,412.1,0.894,0.068,-1.563,7.58"},EPSG_4282:{towgs84:"-178.3,-316.7,-131.5,5.278,6.077,10.979,19.166"},EPSG_4231:{towgs84:"-83.11,-97.38,-117.22,0.0276,-0.2167,0.2147,0.1218"},EPSG_4274:{towgs84:"-230.994,102.591,25.199,0.633,-0.239,0.9,1.95"},EPSG_4134:{towgs84:"-180.624,-225.516,173.919,-0.81,-1.898,8.336,16.71006"},EPSG_4254:{towgs84:"18.38,192.45,96.82,0.056,-0.142,-0.2,-0.0013"},EPSG_4159:{towgs84:"-194.513,-63.978,-25.759,-3.4027,3.756,-3.352,-0.9175"},EPSG_4687:{towgs84:"0.072,-0.507,-0.245,0.0183,-0.0003,0.007,-0.0093"},EPSG_4227:{towgs84:"-83.58,-397.54,458.78,-17.595,-2.847,4.256,3.225"},EPSG_4746:{towgs84:"599.4,72.4,419.2,-0.062,-0.022,-2.723,6.46"},EPSG_4745:{towgs84:"612.4,77,440.2,-0.054,0.057,-2.797,2.55"},EPSG_6311:{towgs84:"8.846,-4.394,-1.122,-0.00237,-0.146528,0.130428,0.783926"},EPSG_4289:{towgs84:"565.7381,50.4018,465.2904,-1.91514,1.60363,-9.09546,4.07244"},EPSG_4230:{towgs84:"-68.863,-134.888,-111.49,-0.53,-0.14,0.57,-3.4"},EPSG_4154:{towgs84:"-123.02,-158.95,-168.47"},EPSG_4156:{towgs84:"570.8,85.7,462.8,4.998,1.587,5.261,3.56"},EPSG_4299:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4179:{towgs84:"33.4,-146.6,-76.3,-0.359,-0.053,0.844,-0.84"},EPSG_4313:{towgs84:"-106.8686,52.2978,-103.7239,0.3366,-0.457,1.8422,-1.2747"},EPSG_4194:{towgs84:"163.511,127.533,-159.789"},EPSG_4195:{towgs84:"105,326,-102.5"},EPSG_4196:{towgs84:"-45,417,-3.5"},EPSG_4611:{towgs84:"-162.619,-276.959,-161.764,0.067753,-2.243649,-1.158827,-1.094246"},EPSG_4633:{towgs84:"137.092,131.66,91.475,-1.9436,-11.5993,-4.3321,-7.4824"},EPSG_4641:{towgs84:"-408.809,366.856,-412.987,1.8842,-0.5308,2.1655,-121.0993"},EPSG_4643:{towgs84:"-480.26,-438.32,-643.429,16.3119,20.1721,-4.0349,-111.7002"},EPSG_4300:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4188:{towgs84:"482.5,-130.6,564.6,-1.042,-0.214,-0.631,8.15"},EPSG_4660:{towgs84:"982.6087,552.753,-540.873,32.39344,-153.25684,-96.2266,16.805"},EPSG_4662:{towgs84:"97.295,-263.247,310.882,-1.5999,0.8386,3.1409,13.3259"},EPSG_3906:{towgs84:"577.88891,165.22205,391.18289,4.9145,-0.94729,-13.05098,7.78664"},EPSG_4307:{towgs84:"-209.3622,-87.8162,404.6198,0.0046,3.4784,0.5805,-1.4547"},EPSG_6892:{towgs84:"-76.269,-16.683,68.562,-6.275,10.536,-4.286,-13.686"},EPSG_4690:{towgs84:"221.597,152.441,176.523,2.403,1.3893,0.884,11.4648"},EPSG_4691:{towgs84:"218.769,150.75,176.75,3.5231,2.0037,1.288,10.9817"},EPSG_4629:{towgs84:"72.51,345.411,79.241,-1.5862,-0.8826,-0.5495,1.3653"},EPSG_4630:{towgs84:"165.804,216.213,180.26,-0.6251,-0.4515,-0.0721,7.4111"},EPSG_4692:{towgs84:"217.109,86.452,23.711,0.0183,-0.0003,0.007,-0.0093"},EPSG_9333:{towgs84:"0,0,0,-8.393,0.749,-10.276,0"},EPSG_9059:{towgs84:"0,0,0"},EPSG_4312:{towgs84:"601.705,84.263,485.227,4.7354,1.3145,5.393,-2.3887"},EPSG_4123:{towgs84:"-96.062,-82.428,-121.753,4.801,0.345,-1.376,1.496"},EPSG_4309:{towgs84:"-124.45,183.74,44.64,-0.4384,0.5446,-0.9706,-2.1365"},ESRI_104106:{towgs84:"-283.088,-70.693,117.445,-1.157,0.059,-0.652,-4.058"},EPSG_4281:{towgs84:"-219.247,-73.802,269.529"},EPSG_4322:{towgs84:"0,0,4.5"},EPSG_4324:{towgs84:"0,0,1.9"},EPSG_4284:{towgs84:"43.822,-108.842,-119.585,1.455,-0.761,0.737,0.549"},EPSG_4277:{towgs84:"446.448,-125.157,542.06,0.15,0.247,0.842,-20.489"},EPSG_4207:{towgs84:"-282.1,-72.2,120,-1.529,0.145,-0.89,-4.46"},EPSG_4688:{towgs84:"347.175,1077.618,2623.677,33.9058,-70.6776,9.4013,186.0647"},EPSG_4689:{towgs84:"410.793,54.542,80.501,-2.5596,-2.3517,-0.6594,17.3218"},EPSG_4720:{towgs84:"0,0,4.5"},EPSG_4273:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},EPSG_4240:{towgs84:"204.64,834.74,293.8"},EPSG_4817:{towgs84:"278.3,93,474.5,7.889,0.05,-6.61,6.21"},ESRI_104131:{towgs84:"426.62,142.62,460.09,4.98,4.49,-12.42,-17.1"},EPSG_4265:{towgs84:"-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68"},EPSG_4263:{towgs84:"-111.92,-87.85,114.5,1.875,0.202,0.219,0.032"},EPSG_4298:{towgs84:"-689.5937,623.84046,-65.93566,-0.02331,1.17094,-0.80054,5.88536"},EPSG_4270:{towgs84:"-253.4392,-148.452,386.5267,0.15605,0.43,-0.1013,-0.0424"},EPSG_4229:{towgs84:"-121.8,98.1,-10.7"},EPSG_4220:{towgs84:"-55.5,-348,-229.2"},EPSG_4214:{towgs84:"12.646,-155.176,-80.863"},EPSG_4232:{towgs84:"-345,3,223"},EPSG_4238:{towgs84:"-1.977,-13.06,-9.993,0.364,0.254,0.689,-1.037"},EPSG_4168:{towgs84:"-170,33,326"},EPSG_4131:{towgs84:"199,931,318.9"},EPSG_4152:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_5228:{towgs84:"572.213,85.334,461.94,4.9732,1.529,5.2484,3.5378"},EPSG_8351:{towgs84:"485.021,169.465,483.839,7.786342,4.397554,4.102655,0"},EPSG_4683:{towgs84:"-127.62,-67.24,-47.04,-3.068,4.903,1.578,-1.06"},EPSG_4133:{towgs84:"0,0,0"},EPSG_7373:{towgs84:"0.819,-0.5762,-1.6446,-0.00378,-0.03317,0.00318,0.0693"},EPSG_9075:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9072:{towgs84:"-0.9102,2.0141,0.5602,0.029039,0.010065,0.010101,0"},EPSG_9294:{towgs84:"1.16835,-1.42001,-2.24431,-0.00822,-0.05508,0.01818,0.23388"},EPSG_4212:{towgs84:"-267.434,173.496,181.814,-13.4704,8.7154,7.3926,14.7492"},EPSG_4191:{towgs84:"-44.183,-0.58,-38.489,2.3867,2.7072,-3.5196,-8.2703"},EPSG_4237:{towgs84:"52.684,-71.194,-13.975,-0.312,-0.1063,-0.3729,1.0191"},EPSG_4740:{towgs84:"-1.08,-0.27,-0.9"},EPSG_4124:{towgs84:"419.3836,99.3335,591.3451,0.850389,1.817277,-7.862238,-0.99496"},EPSG_5681:{towgs84:"584.9636,107.7175,413.8067,1.1155,0.2824,-3.1384,7.9922"},EPSG_4141:{towgs84:"23.772,17.49,17.859,-0.3132,-1.85274,1.67299,-5.4262"},EPSG_4204:{towgs84:"-85.645,-273.077,-79.708,2.289,-1.421,2.532,3.194"},EPSG_4319:{towgs84:"226.702,-193.337,-35.371,-2.229,-4.391,9.238,0.9798"},EPSG_4200:{towgs84:"24.82,-131.21,-82.66"},EPSG_4130:{towgs84:"0,0,0"},EPSG_4127:{towgs84:"-82.875,-57.097,-156.768,-2.158,1.524,-0.982,-0.359"},EPSG_4149:{towgs84:"674.374,15.056,405.346"},EPSG_4617:{towgs84:"-0.991,1.9072,0.5129,1.25033e-7,4.6785e-8,5.6529e-8,0"},EPSG_4663:{towgs84:"-210.502,-66.902,-48.476,2.094,-15.067,-5.817,0.485"},EPSG_4664:{towgs84:"-211.939,137.626,58.3,-0.089,0.251,0.079,0.384"},EPSG_4665:{towgs84:"-105.854,165.589,-38.312,-0.003,-0.026,0.024,-0.048"},EPSG_4666:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},EPSG_4756:{towgs84:"-192.873,-39.382,-111.202,-0.00205,-0.0005,0.00335,0.0188"},EPSG_4723:{towgs84:"-179.483,-69.379,-27.584,-7.862,8.163,6.042,-13.925"},EPSG_4726:{towgs84:"8.853,-52.644,180.304,-0.393,-2.323,2.96,-24.081"},EPSG_4267:{towgs84:"-8.0,160.0,176.0"},EPSG_5365:{towgs84:"-0.16959,0.35312,0.51846,0.03385,-0.16325,0.03446,0.03693"},EPSG_4218:{towgs84:"304.5,306.5,-318.1"},EPSG_4242:{towgs84:"-33.722,153.789,94.959,-8.581,-4.478,4.54,8.95"},EPSG_4216:{towgs84:"-292.295,248.758,429.447,4.9971,2.99,6.6906,1.0289"},ESRI_104105:{towgs84:"631.392,-66.551,481.442,1.09,-4.445,-4.487,-4.43"},ESRI_104129:{towgs84:"0,0,0"},EPSG_4673:{towgs84:"174.05,-25.49,112.57"},EPSG_4202:{towgs84:"-124,-60,154"},EPSG_4203:{towgs84:"-117.763,-51.51,139.061,0.292,0.443,0.277,-0.191"},EPSG_3819:{towgs84:"595.48,121.69,515.35,4.115,-2.9383,0.853,-3.408"},EPSG_8694:{towgs84:"-93.799,-132.737,-219.073,-1.844,0.648,-6.37,-0.169"},EPSG_4145:{towgs84:"275.57,676.78,229.6"},EPSG_4283:{towgs84:"61.55,-10.87,-40.19,39.4924,32.7221,32.8979,-9.994"},EPSG_4317:{towgs84:"2.3287,-147.0425,-92.0802,-0.3092483,0.32482185,0.49729934,5.68906266"},EPSG_4272:{towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993"},EPSG_4248:{towgs84:"-307.7,265.3,-363.5"},EPSG_5561:{towgs84:"24,-121,-76"},EPSG_5233:{towgs84:"-0.293,766.95,87.713,0.195704,1.695068,3.473016,-0.039338"},ESRI_104130:{towgs84:"-86,-98,-119"},ESRI_104102:{towgs84:"682,-203,480"},ESRI_37207:{towgs84:"7,-10,-26"},EPSG_4675:{towgs84:"59.935,118.4,-10.871"},ESRI_104109:{towgs84:"-89.121,-348.182,260.871"},ESRI_104112:{towgs84:"-185.583,-230.096,281.361"},ESRI_104113:{towgs84:"25.1,-275.6,222.6"},IGNF_WGS72G:{towgs84:"0,12,6"},IGNF_NTFG:{towgs84:"-168,-60,320"},IGNF_EFATE57G:{towgs84:"-127,-769,472"},IGNF_PGP50G:{towgs84:"324.8,153.6,172.1"},IGNF_REUN47G:{towgs84:"94,-948,-1262"},IGNF_CSG67G:{towgs84:"-186,230,110"},IGNF_GUAD48G:{towgs84:"-467,-16,-300"},IGNF_TAHI51G:{towgs84:"162,117,154"},IGNF_TAHAAG:{towgs84:"65,342,77"},IGNF_NUKU72G:{towgs84:"84,274,65"},IGNF_PETRELS72G:{towgs84:"365,194,166"},IGNF_WALL78G:{towgs84:"253,-133,-127"},IGNF_MAYO50G:{towgs84:"-382,-59,-262"},IGNF_TANNAG:{towgs84:"-139,-967,436"},IGNF_IGN72G:{towgs84:"-13,-348,292"},IGNF_ATIGG:{towgs84:"1118,23,66"},IGNF_FANGA84G:{towgs84:"150.57,158.33,118.32"},IGNF_RUSAT84G:{towgs84:"202.13,174.6,-15.74"},IGNF_KAUE70G:{towgs84:"126.74,300.1,-75.49"},IGNF_MOP90G:{towgs84:"-10.8,-1.8,12.77"},IGNF_MHPF67G:{towgs84:"338.08,212.58,-296.17"},IGNF_TAHI79G:{towgs84:"160.61,116.05,153.69"},IGNF_ANAA92G:{towgs84:"1.5,3.84,4.81"},IGNF_MARQUI72G:{towgs84:"330.91,-13.92,58.56"},IGNF_APAT86G:{towgs84:"143.6,197.82,74.05"},IGNF_TUBU69G:{towgs84:"237.17,171.61,-77.84"},IGNF_STPM50G:{towgs84:"11.363,424.148,373.13"},EPSG_4150:{towgs84:"674.374,15.056,405.346"},EPSG_4754:{towgs84:"-208.4058,-109.8777,-2.5764"},ESRI_104101:{towgs84:"374,150,588"},EPSG_4693:{towgs84:"0,-0.15,0.68"},EPSG_6207:{towgs84:"293.17,726.18,245.36"},EPSG_4153:{towgs84:"-133.63,-157.5,-158.62"},EPSG_4132:{towgs84:"-241.54,-163.64,396.06"},EPSG_4221:{towgs84:"-154.5,150.7,100.4"},EPSG_4266:{towgs84:"-80.7,-132.5,41.1"},EPSG_4193:{towgs84:"-70.9,-151.8,-41.4"},EPSG_5340:{towgs84:"-0.41,0.46,-0.35"},EPSG_4246:{towgs84:"-294.7,-200.1,525.5"},EPSG_4318:{towgs84:"-3.2,-5.7,2.8"},EPSG_4121:{towgs84:"-199.87,74.79,246.62"},EPSG_4223:{towgs84:"-260.1,5.5,432.2"},EPSG_4158:{towgs84:"-0.465,372.095,171.736"},EPSG_4285:{towgs84:"-128.16,-282.42,21.93"},EPSG_4613:{towgs84:"-404.78,685.68,45.47"},EPSG_4607:{towgs84:"195.671,332.517,274.607"},EPSG_4475:{towgs84:"-381.788,-57.501,-256.673"},EPSG_4208:{towgs84:"-157.84,308.54,-146.6"},EPSG_4743:{towgs84:"70.995,-335.916,262.898"},EPSG_4710:{towgs84:"-323.65,551.39,-491.22"},EPSG_7881:{towgs84:"-0.077,0.079,0.086"},EPSG_4682:{towgs84:"283.729,735.942,261.143"},EPSG_4739:{towgs84:"-156,-271,-189"},EPSG_4679:{towgs84:"-80.01,253.26,291.19"},EPSG_4750:{towgs84:"-56.263,16.136,-22.856"},EPSG_4644:{towgs84:"-10.18,-350.43,291.37"},EPSG_4695:{towgs84:"-103.746,-9.614,-255.95"},EPSG_4292:{towgs84:"-355,21,72"},EPSG_4302:{towgs84:"-61.702,284.488,472.052"},EPSG_4143:{towgs84:"-124.76,53,466.79"},EPSG_4606:{towgs84:"-153,153,307"},EPSG_4699:{towgs84:"-770.1,158.4,-498.2"},EPSG_4247:{towgs84:"-273.5,110.6,-357.9"},EPSG_4160:{towgs84:"8.88,184.86,106.69"},EPSG_4161:{towgs84:"-233.43,6.65,173.64"},EPSG_9251:{towgs84:"-9.5,122.9,138.2"},EPSG_9253:{towgs84:"-78.1,101.6,133.3"},EPSG_4297:{towgs84:"-198.383,-240.517,-107.909"},EPSG_4269:{towgs84:"0,0,0"},EPSG_4301:{towgs84:"-147,506,687"},EPSG_4618:{towgs84:"-59,-11,-52"},EPSG_4612:{towgs84:"0,0,0"},EPSG_4678:{towgs84:"44.585,-131.212,-39.544"},EPSG_4250:{towgs84:"-130,29,364"},EPSG_4144:{towgs84:"214,804,268"},EPSG_4147:{towgs84:"-17.51,-108.32,-62.39"},EPSG_4259:{towgs84:"-254.1,-5.36,-100.29"},EPSG_4164:{towgs84:"-76,-138,67"},EPSG_4211:{towgs84:"-378.873,676.002,-46.255"},EPSG_4182:{towgs84:"-422.651,-172.995,84.02"},EPSG_4224:{towgs84:"-143.87,243.37,-33.52"},EPSG_4225:{towgs84:"-205.57,168.77,-4.12"},EPSG_5527:{towgs84:"-67.35,3.88,-38.22"},EPSG_4752:{towgs84:"98,390,-22"},EPSG_4310:{towgs84:"-30,190,89"},EPSG_9248:{towgs84:"-192.26,65.72,132.08"},EPSG_4680:{towgs84:"124.5,-63.5,-281"},EPSG_4701:{towgs84:"-79.9,-158,-168.9"},EPSG_4706:{towgs84:"-146.21,112.63,4.05"},EPSG_4805:{towgs84:"682,-203,480"},EPSG_4201:{towgs84:"-165,-11,206"},EPSG_4210:{towgs84:"-157,-2,-299"},EPSG_4183:{towgs84:"-104,167,-38"},EPSG_4139:{towgs84:"11,72,-101"},EPSG_4668:{towgs84:"-86,-98,-119"},EPSG_4717:{towgs84:"-2,151,181"},EPSG_4732:{towgs84:"102,52,-38"},EPSG_4280:{towgs84:"-377,681,-50"},EPSG_4209:{towgs84:"-138,-105,-289"},EPSG_4261:{towgs84:"31,146,47"},EPSG_4658:{towgs84:"-73,46,-86"},EPSG_4721:{towgs84:"265.025,384.929,-194.046"},EPSG_4222:{towgs84:"-136,-108,-292"},EPSG_4601:{towgs84:"-255,-15,71"},EPSG_4602:{towgs84:"725,685,536"},EPSG_4603:{towgs84:"72,213.7,93"},EPSG_4605:{towgs84:"9,183,236"},EPSG_4621:{towgs84:"137,248,-430"},EPSG_4657:{towgs84:"-28,199,5"},EPSG_4316:{towgs84:"103.25,-100.4,-307.19"},EPSG_4642:{towgs84:"-13,-348,292"},EPSG_4698:{towgs84:"145,-187,103"},EPSG_4192:{towgs84:"-206.1,-174.7,-87.7"},EPSG_4311:{towgs84:"-265,120,-358"},EPSG_4135:{towgs84:"58,-283,-182"},ESRI_104138:{towgs84:"198,-226,-347"},EPSG_4245:{towgs84:"-11,851,5"},EPSG_4142:{towgs84:"-125,53,467"},EPSG_4213:{towgs84:"-106,-87,188"},EPSG_4253:{towgs84:"-133,-77,-51"},EPSG_4129:{towgs84:"-132,-110,-335"},EPSG_4713:{towgs84:"-77,-128,142"},EPSG_4239:{towgs84:"217,823,299"},EPSG_4146:{towgs84:"295,736,257"},EPSG_4155:{towgs84:"-83,37,124"},EPSG_4165:{towgs84:"-173,253,27"},EPSG_4672:{towgs84:"175,-38,113"},EPSG_4236:{towgs84:"-637,-549,-203"},EPSG_4251:{towgs84:"-90,40,88"},EPSG_4271:{towgs84:"-2,374,172"},EPSG_4175:{towgs84:"-88,4,101"},EPSG_4716:{towgs84:"298,-304,-375"},EPSG_4315:{towgs84:"-23,259,-9"},EPSG_4744:{towgs84:"-242.2,-144.9,370.3"},EPSG_4244:{towgs84:"-97,787,86"},EPSG_4293:{towgs84:"616,97,-251"},EPSG_4714:{towgs84:"-127,-769,472"},EPSG_4736:{towgs84:"260,12,-147"},EPSG_6883:{towgs84:"-235,-110,393"},EPSG_6894:{towgs84:"-63,176,185"},EPSG_4205:{towgs84:"-43,-163,45"},EPSG_4256:{towgs84:"41,-220,-134"},EPSG_4262:{towgs84:"639,405,60"},EPSG_4604:{towgs84:"174,359,365"},EPSG_4169:{towgs84:"-115,118,426"},EPSG_4620:{towgs84:"-106,-129,165"},EPSG_4184:{towgs84:"-203,141,53"},EPSG_4616:{towgs84:"-289,-124,60"},EPSG_9403:{towgs84:"-307,-92,127"},EPSG_4684:{towgs84:"-133,-321,50"},EPSG_4708:{towgs84:"-491,-22,435"},EPSG_4707:{towgs84:"114,-116,-333"},EPSG_4709:{towgs84:"145,75,-272"},EPSG_4712:{towgs84:"-205,107,53"},EPSG_4711:{towgs84:"124,-234,-25"},EPSG_4718:{towgs84:"230,-199,-752"},EPSG_4719:{towgs84:"211,147,111"},EPSG_4724:{towgs84:"208,-435,-229"},EPSG_4725:{towgs84:"189,-79,-202"},EPSG_4735:{towgs84:"647,1777,-1124"},EPSG_4722:{towgs84:"-794,119,-298"},EPSG_4728:{towgs84:"-307,-92,127"},EPSG_4734:{towgs84:"-632,438,-609"},EPSG_4727:{towgs84:"912,-58,1227"},EPSG_4729:{towgs84:"185,165,42"},EPSG_4730:{towgs84:"170,42,84"},EPSG_4733:{towgs84:"276,-57,149"},ESRI_37218:{towgs84:"230,-199,-752"},ESRI_37240:{towgs84:"-7,215,225"},ESRI_37221:{towgs84:"252,-209,-751"},ESRI_4305:{towgs84:"-123,-206,219"},ESRI_104139:{towgs84:"-73,-247,227"},EPSG_4748:{towgs84:"51,391,-36"},EPSG_4219:{towgs84:"-384,664,-48"},EPSG_4255:{towgs84:"-333,-222,114"},EPSG_4257:{towgs84:"-587.8,519.75,145.76"},EPSG_4646:{towgs84:"-963,510,-359"},EPSG_6881:{towgs84:"-24,-203,268"},EPSG_6882:{towgs84:"-183,-15,273"},EPSG_4715:{towgs84:"-104,-129,239"},IGNF_RGF93GDD:{towgs84:"0,0,0"},IGNF_RGM04GDD:{towgs84:"0,0,0"},IGNF_RGSPM06GDD:{towgs84:"0,0,0"},IGNF_RGTAAF07GDD:{towgs84:"0,0,0"},IGNF_RGFG95GDD:{towgs84:"0,0,0"},IGNF_RGNCG:{towgs84:"0,0,0"},IGNF_RGPFGDD:{towgs84:"0,0,0"},IGNF_ETRS89G:{towgs84:"0,0,0"},IGNF_RGR92GDD:{towgs84:"0,0,0"},EPSG_4173:{towgs84:"0,0,0"},EPSG_4180:{towgs84:"0,0,0"},EPSG_4619:{towgs84:"0,0,0"},EPSG_4667:{towgs84:"0,0,0"},EPSG_4075:{towgs84:"0,0,0"},EPSG_6706:{towgs84:"0,0,0"},EPSG_7798:{towgs84:"0,0,0"},EPSG_4661:{towgs84:"0,0,0"},EPSG_4669:{towgs84:"0,0,0"},EPSG_8685:{towgs84:"0,0,0"},EPSG_4151:{towgs84:"0,0,0"},EPSG_9702:{towgs84:"0,0,0"},EPSG_4758:{towgs84:"0,0,0"},EPSG_4761:{towgs84:"0,0,0"},EPSG_4765:{towgs84:"0,0,0"},EPSG_8997:{towgs84:"0,0,0"},EPSG_4023:{towgs84:"0,0,0"},EPSG_4670:{towgs84:"0,0,0"},EPSG_4694:{towgs84:"0,0,0"},EPSG_4148:{towgs84:"0,0,0"},EPSG_4163:{towgs84:"0,0,0"},EPSG_4167:{towgs84:"0,0,0"},EPSG_4189:{towgs84:"0,0,0"},EPSG_4190:{towgs84:"0,0,0"},EPSG_4176:{towgs84:"0,0,0"},EPSG_4659:{towgs84:"0,0,0"},EPSG_3824:{towgs84:"0,0,0"},EPSG_3889:{towgs84:"0,0,0"},EPSG_4046:{towgs84:"0,0,0"},EPSG_4081:{towgs84:"0,0,0"},EPSG_4558:{towgs84:"0,0,0"},EPSG_4483:{towgs84:"0,0,0"},EPSG_5013:{towgs84:"0,0,0"},EPSG_5264:{towgs84:"0,0,0"},EPSG_5324:{towgs84:"0,0,0"},EPSG_5354:{towgs84:"0,0,0"},EPSG_5371:{towgs84:"0,0,0"},EPSG_5373:{towgs84:"0,0,0"},EPSG_5381:{towgs84:"0,0,0"},EPSG_5393:{towgs84:"0,0,0"},EPSG_5489:{towgs84:"0,0,0"},EPSG_5593:{towgs84:"0,0,0"},EPSG_6135:{towgs84:"0,0,0"},EPSG_6365:{towgs84:"0,0,0"},EPSG_5246:{towgs84:"0,0,0"},EPSG_7886:{towgs84:"0,0,0"},EPSG_8431:{towgs84:"0,0,0"},EPSG_8427:{towgs84:"0,0,0"},EPSG_8699:{towgs84:"0,0,0"},EPSG_8818:{towgs84:"0,0,0"},EPSG_4757:{towgs84:"0,0,0"},EPSG_9140:{towgs84:"0,0,0"},EPSG_8086:{towgs84:"0,0,0"},EPSG_4686:{towgs84:"0,0,0"},EPSG_4737:{towgs84:"0,0,0"},EPSG_4702:{towgs84:"0,0,0"},EPSG_4747:{towgs84:"0,0,0"},EPSG_4749:{towgs84:"0,0,0"},EPSG_4674:{towgs84:"0,0,0"},EPSG_4755:{towgs84:"0,0,0"},EPSG_4759:{towgs84:"0,0,0"},EPSG_4762:{towgs84:"0,0,0"},EPSG_4763:{towgs84:"0,0,0"},EPSG_4764:{towgs84:"0,0,0"},EPSG_4166:{towgs84:"0,0,0"},EPSG_4170:{towgs84:"0,0,0"},EPSG_5546:{towgs84:"0,0,0"},EPSG_7844:{towgs84:"0,0,0"},EPSG_4818:{towgs84:"589,76,480"}};for(var W0 in ze){var Li=ze[W0];Li.datumName&&(ze[Li.datumName]=Li)}function X0(t,e,i,s,a,r,o){var n={};return t===void 0||t==="none"?n.datum_type=Ri:n.datum_type=n0,e&&(n.datum_params=e.map(parseFloat),(n.datum_params[0]!==0||n.datum_params[1]!==0||n.datum_params[2]!==0)&&(n.datum_type=Et),n.datum_params.length>3&&(n.datum_params[3]!==0||n.datum_params[4]!==0||n.datum_params[5]!==0||n.datum_params[6]!==0)&&(n.datum_type=St,n.datum_params[3]*=ee,n.datum_params[4]*=ee,n.datum_params[5]*=ee,n.datum_params[6]=n.datum_params[6]/1e6+1)),o&&(n.datum_type=pt,n.grids=o),n.a=i,n.b=s,n.es=a,n.ep2=r,n}var Ui={};function K0(t,e,i){return e instanceof ArrayBuffer?Q0(t,e,i):{ready:Z0(t,e)}}function Q0(t,e,i){var s=!0;i!==void 0&&i.includeErrorFields===!1&&(s=!1);var a=new DataView(e),r=tf(a),o=ef(a,r),n=sf(a,o,r,s),h={header:o,subgrids:n};return Ui[t]=h,h}async function Z0(t,e){for(var i=[],s=await e.getImageCount(),a=s-1;a>=0;a--){var r=await e.getImage(a),o=await r.readRasters(),n=o,h=[r.getWidth(),r.getHeight()],f=r.getBoundingBox().map(Na),u=[r.fileDirectory.ModelPixelScale[0],r.fileDirectory.ModelPixelScale[1]].map(Na),c=f[0]+(h[0]-1)*u[0],l=f[3]-(h[1]-1)*u[1],m=n[0],_=n[1],d=[];for(let S=h[1]-1;S>=0;S--)for(let M=h[0]-1;M>=0;M--){var y=S*h[0]+M;d.push([-lt(_[y]),lt(m[y])])}i.push({del:u,lim:h,ll:[-c,l],cvs:d})}var v={header:{nSubgrids:s},subgrids:i};return Ui[t]=v,v}function Y0(t){if(t===void 0)return null;var e=t.split(",");return e.map(J0)}function J0(t){if(t.length===0)return null;var e=t[0]==="@";return e&&(t=t.slice(1)),t==="null"?{name:"null",mandatory:!e,grid:null,isNull:!0}:{name:t,mandatory:!e,grid:Ui[t]||null,isNull:!1}}function Na(t){return t*Math.PI/180}function lt(t){return t/3600*Math.PI/180}function tf(t){var e=t.getInt32(8,!1);return e===11?!1:(e=t.getInt32(8,!0),e!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function ef(t,e){return{nFields:t.getInt32(8,e),nSubgridFields:t.getInt32(24,e),nSubgrids:t.getInt32(40,e),shiftType:Di(t,56,64).trim(),fromSemiMajorAxis:t.getFloat64(120,e),fromSemiMinorAxis:t.getFloat64(136,e),toSemiMajorAxis:t.getFloat64(152,e),toSemiMinorAxis:t.getFloat64(168,e)}}function Di(t,e,i){return String.fromCharCode.apply(null,new Uint8Array(t.buffer.slice(e,i)))}function sf(t,e,i,s){for(var a=176,r=[],o=0;o<e.nSubgrids;o++){var n=rf(t,a,i),h=nf(t,a,n,i,s),f=Math.round(1+(n.upperLongitude-n.lowerLongitude)/n.longitudeInterval),u=Math.round(1+(n.upperLatitude-n.lowerLatitude)/n.latitudeInterval);r.push({ll:[lt(n.lowerLongitude),lt(n.lowerLatitude)],del:[lt(n.longitudeInterval),lt(n.latitudeInterval)],lim:[f,u],count:n.gridNodeCount,cvs:af(h)});var c=16;s===!1&&(c=8),a+=176+n.gridNodeCount*c}return r}function af(t){return t.map(function(e){return[lt(e.longitudeShift),lt(e.latitudeShift)]})}function rf(t,e,i){return{name:Di(t,e+8,e+16).trim(),parent:Di(t,e+24,e+24+8).trim(),lowerLatitude:t.getFloat64(e+72,i),upperLatitude:t.getFloat64(e+88,i),lowerLongitude:t.getFloat64(e+104,i),upperLongitude:t.getFloat64(e+120,i),latitudeInterval:t.getFloat64(e+136,i),longitudeInterval:t.getFloat64(e+152,i),gridNodeCount:t.getInt32(e+168,i)}}function nf(t,e,i,s,a){var r=e+176,o=16;a===!1&&(o=8);for(var n=[],h=0;h<i.gridNodeCount;h++){var f={latitudeShift:t.getFloat32(r+h*o,s),longitudeShift:t.getFloat32(r+h*o+4,s)};a!==!1&&(f.latitudeAccuracy=t.getFloat32(r+h*o+8,s),f.longitudeAccuracy=t.getFloat32(r+h*o+12,s)),n.push(f)}return n}function J(t,e){if(!(this instanceof J))return new J(t);this.forward=null,this.inverse=null,this.init=null,this.name,this.names=null,this.title,e=e||function(f){if(f)throw f};var i=p0(t);if(typeof i!="object"){e("Could not parse to valid json: "+t);return}var s=J.projections.get(i.projName);if(!s){e("Could not get projection name from: "+t);return}if(i.datumCode&&i.datumCode!=="none"){var a=ft(ze,i.datumCode);a&&(i.datum_params=i.datum_params||(a.towgs84?a.towgs84.split(","):null),i.ellps=a.ellipse,i.datumName=a.datumName?a.datumName:i.datumCode)}i.k0=i.k0||1,i.axis=i.axis||"enu",i.ellps=i.ellps||"wgs84",i.lat1=i.lat1||i.lat0;var r=H0(i.a,i.b,i.rf,i.ellps,i.sphere),o=V0(r.a,r.b,r.rf,i.R_A),n=Y0(i.nadgrids),h=i.datum||X0(i.datumCode,i.datum_params,r.a,r.b,o.es,o.ep2,n);wa(this,i),wa(this,s),this.a=r.a,this.b=r.b,this.rf=r.rf,this.sphere=r.sphere,this.es=o.es,this.e=o.e,this.ep2=o.ep2,this.datum=h,"init"in this&&typeof this.init=="function"&&this.init(),e(null,this)}J.projections=q0,J.projections.start();function of(t,e){return t.datum_type!==e.datum_type||t.a!==e.a||Math.abs(t.es-e.es)>5e-11?!1:t.datum_type===Et?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]:t.datum_type===St?t.datum_params[0]===e.datum_params[0]&&t.datum_params[1]===e.datum_params[1]&&t.datum_params[2]===e.datum_params[2]&&t.datum_params[3]===e.datum_params[3]&&t.datum_params[4]===e.datum_params[4]&&t.datum_params[5]===e.datum_params[5]&&t.datum_params[6]===e.datum_params[6]:!0}function Ra(t,e,i){var s=t.x,a=t.y,r=t.z?t.z:0,o,n,h,f;if(a<-g&&a>-1.001*g)a=-g;else if(a>g&&a<1.001*g)a=g;else{if(a<-g)return{x:-1/0,y:-1/0,z:t.z};if(a>g)return{x:1/0,y:1/0,z:t.z}}return s>Math.PI&&(s-=2*Math.PI),n=Math.sin(a),f=Math.cos(a),h=n*n,o=i/Math.sqrt(1-e*h),{x:(o+r)*f*Math.cos(s),y:(o+r)*f*Math.sin(s),z:(o*(1-e)+r)*n}}function pa(t,e,i,s){var a=1e-12,r=a*a,o=30,n,h,f,u,c,l,m,_,d,y,v,S,M,P=t.x,w=t.y,A=t.z?t.z:0,G,k,L;if(n=Math.sqrt(P*P+w*w),h=Math.sqrt(P*P+w*w+A*A),n/i<a){if(G=0,h/i<a)return k=g,L=-s,{x:t.x,y:t.y,z:t.z}}else G=Math.atan2(w,P);f=A/h,u=n/h,c=1/Math.sqrt(1-e*(2-e)*u*u),_=u*(1-e)*c,d=f*c,M=0;do M++,m=i/Math.sqrt(1-e*d*d),L=n*_+A*d-m*(1-e*d*d),l=e*m/(m+L),c=1/Math.sqrt(1-l*(2-l)*u*u),y=u*(1-l)*c,v=f*c,S=v*_-y*d,_=y,d=v;while(S*S>r&&M<o);return k=Math.atan(v/Math.abs(y)),{x:G,y:k,z:L}}function hf(t,e,i){if(e===Et)return{x:t.x+i[0],y:t.y+i[1],z:t.z+i[2]};if(e===St){var s=i[0],a=i[1],r=i[2],o=i[3],n=i[4],h=i[5],f=i[6];return{x:f*(t.x-h*t.y+n*t.z)+s,y:f*(h*t.x+t.y-o*t.z)+a,z:f*(-n*t.x+o*t.y+t.z)+r}}}function ff(t,e,i){if(e===Et)return{x:t.x-i[0],y:t.y-i[1],z:t.z-i[2]};if(e===St){var s=i[0],a=i[1],r=i[2],o=i[3],n=i[4],h=i[5],f=i[6],u=(t.x-s)/f,c=(t.y-a)/f,l=(t.z-r)/f;return{x:u+h*c-n*l,y:-h*u+c+o*l,z:n*u-o*c+l}}}function qe(t){return t===Et||t===St}function lf(t,e,i){if(of(t,e)||t.datum_type===Ri||e.datum_type===Ri)return i;var s=t.a,a=t.es;if(t.datum_type===pt){var r=Ca(t,!1,i);if(r!==0)return;s=ua,a=_a}var o=e.a,n=e.b,h=e.es;if(e.datum_type===pt&&(o=ua,n=o0,h=_a),a===h&&s===o&&!qe(t.datum_type)&&!qe(e.datum_type))return i;if(i=Ra(i,a,s),qe(t.datum_type)&&(i=hf(i,t.datum_type,t.datum_params)),qe(e.datum_type)&&(i=ff(i,e.datum_type,e.datum_params)),i=pa(i,h,o,n),e.datum_type===pt){var f=Ca(e,!0,i);if(f!==0)return}return i}function Ca(t,e,i){if(t.grids===null||t.grids.length===0)return console.log("Grid shift grids not found"),-1;var s={x:-i.x,y:i.y},a={x:Number.NaN,y:Number.NaN},r=[];t:for(var o=0;o<t.grids.length;o++){var n=t.grids[o];if(r.push(n.name),n.isNull){a=s;break}if(n.grid===null){if(n.mandatory)return console.log("Unable to find mandatory grid '"+n.name+"'"),-1;continue}for(var h=n.grid.subgrids,f=0,u=h.length;f<u;f++){var c=h[f],l=(Math.abs(c.del[1])+Math.abs(c.del[0]))/1e4,m=c.ll[0]-l,_=c.ll[1]-l,d=c.ll[0]+(c.lim[0]-1)*c.del[0]+l,y=c.ll[1]+(c.lim[1]-1)*c.del[1]+l;if(!(_>s.y||m>s.x||y<s.y||d<s.x)&&(a=cf(s,e,c),!isNaN(a.x)))break t}}return isNaN(a.x)?(console.log("Failed to find a grid shift table for location '"+-s.x*et+" "+s.y*et+" tried: '"+r+"'"),-1):(i.x=-a.x,i.y=a.y,0)}function cf(t,e,i){var s={x:Number.NaN,y:Number.NaN};if(isNaN(t.x))return s;var a={x:t.x,y:t.y};a.x-=i.ll[0],a.y-=i.ll[1],a.x=E(a.x-Math.PI)+Math.PI;var r=Fa(a,i);if(e){if(isNaN(r.x))return s;r.x=a.x-r.x,r.y=a.y-r.y;var o=9,n=1e-12,h,f;do{if(f=Fa(r,i),isNaN(f.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}h={x:a.x-(f.x+r.x),y:a.y-(f.y+r.y)},r.x+=h.x,r.y+=h.y}while(o--&&Math.abs(h.x)>n&&Math.abs(h.y)>n);if(o<0)return console.log("Inverse grid shift iterator failed to converge."),s;s.x=E(r.x+i.ll[0]),s.y=r.y+i.ll[1]}else isNaN(r.x)||(s.x=t.x+r.x,s.y=t.y+r.y);return s}function Fa(t,e){var i={x:t.x/e.del[0],y:t.y/e.del[1]},s={x:Math.floor(i.x),y:Math.floor(i.y)},a={x:i.x-1*s.x,y:i.y-1*s.y},r={x:Number.NaN,y:Number.NaN},o;if(s.x<0||s.x>=e.lim[0]||s.y<0||s.y>=e.lim[1])return r;o=s.y*e.lim[0]+s.x;var n={x:e.cvs[o][0],y:e.cvs[o][1]};o++;var h={x:e.cvs[o][0],y:e.cvs[o][1]};o+=e.lim[0];var f={x:e.cvs[o][0],y:e.cvs[o][1]};o--;var u={x:e.cvs[o][0],y:e.cvs[o][1]},c=a.x*a.y,l=a.x*(1-a.y),m=(1-a.x)*(1-a.y),_=(1-a.x)*a.y;return r.x=m*n.x+l*h.x+_*u.x+c*f.x,r.y=m*n.y+l*h.y+_*u.y+c*f.y,r}function Oa(t,e,i){var s=i.x,a=i.y,r=i.z||0,o,n,h,f={};for(h=0;h<3;h++)if(!(e&&h===2&&i.z===void 0))switch(h===0?(o=s,"ew".indexOf(t.axis[h])!==-1?n="x":n="y"):h===1?(o=a,"ns".indexOf(t.axis[h])!==-1?n="y":n="x"):(o=r,n="z"),t.axis[h]){case"e":f[n]=o;break;case"w":f[n]=-o;break;case"n":f[n]=o;break;case"s":f[n]=-o;break;case"u":i[n]!==void 0&&(f.z=o);break;case"d":i[n]!==void 0&&(f.z=-o);break;default:return null}return f}function La(t){var e={x:t[0],y:t[1]};return t.length>2&&(e.z=t[2]),t.length>3&&(e.m=t[3]),e}function uf(t){Ua(t.x),Ua(t.y)}function Ua(t){if(typeof Number.isFinite=="function"){if(Number.isFinite(t))return;throw new TypeError("coordinates must be finite numbers")}if(typeof t!="number"||t!==t||!isFinite(t))throw new TypeError("coordinates must be finite numbers")}function _f(t,e){return(t.datum.datum_type===Et||t.datum.datum_type===St||t.datum.datum_type===pt)&&e.datumCode!=="WGS84"||(e.datum.datum_type===Et||e.datum.datum_type===St||e.datum.datum_type===pt)&&t.datumCode!=="WGS84"}function je(t,e,i,s){var a;Array.isArray(i)?i=La(i):i={x:i.x,y:i.y,z:i.z,m:i.m};var r=i.z!==void 0;if(uf(i),t.datum&&e.datum&&_f(t,e)&&(a=new J("WGS84"),i=je(t,a,i,s),t=a),s&&t.axis!=="enu"&&(i=Oa(t,!1,i)),t.projName==="longlat")i={x:i.x*U,y:i.y*U,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),!i)return;if(t.from_greenwich&&(i.x+=t.from_greenwich),i=lf(t.datum,e.datum,i),!!i)return i=i,e.from_greenwich&&(i={x:i.x-e.from_greenwich,y:i.y,z:i.z||0}),e.projName==="longlat"?i={x:i.x*et,y:i.y*et,z:i.z||0}:(i=e.forward(i),e.to_meter&&(i={x:i.x/e.to_meter,y:i.y/e.to_meter,z:i.z||0})),s&&e.axis!=="enu"?Oa(e,!0,i):(i&&!r&&delete i.z,i)}var Da=J("WGS84");function Bi(t,e,i,s){var a,r,o;return Array.isArray(i)?(a=je(t,e,i,s)||{x:NaN,y:NaN},i.length>2?typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"?typeof a.z=="number"?[a.x,a.y,a.z].concat(i.slice(3)):[a.x,a.y,i[2]].concat(i.slice(3)):[a.x,a.y].concat(i.slice(2)):[a.x,a.y]):(r=je(t,e,i,s),o=Object.keys(i),o.length===2||o.forEach(function(n){if(typeof t.name<"u"&&t.name==="geocent"||typeof e.name<"u"&&e.name==="geocent"){if(n==="x"||n==="y"||n==="z")return}else if(n==="x"||n==="y")return;r[n]=i[n]}),r)}function Ve(t){return t instanceof J?t:typeof t=="object"&&"oProj"in t?t.oProj:J(t)}function mf(t,e,i){var s,a,r=!1,o;return typeof e>"u"?(a=Ve(t),s=Da,r=!0):(typeof e.x<"u"||Array.isArray(e))&&(i=e,a=Ve(t),s=Da,r=!0),s||(s=Ve(t)),a||(a=Ve(e)),i?Bi(s,a,i):(o={forward:function(n,h){return Bi(s,a,n,h)},inverse:function(n,h){return Bi(a,s,n,h)}},r&&(o.oProj=a),o)}var Ba=6,ka="AJSAJS",$a="AFAFAF",Ot=65,H=73,X=79,ne=86,oe=90;const df={forward:za,inverse:yf,toPoint:qa};function za(t,e){return e=e||5,Mf(gf({lat:t[1],lon:t[0]}),e)}function yf(t){var e=$i(Ha(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat,e.lon,e.lat]:[e.left,e.bottom,e.right,e.top]}function qa(t){var e=$i(Ha(t.toUpperCase()));return e.lat&&e.lon?[e.lon,e.lat]:[(e.left+e.right)/2,(e.top+e.bottom)/2]}function ki(t){return t*(Math.PI/180)}function ja(t){return 180*(t/Math.PI)}function gf(t){var e=t.lat,i=t.lon,s=6378137,a=.00669438,r=.9996,o,n,h,f,u,c,l,m=ki(e),_=ki(i),d,y;y=Math.floor((i+180)/6)+1,i===180&&(y=60),e>=56&&e<64&&i>=3&&i<12&&(y=32),e>=72&&e<84&&(i>=0&&i<9?y=31:i>=9&&i<21?y=33:i>=21&&i<33?y=35:i>=33&&i<42&&(y=37)),o=(y-1)*6-180+3,d=ki(o),n=a/(1-a),h=s/Math.sqrt(1-a*Math.sin(m)*Math.sin(m)),f=Math.tan(m)*Math.tan(m),u=n*Math.cos(m)*Math.cos(m),c=Math.cos(m)*(_-d),l=s*((1-a/4-3*a*a/64-5*a*a*a/256)*m-(3*a/8+3*a*a/32+45*a*a*a/1024)*Math.sin(2*m)+(15*a*a/256+45*a*a*a/1024)*Math.sin(4*m)-35*a*a*a/3072*Math.sin(6*m));var v=r*h*(c+(1-f+u)*c*c*c/6+(5-18*f+f*f+72*u-58*n)*c*c*c*c*c/120)+5e5,S=r*(l+h*Math.tan(m)*(c*c/2+(5-f+9*u+4*u*u)*c*c*c*c/24+(61-58*f+f*f+600*u-330*n)*c*c*c*c*c*c/720));return e<0&&(S+=1e7),{northing:Math.round(S),easting:Math.round(v),zoneNumber:y,zoneLetter:vf(e)}}function $i(t){var e=t.northing,i=t.easting,s=t.zoneLetter,a=t.zoneNumber;if(a<0||a>60)return null;var r=.9996,o=6378137,n=.00669438,h,f=(1-Math.sqrt(1-n))/(1+Math.sqrt(1-n)),u,c,l,m,_,d,y,v,S,M=i-5e5,P=e;s<"N"&&(P-=1e7),y=(a-1)*6-180+3,h=n/(1-n),d=P/r,v=d/(o*(1-n/4-3*n*n/64-5*n*n*n/256)),S=v+(3*f/2-27*f*f*f/32)*Math.sin(2*v)+(21*f*f/16-55*f*f*f*f/32)*Math.sin(4*v)+151*f*f*f/96*Math.sin(6*v),u=o/Math.sqrt(1-n*Math.sin(S)*Math.sin(S)),c=Math.tan(S)*Math.tan(S),l=h*Math.cos(S)*Math.cos(S),m=o*(1-n)/Math.pow(1-n*Math.sin(S)*Math.sin(S),1.5),_=M/(u*r);var w=S-u*Math.tan(S)/m*(_*_/2-(5+3*c+10*l-4*l*l-9*h)*_*_*_*_/24+(61+90*c+298*l+45*c*c-252*h-3*l*l)*_*_*_*_*_*_/720);w=ja(w);var A=(_-(1+2*c+l)*_*_*_/6+(5-2*l+28*c-3*l*l+8*h+24*c*c)*_*_*_*_*_/120)/Math.cos(S);A=y+ja(A);var G;if(t.accuracy){var k=$i({northing:t.northing+t.accuracy,easting:t.easting+t.accuracy,zoneLetter:t.zoneLetter,zoneNumber:t.zoneNumber});G={top:k.lat,right:k.lon,bottom:w,left:A}}else G={lat:w,lon:A};return G}function vf(t){var e="Z";return 84>=t&&t>=72?e="X":72>t&&t>=64?e="W":64>t&&t>=56?e="V":56>t&&t>=48?e="U":48>t&&t>=40?e="T":40>t&&t>=32?e="S":32>t&&t>=24?e="R":24>t&&t>=16?e="Q":16>t&&t>=8?e="P":8>t&&t>=0?e="N":0>t&&t>=-8?e="M":-8>t&&t>=-16?e="L":-16>t&&t>=-24?e="K":-24>t&&t>=-32?e="J":-32>t&&t>=-40?e="H":-40>t&&t>=-48?e="G":-48>t&&t>=-56?e="F":-56>t&&t>=-64?e="E":-64>t&&t>=-72?e="D":-72>t&&t>=-80&&(e="C"),e}function Mf(t,e){var i="00000"+t.easting,s="00000"+t.northing;return t.zoneNumber+t.zoneLetter+xf(t.easting,t.northing,t.zoneNumber)+i.substr(i.length-5,e)+s.substr(s.length-5,e)}function xf(t,e,i){var s=Va(i),a=Math.floor(t/1e5),r=Math.floor(e/1e5)%20;return Ef(a,r,s)}function Va(t){var e=t%Ba;return e===0&&(e=Ba),e}function Ef(t,e,i){var s=i-1,a=ka.charCodeAt(s),r=$a.charCodeAt(s),o=a+t-1,n=r+e,h=!1;o>oe&&(o=o-oe+Ot-1,h=!0),(o===H||a<H&&o>H||(o>H||a<H)&&h)&&o++,(o===X||a<X&&o>X||(o>X||a<X)&&h)&&(o++,o===H&&o++),o>oe&&(o=o-oe+Ot-1),n>ne?(n=n-ne+Ot-1,h=!0):h=!1,(n===H||r<H&&n>H||(n>H||r<H)&&h)&&n++,(n===X||r<X&&n>X||(n>X||r<X)&&h)&&(n++,n===H&&n++),n>ne&&(n=n-ne+Ot-1);var f=String.fromCharCode(o)+String.fromCharCode(n);return f}function Ha(t){if(t&&t.length===0)throw"MGRSPoint coverting from nothing";for(var e=t.length,i=null,s="",a,r=0;!/[A-Z]/.test(a=t.charAt(r));){if(r>=2)throw"MGRSPoint bad conversion from: "+t;s+=a,r++}var o=parseInt(s,10);if(r===0||r+3>e)throw"MGRSPoint bad conversion from: "+t;var n=t.charAt(r++);if(n<="A"||n==="B"||n==="Y"||n>="Z"||n==="I"||n==="O")throw"MGRSPoint zone letter "+n+" not handled: "+t;i=t.substring(r,r+=2);for(var h=Va(o),f=Sf(i.charAt(0),h),u=Pf(i.charAt(1),h);u<bf(n);)u+=2e6;var c=e-r;if(c%2!==0)throw`MGRSPoint has to have an even number
|
|
13
|
+
of digits after the zone letter and two 100km letters - front
|
|
14
|
+
half for easting meters, second half for
|
|
15
|
+
northing meters`+t;var l=c/2,m=0,_=0,d,y,v,S,M;return l>0&&(d=1e5/Math.pow(10,l),y=t.substring(r,r+l),m=parseFloat(y)*d,v=t.substring(r+l),_=parseFloat(v)*d),S=m+f,M=_+u,{easting:S,northing:M,zoneLetter:n,zoneNumber:o,accuracy:d}}function Sf(t,e){for(var i=ka.charCodeAt(e-1),s=1e5,a=!1;i!==t.charCodeAt(0);){if(i++,i===H&&i++,i===X&&i++,i>oe){if(a)throw"Bad character: "+t;i=Ot,a=!0}s+=1e5}return s}function Pf(t,e){if(t>"V")throw"MGRSPoint given invalid Northing "+t;for(var i=$a.charCodeAt(e-1),s=0,a=!1;i!==t.charCodeAt(0);){if(i++,i===H&&i++,i===X&&i++,i>ne){if(a)throw"Bad character: "+t;i=Ot,a=!0}s+=1e5}return s}function bf(t){var e;switch(t){case"C":e=11e5;break;case"D":e=2e6;break;case"E":e=28e5;break;case"F":e=37e5;break;case"G":e=46e5;break;case"H":e=55e5;break;case"J":e=64e5;break;case"K":e=73e5;break;case"L":e=82e5;break;case"M":e=91e5;break;case"N":e=0;break;case"P":e=8e5;break;case"Q":e=17e5;break;case"R":e=26e5;break;case"S":e=35e5;break;case"T":e=44e5;break;case"U":e=53e5;break;case"V":e=62e5;break;case"W":e=7e6;break;case"X":e=79e5;break;default:e=-1}if(e>=0)return e;throw"Invalid zone letter: "+t}function Lt(t,e,i){if(!(this instanceof Lt))return new Lt(t,e,i);if(Array.isArray(t))this.x=t[0],this.y=t[1],this.z=t[2]||0;else if(typeof t=="object")this.x=t.x,this.y=t.y,this.z=t.z||0;else if(typeof t=="string"&&typeof e>"u"){var s=t.split(",");this.x=parseFloat(s[0]),this.y=parseFloat(s[1]),this.z=parseFloat(s[2])||0}else this.x=t,this.y=e,this.z=i||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}Lt.fromMGRS=function(t){return new Lt(qa(t))},Lt.prototype.toMGRS=function(t){return za([this.x,this.y],t)};var wf=1,Af=.25,Wa=.046875,Xa=.01953125,Ka=.01068115234375,Gf=.75,If=.46875,Tf=.013020833333333334,Nf=.007120768229166667,Rf=.3645833333333333,pf=.005696614583333333,Cf=.3076171875;function zi(t){var e=[];e[0]=wf-t*(Af+t*(Wa+t*(Xa+t*Ka))),e[1]=t*(Gf-t*(Wa+t*(Xa+t*Ka)));var i=t*t;return e[2]=i*(If-t*(Tf+t*Nf)),i*=t,e[3]=i*(Rf-t*pf),e[4]=i*t*Cf,e}function Ut(t,e,i,s){return i*=e,e*=e,s[0]*t-i*(s[1]+e*(s[2]+e*(s[3]+e*s[4])))}var Ff=20;function qi(t,e,i){for(var s=1/(1-e),a=t,r=Ff;r;--r){var o=Math.sin(a),n=1-e*o*o;if(n=(Ut(a,o,Math.cos(a),i)-t)*(n*Math.sqrt(n))*s,a-=n,Math.abs(n)<x)return a}return a}function Of(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=zi(this.es),this.ml0=Ut(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function Lf(t){var e=t.x,i=t.y,s=E(e-this.long0),a,r,o,n=Math.sin(i),h=Math.cos(i);if(this.es){var u=h*s,c=Math.pow(u,2),l=this.ep2*Math.pow(h,2),m=Math.pow(l,2),_=Math.abs(h)>x?Math.tan(i):0,d=Math.pow(_,2),y=Math.pow(d,2);a=1-this.es*Math.pow(n,2),u=u/Math.sqrt(a);var v=Ut(i,n,h,this.en);r=this.a*(this.k0*u*(1+c/6*(1-d+l+c/20*(5-18*d+y+14*l-58*d*l+c/42*(61+179*y-y*d-479*d)))))+this.x0,o=this.a*(this.k0*(v-this.ml0+n*s*u/2*(1+c/12*(5-d+9*l+4*m+c/30*(61+y-58*d+270*l-330*d*l+c/56*(1385+543*y-y*d-3111*d))))))+this.y0}else{var f=h*Math.sin(s);if(Math.abs(Math.abs(f)-1)<x)return 93;if(r=.5*this.a*this.k0*Math.log((1+f)/(1-f))+this.x0,o=h*Math.cos(s)/Math.sqrt(1-Math.pow(f,2)),f=Math.abs(o),f>=1){if(f-1>x)return 93;o=0}else o=Math.acos(o);i<0&&(o=-o),o=this.a*this.k0*(o-this.lat0)+this.y0}return t.x=r,t.y=o,t}function Uf(t){var e,i,s,a,r=(t.x-this.x0)*(1/this.a),o=(t.y-this.y0)*(1/this.a);if(this.es)if(e=this.ml0+o/this.k0,i=qi(e,this.es,this.en),Math.abs(i)<g){var c=Math.sin(i),l=Math.cos(i),m=Math.abs(l)>x?Math.tan(i):0,_=this.ep2*Math.pow(l,2),d=Math.pow(_,2),y=Math.pow(m,2),v=Math.pow(y,2);e=1-this.es*Math.pow(c,2);var S=r*Math.sqrt(e)/this.k0,M=Math.pow(S,2);e=e*m,s=i-e*M/(1-this.es)*.5*(1-M/12*(5+3*y-9*_*y+_-4*d-M/30*(61+90*y-252*_*y+45*v+46*_-M/56*(1385+3633*y+4095*v+1574*v*y)))),a=E(this.long0+S*(1-M/6*(1+2*y+_-M/20*(5+28*y+24*v+8*_*y+6*_-M/42*(61+662*y+1320*v+720*v*y))))/l)}else s=g*ae(o),a=0;else{var n=Math.exp(r/this.k0),h=.5*(n-1/n),f=this.lat0+o/this.k0,u=Math.cos(f);e=Math.sqrt((1-Math.pow(u,2))/(1+Math.pow(h,2))),s=Math.asin(e),o<0&&(s=-s),h===0&&u===0?a=0:a=E(Math.atan2(h,u)+this.long0)}return t.x=a,t.y=s,t}var Df=["Fast_Transverse_Mercator","Fast Transverse Mercator"];const He={init:Of,forward:Lf,inverse:Uf,names:Df};function Qa(t){var e=Math.exp(t);return e=(e-1/e)/2,e}function W(t,e){t=Math.abs(t),e=Math.abs(e);var i=Math.max(t,e),s=Math.min(t,e)/(i||1);return i*Math.sqrt(1+Math.pow(s,2))}function Bf(t){var e=1+t,i=e-1;return i===0?t:t*Math.log(e)/i}function kf(t){var e=Math.abs(t);return e=Bf(e*(1+e/(W(1,e)+1))),t<0?-e:e}function ji(t,e){for(var i=2*Math.cos(2*e),s=t.length-1,a=t[s],r=0,o;--s>=0;)o=-r+i*a+t[s],r=a,a=o;return e+o*Math.sin(2*e)}function $f(t,e){for(var i=2*Math.cos(e),s=t.length-1,a=t[s],r=0,o;--s>=0;)o=-r+i*a+t[s],r=a,a=o;return Math.sin(e)*o}function zf(t){var e=Math.exp(t);return e=(e+1/e)/2,e}function Za(t,e,i){for(var s=Math.sin(e),a=Math.cos(e),r=Qa(i),o=zf(i),n=2*a*o,h=-2*s*r,f=t.length-1,u=t[f],c=0,l=0,m=0,_,d;--f>=0;)_=l,d=c,l=u,c=m,u=-_+n*l-h*c+t[f],m=-d+h*l+n*c;return n=s*o,h=a*r,[n*u-h*m,n*m+h*u]}function qf(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(He.init.apply(this),this.forward=He.forward,this.inverse=He.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var t=this.es/(1+Math.sqrt(1-this.es)),e=t/(2-t),i=e;this.cgb[0]=e*(2+e*(-2/3+e*(-2+e*(116/45+e*(26/45+e*(-2854/675)))))),this.cbg[0]=e*(-2+e*(2/3+e*(4/3+e*(-82/45+e*(32/45+e*(4642/4725)))))),i=i*e,this.cgb[1]=i*(7/3+e*(-8/5+e*(-227/45+e*(2704/315+e*(2323/945))))),this.cbg[1]=i*(5/3+e*(-16/15+e*(-13/9+e*(904/315+e*(-1522/945))))),i=i*e,this.cgb[2]=i*(56/15+e*(-136/35+e*(-1262/105+e*(73814/2835)))),this.cbg[2]=i*(-26/15+e*(34/21+e*(8/5+e*(-12686/2835)))),i=i*e,this.cgb[3]=i*(4279/630+e*(-332/35+e*(-399572/14175))),this.cbg[3]=i*(1237/630+e*(-12/5+e*(-24832/14175))),i=i*e,this.cgb[4]=i*(4174/315+e*(-144838/6237)),this.cbg[4]=i*(-734/315+e*(109598/31185)),i=i*e,this.cgb[5]=i*(601676/22275),this.cbg[5]=i*(444337/155925),i=Math.pow(e,2),this.Qn=this.k0/(1+e)*(1+i*(1/4+i*(1/64+i/256))),this.utg[0]=e*(-.5+e*(2/3+e*(-37/96+e*(1/360+e*(81/512+e*(-96199/604800)))))),this.gtu[0]=e*(.5+e*(-2/3+e*(5/16+e*(41/180+e*(-127/288+e*(7891/37800)))))),this.utg[1]=i*(-1/48+e*(-1/15+e*(437/1440+e*(-46/105+e*(1118711/3870720))))),this.gtu[1]=i*(13/48+e*(-3/5+e*(557/1440+e*(281/630+e*(-1983433/1935360))))),i=i*e,this.utg[2]=i*(-17/480+e*(37/840+e*(209/4480+e*(-5569/90720)))),this.gtu[2]=i*(61/240+e*(-103/140+e*(15061/26880+e*(167603/181440)))),i=i*e,this.utg[3]=i*(-4397/161280+e*(11/504+e*(830251/7257600))),this.gtu[3]=i*(49561/161280+e*(-179/168+e*(6601661/7257600))),i=i*e,this.utg[4]=i*(-4583/161280+e*(108847/3991680)),this.gtu[4]=i*(34729/80640+e*(-3418889/1995840)),i=i*e,this.utg[5]=i*(-20648693/638668800),this.gtu[5]=i*(212378941/319334400);var s=ji(this.cbg,this.lat0);this.Zb=-this.Qn*(s+$f(this.gtu,2*s))}function jf(t){var e=E(t.x-this.long0),i=t.y;i=ji(this.cbg,i);var s=Math.sin(i),a=Math.cos(i),r=Math.sin(e),o=Math.cos(e);i=Math.atan2(s,o*a),e=Math.atan2(r*a,W(s,a*o)),e=kf(Math.tan(e));var n=Za(this.gtu,2*i,2*e);i=i+n[0],e=e+n[1];var h,f;return Math.abs(e)<=2.623395162778?(h=this.a*(this.Qn*e)+this.x0,f=this.a*(this.Qn*i+this.Zb)+this.y0):(h=1/0,f=1/0),t.x=h,t.y=f,t}function Vf(t){var e=(t.x-this.x0)*(1/this.a),i=(t.y-this.y0)*(1/this.a);i=(i-this.Zb)/this.Qn,e=e/this.Qn;var s,a;if(Math.abs(e)<=2.623395162778){var r=Za(this.utg,2*i,2*e);i=i+r[0],e=e+r[1],e=Math.atan(Qa(e));var o=Math.sin(i),n=Math.cos(i),h=Math.sin(e),f=Math.cos(e);i=Math.atan2(o*f,W(h,f*n)),e=Math.atan2(h,f*n),s=E(e+this.long0),a=ji(this.cgb,i)}else s=1/0,a=1/0;return t.x=s,t.y=a,t}var Hf=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","Gauss Kruger","Gauss_Kruger","tmerc"];const We={init:qf,forward:jf,inverse:Vf,names:Hf};function Wf(t,e){if(t===void 0){if(t=Math.floor((E(e)+Math.PI)*30/Math.PI)+1,t<0)return 0;if(t>60)return 60}return t}var Xf="etmerc";function Kf(){var t=Wf(this.zone,this.long0);if(t===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(t)-183)*U,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,We.init.apply(this),this.forward=We.forward,this.inverse=We.inverse}var Qf=["Universal Transverse Mercator System","utm"];const Zf={init:Kf,names:Qf,dependsOn:Xf};function Vi(t,e){return Math.pow((1-t)/(1+t),e)}var Yf=20;function Jf(){var t=Math.sin(this.lat0),e=Math.cos(this.lat0);e*=e,this.rc=Math.sqrt(1-this.es)/(1-this.es*t*t),this.C=Math.sqrt(1+this.es*e*e/(1-this.es)),this.phic0=Math.asin(t/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+I)/(Math.pow(Math.tan(.5*this.lat0+I),this.C)*Vi(this.e*t,this.ratexp))}function t1(t){var e=t.x,i=t.y;return t.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*i+I),this.C)*Vi(this.e*Math.sin(i),this.ratexp))-g,t.x=this.C*e,t}function e1(t){for(var e=1e-14,i=t.x/this.C,s=t.y,a=Math.pow(Math.tan(.5*s+I)/this.K,1/this.C),r=Yf;r>0&&(s=2*Math.atan(a*Vi(this.e*Math.sin(t.y),-.5*this.e))-g,!(Math.abs(s-t.y)<e));--r)t.y=s;return r?(t.x=i,t.y=s,t):null}const Hi={init:Jf,forward:t1,inverse:e1};function i1(){Hi.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function s1(t){var e,i,s,a;return t.x=E(t.x-this.long0),Hi.forward.apply(this,[t]),e=Math.sin(t.y),i=Math.cos(t.y),s=Math.cos(t.x),a=this.k0*this.R2/(1+this.sinc0*e+this.cosc0*i*s),t.x=a*i*Math.sin(t.x),t.y=a*(this.cosc0*e-this.sinc0*i*s),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function a1(t){var e,i,s,a,r;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,r=W(t.x,t.y)){var o=2*Math.atan2(r,this.R2);e=Math.sin(o),i=Math.cos(o),a=Math.asin(i*this.sinc0+t.y*e*this.cosc0/r),s=Math.atan2(t.x*e,r*this.cosc0*i-t.y*this.sinc0*e)}else a=this.phic0,s=0;return t.x=s,t.y=a,Hi.inverse.apply(this,[t]),t.x=E(t.x+this.long0),t}var r1=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"];const n1={init:i1,forward:s1,inverse:a1,names:r1};function Wi(t,e,i){return e*=i,Math.tan(.5*(g+t))*Math.pow((1-e)/(1+e),.5*i)}function o1(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=x&&(this.k0=.5*(1+ae(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=x&&(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)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=x&&Math.abs(Math.cos(this.lat_ts))>x&&(this.k0=.5*this.cons*it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/Y(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=it(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(Wi(this.lat0,this.sinlat0,this.e))-g,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function h1(t){var e=t.x,i=t.y,s=Math.sin(i),a=Math.cos(i),r,o,n,h,f,u,c=E(e-this.long0);return Math.abs(Math.abs(e-this.long0)-Math.PI)<=x&&Math.abs(i+this.lat0)<=x?(t.x=NaN,t.y=NaN,t):this.sphere?(r=2*this.k0/(1+this.sinlat0*s+this.coslat0*a*Math.cos(c)),t.x=this.a*r*a*Math.sin(c)+this.x0,t.y=this.a*r*(this.coslat0*s-this.sinlat0*a*Math.cos(c))+this.y0,t):(o=2*Math.atan(Wi(i,s,this.e))-g,h=Math.cos(o),n=Math.sin(o),Math.abs(this.coslat0)<=x?(f=Y(this.e,i*this.con,this.con*s),u=2*this.a*this.k0*f/this.cons,t.x=this.x0+u*Math.sin(e-this.long0),t.y=this.y0-this.con*u*Math.cos(e-this.long0),t):(Math.abs(this.sinlat0)<x?(r=2*this.a*this.k0/(1+h*Math.cos(c)),t.y=r*n):(r=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*n+this.cosX0*h*Math.cos(c))),t.y=r*(this.cosX0*n-this.sinX0*h*Math.cos(c))+this.y0),t.x=r*h*Math.sin(c)+this.x0,t))}function f1(t){t.x-=this.x0,t.y-=this.y0;var e,i,s,a,r,o=Math.sqrt(t.x*t.x+t.y*t.y);if(this.sphere){var n=2*Math.atan(o/(2*this.a*this.k0));return e=this.long0,i=this.lat0,o<=x?(t.x=e,t.y=i,t):(i=Math.asin(Math.cos(n)*this.sinlat0+t.y*Math.sin(n)*this.coslat0/o),Math.abs(this.coslat0)<x?this.lat0>0?e=E(this.long0+Math.atan2(t.x,-1*t.y)):e=E(this.long0+Math.atan2(t.x,t.y)):e=E(this.long0+Math.atan2(t.x*Math.sin(n),o*this.coslat0*Math.cos(n)-t.y*this.sinlat0*Math.sin(n))),t.x=e,t.y=i,t)}else if(Math.abs(this.coslat0)<=x){if(o<=x)return i=this.lat0,e=this.long0,t.x=e,t.y=i,t;t.x*=this.con,t.y*=this.con,s=o*this.cons/(2*this.a*this.k0),i=this.con*re(this.e,s),e=this.con*E(this.con*this.long0+Math.atan2(t.x,-1*t.y))}else a=2*Math.atan(o*this.cosX0/(2*this.a*this.k0*this.ms1)),e=this.long0,o<=x?r=this.X0:(r=Math.asin(Math.cos(a)*this.sinX0+t.y*Math.sin(a)*this.cosX0/o),e=E(this.long0+Math.atan2(t.x*Math.sin(a),o*this.cosX0*Math.cos(a)-t.y*this.sinX0*Math.sin(a)))),i=-1*re(this.e,Math.tan(.5*(g+r)));return t.x=e,t.y=i,t}var l1=["stere","Stereographic_South_Pole","Polar_Stereographic_variant_A","Polar_Stereographic_variant_B","Polar_Stereographic"];const c1={init:o1,forward:h1,inverse:f1,names:l1,ssfn_:Wi};function u1(){var t=this.lat0;this.lambda0=this.long0;var e=Math.sin(t),i=this.a,s=this.rf,a=1/s,r=2*a-Math.pow(a,2),o=this.e=Math.sqrt(r);this.R=this.k0*i*Math.sqrt(1-r)/(1-r*Math.pow(e,2)),this.alpha=Math.sqrt(1+r/(1-r)*Math.pow(Math.cos(t),4)),this.b0=Math.asin(e/this.alpha);var n=Math.log(Math.tan(Math.PI/4+this.b0/2)),h=Math.log(Math.tan(Math.PI/4+t/2)),f=Math.log((1+o*e)/(1-o*e));this.K=n-this.alpha*h+this.alpha*o/2*f}function _1(t){var e=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))),s=-this.alpha*(e+i)+this.K,a=2*(Math.atan(Math.exp(s))-Math.PI/4),r=this.alpha*(t.x-this.lambda0),o=Math.atan(Math.sin(r)/(Math.sin(this.b0)*Math.tan(a)+Math.cos(this.b0)*Math.cos(r))),n=Math.asin(Math.cos(this.b0)*Math.sin(a)-Math.sin(this.b0)*Math.cos(a)*Math.cos(r));return t.y=this.R/2*Math.log((1+Math.sin(n))/(1-Math.sin(n)))+this.y0,t.x=this.R*o+this.x0,t}function m1(t){for(var e=t.x-this.x0,i=t.y-this.y0,s=e/this.R,a=2*(Math.atan(Math.exp(i/this.R))-Math.PI/4),r=Math.asin(Math.cos(this.b0)*Math.sin(a)+Math.sin(this.b0)*Math.cos(a)*Math.cos(s)),o=Math.atan(Math.sin(s)/(Math.cos(this.b0)*Math.cos(s)-Math.sin(this.b0)*Math.tan(a))),n=this.lambda0+o/this.alpha,h=0,f=r,u=-1e3,c=0;Math.abs(f-u)>1e-7;){if(++c>20)return;h=1/this.alpha*(Math.log(Math.tan(Math.PI/4+r/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(f))/2)),u=f,f=2*Math.atan(Math.exp(h))-Math.PI/2}return t.x=n,t.y=f,t}var d1=["somerc"];const y1={init:u1,forward:_1,inverse:m1,names:d1};var Dt=1e-7;function g1(t){var e=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],i=typeof t.projName=="object"?Object.keys(t.projName)[0]:t.projName;return"no_uoff"in t||"no_off"in t||e.indexOf(i)!==-1||e.indexOf(Ia(i))!==-1}function v1(){var t,e,i,s,a,r,o,n,h,f,u=0,c,l=0,m=0,_=0,d=0,y=0,v=0;this.no_off=g1(this),this.no_rot="no_rot"in this;var S=!1;"alpha"in this&&(S=!0);var M=!1;if("rectified_grid_angle"in this&&(M=!0),S&&(v=this.alpha),M&&(u=this.rectified_grid_angle),S||M)l=this.longc;else if(m=this.long1,d=this.lat1,_=this.long2,y=this.lat2,Math.abs(d-y)<=Dt||(t=Math.abs(d))<=Dt||Math.abs(t-g)<=Dt||Math.abs(Math.abs(this.lat0)-g)<=Dt||Math.abs(Math.abs(y)-g)<=Dt)throw new Error;var P=1-this.es;e=Math.sqrt(P),Math.abs(this.lat0)>x?(n=Math.sin(this.lat0),i=Math.cos(this.lat0),t=1-this.es*n*n,this.B=i*i,this.B=Math.sqrt(1+this.es*this.B*this.B/P),this.A=this.B*this.k0*e/t,s=this.B*e/(i*Math.sqrt(t)),a=s*s-1,a<=0?a=0:(a=Math.sqrt(a),this.lat0<0&&(a=-a)),this.E=a+=s,this.E*=Math.pow(Y(this.e,this.lat0,n),this.B)):(this.B=1/e,this.A=this.k0,this.E=s=a=1),S||M?(S?(c=Math.asin(Math.sin(v)/s),M||(u=v)):(c=u,v=Math.asin(s*Math.sin(c))),this.lam0=l-Math.asin(.5*(a-1/a)*Math.tan(c))/this.B):(r=Math.pow(Y(this.e,d,Math.sin(d)),this.B),o=Math.pow(Y(this.e,y,Math.sin(y)),this.B),a=this.E/r,h=(o-r)/(o+r),f=this.E*this.E,f=(f-o*r)/(f+o*r),t=m-_,t<-Math.PI?_-=ie:t>Math.PI&&(_+=ie),this.lam0=E(.5*(m+_)-Math.atan(f*Math.tan(.5*this.B*(m-_))/h)/this.B),c=Math.atan(2*Math.sin(this.B*E(m-this.lam0))/(a-1/a)),u=v=Math.asin(s*Math.sin(c))),this.singam=Math.sin(c),this.cosgam=Math.cos(c),this.sinrot=Math.sin(u),this.cosrot=Math.cos(u),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(s*s-1)/Math.cos(v))),this.lat0<0&&(this.u_0=-this.u_0)),a=.5*c,this.v_pole_n=this.ArB*Math.log(Math.tan(I-a)),this.v_pole_s=this.ArB*Math.log(Math.tan(I+a))}function M1(t){var e={},i,s,a,r,o,n,h,f;if(t.x=t.x-this.lam0,Math.abs(Math.abs(t.y)-g)>x){if(o=this.E/Math.pow(Y(this.e,t.y,Math.sin(t.y)),this.B),n=1/o,i=.5*(o-n),s=.5*(o+n),r=Math.sin(this.B*t.x),a=(i*this.singam-r*this.cosgam)/s,Math.abs(Math.abs(a)-1)<x)throw new Error;f=.5*this.ArB*Math.log((1-a)/(1+a)),n=Math.cos(this.B*t.x),Math.abs(n)<Dt?h=this.A*t.x:h=this.ArB*Math.atan2(i*this.cosgam+r*this.singam,n)}else f=t.y>0?this.v_pole_n:this.v_pole_s,h=this.ArB*t.y;return this.no_rot?(e.x=h,e.y=f):(h-=this.u_0,e.x=f*this.cosrot+h*this.sinrot,e.y=h*this.cosrot-f*this.sinrot),e.x=this.a*e.x+this.x0,e.y=this.a*e.y+this.y0,e}function x1(t){var e,i,s,a,r,o,n,h={};if(t.x=(t.x-this.x0)*(1/this.a),t.y=(t.y-this.y0)*(1/this.a),this.no_rot?(i=t.y,e=t.x):(i=t.x*this.cosrot-t.y*this.sinrot,e=t.y*this.cosrot+t.x*this.sinrot+this.u_0),s=Math.exp(-this.BrA*i),a=.5*(s-1/s),r=.5*(s+1/s),o=Math.sin(this.BrA*e),n=(o*this.cosgam+a*this.singam)/r,Math.abs(Math.abs(n)-1)<x)h.x=0,h.y=n<0?-g:g;else{if(h.y=this.E/Math.sqrt((1+n)/(1-n)),h.y=re(this.e,Math.pow(h.y,1/this.B)),h.y===1/0)throw new Error;h.x=-this.rB*Math.atan2(a*this.cosgam-o*this.singam,Math.cos(this.BrA*e))}return h.x+=this.lam0,h}var E1=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_variant_A","Hotine_Oblique_Mercator_Variant_B","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"];const S1={init:v1,forward:M1,inverse:x1,names:E1};function P1(){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)<x)){var t=this.b/this.a;this.e=Math.sqrt(1-t*t);var e=Math.sin(this.lat1),i=Math.cos(this.lat1),s=it(this.e,e,i),a=Y(this.e,this.lat1,e),r=Math.sin(this.lat2),o=Math.cos(this.lat2),n=it(this.e,r,o),h=Y(this.e,this.lat2,r),f=Math.abs(Math.abs(this.lat0)-g)<x?0:Y(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>x?this.ns=Math.log(s/n)/Math.log(a/h):this.ns=e,isNaN(this.ns)&&(this.ns=e),this.f0=s/(this.ns*Math.pow(a,this.ns)),this.rh=this.a*this.f0*Math.pow(f,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function b1(t){var e=t.x,i=t.y;Math.abs(2*Math.abs(i)-Math.PI)<=x&&(i=ae(i)*(g-2*x));var s=Math.abs(Math.abs(i)-g),a,r;if(s>x)a=Y(this.e,i,Math.sin(i)),r=this.a*this.f0*Math.pow(a,this.ns);else{if(s=i*this.ns,s<=0)return null;r=0}var o=this.ns*E(e-this.long0);return t.x=this.k0*(r*Math.sin(o))+this.x0,t.y=this.k0*(this.rh-r*Math.cos(o))+this.y0,t}function w1(t){var e,i,s,a,r,o=(t.x-this.x0)/this.k0,n=this.rh-(t.y-this.y0)/this.k0;this.ns>0?(e=Math.sqrt(o*o+n*n),i=1):(e=-Math.sqrt(o*o+n*n),i=-1);var h=0;if(e!==0&&(h=Math.atan2(i*o,i*n)),e!==0||this.ns>0){if(i=1/this.ns,s=Math.pow(e/(this.a*this.f0),i),a=re(this.e,s),a===-9999)return null}else a=-g;return r=E(h/this.ns+this.long0),t.x=r,t.y=a,t}var A1=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"];const G1={init:P1,forward:b1,inverse:w1,names:A1};function I1(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function T1(t){var e,i,s,a,r,o,n,h=t.x,f=t.y,u=E(h-this.long0);return e=Math.pow((1+this.e*Math.sin(f))/(1-this.e*Math.sin(f)),this.alfa*this.e/2),i=2*(Math.atan(this.k*Math.pow(Math.tan(f/2+this.s45),this.alfa)/e)-this.s45),s=-u*this.alfa,a=Math.asin(Math.cos(this.ad)*Math.sin(i)+Math.sin(this.ad)*Math.cos(i)*Math.cos(s)),r=Math.asin(Math.cos(i)*Math.sin(s)/Math.cos(a)),o=this.n*r,n=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(a/2+this.s45),this.n),t.y=n*Math.cos(o)/1,t.x=n*Math.sin(o)/1,this.czech||(t.y*=-1,t.x*=-1),t}function N1(t){var e,i,s,a,r,o,n,h,f=t.x;t.x=t.y,t.y=f,this.czech||(t.y*=-1,t.x*=-1),o=Math.sqrt(t.x*t.x+t.y*t.y),r=Math.atan2(t.y,t.x),a=r/Math.sin(this.s0),s=2*(Math.atan(Math.pow(this.ro0/o,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),e=Math.asin(Math.cos(this.ad)*Math.sin(s)-Math.sin(this.ad)*Math.cos(s)*Math.cos(a)),i=Math.asin(Math.cos(s)*Math.sin(a)/Math.cos(e)),t.x=this.long0-i/this.alfa,n=e,h=0;var u=0;do t.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(e/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&&(h=1),n=t.y,u+=1;while(h===0&&u<15);return u>=15?null:t}var R1=["Krovak","krovak"];const p1={init:I1,forward:T1,inverse:N1,names:R1};function j(t,e,i,s,a){return t*a-e*Math.sin(2*a)+i*Math.sin(4*a)-s*Math.sin(6*a)}function he(t){return 1-.25*t*(1+t/16*(3+1.25*t))}function fe(t){return .375*t*(1+.25*t*(1+.46875*t))}function le(t){return .05859375*t*t*(1+.75*t)}function ce(t){return t*t*t*(35/3072)}function Xi(t,e,i){var s=e*i;return t/Math.sqrt(1-s*s)}function ct(t){return Math.abs(t)<g?t:t-ae(t)*Math.PI}function Xe(t,e,i,s,a){var r,o;r=t/e;for(var n=0;n<15;n++)if(o=(t-(e*r-i*Math.sin(2*r)+s*Math.sin(4*r)-a*Math.sin(6*r)))/(e-2*i*Math.cos(2*r)+4*s*Math.cos(4*r)-6*a*Math.cos(6*r)),r+=o,Math.abs(o)<=1e-10)return r;return NaN}function C1(){this.sphere||(this.e0=he(this.es),this.e1=fe(this.es),this.e2=le(this.es),this.e3=ce(this.es),this.ml0=this.a*j(this.e0,this.e1,this.e2,this.e3,this.lat0))}function F1(t){var e,i,s=t.x,a=t.y;if(s=E(s-this.long0),this.sphere)e=this.a*Math.asin(Math.cos(a)*Math.sin(s)),i=this.a*(Math.atan2(Math.tan(a),Math.cos(s))-this.lat0);else{var r=Math.sin(a),o=Math.cos(a),n=Xi(this.a,this.e,r),h=Math.tan(a)*Math.tan(a),f=s*Math.cos(a),u=f*f,c=this.es*o*o/(1-this.es),l=this.a*j(this.e0,this.e1,this.e2,this.e3,a);e=n*f*(1-u*h*(1/6-(8-h+8*c)*u/120)),i=l-this.ml0+n*r/o*u*(.5+(5-h+6*c)*u/24)}return t.x=e+this.x0,t.y=i+this.y0,t}function O1(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,i=t.y/this.a,s,a;if(this.sphere){var r=i+this.lat0;s=Math.asin(Math.sin(r)*Math.cos(e)),a=Math.atan2(Math.tan(e),Math.cos(r))}else{var o=this.ml0/this.a+i,n=Xe(o,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(n)-g)<=x)return t.x=this.long0,t.y=g,i<0&&(t.y*=-1),t;var h=Xi(this.a,this.e,Math.sin(n)),f=h*h*h/this.a/this.a*(1-this.es),u=Math.pow(Math.tan(n),2),c=e*this.a/h,l=c*c;s=n-h*Math.tan(n)/f*c*c*(.5-(1+3*u)*c*c/24),a=c*(1-l*(u/3+(1+3*u)*u*l/15))/Math.cos(n)}return t.x=E(a+this.long0),t.y=ct(s),t}var L1=["Cassini","Cassini_Soldner","cass"];const U1={init:C1,forward:F1,inverse:O1,names:L1};function ut(t,e){var i;return t>1e-7?(i=t*e,(1-t*t)*(e/(1-i*i)-.5/t*Math.log((1-i)/(1+i)))):2*e}var Ki=1,Qi=2,Zi=3,Ke=4;function D1(){var t=Math.abs(this.lat0);if(Math.abs(t-g)<x?this.mode=this.lat0<0?Ki:Qi:Math.abs(t)<x?this.mode=Zi:this.mode=Ke,this.es>0){var e;switch(this.qp=ut(this.e,1),this.mmf=.5/(1-this.es),this.apa=W1(this.es),this.mode){case Qi:this.dd=1;break;case Ki:this.dd=1;break;case Zi:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case Ke:this.rq=Math.sqrt(.5*this.qp),e=Math.sin(this.lat0),this.sinb1=ut(this.e,e)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*e*e)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===Ke&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function B1(t){var e,i,s,a,r,o,n,h,f,u,c=t.x,l=t.y;if(c=E(c-this.long0),this.sphere){if(r=Math.sin(l),u=Math.cos(l),s=Math.cos(c),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(i=this.mode===this.EQUIT?1+u*s:1+this.sinph0*r+this.cosph0*u*s,i<=x)return null;i=Math.sqrt(2/i),e=i*u*Math.sin(c),i*=this.mode===this.EQUIT?r:this.cosph0*r-this.sinph0*u*s}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(s=-s),Math.abs(l+this.lat0)<x)return null;i=I-l*.5,i=2*(this.mode===this.S_POLE?Math.cos(i):Math.sin(i)),e=i*Math.sin(c),i*=s}}else{switch(n=0,h=0,f=0,s=Math.cos(c),a=Math.sin(c),r=Math.sin(l),o=ut(this.e,r),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(n=o/this.qp,h=Math.sqrt(1-n*n)),this.mode){case this.OBLIQ:f=1+this.sinb1*n+this.cosb1*h*s;break;case this.EQUIT:f=1+h*s;break;case this.N_POLE:f=g+l,o=this.qp-o;break;case this.S_POLE:f=l-g,o=this.qp+o;break}if(Math.abs(f)<x)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:f=Math.sqrt(2/f),this.mode===this.OBLIQ?i=this.ymf*f*(this.cosb1*n-this.sinb1*h*s):i=(f=Math.sqrt(2/(1+h*s)))*n*this.ymf,e=this.xmf*f*h*a;break;case this.N_POLE:case this.S_POLE:o>=0?(e=(f=Math.sqrt(o))*a,i=s*(this.mode===this.S_POLE?f:-f)):e=i=0;break}}return t.x=this.a*e+this.x0,t.y=this.a*i+this.y0,t}function k1(t){t.x-=this.x0,t.y-=this.y0;var e=t.x/this.a,i=t.y/this.a,s,a,r,o,n,h,f;if(this.sphere){var u=0,c,l=0;if(c=Math.sqrt(e*e+i*i),a=c*.5,a>1)return null;switch(a=2*Math.asin(a),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(l=Math.sin(a),u=Math.cos(a)),this.mode){case this.EQUIT:a=Math.abs(c)<=x?0:Math.asin(i*l/c),e*=l,i=u*c;break;case this.OBLIQ:a=Math.abs(c)<=x?this.lat0:Math.asin(u*this.sinph0+i*l*this.cosph0/c),e*=l*this.cosph0,i=(u-Math.sin(a)*this.sinph0)*c;break;case this.N_POLE:i=-i,a=g-a;break;case this.S_POLE:a-=g;break}s=i===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(e,i)}else{if(f=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(e/=this.dd,i*=this.dd,h=Math.sqrt(e*e+i*i),h<x)return t.x=this.long0,t.y=this.lat0,t;o=2*Math.asin(.5*h/this.rq),r=Math.cos(o),e*=o=Math.sin(o),this.mode===this.OBLIQ?(f=r*this.sinb1+i*o*this.cosb1/h,n=this.qp*f,i=h*this.cosb1*r-i*this.sinb1*o):(f=i*o/h,n=this.qp*f,i=h*r)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(i=-i),n=e*e+i*i,!n)return t.x=this.long0,t.y=this.lat0,t;f=1-n/this.qp,this.mode===this.S_POLE&&(f=-f)}s=Math.atan2(e,i),a=X1(Math.asin(f),this.apa)}return t.x=E(this.long0+s),t.y=a,t}var $1=.3333333333333333,z1=.17222222222222222,q1=.10257936507936508,j1=.06388888888888888,V1=.0664021164021164,H1=.016415012942191543;function W1(t){var e,i=[];return i[0]=t*$1,e=t*t,i[0]+=e*z1,i[1]=e*j1,e*=t,i[0]+=e*q1,i[1]+=e*V1,i[2]=e*H1,i}function X1(t,e){var i=t+t;return t+e[0]*Math.sin(i)+e[1]*Math.sin(i+i)+e[2]*Math.sin(i+i+i)}var K1=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"];const Q1={init:D1,forward:B1,inverse:k1,names:K1,S_POLE:Ki,N_POLE:Qi,EQUIT:Zi,OBLIQ:Ke};function _t(t){return Math.abs(t)>1&&(t=t>1?1:-1),Math.asin(t)}function Z1(){Math.abs(this.lat1+this.lat2)<x||(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=it(this.e3,this.sin_po,this.cos_po),this.qs1=ut(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=it(this.e3,this.sin_po,this.cos_po),this.qs2=ut(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=ut(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>x?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function Y1(t){var e=t.x,i=t.y;this.sin_phi=Math.sin(i),this.cos_phi=Math.cos(i);var s=ut(this.e3,this.sin_phi),a=this.a*Math.sqrt(this.c-this.ns0*s)/this.ns0,r=this.ns0*E(e-this.long0),o=a*Math.sin(r)+this.x0,n=this.rh-a*Math.cos(r)+this.y0;return t.x=o,t.y=n,t}function J1(t){var e,i,s,a,r,o;return t.x-=this.x0,t.y=this.rh-t.y+this.y0,this.ns0>=0?(e=Math.sqrt(t.x*t.x+t.y*t.y),s=1):(e=-Math.sqrt(t.x*t.x+t.y*t.y),s=-1),a=0,e!==0&&(a=Math.atan2(s*t.x,s*t.y)),s=e*this.ns0/this.a,this.sphere?o=Math.asin((this.c-s*s)/(2*this.ns0)):(i=(this.c-s*s)/this.ns0,o=this.phi1z(this.e3,i)),r=E(a/this.ns0+this.long0),t.x=r,t.y=o,t}function tl(t,e){var i,s,a,r,o,n=_t(.5*e);if(t<x)return n;for(var h=t*t,f=1;f<=25;f++)if(i=Math.sin(n),s=Math.cos(n),a=t*i,r=1-a*a,o=.5*r*r/s*(e/(1-h)-i/r+.5/t*Math.log((1-a)/(1+a))),n=n+o,Math.abs(o)<=1e-7)return n;return null}var el=["Albers_Conic_Equal_Area","Albers_Equal_Area","Albers","aea"];const il={init:Z1,forward:Y1,inverse:J1,names:el,phi1z:tl};function sl(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function al(t){var e,i,s,a,r,o,n,h,f=t.x,u=t.y;return s=E(f-this.long0),e=Math.sin(u),i=Math.cos(u),a=Math.cos(s),o=this.sin_p14*e+this.cos_p14*i*a,r=1,o>0||Math.abs(o)<=x?(n=this.x0+this.a*r*i*Math.sin(s)/o,h=this.y0+this.a*r*(this.cos_p14*e-this.sin_p14*i*a)/o):(n=this.x0+this.infinity_dist*i*Math.sin(s),h=this.y0+this.infinity_dist*(this.cos_p14*e-this.sin_p14*i*a)),t.x=n,t.y=h,t}function rl(t){var e,i,s,a,r,o;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=Math.sqrt(t.x*t.x+t.y*t.y))?(a=Math.atan2(e,this.rc),i=Math.sin(a),s=Math.cos(a),o=_t(s*this.sin_p14+t.y*i*this.cos_p14/e),r=Math.atan2(t.x*i,e*this.cos_p14*s-t.y*this.sin_p14*i),r=E(this.long0+r)):(o=this.phic0,r=0),t.x=r,t.y=o,t}var nl=["gnom"];const ol={init:sl,forward:al,inverse:rl,names:nl};function hl(t,e){var i=1-(1-t*t)/(2*t)*Math.log((1-t)/(1+t));if(Math.abs(Math.abs(e)-i)<1e-6)return e<0?-1*g:g;for(var s=Math.asin(.5*e),a,r,o,n,h=0;h<30;h++)if(r=Math.sin(s),o=Math.cos(s),n=t*r,a=Math.pow(1-n*n,2)/(2*o)*(e/(1-t*t)-r/(1-n*n)+.5/t*Math.log((1-n)/(1+n))),s+=a,Math.abs(a)<=1e-10)return s;return NaN}function fl(){this.sphere||(this.k0=it(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function ll(t){var e=t.x,i=t.y,s,a,r=E(e-this.long0);if(this.sphere)s=this.x0+this.a*r*Math.cos(this.lat_ts),a=this.y0+this.a*Math.sin(i)/Math.cos(this.lat_ts);else{var o=ut(this.e,Math.sin(i));s=this.x0+this.a*this.k0*r,a=this.y0+this.a*o*.5/this.k0}return t.x=s,t.y=a,t}function cl(t){t.x-=this.x0,t.y-=this.y0;var e,i;return this.sphere?(e=E(this.long0+t.x/this.a/Math.cos(this.lat_ts)),i=Math.asin(t.y/this.a*Math.cos(this.lat_ts))):(i=hl(this.e,2*t.y*this.k0/this.a),e=E(this.long0+t.x/(this.a*this.k0))),t.x=e,t.y=i,t}var ul=["cea"];const _l={init:fl,forward:ll,inverse:cl,names:ul};function ml(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function dl(t){var e=t.x,i=t.y,s=E(e-this.long0),a=ct(i-this.lat0);return t.x=this.x0+this.a*s*this.rc,t.y=this.y0+this.a*a,t}function yl(t){var e=t.x,i=t.y;return t.x=E(this.long0+(e-this.x0)/(this.a*this.rc)),t.y=ct(this.lat0+(i-this.y0)/this.a),t}var gl=["Equirectangular","Equidistant_Cylindrical","Equidistant_Cylindrical_Spherical","eqc"];const vl={init:ml,forward:dl,inverse:yl,names:gl};var Ya=20;function Ml(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=he(this.es),this.e1=fe(this.es),this.e2=le(this.es),this.e3=ce(this.es),this.ml0=this.a*j(this.e0,this.e1,this.e2,this.e3,this.lat0)}function xl(t){var e=t.x,i=t.y,s,a,r,o=E(e-this.long0);if(r=o*Math.sin(i),this.sphere)Math.abs(i)<=x?(s=this.a*o,a=-1*this.a*this.lat0):(s=this.a*Math.sin(r)/Math.tan(i),a=this.a*(ct(i-this.lat0)+(1-Math.cos(r))/Math.tan(i)));else if(Math.abs(i)<=x)s=this.a*o,a=-1*this.ml0;else{var n=Xi(this.a,this.e,Math.sin(i))/Math.tan(i);s=n*Math.sin(r),a=this.a*j(this.e0,this.e1,this.e2,this.e3,i)-this.ml0+n*(1-Math.cos(r))}return t.x=s+this.x0,t.y=a+this.y0,t}function El(t){var e,i,s,a,r,o,n,h,f;if(s=t.x-this.x0,a=t.y-this.y0,this.sphere)if(Math.abs(a+this.a*this.lat0)<=x)e=E(s/this.a+this.long0),i=0;else{o=this.lat0+a/this.a,n=s*s/this.a/this.a+o*o,h=o;var u;for(r=Ya;r;--r)if(u=Math.tan(h),f=-1*(o*(h*u+1)-h-.5*(h*h+n)*u)/((h-o)/u-1),h+=f,Math.abs(f)<=x){i=h;break}e=E(this.long0+Math.asin(s*Math.tan(h)/this.a)/Math.sin(i))}else if(Math.abs(a+this.ml0)<=x)i=0,e=E(this.long0+s/this.a);else{o=(this.ml0+a)/this.a,n=s*s/this.a/this.a+o*o,h=o;var c,l,m,_,d;for(r=Ya;r;--r)if(d=this.e*Math.sin(h),c=Math.sqrt(1-d*d)*Math.tan(h),l=this.a*j(this.e0,this.e1,this.e2,this.e3,h),m=this.e0-2*this.e1*Math.cos(2*h)+4*this.e2*Math.cos(4*h)-6*this.e3*Math.cos(6*h),_=l/this.a,f=(o*(c*_+1)-_-.5*c*(_*_+n))/(this.es*Math.sin(2*h)*(_*_+n-2*o*_)/(4*c)+(o-_)*(c*m-2/Math.sin(2*h))-m),h-=f,Math.abs(f)<=x){i=h;break}c=Math.sqrt(1-this.es*Math.pow(Math.sin(i),2))*Math.tan(i),e=E(this.long0+Math.asin(s*c/this.a)/Math.sin(i))}return t.x=e,t.y=i,t}var Sl=["Polyconic","American_Polyconic","poly"];const Pl={init:Ml,forward:xl,inverse:El,names:Sl};function bl(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function wl(t){var e,i=t.x,s=t.y,a=s-this.lat0,r=i-this.long0,o=a/ee*1e-5,n=r,h=1,f=0;for(e=1;e<=10;e++)h=h*o,f=f+this.A[e]*h;var u=f,c=n,l=1,m=0,_,d,y=0,v=0;for(e=1;e<=6;e++)_=l*u-m*c,d=m*u+l*c,l=_,m=d,y=y+this.B_re[e]*l-this.B_im[e]*m,v=v+this.B_im[e]*l+this.B_re[e]*m;return t.x=v*this.a+this.x0,t.y=y*this.a+this.y0,t}function Al(t){var e,i=t.x,s=t.y,a=i-this.x0,r=s-this.y0,o=r/this.a,n=a/this.a,h=1,f=0,u,c,l=0,m=0;for(e=1;e<=6;e++)u=h*o-f*n,c=f*o+h*n,h=u,f=c,l=l+this.C_re[e]*h-this.C_im[e]*f,m=m+this.C_im[e]*h+this.C_re[e]*f;for(var _=0;_<this.iterations;_++){var d=l,y=m,v,S,M=o,P=n;for(e=2;e<=6;e++)v=d*l-y*m,S=y*l+d*m,d=v,y=S,M=M+(e-1)*(this.B_re[e]*d-this.B_im[e]*y),P=P+(e-1)*(this.B_im[e]*d+this.B_re[e]*y);d=1,y=0;var w=this.B_re[1],A=this.B_im[1];for(e=2;e<=6;e++)v=d*l-y*m,S=y*l+d*m,d=v,y=S,w=w+e*(this.B_re[e]*d-this.B_im[e]*y),A=A+e*(this.B_im[e]*d+this.B_re[e]*y);var G=w*w+A*A;l=(M*w+P*A)/G,m=(P*w-M*A)/G}var k=l,L=m,mt=1,K=0;for(e=1;e<=9;e++)mt=mt*k,K=K+this.D[e]*mt;var $t=this.lat0+K*ee*1e5,zt=this.long0+L;return t.x=zt,t.y=$t,t}var Gl=["New_Zealand_Map_Grid","nzmg"];const Il={init:bl,forward:wl,inverse:Al,names:Gl};function Tl(){}function Nl(t){var e=t.x,i=t.y,s=E(e-this.long0),a=this.x0+this.a*s,r=this.y0+this.a*Math.log(Math.tan(Math.PI/4+i/2.5))*1.25;return t.x=a,t.y=r,t}function Rl(t){t.x-=this.x0,t.y-=this.y0;var e=E(this.long0+t.x/this.a),i=2.5*(Math.atan(Math.exp(.8*t.y/this.a))-Math.PI/4);return t.x=e,t.y=i,t}var pl=["Miller_Cylindrical","mill"];const Cl={init:Tl,forward:Nl,inverse:Rl,names:pl};var Fl=20;function Ol(){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=zi(this.es)}function Ll(t){var e,i,s=t.x,a=t.y;if(s=E(s-this.long0),this.sphere){if(!this.m)a=this.n!==1?Math.asin(this.n*Math.sin(a)):a;else for(var r=this.n*Math.sin(a),o=Fl;o;--o){var n=(this.m*a+Math.sin(a)-r)/(this.m+Math.cos(a));if(a-=n,Math.abs(n)<x)break}e=this.a*this.C_x*s*(this.m+Math.cos(a)),i=this.a*this.C_y*a}else{var h=Math.sin(a),f=Math.cos(a);i=this.a*Ut(a,h,f,this.en),e=this.a*s*f/Math.sqrt(1-this.es*h*h)}return t.x=e,t.y=i,t}function Ul(t){var e,i,s,a;return t.x-=this.x0,s=t.x/this.a,t.y-=this.y0,e=t.y/this.a,this.sphere?(e/=this.C_y,s=s/(this.C_x*(this.m+Math.cos(e))),this.m?e=_t((this.m*e+Math.sin(e))/this.n):this.n!==1&&(e=_t(Math.sin(e)/this.n)),s=E(s+this.long0),e=ct(e)):(e=qi(t.y/this.a,this.es,this.en),a=Math.abs(e),a<g?(a=Math.sin(e),i=this.long0+t.x*Math.sqrt(1-this.es*a*a)/(this.a*Math.cos(e)),s=E(i)):a-x<g&&(s=this.long0)),t.x=s,t.y=e,t}var Dl=["Sinusoidal","sinu"];const Bl={init:Ol,forward:Ll,inverse:Ul,names:Dl};function kl(){}function $l(t){for(var e=t.x,i=t.y,s=E(e-this.long0),a=i,r=Math.PI*Math.sin(i);;){var o=-(a+Math.sin(a)-r)/(1+Math.cos(a));if(a+=o,Math.abs(o)<x)break}a/=2,Math.PI/2-Math.abs(i)<x&&(s=0);var n=.900316316158*this.a*s*Math.cos(a)+this.x0,h=1.4142135623731*this.a*Math.sin(a)+this.y0;return t.x=n,t.y=h,t}function zl(t){var e,i;t.x-=this.x0,t.y-=this.y0,i=t.y/(1.4142135623731*this.a),Math.abs(i)>.999999999999&&(i=.999999999999),e=Math.asin(i);var s=E(this.long0+t.x/(.900316316158*this.a*Math.cos(e)));s<-Math.PI&&(s=-Math.PI),s>Math.PI&&(s=Math.PI),i=(2*e+Math.sin(2*e))/Math.PI,Math.abs(i)>1&&(i=1);var a=Math.asin(i);return t.x=s,t.y=a,t}var ql=["Mollweide","moll"];const jl={init:kl,forward:$l,inverse:zl,names:ql};function Vl(){Math.abs(this.lat1+this.lat2)<x||(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=he(this.es),this.e1=fe(this.es),this.e2=le(this.es),this.e3=ce(this.es),this.sin_phi=Math.sin(this.lat1),this.cos_phi=Math.cos(this.lat1),this.ms1=it(this.e,this.sin_phi,this.cos_phi),this.ml1=j(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<x?this.ns=this.sin_phi:(this.sin_phi=Math.sin(this.lat2),this.cos_phi=Math.cos(this.lat2),this.ms2=it(this.e,this.sin_phi,this.cos_phi),this.ml2=j(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=j(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function Hl(t){var e=t.x,i=t.y,s;if(this.sphere)s=this.a*(this.g-i);else{var a=j(this.e0,this.e1,this.e2,this.e3,i);s=this.a*(this.g-a)}var r=this.ns*E(e-this.long0),o=this.x0+s*Math.sin(r),n=this.y0+this.rh-s*Math.cos(r);return t.x=o,t.y=n,t}function Wl(t){t.x-=this.x0,t.y=this.rh-t.y+this.y0;var e,i,s,a;this.ns>=0?(i=Math.sqrt(t.x*t.x+t.y*t.y),e=1):(i=-Math.sqrt(t.x*t.x+t.y*t.y),e=-1);var r=0;if(i!==0&&(r=Math.atan2(e*t.x,e*t.y)),this.sphere)return a=E(this.long0+r/this.ns),s=ct(this.g-i/this.a),t.x=a,t.y=s,t;var o=this.g-i/this.a;return s=Xe(o,this.e0,this.e1,this.e2,this.e3),a=E(this.long0+r/this.ns),t.x=a,t.y=s,t}var Xl=["Equidistant_Conic","eqdc"];const Kl={init:Vl,forward:Hl,inverse:Wl,names:Xl};function Ql(){this.R=this.a}function Zl(t){var e=t.x,i=t.y,s=E(e-this.long0),a,r;Math.abs(i)<=x&&(a=this.x0+this.R*s,r=this.y0);var o=_t(2*Math.abs(i/Math.PI));(Math.abs(s)<=x||Math.abs(Math.abs(i)-g)<=x)&&(a=this.x0,i>=0?r=this.y0+Math.PI*this.R*Math.tan(.5*o):r=this.y0+Math.PI*this.R*-Math.tan(.5*o));var n=.5*Math.abs(Math.PI/s-s/Math.PI),h=n*n,f=Math.sin(o),u=Math.cos(o),c=u/(f+u-1),l=c*c,m=c*(2/f-1),_=m*m,d=Math.PI*this.R*(n*(c-_)+Math.sqrt(h*(c-_)*(c-_)-(_+h)*(l-_)))/(_+h);s<0&&(d=-d),a=this.x0+d;var y=h+c;return d=Math.PI*this.R*(m*y-n*Math.sqrt((_+h)*(h+1)-y*y))/(_+h),i>=0?r=this.y0+d:r=this.y0-d,t.x=a,t.y=r,t}function Yl(t){var e,i,s,a,r,o,n,h,f,u,c,l,m;return t.x-=this.x0,t.y-=this.y0,c=Math.PI*this.R,s=t.x/c,a=t.y/c,r=s*s+a*a,o=-Math.abs(a)*(1+r),n=o-2*a*a+s*s,h=-2*o+1+2*a*a+r*r,m=a*a/h+(2*n*n*n/h/h/h-9*o*n/h/h)/27,f=(o-n*n/3/h)/h,u=2*Math.sqrt(-f/3),c=3*m/f/u,Math.abs(c)>1&&(c>=0?c=1:c=-1),l=Math.acos(c)/3,t.y>=0?i=(-u*Math.cos(l+Math.PI/3)-n/3/h)*Math.PI:i=-(-u*Math.cos(l+Math.PI/3)-n/3/h)*Math.PI,Math.abs(s)<x?e=this.long0:e=E(this.long0+Math.PI*(r-1+Math.sqrt(1+2*(s*s-a*a)+r*r))/2/s),t.x=e,t.y=i,t}var Jl=["Van_der_Grinten_I","VanDerGrinten","Van_der_Grinten","vandg"];const tc={init:Ql,forward:Zl,inverse:Yl,names:Jl};function ec(t,e,i,s,a,r){const o=s-e,n=Math.atan((1-r)*Math.tan(t)),h=Math.atan((1-r)*Math.tan(i)),f=Math.sin(n),u=Math.cos(n),c=Math.sin(h),l=Math.cos(h);let m=o,_,d=100,y,v,S,M,P,w,A,G,k,L,mt,K,$t,zt;do{if(y=Math.sin(m),v=Math.cos(m),S=Math.sqrt(l*y*(l*y)+(u*c-f*l*v)*(u*c-f*l*v)),S===0)return{azi1:0,s12:0};M=f*c+u*l*v,P=Math.atan2(S,M),w=u*l*y/S,A=1-w*w,G=A!==0?M-2*f*c/A:0,k=r/16*A*(4+r*(4-3*A)),_=m,m=o+(1-k)*r*w*(P+k*S*(G+k*M*(-1+2*G*G)))}while(Math.abs(m-_)>1e-12&&--d>0);return d===0?{azi1:NaN,s12:NaN}:(L=A*(a*a-a*(1-r)*(a*(1-r)))/(a*(1-r)*(a*(1-r))),mt=1+L/16384*(4096+L*(-768+L*(320-175*L))),K=L/1024*(256+L*(-128+L*(74-47*L))),$t=K*S*(G+K/4*(M*(-1+2*G*G)-K/6*G*(-3+4*S*S)*(-3+4*G*G))),zt=a*(1-r)*mt*(P-$t),{azi1:Math.atan2(l*y,u*c-f*l*v),s12:zt})}function ic(t,e,i,s,a,r){const o=Math.atan((1-r)*Math.tan(t)),n=Math.sin(o),h=Math.cos(o),f=Math.sin(i),u=Math.cos(i),c=Math.atan2(n,h*u),l=h*f,m=1-l*l,_=m*(a*a-a*(1-r)*(a*(1-r)))/(a*(1-r)*(a*(1-r))),d=1+_/16384*(4096+_*(-768+_*(320-175*_))),y=_/1024*(256+_*(-128+_*(74-47*_)));let v=s/(a*(1-r)*d),S,M=100,P,w,A,G;do P=Math.cos(2*c+v),w=Math.sin(v),A=Math.cos(v),G=y*w*(P+y/4*(A*(-1+2*P*P)-y/6*P*(-3+4*w*w)*(-3+4*P*P))),S=v,v=s/(a*(1-r)*d)+G;while(Math.abs(v-S)>1e-12&&--M>0);if(M===0)return{lat2:NaN,lon2:NaN};const k=n*w-h*A*u,L=Math.atan2(n*A+h*w*u,(1-r)*Math.sqrt(l*l+k*k)),mt=Math.atan2(w*f,h*A-n*w*u),K=r/16*m*(4+r*(4-3*m)),$t=mt-(1-K)*r*l*(v+K*w*(P+K*A*(-1+2*P*P))),zt=e+$t;return{lat2:L,lon2:zt}}function sc(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0),this.f=this.es/(1+Math.sqrt(1-this.es))}function ac(t){var e=t.x,i=t.y,s=Math.sin(t.y),a=Math.cos(t.y),r=E(e-this.long0),o,n,h,f,u,c,l,m,_,d,y;return this.sphere?Math.abs(this.sin_p12-1)<=x?(t.x=this.x0+this.a*(g-i)*Math.sin(r),t.y=this.y0-this.a*(g-i)*Math.cos(r),t):Math.abs(this.sin_p12+1)<=x?(t.x=this.x0+this.a*(g+i)*Math.sin(r),t.y=this.y0+this.a*(g+i)*Math.cos(r),t):(_=this.sin_p12*s+this.cos_p12*a*Math.cos(r),l=Math.acos(_),m=l?l/Math.sin(l):1,t.x=this.x0+this.a*m*a*Math.sin(r),t.y=this.y0+this.a*m*(this.cos_p12*s-this.sin_p12*a*Math.cos(r)),t):(o=he(this.es),n=fe(this.es),h=le(this.es),f=ce(this.es),Math.abs(this.sin_p12-1)<=x?(u=this.a*j(o,n,h,f,g),c=this.a*j(o,n,h,f,i),t.x=this.x0+(u-c)*Math.sin(r),t.y=this.y0-(u-c)*Math.cos(r),t):Math.abs(this.sin_p12+1)<=x?(u=this.a*j(o,n,h,f,g),c=this.a*j(o,n,h,f,i),t.x=this.x0+(u+c)*Math.sin(r),t.y=this.y0+(u+c)*Math.cos(r),t):Math.abs(e)<x&&Math.abs(i-this.lat0)<x?(t.x=t.y=0,t):(d=ec(this.lat0,this.long0,i,e,this.a,this.f),y=d.azi1,t.x=d.s12*Math.sin(y),t.y=d.s12*Math.cos(y),t))}function rc(t){t.x-=this.x0,t.y-=this.y0;var e,i,s,a,r,o,n,h,f,u,c,l,m,_,d,y;return this.sphere?(e=Math.sqrt(t.x*t.x+t.y*t.y),e>2*g*this.a?void 0:(i=e/this.a,s=Math.sin(i),a=Math.cos(i),r=this.long0,Math.abs(e)<=x?o=this.lat0:(o=_t(a*this.sin_p12+t.y*s*this.cos_p12/e),n=Math.abs(this.lat0)-g,Math.abs(n)<=x?this.lat0>=0?r=E(this.long0+Math.atan2(t.x,-t.y)):r=E(this.long0-Math.atan2(-t.x,t.y)):r=E(this.long0+Math.atan2(t.x*s,e*this.cos_p12*a-t.y*this.sin_p12*s))),t.x=r,t.y=o,t)):(h=he(this.es),f=fe(this.es),u=le(this.es),c=ce(this.es),Math.abs(this.sin_p12-1)<=x?(l=this.a*j(h,f,u,c,g),e=Math.sqrt(t.x*t.x+t.y*t.y),m=l-e,o=Xe(m/this.a,h,f,u,c),r=E(this.long0+Math.atan2(t.x,-1*t.y)),t.x=r,t.y=o,t):Math.abs(this.sin_p12+1)<=x?(l=this.a*j(h,f,u,c,g),e=Math.sqrt(t.x*t.x+t.y*t.y),m=e-l,o=Xe(m/this.a,h,f,u,c),r=E(this.long0+Math.atan2(t.x,t.y)),t.x=r,t.y=o,t):(_=Math.atan2(t.x,t.y),d=Math.sqrt(t.x*t.x+t.y*t.y),y=ic(this.lat0,this.long0,_,d,this.a,this.f),t.x=y.lon2,t.y=y.lat2,t))}var nc=["Azimuthal_Equidistant","aeqd"];const oc={init:sc,forward:ac,inverse:rc,names:nc};function hc(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function fc(t){var e,i,s,a,r,o,n,h,f=t.x,u=t.y;return s=E(f-this.long0),e=Math.sin(u),i=Math.cos(u),a=Math.cos(s),o=this.sin_p14*e+this.cos_p14*i*a,r=1,(o>0||Math.abs(o)<=x)&&(n=this.a*r*i*Math.sin(s),h=this.y0+this.a*r*(this.cos_p14*e-this.sin_p14*i*a)),t.x=n,t.y=h,t}function lc(t){var e,i,s,a,r,o,n;return t.x-=this.x0,t.y-=this.y0,e=Math.sqrt(t.x*t.x+t.y*t.y),i=_t(e/this.a),s=Math.sin(i),a=Math.cos(i),o=this.long0,Math.abs(e)<=x?(n=this.lat0,t.x=o,t.y=n,t):(n=_t(a*this.sin_p14+t.y*s*this.cos_p14/e),r=Math.abs(this.lat0)-g,Math.abs(r)<=x?(this.lat0>=0?o=E(this.long0+Math.atan2(t.x,-t.y)):o=E(this.long0-Math.atan2(-t.x,t.y)),t.x=o,t.y=n,t):(o=E(this.long0+Math.atan2(t.x*s,e*this.cos_p14*a-t.y*this.sin_p14*s)),t.x=o,t.y=n,t))}var cc=["ortho"];const uc={init:hc,forward:fc,inverse:lc,names:cc};var C={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},T={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function _c(){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>=g-I/2?this.face=C.TOP:this.lat0<=-(g-I/2)?this.face=C.BOTTOM:Math.abs(this.long0)<=I?this.face=C.FRONT:Math.abs(this.long0)<=g+I?this.face=this.long0>0?C.RIGHT:C.LEFT:this.face=C.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function mc(t){var e={x:0,y:0},i,s,a,r,o,n,h={value:0};if(t.x-=this.long0,this.es!==0?i=Math.atan(this.one_minus_f_squared*Math.tan(t.y)):i=t.y,s=t.x,this.face===C.TOP)r=g-i,s>=I&&s<=g+I?(h.value=T.AREA_0,a=s-g):s>g+I||s<=-(g+I)?(h.value=T.AREA_1,a=s>0?s-F:s+F):s>-(g+I)&&s<=-I?(h.value=T.AREA_2,a=s+g):(h.value=T.AREA_3,a=s);else if(this.face===C.BOTTOM)r=g+i,s>=I&&s<=g+I?(h.value=T.AREA_0,a=-s+g):s<I&&s>=-I?(h.value=T.AREA_1,a=-s):s<-I&&s>=-(g+I)?(h.value=T.AREA_2,a=-s-g):(h.value=T.AREA_3,a=s>0?-s+F:-s-F);else{var f,u,c,l,m,_,d;this.face===C.RIGHT?s=Bt(s,+g):this.face===C.BACK?s=Bt(s,+F):this.face===C.LEFT&&(s=Bt(s,-g)),l=Math.sin(i),m=Math.cos(i),_=Math.sin(s),d=Math.cos(s),f=m*d,u=m*_,c=l,this.face===C.FRONT?(r=Math.acos(f),a=Qe(r,c,u,h)):this.face===C.RIGHT?(r=Math.acos(u),a=Qe(r,c,-f,h)):this.face===C.BACK?(r=Math.acos(-f),a=Qe(r,c,-u,h)):this.face===C.LEFT?(r=Math.acos(-u),a=Qe(r,c,f,h)):(r=a=0,h.value=T.AREA_0)}return n=Math.atan(12/F*(a+Math.acos(Math.sin(a)*Math.cos(I))-g)),o=Math.sqrt((1-Math.cos(r))/(Math.cos(n)*Math.cos(n))/(1-Math.cos(Math.atan(1/Math.cos(a))))),h.value===T.AREA_1?n+=g:h.value===T.AREA_2?n+=F:h.value===T.AREA_3&&(n+=1.5*F),e.x=o*Math.cos(n),e.y=o*Math.sin(n),e.x=e.x*this.a+this.x0,e.y=e.y*this.a+this.y0,t.x=e.x,t.y=e.y,t}function dc(t){var e={lam:0,phi:0},i,s,a,r,o,n,h,f,u,c={value:0};if(t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a,s=Math.atan(Math.sqrt(t.x*t.x+t.y*t.y)),i=Math.atan2(t.y,t.x),t.x>=0&&t.x>=Math.abs(t.y)?c.value=T.AREA_0:t.y>=0&&t.y>=Math.abs(t.x)?(c.value=T.AREA_1,i-=g):t.x<0&&-t.x>=Math.abs(t.y)?(c.value=T.AREA_2,i=i<0?i+F:i-F):(c.value=T.AREA_3,i+=g),u=F/12*Math.tan(i),o=Math.sin(u)/(Math.cos(u)-1/Math.sqrt(2)),n=Math.atan(o),a=Math.cos(i),r=Math.tan(s),h=1-a*a*r*r*(1-Math.cos(Math.atan(1/Math.cos(n)))),h<-1?h=-1:h>1&&(h=1),this.face===C.TOP)f=Math.acos(h),e.phi=g-f,c.value===T.AREA_0?e.lam=n+g:c.value===T.AREA_1?e.lam=n<0?n+F:n-F:c.value===T.AREA_2?e.lam=n-g:e.lam=n;else if(this.face===C.BOTTOM)f=Math.acos(h),e.phi=f-g,c.value===T.AREA_0?e.lam=-n+g:c.value===T.AREA_1?e.lam=-n:c.value===T.AREA_2?e.lam=-n-g:e.lam=n<0?-n-F:-n+F;else{var l,m,_;l=h,u=l*l,u>=1?_=0:_=Math.sqrt(1-u)*Math.sin(n),u+=_*_,u>=1?m=0:m=Math.sqrt(1-u),c.value===T.AREA_1?(u=m,m=-_,_=u):c.value===T.AREA_2?(m=-m,_=-_):c.value===T.AREA_3&&(u=m,m=_,_=-u),this.face===C.RIGHT?(u=l,l=-m,m=u):this.face===C.BACK?(l=-l,m=-m):this.face===C.LEFT&&(u=l,l=m,m=-u),e.phi=Math.acos(-_)-g,e.lam=Math.atan2(m,l),this.face===C.RIGHT?e.lam=Bt(e.lam,-g):this.face===C.BACK?e.lam=Bt(e.lam,-F):this.face===C.LEFT&&(e.lam=Bt(e.lam,+g))}if(this.es!==0){var d,y,v;d=e.phi<0?1:0,y=Math.tan(e.phi),v=this.b/Math.sqrt(y*y+this.one_minus_f_squared),e.phi=Math.atan(Math.sqrt(this.a*this.a-v*v)/(this.one_minus_f*v)),d&&(e.phi=-e.phi)}return e.lam+=this.long0,t.x=e.lam,t.y=e.phi,t}function Qe(t,e,i,s){var a;return t<x?(s.value=T.AREA_0,a=0):(a=Math.atan2(e,i),Math.abs(a)<=I?s.value=T.AREA_0:a>I&&a<=g+I?(s.value=T.AREA_1,a-=g):a>g+I||a<=-(g+I)?(s.value=T.AREA_2,a=a>=0?a-F:a+F):(s.value=T.AREA_3,a+=g)),a}function Bt(t,e){var i=t+e;return i<-F?i+=ie:i>+F&&(i-=ie),i}var yc=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"];const gc={init:_c,forward:mc,inverse:dc,names:yc};var Yi=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.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,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.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]],ue=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Ja=.8487,tr=1.3523,er=et/5,vc=1/er,kt=18,Ze=function(t,e){return t[0]+e*(t[1]+e*(t[2]+e*t[3]))},Mc=function(t,e){return t[1]+e*(2*t[2]+e*3*t[3])};function xc(t,e,i,s){for(var a=e;s;--s){var r=t(a);if(a-=r,Math.abs(r)<i)break}return a}function Ec(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function Sc(t){var e=E(t.x-this.long0),i=Math.abs(t.y),s=Math.floor(i*er);s<0?s=0:s>=kt&&(s=kt-1),i=et*(i-vc*s);var a={x:Ze(Yi[s],i)*e,y:Ze(ue[s],i)};return t.y<0&&(a.y=-a.y),a.x=a.x*this.a*Ja+this.x0,a.y=a.y*this.a*tr+this.y0,a}function Pc(t){var e={x:(t.x-this.x0)/(this.a*Ja),y:Math.abs(t.y-this.y0)/(this.a*tr)};if(e.y>=1)e.x/=Yi[kt][0],e.y=t.y<0?-g:g;else{var i=Math.floor(e.y*kt);for(i<0?i=0:i>=kt&&(i=kt-1);;)if(ue[i][0]>e.y)--i;else if(ue[i+1][0]<=e.y)++i;else break;var s=ue[i],a=5*(e.y-s[0])/(ue[i+1][0]-s[0]);a=xc(function(r){return(Ze(s,r)-e.y)/Mc(s,r)},a,x,100),e.x/=Ze(Yi[i],a),e.y=(5*i+a)*U,t.y<0&&(e.y=-e.y)}return e.x=E(e.x+this.long0),e}var bc=["Robinson","robin"];const wc={init:Ec,forward:Sc,inverse:Pc,names:bc};function Ac(){this.name="geocent"}function Gc(t){var e=Ra(t,this.es,this.a);return e}function Ic(t){var e=pa(t,this.es,this.a,this.b);return e}var Tc=["Geocentric","geocentric","geocent","Geocent"];const Nc={init:Ac,forward:Gc,inverse:Ic,names:Tc};var B={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},_e={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Rc(){if(Object.keys(_e).forEach((function(i){if(typeof this[i]>"u")this[i]=_e[i].def;else{if(_e[i].num&&isNaN(this[i]))throw new Error("Invalid parameter value, must be numeric "+i+" = "+this[i]);_e[i].num&&(this[i]=parseFloat(this[i]))}_e[i].degrees&&(this[i]=this[i]*U)}).bind(this)),Math.abs(Math.abs(this.lat0)-g)<x?this.mode=this.lat0<0?B.S_POLE:B.N_POLE:Math.abs(this.lat0)<x?this.mode=B.EQUIT:(this.mode=B.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var t=this.tilt,e=this.azi;this.cg=Math.cos(e),this.sg=Math.sin(e),this.cw=Math.cos(t),this.sw=Math.sin(t)}function pc(t){t.x-=this.long0;var e=Math.sin(t.y),i=Math.cos(t.y),s=Math.cos(t.x),a,r;switch(this.mode){case B.OBLIQ:r=this.sinph0*e+this.cosph0*i*s;break;case B.EQUIT:r=i*s;break;case B.S_POLE:r=-e;break;case B.N_POLE:r=e;break}switch(r=this.pn1/(this.p-r),a=r*i*Math.sin(t.x),this.mode){case B.OBLIQ:r*=this.cosph0*e-this.sinph0*i*s;break;case B.EQUIT:r*=e;break;case B.N_POLE:r*=-(i*s);break;case B.S_POLE:r*=i*s;break}var o,n;return o=r*this.cg+a*this.sg,n=1/(o*this.sw*this.h1+this.cw),a=(a*this.cg-r*this.sg)*this.cw*n,r=o*n,t.x=a*this.a,t.y=r*this.a,t}function Cc(t){t.x/=this.a,t.y/=this.a;var e={x:t.x,y:t.y},i,s,a;a=1/(this.pn1-t.y*this.sw),i=this.pn1*t.x*a,s=this.pn1*t.y*this.cw*a,t.x=i*this.cg+s*this.sg,t.y=s*this.cg-i*this.sg;var r=W(t.x,t.y);if(Math.abs(r)<x)e.x=0,e.y=t.y;else{var o,n;switch(n=1-r*r*this.pfact,n=(this.p-Math.sqrt(n))/(this.pn1/r+r/this.pn1),o=Math.sqrt(1-n*n),this.mode){case B.OBLIQ:e.y=Math.asin(o*this.sinph0+t.y*n*this.cosph0/r),t.y=(o-this.sinph0*Math.sin(e.y))*r,t.x*=n*this.cosph0;break;case B.EQUIT:e.y=Math.asin(t.y*n/r),t.y=o*r,t.x*=n;break;case B.N_POLE:e.y=Math.asin(o),t.y=-t.y;break;case B.S_POLE:e.y=-Math.asin(o);break}e.x=Math.atan2(t.x,t.y)}return t.x=e.x+this.long0,t.y=e.y,t}var Fc=["Tilted_Perspective","tpers"];const Oc={init:Rc,forward:pc,inverse:Cc,names:Fc};function Lc(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var t=1-this.es,e=1/t;this.radius_p=Math.sqrt(t),this.radius_p2=t,this.radius_p_inv2=e,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function Uc(t){var e=t.x,i=t.y,s,a,r,o;if(e=e-this.long0,this.shape==="ellipse"){i=Math.atan(this.radius_p2*Math.tan(i));var n=this.radius_p/W(this.radius_p*Math.cos(i),Math.sin(i));if(a=n*Math.cos(e)*Math.cos(i),r=n*Math.sin(e)*Math.cos(i),o=n*Math.sin(i),(this.radius_g-a)*a-r*r-o*o*this.radius_p_inv2<0)return t.x=Number.NaN,t.y=Number.NaN,t;s=this.radius_g-a,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/W(o,s)),t.y=this.radius_g_1*Math.atan(o/s)):(t.x=this.radius_g_1*Math.atan(r/s),t.y=this.radius_g_1*Math.atan(o/W(r,s)))}else this.shape==="sphere"&&(s=Math.cos(i),a=Math.cos(e)*s,r=Math.sin(e)*s,o=Math.sin(i),s=this.radius_g-a,this.flip_axis?(t.x=this.radius_g_1*Math.atan(r/W(o,s)),t.y=this.radius_g_1*Math.atan(o/s)):(t.x=this.radius_g_1*Math.atan(r/s),t.y=this.radius_g_1*Math.atan(o/W(r,s))));return t.x=t.x*this.a,t.y=t.y*this.a,t}function Dc(t){var e=-1,i=0,s=0,a,r,o,n;if(t.x=t.x/this.a,t.y=t.y/this.a,this.shape==="ellipse"){this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),i=Math.tan(t.x/this.radius_g_1)*W(1,s)):(i=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*W(1,i));var h=s/this.radius_p;if(a=i*i+h*h+e*e,r=2*this.radius_g*e,o=r*r-4*a*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(o))/(2*a),e=this.radius_g+n*e,i*=n,s*=n,t.x=Math.atan2(i,e),t.y=Math.atan(s*Math.cos(t.x)/e),t.y=Math.atan(this.radius_p_inv2*Math.tan(t.y))}else if(this.shape==="sphere"){if(this.flip_axis?(s=Math.tan(t.y/this.radius_g_1),i=Math.tan(t.x/this.radius_g_1)*Math.sqrt(1+s*s)):(i=Math.tan(t.x/this.radius_g_1),s=Math.tan(t.y/this.radius_g_1)*Math.sqrt(1+i*i)),a=i*i+s*s+e*e,r=2*this.radius_g*e,o=r*r-4*a*this.C,o<0)return t.x=Number.NaN,t.y=Number.NaN,t;n=(-r-Math.sqrt(o))/(2*a),e=this.radius_g+n*e,i*=n,s*=n,t.x=Math.atan2(i,e),t.y=Math.atan(s*Math.cos(t.x)/e)}return t.x=t.x+this.long0,t}var Bc=["Geostationary Satellite View","Geostationary_Satellite","geos"];const kc={init:Lc,forward:Uc,inverse:Dc,names:Bc};var me=1.340264,de=-.081106,ye=893e-6,ge=.003796,Ye=Math.sqrt(3)/2;function $c(){this.es=0,this.long0=this.long0!==void 0?this.long0:0}function zc(t){var e=E(t.x-this.long0),i=t.y,s=Math.asin(Ye*Math.sin(i)),a=s*s,r=a*a*a;return t.x=e*Math.cos(s)/(Ye*(me+3*de*a+r*(7*ye+9*ge*a))),t.y=s*(me+de*a+r*(ye+ge*a)),t.x=this.a*t.x+this.x0,t.y=this.a*t.y+this.y0,t}function qc(t){t.x=(t.x-this.x0)/this.a,t.y=(t.y-this.y0)/this.a;var e=1e-9,i=12,s=t.y,a,r,o,n,h,f;for(f=0;f<i&&(a=s*s,r=a*a*a,o=s*(me+de*a+r*(ye+ge*a))-t.y,n=me+3*de*a+r*(7*ye+9*ge*a),s-=h=o/n,!(Math.abs(h)<e));++f);return a=s*s,r=a*a*a,t.x=Ye*t.x*(me+3*de*a+r*(7*ye+9*ge*a))/Math.cos(s),t.y=Math.asin(Math.sin(s)/Ye),t.x=E(t.x+this.long0),t}var jc=["eqearth","Equal Earth","Equal_Earth"];const Vc={init:$c,forward:zc,inverse:qc,names:jc};var ve=1e-10;function Hc(){var t;if(this.phi1=this.lat1,Math.abs(this.phi1)<ve)throw new Error;this.es?(this.en=zi(this.es),this.m1=Ut(this.phi1,this.am1=Math.sin(this.phi1),t=Math.cos(this.phi1),this.en),this.am1=t/(Math.sqrt(1-this.es*this.am1*this.am1)*this.am1),this.inverse=Xc,this.forward=Wc):(Math.abs(this.phi1)+ve>=g?this.cphi1=0:this.cphi1=1/Math.tan(this.phi1),this.inverse=Qc,this.forward=Kc)}function Wc(t){var e=E(t.x-(this.long0||0)),i=t.y,s,a,r;return s=this.am1+this.m1-Ut(i,a=Math.sin(i),r=Math.cos(i),this.en),a=r*e/(s*Math.sqrt(1-this.es*a*a)),t.x=s*Math.sin(a),t.y=this.am1-s*Math.cos(a),t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Xc(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,i,s,a;if(i=W(t.x,t.y=this.am1-t.y),a=qi(this.am1+this.m1-i,this.es,this.en),(e=Math.abs(a))<g)e=Math.sin(a),s=i*Math.atan2(t.x,t.y)*Math.sqrt(1-this.es*e*e)/Math.cos(a);else if(Math.abs(e-g)<=ve)s=0;else throw new Error;return t.x=E(s+(this.long0||0)),t.y=ct(a),t}function Kc(t){var e=E(t.x-(this.long0||0)),i=t.y,s,a;return a=this.cphi1+this.phi1-i,Math.abs(a)>ve?(t.x=a*Math.sin(s=e*Math.cos(i)/a),t.y=this.cphi1-a*Math.cos(s)):t.x=t.y=0,t.x=this.a*t.x+(this.x0||0),t.y=this.a*t.y+(this.y0||0),t}function Qc(t){t.x=(t.x-(this.x0||0))/this.a,t.y=(t.y-(this.y0||0))/this.a;var e,i,s=W(t.x,t.y=this.cphi1-t.y);if(i=this.cphi1+this.phi1-s,Math.abs(i)>g)throw new Error;return Math.abs(Math.abs(i)-g)<=ve?e=0:e=s*Math.atan2(t.x,t.y)/Math.cos(i),t.x=E(e+(this.long0||0)),t.y=ct(i),t}var Zc=["bonne","Bonne (Werner lat_1=90)"];const Yc={init:Hc,names:Zc};function Jc(t){t.Proj.projections.add(He),t.Proj.projections.add(We),t.Proj.projections.add(Zf),t.Proj.projections.add(n1),t.Proj.projections.add(c1),t.Proj.projections.add(y1),t.Proj.projections.add(S1),t.Proj.projections.add(G1),t.Proj.projections.add(p1),t.Proj.projections.add(U1),t.Proj.projections.add(Q1),t.Proj.projections.add(il),t.Proj.projections.add(ol),t.Proj.projections.add(_l),t.Proj.projections.add(vl),t.Proj.projections.add(Pl),t.Proj.projections.add(Il),t.Proj.projections.add(Cl),t.Proj.projections.add(Bl),t.Proj.projections.add(jl),t.Proj.projections.add(Kl),t.Proj.projections.add(tc),t.Proj.projections.add(oc),t.Proj.projections.add(uc),t.Proj.projections.add(gc),t.Proj.projections.add(wc),t.Proj.projections.add(Nc),t.Proj.projections.add(Oc),t.Proj.projections.add(kc),t.Proj.projections.add(Vc),t.Proj.projections.add(Yc)}const ir=Object.assign(mf,{defaultDatum:"WGS84",Proj:J,WGS84:new J("WGS84"),Point:Lt,toPoint:La,defs:q,nadgrid:K0,transform:je,mgrs:df,version:"__VERSION__"});Jc(ir);class tu{constructor(e=[],i=(s,a)=>s<a?-1:s>a?1:0){if(this.data=e,this.length=this.data.length,this.compare=i,this.length>0)for(let s=(this.length>>1)-1;s>=0;s--)this._down(s)}push(e){this.data.push(e),this._up(this.length++)}pop(){if(this.length===0)return;const e=this.data[0],i=this.data.pop();return--this.length>0&&(this.data[0]=i,this._down(0)),e}peek(){return this.data[0]}_up(e){const{data:i,compare:s}=this,a=i[e];for(;e>0;){const r=e-1>>1,o=i[r];if(s(a,o)>=0)break;i[e]=o,e=r}i[e]=a}_down(e){const{data:i,compare:s}=this,a=this.length>>1,r=i[e];for(;e<a;){let o=(e<<1)+1;const n=o+1;if(n<this.length&&s(i[n],i[o])<0&&(o=n),s(i[o],r)>=0)break;i[e]=i[o],e=o}i[e]=r}}class eu{constructor(e,i,s,a){this._projector=e,this._verts=i,this._uv=s,this._projVerts=i.map(e),this._trigs=a,this._segs=[],this._segCount=0,this._segTrigs=[],this._queue=new tu([],function(r,o){return o.epsilon-r.epsilon}),this._vertToSeg=new Array(i.length);for(const r in this._verts)this._vertToSeg[r]=[];for(const r in this._trigs){const o=this._trigs[r],n=o[0],h=o[1],f=o[2];this._segment(n,h,r),this._segment(h,f,r),this._segment(f,n,r)}}_segment(e,i,s,a=1/0){if(this._vertToSeg[e]&&this._vertToSeg[e][i]!==void 0){const u=this._vertToSeg[e][i];return this._segTrigs[u].includes(s)||this._segTrigs[u].push(s),u}const r=this._segCount++;this._segs[r]=[e,i],this._vertToSeg[e][i]=r,this._vertToSeg[i][e]=r,this._segTrigs[r]=[s];const o=[(this._verts[e][0]+this._verts[i][0])/2,(this._verts[e][1]+this._verts[i][1])/2],n=this._projector(o),h=[(this._projVerts[e][0]+this._projVerts[i][0])/2,(this._projVerts[e][1]+this._projVerts[i][1])/2],f=(n[0]-h[0])**2+(n[1]-h[1])**2;return Number.isFinite(f)&&f<a&&this._queue.push({v1:e,v2:i,epsilon:f,midpoint:o,projectedMid:n}),r}output(){return{unprojected:Array.from(this._verts),projected:Array.from(this._projVerts),uv:Array.from(this._uv),trigs:Array.from(this._trigs)}}_stepsWithSameEpsilon=0;lowerEpsilon(e){let i=this._queue.peek().epsilon,s=i;for(;i>=e;)if(this.step(),i=this._queue.peek().epsilon,i===s){if(this._stepsWithSameEpsilon++,this._stepsWithSameEpsilon<500){console.warn("Arrugator stopped due to epsilon stall. Raster may need hints for proper arrugation.");break}}else this._stepsWithSameEpsilon=0,s=i}get epsilon(){return this._queue.peek().epsilon}set epsilon(e){return this.lowerEpsilon(e)}step(){const e=this._queue.pop();return this._splitSegment(e,e.epsilon)}force(){const e=this._queue.data;this._queue.data=[],this._queue.length=0,e.forEach(i=>this._splitSegment(i,1/0))}_splitSegment(e,i){const s=e.v1,a=e.v2,r=this._vertToSeg[s]&&this._vertToSeg[s][a],o=this._segTrigs[r];if(o.length>=3)throw new Error("Somehow a segment is shared by three triangles");delete this._segTrigs[r],delete this._segs[r],delete this._vertToSeg[s][a],delete this._vertToSeg[a][s];const n=this._verts.length;this._projVerts[n]=e.projectedMid,this._verts[n]=e.midpoint,this._vertToSeg[n]=[],this._uv[n]=[(this._uv[s][0]+this._uv[a][0])/2,(this._uv[s][1]+this._uv[a][1])/2];for(const h of o)this._splitTriangle(s,a,n,h,i)}_splitTriangle(e,i,s,a,r=1/0){const o=this._trigs[a];let n,h=!1;if(o[0]===e&&o[1]===i)n=o[2],h=!0;else if(o[1]===e&&o[2]===i)n=o[0],h=!0;else if(o[2]===e&&o[0]===i)n=o[1],h=!0;else if(o[1]===e&&o[0]===i)n=o[2],h=!1;else if(o[2]===e&&o[1]===i)n=o[0],h=!1;else if(o[0]===e&&o[2]===i)n=o[1],h=!1;else throw new Error("Data structure mishap: could not fetch 3rd vertex used in triangle");const f=this._trigs.length;h?(this._trigs[a]=[e,s,n],this._trigs[f]=[s,i,n]):(this._trigs[a]=[s,e,n],this._trigs[f]=[i,s,n]);const u=this._vertToSeg[e]&&this._vertToSeg[e][i],c=this._vertToSeg[i]&&this._vertToSeg[i][n],l=this._vertToSeg[n]&&this._vertToSeg[n][e];function m(_){return _!==a}u!==void 0&&(this._segTrigs[u]=this._segTrigs[u].filter(m)),c!==void 0&&(this._segTrigs[c]=this._segTrigs[c].filter(m)),l!==void 0&&(this._segTrigs[l]=this._segTrigs[l].filter(m)),this._segment(e,s,a,r),this._segment(s,n,a,r),this._segment(n,e,a,r),this._segment(i,s,f,r),this._segment(s,n,f,r),this._segment(n,i,f,r)}}function sr(t,e,i=100){const s=[-20037508342789244e-9,20037508342789244e-9],a=[e[0],e[3],e[1],e[2]],r=ir(t,"EPSG:3857").forward;function o(u){const c=r(u),l=Math.abs((c[0]-s[0])/(20037508342789244e-9*2)),m=Math.abs((c[1]-s[1])/(20037508342789244e-9*2));return[l,m]}const n=[[0,0],[0,1],[1,0],[1,1]],h=new eu(o,a,n,[[0,1,3],[0,3,2]]);if(i>0){h.force();for(let u=0;u<i;u++)h.step()}const f=h.output();return{pos:f.projected.flat(),uv:f.uv.flat(),trigs:f.trigs.flat()}}const iu=`
|
|
16
|
+
#ifdef GL_ES
|
|
17
|
+
precision highp int;
|
|
18
|
+
precision mediump float;
|
|
19
|
+
#endif
|
|
20
|
+
uniform sampler2D u_sampler;
|
|
21
|
+
uniform float u_opacity;
|
|
22
|
+
varying vec2 v_uv;
|
|
23
|
+
void main() {
|
|
24
|
+
vec4 color = texture2D(u_sampler, v_uv);
|
|
25
|
+
gl_FragColor = color * u_opacity;
|
|
26
|
+
}
|
|
27
|
+
`,su=`
|
|
28
|
+
uniform mat4 u_matrix;
|
|
29
|
+
attribute vec2 a_pos;
|
|
30
|
+
attribute vec2 a_uv;
|
|
31
|
+
varying vec2 v_uv;
|
|
32
|
+
void main() {
|
|
33
|
+
gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
|
|
34
|
+
v_uv = a_uv;
|
|
35
|
+
}
|
|
36
|
+
`,ar=`
|
|
37
|
+
#ifdef GL_ES
|
|
38
|
+
precision highp int;
|
|
39
|
+
precision mediump float;
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
void main() {
|
|
43
|
+
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
|
44
|
+
}
|
|
45
|
+
`,rr=`
|
|
46
|
+
uniform mat4 u_matrix;
|
|
47
|
+
uniform float u_alt;
|
|
48
|
+
attribute vec2 a_pos;
|
|
49
|
+
|
|
50
|
+
const float PI = 3.1415926536;
|
|
51
|
+
const float earthRadius = 6371008.8;
|
|
52
|
+
const float earthCircumference = 2.0 * PI * earthRadius; // meters
|
|
53
|
+
|
|
54
|
+
float circumferenceAtLatitude(float latitude) {
|
|
55
|
+
return earthCircumference * cos(latitude * PI / 180.0);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
float mercatorXfromLng(float lng) {
|
|
59
|
+
return (180.0 + lng) / 360.0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
float mercatorYfromLat(float lat) {
|
|
63
|
+
return (180.0 - (180.0 / PI * log(tan(PI / 4.0 + lat * PI / 360.0)))) / 360.0;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
float mercatorZfromAltitude(float altitude, float lat) {
|
|
67
|
+
return altitude / circumferenceAtLatitude(lat);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
vec3 mercatorfromLngLat(vec2 lnglat, float alt) {
|
|
71
|
+
return vec3(mercatorXfromLng(lnglat.x), mercatorYfromLat(lnglat.y), mercatorZfromAltitude(alt, lnglat.y));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
void main() {
|
|
75
|
+
vec3 mercator = mercatorfromLngLat(a_pos, 0.0);
|
|
76
|
+
gl_Position = u_matrix * vec4(mercator, 1.0);
|
|
77
|
+
// gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);
|
|
78
|
+
}
|
|
79
|
+
`;class au{id;type="custom";renderingMode="2d";metadata;option;map;gl;loaded;arrugado;programInfo;bufferInfo;texture;maskProperty;maskProgramInfo;maskBufferInfo;constructor(e,i){this.id=e,this.option=i,this.loaded=!1,this.maskProperty=Object.assign({type:"in"},i.mask),this.metadata=i.metadata;const{projection:s,coordinates:a}=i;this.arrugado=sr(s,a,i.arrugatorStep)}onAdd(e,i){if(this.map=e,this.gl=i,this.programInfo=Ni(i,[su,iu]),this.loadTexture(e,i),this.bufferInfo=ci(i,{a_pos:{numComponents:2,data:this.arrugado.pos},a_uv:{numComponents:2,data:this.arrugado.uv},indices:this.arrugado.trigs}),this.maskProperty.data){const{data:s}=this.maskProperty;s&&(this.maskProgramInfo=Ni(i,[rr,ar]),this.maskBufferInfo=this.getMaskBufferInfo(i,s))}}onRemove(e,i){this.programInfo&&i.deleteProgram(this.programInfo.program),this.maskProgramInfo&&i.deleteProgram(this.maskProgramInfo.program),this.texture&&i.deleteTexture(this.texture)}render(e,i){if(this.map&&!this.map.painter.terrain&&(this.map.painter.currentStencilSource=void 0,this.map.painter._tileClippingMaskIDs={}),this.loaded&&this.programInfo&&this.bufferInfo){const s=i.defaultProjectionData.mainMatrix;if(e.enable(e.BLEND),e.blendFunc(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA),this.maskProgramInfo&&this.maskBufferInfo){e.useProgram(this.maskProgramInfo.program),e.enable(e.STENCIL_TEST),e.stencilFunc(e.ALWAYS,1,255),e.stencilOp(e.REPLACE,e.REPLACE,e.REPLACE),e.stencilMask(255),e.clear(e.STENCIL_BUFFER_BIT),Ti(this.maskProgramInfo,{u_matrix:s}),la(e,this.maskProgramInfo,this.maskBufferInfo);let a=e.UNSIGNED_SHORT;this.maskBufferInfo.numElements/3>65535&&(e.getExtension("OES_element_index_uint"),a=e.UNSIGNED_INT),e.drawElements(e.TRIANGLES,this.maskBufferInfo.numElements,a,0)}if(e.useProgram(this.programInfo.program),this.maskProgramInfo?.program){const a=this.maskProperty.type==="out"?0:1;e.stencilFunc(e.EQUAL,a,255),e.stencilOp(e.KEEP,e.KEEP,e.KEEP)}Ti(this.programInfo,{u_matrix:s,u_opacity:this.option.opacity??1,u_sampler:this.texture}),la(e,this.programInfo,this.bufferInfo),e.drawElements(e.TRIANGLES,this.arrugado.trigs.length,e.UNSIGNED_SHORT,0),e.clear(e.STENCIL_BUFFER_BIT),e.disable(e.STENCIL_TEST)}}updateImage(e){return this.gl&&this.map&&(this.option.opacity=e.opacity??this.option.opacity,(e.projection||e.coordinates)&&(this.option.projection=e.projection??this.option.projection,this.option.coordinates=e.coordinates??this.option.coordinates,this.arrugado=sr(this.option.projection,this.option.coordinates,this.option.arrugatorStep),this.bufferInfo=ci(this.gl,{a_pos:{numComponents:2,data:this.arrugado.pos},a_uv:{numComponents:2,data:this.arrugado.uv},indices:this.arrugado.trigs})),e.url||e.resampling?(this.loaded=!1,this.option.url=e.url??this.option.url,this.option.resampling=e.resampling??this.option.resampling,this.loadTexture(this.map,this.gl)):this.map.triggerRepaint()),this}updateMask(e){return this.gl&&this.map&&(e.data?(this.maskProgramInfo||(this.maskProgramInfo=Ni(this.gl,[rr,ar])),this.maskProperty=Object.assign(this.maskProperty,e),this.maskBufferInfo=this.getMaskBufferInfo(this.gl,this.maskProperty.data)):(this.maskProgramInfo&&this.gl.deleteProgram(this.maskProgramInfo.program),this.maskProgramInfo=void 0,this.maskBufferInfo=void 0),this.map.triggerRepaint()),this}loadTexture(e,i){const s=this.option.resampling==="nearest"?i.NEAREST:i.LINEAR;this.texture=Uo(i,{src:this.option.url,crossOrigin:this.option.crossOrigin,minMag:s,flipY:0},()=>{this.loaded=!0,e.triggerRepaint()})}getMaskBufferInfo(e,i){let s=[],a=[];if(i.type==="MultiPolygon"){const r=i.coordinates.length;let o=0;for(let n=0;n<r;n++){const h=i.coordinates[n],f=ss(h),{vertices:u,holes:c,dimensions:l}=f,_=bt(u,c,l).map(d=>d+o);o+=u.length/2;for(let d=0;d<u.length;d++)s.push(u[d]);for(let d=0;d<_.length;d++)a.push(_[d])}}else{const r=ss(i.coordinates),{vertices:o,holes:n,dimensions:h}=r;s=o,a=bt(o,n,h)}return ci(e,{a_pos:{numComponents:2,data:s},indices:a.length/3>65535?new Uint32Array(a):new Uint16Array(a)})}}return au});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\n#ifdef GL_ES\n precision highp int;\n precision mediump float;\n#endif\nuniform sampler2D u_sampler;\nuniform float u_opacity;\nvarying vec2 v_uv;\nvoid main() {\n vec4 color = texture2D(u_sampler, v_uv);\n gl_FragColor = color * u_opacity;\n}\n";
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: "\nuniform mat4 u_matrix;\nuniform float u_alt;\nattribute vec2 a_pos;\n\nconst float PI = 3.1415926536;\nconst float earthRadius = 6371008.8;\nconst float earthCircumference = 2.0 * PI * earthRadius; // meters\n\nfloat circumferenceAtLatitude(float latitude) {\n return earthCircumference * cos(latitude * PI / 180.0);\n}\n\nfloat mercatorXfromLng(float lng) {\n return (180.0 + lng) / 360.0;\n}\n\nfloat mercatorYfromLat(float lat) {\n return (180.0 - (180.0 / PI * log(tan(PI / 4.0 + lat * PI / 360.0)))) / 360.0;\n}\n\nfloat mercatorZfromAltitude(float altitude, float lat) {\n return altitude / circumferenceAtLatitude(lat);\n}\n\nvec3 mercatorfromLngLat(vec2 lnglat, float alt) {\n return vec3(mercatorXfromLng(lnglat.x), mercatorYfromLat(lnglat.y), mercatorZfromAltitude(alt, lnglat.y));\n}\n\nvoid main() {\n vec3 mercator = mercatorfromLngLat(a_pos, 0.0);\n gl_Position = u_matrix * vec4(mercator, 1.0);\n // gl_Position = u_matrix * vec4(a_pos, 0.0, 1.0);\n}\n";
|
|
2
|
+
export default _default;
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@naivemap/maplibre-gl-image-layer",
|
|
3
|
+
"version": "0.0.1-alpha.0",
|
|
4
|
+
"description": "Load a static image of any projection via Arrugator and Proj4js.",
|
|
5
|
+
"main": "./dist/index.umd.cjs",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"require": "./dist/index.umd.cjs"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"keywords": [
|
|
18
|
+
"maplibre",
|
|
19
|
+
"image",
|
|
20
|
+
"layer",
|
|
21
|
+
"custom"
|
|
22
|
+
],
|
|
23
|
+
"author": "naivemap",
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
26
|
+
"repository": "https://github.com/naivemap/maplibre-gl-layers",
|
|
27
|
+
"publishConfig": {
|
|
28
|
+
"access": "public"
|
|
29
|
+
},
|
|
30
|
+
"peerDependencies": {
|
|
31
|
+
"proj4": "^2.8.0",
|
|
32
|
+
"maplibre-gl": "^4.0.0 || ^5.0.0"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"earcut": "^3.0.1",
|
|
36
|
+
"tinyqueue": "^3.0.0",
|
|
37
|
+
"twgl.js": "^5.5.4"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@types/earcut": "^2.1.1",
|
|
41
|
+
"@types/proj4": "^2.5.2"
|
|
42
|
+
},
|
|
43
|
+
"scripts": {
|
|
44
|
+
"build": "vite build",
|
|
45
|
+
"docs:build": "pnpm typedoc"
|
|
46
|
+
}
|
|
47
|
+
}
|