Agriculture-front-end/public/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js

2 lines
7.4 KiB
JavaScript
Raw Normal View History

2023-04-16 22:33:44 +08:00
define(["./EllipsoidTangentPlane-edb321d3","./buildModuleUrl-4e1b81e7","./Cartesian2-47311507","./Cartographic-3309dd0d","./when-b60132fc","./TerrainEncoding-c4158481","./Math-119be1a3","./PrimitiveType-a54dc62f","./OrientedBoundingBox-87d59c2a","./RuntimeError-4a5c8994","./GeometryAttribute-3a88ba31","./WebMercatorProjection-01b1b5e7","./createTaskProcessorWorker","./Check-7b2a090c","./Cartesian4-3ca25aab","./IntersectionTests-7386ffbf","./Plane-7ae8294c","./Event-16a2dfbf","./AttributeCompression-90851096","./ComponentDatatype-c140a87d","./WebGLConstants-4ae0db90","./PolygonPipeline-660e1625","./earcut-2.2.1-20c8012f","./EllipsoidRhumbLine-ed1a6bf4","./FeatureDetection-c3b71206"],(function(e,t,i,a,r,n,o,s,u,h,c,d,l,g,m,p,v,E,I,f,C,T,M,b,N){"use strict";var x=Uint16Array.BYTES_PER_ELEMENT,S=Int32Array.BYTES_PER_ELEMENT,P=Uint32Array.BYTES_PER_ELEMENT,w=Float32Array.BYTES_PER_ELEMENT,y=Float64Array.BYTES_PER_ELEMENT;function B(e,t,i){i=r.defaultValue(i,o.CesiumMath);for(var a=e.length,n=0;n<a;++n)if(i.equalsEpsilon(e[n],t,o.CesiumMath.EPSILON12))return n;return-1}var A=new a.Cartographic,R=new a.Cartesian3,_=new a.Cartesian3,F=new a.Cartesian3,W=new s.Matrix4;function O(e,t,n,u,h,c,d,l,g,m){for(var p=d.length,v=0;v<p;++v){var E=d[v],I=E.cartographic,f=E.index,C=e.length,T=I.longitude,M=I.latitude;M=o.CesiumMath.clamp(M,-o.CesiumMath.PI_OVER_TWO,o.CesiumMath.PI_OVER_TWO);var b=I.height-c.skirtHeight;c.hMin=Math.min(c.hMin,b),a.Cartographic.fromRadians(T,M,b,A),g&&(A.longitude+=l),g?v===p-1?A.latitude+=m:0===v&&(A.latitude-=m):A.latitude+=l;var N=c.ellipsoid.cartographicToCartesian(A);e.push(N),t.push(b),n.push(i.Cartesian2.clone(n[f])),u.length>0&&u.push(u[f]),s.Matrix4.multiplyByPoint(c.toENU,N,R);var x=c.minimum,S=c.maximum;a.Cartesian3.minimumByComponent(R,x,x),a.Cartesian3.maximumByComponent(R,S,S);var P=c.lastBorderPoint;if(r.defined(P)){var w=P.index;h.push(w,C-1,C,C,f,w)}c.lastBorderPoint=E}}return l((function(l,g){l.ellipsoid=i.Ellipsoid.clone(l.ellipsoid),l.rectangle=i.Rectangle.clone(l.rectangle);var m=function(l,g,m,p,v,E,I,f,C,T){var M,b,N,U,Y,k;r.defined(p)?(M=p.west,b=p.south,N=p.east,U=p.north,Y=p.width,k=p.height):(M=o.CesiumMath.toRadians(v.west),b=o.CesiumMath.toRadians(v.south),N=o.CesiumMath.toRadians(v.east),U=o.CesiumMath.toRadians(v.north),Y=o.CesiumMath.toRadians(p.width),k=o.CesiumMath.toRadians(p.height));var V,L,H=[b,U],D=[M,N],G=c.Transforms.eastNorthUpToFixedFrame(g,m),j=s.Matrix4.inverseTransformation(G,W);f&&(V=d.WebMercatorProjection.geodeticLatitudeToMercatorAngle(b),L=1/(d.WebMercatorProjection.geodeticLatitudeToMercatorAngle(U)-V));var z=new DataView(l),q=Number.POSITIVE_INFINITY,J=Number.NEGATIVE_INFINITY,K=_;K.x=Number.POSITIVE_INFINITY,K.y=Number.POSITIVE_INFINITY,K.z=Number.POSITIVE_INFINITY;var Q=F;Q.x=Number.NEGATIVE_INFINITY,Q.y=Number.NEGATIVE_INFINITY,Q.z=Number.NEGATIVE_INFINITY;var X,Z,$=0,ee=0,te=0;for(Z=0;Z<4;++Z){var ie=$;X=z.getUint32(ie,!0),ie+=P;var ae=o.CesiumMath.toRadians(180*z.getFloat64(ie,!0));ie+=y,-1===B(D,ae)&&D.push(ae);var re=o.CesiumMath.toRadians(180*z.getFloat64(ie,!0));ie+=y,-1===B(H,re)&&H.push(re),ie+=2*y;var ne=z.getInt32(ie,!0);ie+=S,ee+=ne,te+=3*(ne=z.getInt32(ie,!0)),$+=X+P}var oe=[],se=[],ue=new Array(ee),he=new Array(ee),ce=new Array(ee),de=f?new Array(ee):[],le=new Array(te),ge=[],me=[],pe=[],ve=[],Ee=0,Ie=0;for($=0,Z=0;Z<4;++Z){X=z.getUint32($,!0);var fe=$+=P,Ce=o.CesiumMath.toRadians(180*z.getFloat64($,!0));$+=y;var Te=o.CesiumMath.toRadians(180*z.getFloat64($,!0));$+=y;var Me=o.CesiumMath.toRadians(180*z.getFloat64($,!0)),be=.5*Me;$+=y;var Ne=o.CesiumMath.toRadians(180*z.getFloat64($,!0)),xe=.5*Ne;$+=y;var Se=z.getInt32($,!0);$+=S;var Pe=z.getInt32($,!0);$+=S,$+=S;for(var we=new Array(Se),ye=0;ye<Se;++ye){var Be=Ce+z.getUint8($++)*Me;A.longitude=Be;var Ae=Te+z.getUint8($++)*Ne;A.latitude=Ae;var Re=z.getFloat32($,!0);if($+=w,0!==Re&&Re<T&&(Re*=-Math.pow(2,C)),Re*=6371010*E,A.height=Re,-1!==B(D,Be)||-1!==B(H,Ae)){var _e=B(oe,A,a.Cartographic);if(-1!==_e){we[ye]=se[_e];continue}oe.push(a.Cartographic.clone(A)),se.push(Ee)}we[ye]=Ee,Math.abs(Be-M)