1 |
- import{cl as xt,t as Y,k as Mt,a as ft,s as yt,h as z,l as kt,b7 as ut,ap as At,cA as bt,dj as It}from"./index.6c049565.js";import{r as at,g as tt}from"./pixelUtils.f4eba4af.js";const W=new Map;W.set("meter-per-second",1),W.set("kilometer-per-hour",.277778),W.set("knots",.514444),W.set("feet-per-second",.3048),W.set("mile-per-hour",.44704);const ot=180/Math.PI,it=5,et=new xt({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function st(t,n){return W.get(t)/W.get(n)||1}function dt(t){return(450-t)%360}function mt(t,n="geographic"){const[o,c]=t,i=Math.sqrt(o*o+c*c);let a=Math.atan2(c,o)*ot;return a=(360+a)%360,n==="geographic"&&(a=dt(a)),[i,a]}function pt(t,n="geographic"){let o=t[1];n==="geographic"&&(o=dt(o)),o%=360;const c=t[0];return[c*Math.cos(o/ot),c*Math.sin(o/ot)]}function Ct(t,n,o,c="geographic"){if(!at(t)||Y(o))return t;const i=n==="vector-magdir"?t.clone():Mt(lt(t,n)),a=i.pixels[1];for(let d=0;d<a.length;d++)a[d]=c==="geographic"?(a[d]+o[d]+270)%360:(a[d]+360-o[d])%360;return n==="vector-magdir"?i:lt(i,"vector-magdir")}function lt(t,n,o="geographic",c=1){if(!at(t))return t;const{pixels:i,width:a,height:d}=t,h=a*d,l=i[0],e=i[1],r=t.pixelType.startsWith("f")?t.pixelType:"f32",s=tt.createEmptyBand(r,h),m=tt.createEmptyBand(r,h);let u=0;for(let A=0;A<d;A++)for(let k=0;k<a;k++)n==="vector-uv"?([s[u],m[u]]=mt([l[u],e[u]],o),s[u]*=c):([s[u],m[u]]=pt([l[u],e[u]],o),s[u]*=c,m[u]*=c),u++;const g=new tt({pixelType:r,width:t.width,height:t.height,mask:t.mask,validPixelCount:t.validPixelCount,maskIsAlpha:t.maskIsAlpha,pixels:[s,m]});return g.updateStatistics(),g}function Ht(t,n,o=1){if(o===1||!at(t))return t;const c=t.clone(),{pixels:i,width:a,height:d}=c,h=i[0],l=i[1];let e=0;for(let r=0;r<d;r++)for(let s=0;s<a;s++)n==="vector-uv"?(h[e]*=o,l[e]*=o):h[e]*=o,e++;return c.updateStatistics(),c}function Kt(t,n,o,c,i){if(Y(i)||!i.spatialReference.equals(t.spatialReference))return{extent:t,width:Math.round(n/c),height:Math.round(o/c),resolution:t.width/n};const a=i.xmin,d=i.ymax,h=(t.xmax-t.xmin)/n*c,l=(t.ymax-t.ymin)/o*c,e=(h+l)/2;return t.xmin=a+Math.floor((t.xmin-a)/h)*h,t.xmax=a+Math.ceil((t.xmax-a)/h)*h,t.ymin=d+Math.floor((t.ymin-d)/l)*l,t.ymax=d+Math.ceil((t.ymax-d)/l)*l,{extent:t,width:Math.round(t.width/h),height:Math.round(t.height/l),resolution:e}}const vt=gt(0,0,0);function gt(t=0,n=0,o=Math.PI,c=!0){c&&(o=(2*Math.PI-o)%(2*Math.PI));const i=c?-1:1,a=13*i,d=-7*i,h=-2*i,l=-16*i,e=21.75,[r,s]=T(0,n+a,o,e),[m,u]=T(t-5.5,n+d,o,e),[g,A]=T(t+5.5,n+d,o,e),[k,I]=T(t-1.5,n+h,o,e),[y,w]=T(t+1.5,n+h,o,e),[x,f]=T(t-1.5,n+l,o,e),[p,b]=T(t+1.5,n+l,o,e);return[r,s,m,u,k,I,y,w,g,A,x,f,p,b]}function Pt(t=0,n=Math.PI,o=!0){o&&(n=(2*Math.PI-n)%(2*Math.PI));const c=10,i=o?-1:1,a=5*i,d=20*i,h=25*i,l=45,e=0,r=0,s=2,m=0,u=s*i,g=o?1:-1,A=c/2*g;let[k,I]=[e+A,r-d],[y,w]=[k+s*g,I],[x,f]=[y-m*g,w+u],[p,b]=[e-A,r-h],[M,P]=[p+m*g,b-u],v=Math.ceil(t/it),U=Math.floor(v/10);v-=8*U;const F=[],_=[];for(let C=0;C<v/2;C++,U--){U<=0&&v%2==1&&C===(v-1)/2&&(p=e,M=p+m*g,b=(b+I)/2,P=b-u);const[H,Z]=T(p,b,n,l);if(U>0){const[X,G]=T(y,b,n,l),[Q,L]=T(k,I,n,l);F.push(X),F.push(G),F.push(H),F.push(Z),F.push(Q),F.push(L)}else{const[X,G]=T(y,w,n,l),[Q,L]=T(x,f,n,l),[O,nt]=T(M,P,n,l);_.push(H),_.push(Z),_.push(O),_.push(nt),_.push(Q),_.push(L),_.push(X),_.push(G)}b+=a,I+=a,w+=a,f+=a,P+=a}const[N,S]=T(e+A,r+d,n,l),D=(c/2+s)*g,[V,q]=T(e+D,r+d,n,l),[j,J]=T(e+A,r-h,n,l),[B,E]=T(e+D,r-h,n,l);return{pennants:F,barbs:_,shaft:[N,S,V,q,j,J,B,E]}}function T(t,n,o,c=1){const i=Math.sqrt(t*t+n*n)/c,a=(2*Math.PI+Math.atan2(n,t))%(2*Math.PI);return[i,(2*Math.PI+a-o)%(2*Math.PI)]}const $=[0,1,3,6,10,16,21,27,33,40,47,55,63],Dt=[0,.5,1,1.5,2],Ft=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function K(t,n,o,c){const i=st(c||"knots",o);let a;for(a=1;a<n.length;a++)if(a===n.length-1){if(t<n[a]*i)break}else if(t<=n[a]*i)break;return Math.min(a-1,n.length-2)}function St(t,n,o,c,i){let a=0;switch(n){case"beaufort_kn":a=K(t,$,"knots",o);break;case"beaufort_km":a=K(t,$,"kilometer-per-hour",o);break;case"beaufort_ft":a=K(t,$,"feet-per-second",o);break;case"beaufort_m":a=K(t,$,"meter-per-second",o);break;case"classified_arrow":a=K(t,i!=null?i:[],c,o);break;case"ocean_current_m":a=K(t,Dt,"meter-per-second",o);break;case"ocean_current_kn":a=K(t,Ft,"knots",o)}return a}function Vt(t,n){const{style:o,inputUnit:c,outputUnit:i,breakValues:a}=n,d=et.fromJSON(c),h=et.fromJSON(i),l=7*6,e=15;let r=0,s=0;const{width:m,height:u,mask:g}=t,A=t.pixels[0],k=t.pixels[1],I=ft(g)?g.filter(f=>f>0).length:m*u,y=new Float32Array(I*l),w=new Uint32Array(e*I),x=n.invertDirection?gt(0,0,0,!1):vt;for(let f=0;f<u;f++)for(let p=0;p<m;p++){const b=f*m+p;if(!g||g[f*m+p]){const M=(k[b]+360)%360/180*Math.PI,P=St(A[b],o,d,h,a);for(let U=0;U<x.length;U+=2)y[r++]=(p+.5)/m,y[r++]=(f+.5)/u,y[r++]=x[U],y[r++]=x[U+1]+M,y[r++]=P,y[r++]=A[b];const v=7*(r/l-1);w[s++]=v,w[s++]=v+1,w[s++]=v+2,w[s++]=v+0,w[s++]=v+4,w[s++]=v+3,w[s++]=v+0,w[s++]=v+2,w[s++]=v+3,w[s++]=v+2,w[s++]=v+5,w[s++]=v+3,w[s++]=v+5,w[s++]=v+6,w[s++]=v+3}}return{vertexData:y,indexData:w}}const rt=[];function Ut(t,n){if(rt.length===0)for(let u=0;u<30;u++)rt.push(Pt(5*u,0,!n.invertDirection));const o=st(et.fromJSON(n.inputUnit),"knots"),{width:c,height:i,mask:a}=t,d=t.pixels[0],h=t.pixels[1],l=6,e=[],r=[];let s=0,m=0;for(let u=0;u<i;u++)for(let g=0;g<c;g++){const A=u*c+g,k=d[A]*o;if((!a||a[u*c+g])&&k>=it){const I=(h[A]+360)%360/180*Math.PI,{pennants:y,barbs:w,shaft:x}=rt[Math.min(Math.floor(k/5),29)];if(y.length+w.length===0)continue;let f=e.length/l;const p=(g+.5)/c,b=(u+.5)/i;for(let M=0;M<y.length;M+=2)e[s++]=p,e[s++]=b,e[s++]=y[M],e[s++]=y[M+1]+I,e[s++]=0,e[s++]=k;for(let M=0;M<w.length;M+=2)e[s++]=p,e[s++]=b,e[s++]=w[M],e[s++]=w[M+1]+I,e[s++]=0,e[s++]=k;for(let M=0;M<x.length;M+=2)e[s++]=p,e[s++]=b,e[s++]=x[M],e[s++]=x[M+1]+I,e[s++]=0,e[s++]=k;for(let M=0;M<y.length/6;M++)r[m++]=f,r[m++]=f+1,r[m++]=f+2,f+=3;for(let M=0;M<w.length/8;M++)r[m++]=f,r[m++]=f+1,r[m++]=f+2,r[m++]=f+1,r[m++]=f+2,r[m++]=f+3,f+=4;r[m++]=f+0,r[m++]=f+1,r[m++]=f+2,r[m++]=f+1,r[m++]=f+3,r[m++]=f+2,f+=4}}return{vertexData:new Float32Array(e),indexData:new Uint32Array(r)}}function _t(t,n){let c=0,i=0;const{width:a,height:d,mask:h}=t,l=t.pixels[0],e=[],r=[],s=st(et.fromJSON(n.inputUnit),"knots"),m=n.style==="wind_speed"?it:Number.MAX_VALUE;for(let u=0;u<d;u++)for(let g=0;g<a;g++){const A=l[u*a+g]*s;if((!h||h[u*a+g])&&A<m){for(let I=0;I<4;I++)e[c++]=(g+.5)/a,e[c++]=(u+.5)/d,e[c++]=I<2?-.5:.5,e[c++]=I%2==0?-.5:.5,e[c++]=0,e[c++]=A;const k=4*(c/24-1);r[i++]=k,r[i++]=k+1,r[i++]=k+2,r[i++]=k+1,r[i++]=k+2,r[i++]=k+3}}return{vertexData:new Float32Array(e),indexData:new Uint32Array(r)}}function Wt(t,n){return n.style==="simple_scalar"?_t(t,n):n.style==="wind_speed"?Ut(t,n):Vt(t,n)}function zt(t,n,o,c=[0,0],i=.5){const{width:a,height:d,mask:h}=t,[l,e]=t.pixels,[r,s]=c,m=Math.round((a-r)/o),u=Math.round((d-s)/o),g=m*u,A=new Float32Array(g),k=new Float32Array(g),I=new Uint8Array(g),y=n==="vector-uv";for(let x=0;x<u;x++)for(let f=0;f<m;f++){let p=0;const b=x*m+f,M=Math.max(0,x*o+s),P=Math.max(0,f*o+r),v=Math.min(d,M+o),U=Math.min(a,P+o);for(let F=M;F<v;F++)for(let _=P;_<U;_++){const N=F*a+_;if(!h||h[N]){p++;const S=y?[l[N],e[N]]:[l[N],(360+e[N])%360],[D,V]=y?S:pt(S);A[b]+=D,k[b]+=V}}if(p>=(v-M)*(U-P)*(1-i)){I[b]=1;const[F,_]=mt([A[b]/p,k[b]/p]);A[b]=F,k[b]=_}else I[b]=0,A[b]=0,k[b]=0}const w=new tt({width:m,height:u,pixels:[A,k],mask:I});return w.updateStatistics(),w}const R=yt.getLogger("esri.views.2d.engine.flow.dataUtils"),qt=10;async function Xt(t,n,o,c){const i=performance.now(),a=Lt(n,o),d=performance.now(),h=Tt(n,a,o.width,o.height),l=performance.now(),e=Bt(h,!0),r=performance.now(),s=t==="Streamlines"?jt(e,qt):Rt(e),m=performance.now();return z("esri-2d-profiler")&&(R.info("I.1","_createFlowFieldFromData (ms)",Math.round(d-i)),R.info("I.2","_getStreamlines (ms)",Math.round(l-d)),R.info("I.3","createAnimatedLinesData (ms)",Math.round(r-l)),R.info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(m-r)),R.info("I.5","createFlowMesh (ms)",Math.round(m-i)),R.info("I.6","Mesh size (bytes)",s.vertexData.buffer.byteLength+s.indexData.buffer.byteLength)),await Promise.resolve(),kt(c),s}function Lt(t,n){const o=Nt(n.data,n.width,n.height,t.smoothing);return t.interpolate?(c,i)=>{const a=Math.floor(c),d=Math.floor(i);if(a<0||a>=n.width)return[0,0];if(d<0||d>=n.height)return[0,0];const h=c-a,l=i-d,e=a,r=d,s=a<n.width-1?a+1:a,m=d<n.height-1?d+1:d,u=o[2*(r*n.width+e)],g=o[2*(r*n.width+s)],A=o[2*(m*n.width+e)],k=o[2*(m*n.width+s)],I=o[2*(r*n.width+e)+1],y=o[2*(r*n.width+s)+1];return[(u*(1-l)+A*l)*(1-h)+(g*(1-l)+k*l)*h,(I*(1-l)+o[2*(m*n.width+e)+1]*l)*(1-h)+(y*(1-l)+o[2*(m*n.width+s)+1]*l)*h]}:(c,i)=>{const a=Math.round(c),d=Math.round(i);return a<0||a>=n.width||d<0||d>=n.height?[0,0]:[o[2*(d*n.width+a)+0],o[2*(d*n.width+a)+1]]}}function Ot(t,n,o,c,i,a,d,h,l){const e=[];let r=o,s=c,m=0,[u,g]=n(r,s);u*=t.velocityScale,g*=t.velocityScale;const A=Math.sqrt(u*u+g*g);let k,I;e.push({x:r,y:s,t:m,speed:A});for(let y=0;y<t.verticesPerLine;y++){let[w,x]=n(r,s);w*=t.velocityScale,x*=t.velocityScale;const f=Math.sqrt(w*w+x*x);if(f<t.minSpeedThreshold)return e;const p=w/f,b=x/f;if(r+=p*t.segmentLength,s+=b*t.segmentLength,m+=t.segmentLength/f,Math.acos(p*k+b*I)>t.maxTurnAngle)return e;if(t.collisions){const M=Math.round(r*l),P=Math.round(s*l);if(M<0||M>d-1||P<0||P>h-1)return e;const v=a[P*d+M];if(v!==-1&&v!==i)return e;a[P*d+M]=i}e.push({x:r,y:s,t:m,speed:f}),k=p,I=b}return e}function Tt(t,n,o,c){const i=[],a=new ut,d=1/Math.max(t.lineCollisionWidth,1),h=Math.round(o*d),l=Math.round(c*d),e=new Int32Array(h*l);for(let s=0;s<e.length;s++)e[s]=-1;const r=[];for(let s=0;s<c;s+=t.lineSpacing)for(let m=0;m<o;m+=t.lineSpacing)r.push({x:m,y:s,sort:a.getFloat()});r.sort((s,m)=>s.sort-m.sort);for(const{x:s,y:m}of r)if(a.getFloat()<t.density){const u=Ot(t,n,s,m,i.length,e,h,l,d);if(u.length<2)continue;i.push(u)}return i}function Nt(t,n,o,c){if(c===0)return t;const i=Math.round(3*c),a=new Array(2*i+1);let d=0;for(let e=-i;e<=i;e++){const r=Math.exp(-e*e/(c*c));a[e+i]=r,d+=r}for(let e=-i;e<=i;e++)a[e+i]/=d;const h=new Float32Array(t.length);for(let e=0;e<o;e++)for(let r=0;r<n;r++){let s=0,m=0;for(let u=-i;u<=i;u++){if(r+u<0||r+u>=n)continue;const g=a[u+i];s+=g*t[2*(e*n+(r+u))+0],m+=g*t[2*(e*n+(r+u))+1]}h[2*(e*n+r)+0]=s,h[2*(e*n+r)+1]=m}const l=new Float32Array(t.length);for(let e=0;e<n;e++)for(let r=0;r<o;r++){let s=0,m=0;for(let u=-i;u<=i;u++){if(r+u<0||r+u>=o)continue;const g=a[u+i];s+=g*h[2*((r+u)*n+e)+0],m+=g*h[2*((r+u)*n+e)+1]}l[2*(r*n+e)+0]=s,l[2*(r*n+e)+1]=m}return l}function Bt(t,n){const o=new ut,c=t.reduce((l,e)=>l+e.length,0),i=new Float32Array(4*c),a=new Array(t.length);let d=0,h=0;for(const l of t){const e=d;for(const r of l)i[4*d+0]=r.x,i[4*d+1]=r.y,i[4*d+2]=r.t,i[4*d+3]=r.speed,d++;a[h++]={startVertex:e,numberOfVertices:l.length,totalTime:l[l.length-1].t,timeSeed:n?o.getFloat():0}}return{lineVertices:i,lineDescriptors:a}}function jt(t,n){const{lineVertices:c,lineDescriptors:i}=t;let a=0,d=0;for(const u of i)a+=2*u.numberOfVertices,d+=6*(u.numberOfVertices-1);const h=new Float32Array(a*9),l=new Uint32Array(d);let e=0,r=0;function s(){l[r++]=e-2,l[r++]=e,l[r++]=e-1,l[r++]=e,l[r++]=e+1,l[r++]=e-1}function m(u,g,A,k,I,y,w,x){const f=e*9;let p=0;h[f+p++]=u,h[f+p++]=g,h[f+p++]=1,h[f+p++]=A,h[f+p++]=y,h[f+p++]=w,h[f+p++]=k/2,h[f+p++]=I/2,h[f+p++]=x,e++,h[f+p++]=u,h[f+p++]=g,h[f+p++]=-1,h[f+p++]=A,h[f+p++]=y,h[f+p++]=w,h[f+p++]=-k/2,h[f+p++]=-I/2,h[f+p++]=x,e++}for(const u of i){const{totalTime:g,timeSeed:A}=u;let k=null,I=null,y=null,w=null,x=null,f=null;for(let p=0;p<u.numberOfVertices;p++){const b=c[4*(u.startVertex+p)+0],M=c[4*(u.startVertex+p)+1],P=c[4*(u.startVertex+p)+2],v=c[4*(u.startVertex+p)+3];let U=null,F=null,_=null,N=null;if(p>0){U=b-k,F=M-I;const S=Math.sqrt(U*U+F*F);if(U/=S,F/=S,p>1){let D=U+x,V=F+f;const q=Math.sqrt(D*D+V*V);D/=q,V/=q;const j=Math.min(1/(D*U+V*F),n);D*=j,V*=j,_=-V,N=D}else _=-F,N=U;_!==null&&N!==null&&(m(k,I,y,_,N,g,A,v),s())}k=b,I=M,y=P,x=U,f=F,w=v}m(k,I,y,-f,x,g,A,w)}return{vertexData:h,indexData:l}}function Rt(t){const{lineVertices:i,lineDescriptors:a}=t;let d=0,h=0;for(const S of a){const D=S.numberOfVertices-1;d+=4*D*2,h+=6*D*2}const l=new Float32Array(d*16),e=new Uint32Array(h);let r,s,m,u,g,A,k,I,y,w,x,f,p,b,M=0,P=0;function v(){e[P++]=M-8,e[P++]=M-7,e[P++]=M-6,e[P++]=M-7,e[P++]=M-5,e[P++]=M-6,e[P++]=M-4,e[P++]=M-3,e[P++]=M-2,e[P++]=M-3,e[P++]=M-1,e[P++]=M-2}function U(S,D,V,q,j,J,B,E,C,H,Z,X,G,Q){const L=M*16;let O=0;for(const nt of[1,2])for(const wt of[1,2,3,4])l[L+O++]=S,l[L+O++]=D,l[L+O++]=V,l[L+O++]=q,l[L+O++]=B,l[L+O++]=E,l[L+O++]=C,l[L+O++]=H,l[L+O++]=nt,l[L+O++]=wt,l[L+O++]=G,l[L+O++]=Q,l[L+O++]=j/2,l[L+O++]=J/2,l[L+O++]=Z/2,l[L+O++]=X/2,M++}function F(S,D){let V=y+x,q=w+f;const j=Math.sqrt(V*V+q*q);V/=j,q/=j;const J=y*V+w*q;V/=J,q/=J;let B=x+p,E=f+b;const C=Math.sqrt(B*B+E*E);B/=C,E/=C;const H=x*B+f*E;B/=H,E/=H,U(r,s,m,u,-q,V,g,A,k,I,-E,B,S,D),v()}function _(S,D,V,q,j,J){if(y=x,w=f,x=p,f=b,y==null&&w==null&&(y=x,w=f),g!=null&&A!=null){p=S-g,b=D-A;const B=Math.sqrt(p*p+b*b);p/=B,b/=B}y!=null&&w!=null&&F(j,J),r=g,s=A,m=k,u=I,g=S,A=D,k=V,I=q}function N(S,D){y=x,w=f,x=p,f=b,y==null&&w==null&&(y=x,w=f),y!=null&&w!=null&&F(S,D)}for(const S of a){r=null,s=null,m=null,u=null,g=null,A=null,k=null,I=null,y=null,w=null,x=null,f=null,p=null,b=null;const{totalTime:D,timeSeed:V}=S;for(let q=0;q<S.numberOfVertices;q++)_(i[4*(S.startVertex+q)+0],i[4*(S.startVertex+q)+1],i[4*(S.startVertex+q)+2],i[4*(S.startVertex+q)+3],D,V);N(D,V)}return{vertexData:l,indexData:e}}function ct(t,n){const o=n.pixels,{width:c,height:i}=n,a=new Float32Array(c*i*2),d=n.mask||new Uint8Array(c*i*2);if(n.mask||d.fill(255),t==="vector-uv")for(let h=0;h<c*i;h++)a[2*h+0]=o[0][h],a[2*h+1]=-o[1][h];else if(t==="vector-magdir")for(let h=0;h<c*i;h++){const l=o[0][h],e=It(o[1][h]),r=Math.cos(e-Math.PI/2),s=Math.sin(e-Math.PI/2);a[2*h+0]=r*l,a[2*h+1]=s*l}return{data:a,mask:d,width:c,height:i}}async function Gt(t,n,o,c,i,a){const d=performance.now(),h=At(n.spatialReference);if(!h){const x=await ht(t,n,o,c,i,a);return z("esri-2d-profiler")&&R.info("I.7","loadImagery, early exit (ms)",Math.round(performance.now()-d)),z("esri-2d-profiler")&&R.info("I.9","Number of parts",1),x}const[l,e]=h.valid,r=e-l,s=Math.ceil(n.width/r),m=n.width/s,u=Math.round(o/s);let g=n.xmin;const A=[],k=performance.now();for(let x=0;x<s;x++){const f=new bt({xmin:g,xmax:g+m,ymin:n.ymin,ymax:n.ymax,spatialReference:n.spatialReference});A.push(ht(t,f,u,c,i,a)),g+=m}const I=await Promise.all(A);z("esri-2d-profiler")&&R.info("I.8","All calls to _fetchPart (ms)",Math.round(performance.now()-k)),z("esri-2d-profiler")&&R.info("I.9","Number of parts",I.length);const y={data:new Float32Array(o*c*2),mask:new Uint8Array(o*c),width:o,height:c};let w=0;for(const x of I){for(let f=0;f<x.height;f++)for(let p=0;p<x.width;p++)w+p>=o||(y.data[2*(f*o+w+p)+0]=x.data[2*(f*x.width+p)+0],y.data[2*(f*o+w+p)+1]=x.data[2*(f*x.width+p)+1],y.mask[f*o+w+p]=x.mask[f*x.width+p]);w+=x.width}return z("esri-2d-profiler")&&R.info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-d)),y}async function ht(t,n,o,c,i,a){const d={requestProjectedLocalDirections:!0,signal:a};if(ft(i)&&(d.timeExtent=i),t.type==="imagery"){await t.load({signal:a});const e=t.rasterInfo.dataType,r=await t.fetchImage(n,o,c,d);return!r||Y(r.pixelData)||Y(r.pixelData.pixelBlock)?{data:new Float32Array(o*c*2),mask:new Uint8Array(o*c),width:o,height:c}:ct(e,r.pixelData.pixelBlock)}await t.load({signal:a});const h=t.rasterInfo.dataType,l=await t.fetchPixels(n,o,c,d);return!l||Y(l.pixelBlock)?{data:new Float32Array(o*c*2),mask:new Uint8Array(o*c),width:o,height:c}:ct(h,l.pixelBlock)}export{_t as D,Wt as F,Gt as a,mt as b,et as c,lt as d,Xt as f,Ht as g,zt as j,st as l,Ct as m,Kt as x};
|