@arcgis/core 4.25.0-next.20220818 → 4.25.0-next.20220821
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/analysis/LengthDimension.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0b1d39dc063c4c3385e2.js +1 -0
- package/assets/esri/core/workers/chunks/{59a04f1640cd2b710028.js → 0c625803648e554f1fcf.js} +1 -1
- package/assets/esri/core/workers/chunks/{50985ec72b9e4557d371.js → 0f1fae79b5311d55c0da.js} +1 -1
- package/assets/esri/core/workers/chunks/1a360d839c4eb83aaa02.js +1 -0
- package/assets/esri/core/workers/chunks/3381b5454cd530cf940a.js +1 -0
- package/assets/esri/core/workers/chunks/3900c702242358c5d00e.js +1 -0
- package/assets/esri/core/workers/chunks/43f84cb852c9ab5e742f.js +1 -0
- package/assets/esri/core/workers/chunks/4637bfd3deff50b03f2e.js +1 -0
- package/assets/esri/core/workers/chunks/4d5bdf18feeb9c8cb6ff.js +1 -0
- package/assets/esri/core/workers/chunks/5c2574365af4a484cd4b.js +1 -0
- package/assets/esri/core/workers/chunks/70179a003b5e52a99e10.js +1 -0
- package/assets/esri/core/workers/chunks/77a38124ef155a1b0f3e.js +1 -0
- package/assets/esri/core/workers/chunks/{ab0ce16ced3532f0e429.js → 81418b47acb4ef68daf7.js} +1 -1
- package/assets/esri/core/workers/chunks/88b5ce63c4706d0954dc.js +1 -0
- package/assets/esri/core/workers/chunks/{064a4baa576964efa238.js → 9809878b87595ac77dc4.js} +1 -1
- package/assets/esri/core/workers/chunks/9dbe94a70624a5592690.js +1 -0
- package/assets/esri/core/workers/chunks/{d013daa46de022f0db4d.js → a0750175b499a89fd07d.js} +1 -1
- package/assets/esri/core/workers/chunks/be4a8a4b2804188817b3.js +1 -0
- package/assets/esri/core/workers/chunks/da13db62d54cbca350c3.js +1 -0
- package/assets/esri/core/workers/chunks/e472e4f4a2f046846258.js +1 -0
- package/assets/esri/core/workers/chunks/f351cccf879ba295acbc.js +1 -0
- package/chunks/boundedPlane.js +1 -1
- package/chunks/pe.js +1 -1
- package/core/Identifiable.js +1 -1
- package/geometry/Circle.js +1 -1
- package/geometry/Extent.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/Multipoint.js +1 -1
- package/geometry/Point.js +1 -1
- package/geometry/geometryEngine.js +1 -1
- package/geometry/geometryEngineAsync.js +1 -1
- package/geometry/projection.js +1 -1
- package/geometry/support/aaBoundingBox.js +1 -1
- package/geometry/support/boundsUtils.js +1 -1
- package/geometry/support/centroid.js +1 -1
- package/geometry/support/cut.js +1 -1
- package/geometry/support/extentUtils.js +1 -1
- package/geometry/support/geodesicUtils.js +1 -1
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/meshUtils/primitives.js +1 -1
- package/geometry/support/quantizationUtils.js +1 -1
- package/interfaces.d.ts +60 -84
- package/layers/DimensionLayer.js +1 -1
- package/layers/support/ExportImageServiceParameters.js +1 -1
- package/layers/support/imageryRendererUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMResourceManager.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/symbols/cim/quantizeTime.js +5 -0
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/animatedFormats/AnimatableTextureResource.js +5 -0
- package/views/2d/engine/webgl/animatedFormats/apng.js +1 -1
- package/views/2d/engine/webgl/animatedFormats/gif.js +1 -1
- package/views/2d/engine/webgl/animatedFormats/utils.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionComputation.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionSubTool.js +1 -1
- package/views/3d/analysis/Dimensioning/LengthDimensionVisualization.js +1 -1
- package/views/3d/analysis/Dimensioning/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
- package/views/3d/analysis/support/measurementUtils.js +1 -1
- package/views/3d/terrain/PlanarPatch.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/interfaces.js +1 -1
- package/views/support/geodesicLengthMeasurementUtils.js +1 -1
- package/widgets/Bookmarks.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/229bfbf3faa789f40b7e.js +0 -1
- package/assets/esri/core/workers/chunks/2e715520e5badbe570ac.js +0 -1
- package/assets/esri/core/workers/chunks/40098b3be512ad8461f8.js +0 -1
- package/assets/esri/core/workers/chunks/420ae87ba8dc74fd05f5.js +0 -1
- package/assets/esri/core/workers/chunks/46c836fc575251f1ff34.js +0 -1
- package/assets/esri/core/workers/chunks/481532ce4871b0d94587.js +0 -1
- package/assets/esri/core/workers/chunks/5fa78a6745ef14c7c4d1.js +0 -1
- package/assets/esri/core/workers/chunks/606f45a93c707054c521.js +0 -1
- package/assets/esri/core/workers/chunks/78e59b29e59b10f64aa9.js +0 -1
- package/assets/esri/core/workers/chunks/7be7c53727cb1bc73a64.js +0 -1
- package/assets/esri/core/workers/chunks/8d3fba983c360e1fdabf.js +0 -1
- package/assets/esri/core/workers/chunks/a69d194526bdc489b30b.js +0 -1
- package/assets/esri/core/workers/chunks/b59855826d235cba0889.js +0 -1
- package/assets/esri/core/workers/chunks/bff5812e3797c8e42ac0.js +0 -1
- package/assets/esri/core/workers/chunks/d6e177749bde46ab57fc.js +0 -1
- package/assets/esri/core/workers/chunks/d9c8a8bed6b34ed57faf.js +0 -1
- package/views/2d/engine/webgl/animatedFormats/BaseAnimatableTextureResource.js +0 -5
package/chunks/boundedPlane.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../core/has.js";import s from"../core/Logger.js";import{acosClamped as
|
|
5
|
+
import"../core/has.js";import s from"../core/Logger.js";import{acosClamped as t}from"../core/mathUtils.js";import{ObjectStack as i}from"../core/ObjectStack.js";import{a as n,t as o,d as r}from"./mat4.js";import{c as e}from"./mat4f64.js";import{c as a,g as c,a as u,s as g,i as b,l as f,r as p,e as l,b as m,k as d,m as h,n as j,p as I}from"./vec3.js";import{f as y,c as P,a as v}from"./vec3f64.js";import{Axis as N}from"../geometry/support/Axis.js";import{create as w,projectPointClamp as M,distance2 as S}from"../geometry/support/lineSegment.js";import{create as T,wrap as A,copy as x,fromVectorsAndPoint as V,fromValues as _,intersectRay as O,intersectLineSegment as k,intersectLineSegmentClamp as E,isPointInside as U,projectPoint as Y,normal as q,setOffsetFromPoint as B}from"../geometry/support/plane.js";import{distance2 as F}from"../geometry/support/ray.js";import{projectPointSignedLength as R}from"../geometry/support/vector.js";import{sv3d as C}from"../geometry/support/vectorStacks.js";const L=s.getLogger("esri.views.3d.support.geometryUtils.boundedPlane");class z{constructor(){this.plane=T(),this.origin=P(),this.basis1=P(),this.basis2=P()}}function G(s=vs){return{plane:T(s.plane),origin:v(s.origin),basis1:v(s.basis1),basis2:v(s.basis2)}}function W(s,t,i){const n=Ss.get();return n.origin=s,n.basis1=t,n.basis2=i,n.plane=A(0,0,0,0),H(n),n}function X(s,t=G()){return D(s.origin,s.basis1,s.basis2,t)}function Z(s,t){a(t.origin,s.origin),a(t.basis1,s.basis1),a(t.basis2,s.basis2),x(t.plane,s.plane)}function D(s,t,i,n=G()){return a(n.origin,s),a(n.basis1,t),a(n.basis2,i),H(n),ys(n,"fromValues()"),n}function H(s){V(s.basis2,s.basis1,s.origin,s.plane)}function J(s,t,i){s!==i&&X(s,i);const n=c(C.get(),ms(s),t);return u(i.origin,i.origin,n),i.plane[3]-=t,i}function K(s,t,i){return Q(t,i),J(i,gs(s,s.origin),i),i}function Q(s,t=G()){const i=(s[2]-s[0])/2,n=(s[3]-s[1])/2;return g(t.origin,s[0]+i,s[1]+n,0),g(t.basis1,i,0,0),g(t.basis2,0,n,0),_(0,0,1,0,t.plane),t}function $(s,t,i){return!!O(s.plane,t,i)&&hs(s,i)}function ss(s,t,i){if($(s,t,i))return i;const n=ts(s,t,C.get());return u(i,t.origin,c(C.get(),t.direction,b(t.origin,n)/f(t.direction))),i}function ts(s,i,n){const o=Ns.get();Ps(s,i,o,Ns.get());let r=Number.POSITIVE_INFINITY;for(const e of Ts){const c=Is(s,e,ws.get()),u=C.get();if(k(o,c,u)){const s=p(C.get(),i.origin,u),o=Math.abs(t(l(i.direction,s)));o<r&&(r=o,a(n,u))}}return r===Number.POSITIVE_INFINITY?is(s,i,n):n}function is(s,t,i){if($(s,t,i))return i;const n=Ns.get(),o=Ns.get();Ps(s,t,n,o);let r=Number.POSITIVE_INFINITY;for(const e of Ts){const c=Is(s,e,ws.get()),u=C.get();if(E(n,c,u)){const s=F(t,u);if(!U(o,u))continue;s<r&&(r=s,a(i,u))}}return rs(s,t.origin)<r&&ns(s,t.origin,i),i}function ns(s,t,i){const n=Y(s.plane,t,C.get()),o=M(js(s,s.basis1),n,-1,1,C.get()),r=M(js(s,s.basis2),n,-1,1,C.get());return m(i,u(C.get(),o,r),s.origin),i}function os(s,t,i){const{origin:n,basis1:o,basis2:r}=s,e=m(C.get(),t,n),a=R(o,e),c=R(r,e),u=R(ms(s),e);return g(i,a,c,u)}function rs(s,t){const i=os(s,t,C.get()),{basis1:n,basis2:o}=s,r=f(n),e=f(o),a=Math.max(Math.abs(i[0])-r,0),c=Math.max(Math.abs(i[1])-e,0),u=i[2];return a*a+c*c+u*u}function es(s,t){return Math.sqrt(rs(s,t))}function as(s,t){let i=Number.NEGATIVE_INFINITY;for(const n of Ts){const o=Is(s,n,ws.get()),r=S(o,t);r>i&&(i=r)}return Math.sqrt(i)}function cs(s,t){return U(s.plane,t)&&hs(s,t)}function us(s,t,i,n){return ds(s,i,n)}function gs(s,t){const i=-s.plane[3];return R(ms(s),t)-i}function bs(s,t,i,n){const o=gs(s,t),r=c(Ms,ms(s),i-o);return u(n,t,r),n}function fs(s,t){return d(s.basis1,t.basis1)&&d(s.basis2,t.basis2)&&d(s.origin,t.origin)}function ps(s,t,i){return s!==i&&X(s,i),n(As,t),o(As,As),h(i.basis1,s.basis1,As),h(i.basis2,s.basis2,As),h(q(i.plane),q(s.plane),As),h(i.origin,s.origin,t),B(i.plane,i.plane,i.origin),i}function ls(s,t,i,n){return s!==n&&X(s,n),r(xs,t,i),h(n.basis1,s.basis1,xs),h(n.basis2,s.basis2,xs),H(n),n}function ms(s){return q(s.plane)}function ds(s,t,i){switch(t){case N.X:a(i,s.basis1),j(i,i);break;case N.Y:a(i,s.basis2),j(i,i);break;case N.Z:a(i,ms(s))}return i}function hs(s,t){const i=m(C.get(),t,s.origin),n=I(s.basis1),o=I(s.basis2),r=l(s.basis1,i),e=l(s.basis2,i);return-r-n<0&&r-n<0&&-e-o<0&&e-o<0}function js(s,t){const i=ws.get();return a(i.origin,s.origin),a(i.vector,t),i}function Is(s,t,i){const{basis1:n,basis2:o,origin:r}=s,e=c(C.get(),n,t.origin[0]),a=c(C.get(),o,t.origin[1]);u(i.origin,e,a),u(i.origin,i.origin,r);const g=c(C.get(),n,t.direction[0]),b=c(C.get(),o,t.direction[1]);return c(i.vector,u(g,g,b),2),i}function ys(s,t){Math.abs(l(s.basis1,s.basis2)/(f(s.basis1)*f(s.basis2)))>1e-6&&L.warn(t,"Provided basis vectors are not perpendicular"),Math.abs(l(s.basis1,ms(s)))>1e-6&&L.warn(t,"Basis vectors and plane normal are not perpendicular"),Math.abs(-l(ms(s),s.origin)-s.plane[3])>1e-6&&L.warn(t,"Plane offset is not consistent with plane origin")}function Ps(s,t,i,n){const o=ms(s);V(o,t.direction,t.origin,i),V(q(i),o,t.origin,n)}const vs={plane:T(),origin:y(0,0,0),basis1:y(1,0,0),basis2:y(0,1,0)},Ns=new i(T),ws=new i(w),Ms=P(),Ss=new i((()=>G())),Ts=[{origin:[-1,-1],direction:[1,0]},{origin:[1,-1],direction:[0,1]},{origin:[1,1],direction:[-1,0]},{origin:[-1,1],direction:[0,-1]}],As=e(),xs=e(),Vs=Object.freeze(Object.defineProperty({__proto__:null,BoundedPlaneClass:z,create:G,wrap:W,copy:X,copyWithoutVerify:Z,fromValues:D,updateUnboundedPlane:H,elevate:J,setExtent:K,fromAABoundingRect:Q,intersectRay:$,intersectRayClosestSilhouette:ss,closestPointOnSilhouette:ts,closestPoint:is,projectPoint:ns,projectPointLocal:os,distance2:rs,distance:es,distanceToSilhouette:as,extrusionContainsPoint:cs,axisAt:us,altitudeAt:gs,setAltitudeAt:bs,equals:fs,transform:ps,rotate:ls,normal:ms,UP:vs},Symbol.toStringTag,{value:"Module"}));export{bs as A,z as B,vs as U,G as a,Vs as b,X as c,fs as d,cs as e,D as f,Q as g,es as h,$ as i,Z as j,J as k,ss as l,ts as m,ms as n,is as o,ns as p,os as q,ls as r,K as s,ps as t,H as u,rs as v,W as w,as as x,us as y,gs as z};
|
package/chunks/pe.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getAssetUrl as e}from"../assets.js";import has from"../core/has.js";let t,o=null;function r(){return!!o}function n(){return!!has("esri-wasm")}function _(){return t||(t=import("./pe-wasm.js").then((e=>e.p)).then((({default:t})=>t({locateFile:t=>e(`esri/geometry/support/${t}`)}))).then((e=>{l(e)})),t)}var P,s,E;!function(e){function t(e,t,r){o.ensureCache.prepare();const n=M(r),_=r===n,P=o.ensureFloat64(n),s=o._pe_geog_to_proj(o.getPointer(e),t,P);return s&&A(r,t,P,_),s}function r(e,o,r,_){switch(_){case s.PE_TRANSFORM_P_TO_G:return n(e,o,r);case s.PE_TRANSFORM_G_TO_P:return t(e,o,r)}return 0}function n(e,t,o){return _(e,t,o,0)}function _(e,t,r,n){o.ensureCache.prepare();const _=M(r),P=r===_,s=o.ensureFloat64(_),E=o._pe_proj_to_geog_center(o.getPointer(e),t,s,n);return E&&A(r,t,s,P),E}e.geogToProj=t,e.projGeog=r,e.projToGeog=n,e.projToGeogCenter=_}(P||(P={})),function(e){function t(){e.PE_BUFFER_MAX=o.PeDefs.prototype.PE_BUFFER_MAX,e.PE_NAME_MAX=o.PeDefs.prototype.PE_NAME_MAX,e.PE_MGRS_MAX=o.PeDefs.prototype.PE_MGRS_MAX,e.PE_USNG_MAX=o.PeDefs.prototype.PE_USNG_MAX,e.PE_DD_MAX=o.PeDefs.prototype.PE_DD_MAX,e.PE_DDM_MAX=o.PeDefs.prototype.PE_DDM_MAX,e.PE_DMS_MAX=o.PeDefs.prototype.PE_DMS_MAX,e.PE_UTM_MAX=o.PeDefs.prototype.PE_UTM_MAX,e.PE_PARM_MAX=o.PeDefs.prototype.PE_PARM_MAX,e.PE_TYPE_NONE=o.PeDefs.prototype.PE_TYPE_NONE,e.PE_TYPE_GEOGCS=o.PeDefs.prototype.PE_TYPE_GEOGCS,e.PE_TYPE_PROJCS=o.PeDefs.prototype.PE_TYPE_PROJCS,e.PE_TYPE_GEOGTRAN=o.PeDefs.prototype.PE_TYPE_GEOGTRAN,e.PE_TYPE_COORDSYS=o.PeDefs.prototype.PE_TYPE_COORDSYS,e.PE_TYPE_UNIT=o.PeDefs.prototype.PE_TYPE_UNIT,e.PE_TYPE_LINUNIT=o.PeDefs.prototype.PE_TYPE_LINUNIT,e.PE_STR_OPTS_NONE=o.PeDefs.prototype.PE_STR_OPTS_NONE,e.PE_STR_AUTH_NONE=o.PeDefs.prototype.PE_STR_AUTH_NONE,e.PE_STR_AUTH_TOP=o.PeDefs.prototype.PE_STR_AUTH_TOP,e.PE_STR_NAME_CANON=o.PeDefs.prototype.PE_STR_NAME_CANON,e.PE_PARM_X0=o.PeDefs.prototype.PE_PARM_X0,e.PE_PARM_ND=o.PeDefs.prototype.PE_PARM_ND,e.PE_TRANSFORM_1_TO_2=o.PeDefs.prototype.PE_TRANSFORM_1_TO_2,e.PE_TRANSFORM_2_TO_1=o.PeDefs.prototype.PE_TRANSFORM_2_TO_1,e.PE_TRANSFORM_P_TO_G=o.PeDefs.prototype.PE_TRANSFORM_P_TO_G,e.PE_TRANSFORM_G_TO_P=o.PeDefs.prototype.PE_TRANSFORM_G_TO_P,e.PE_HORIZON_RECT=o.PeDefs.prototype.PE_HORIZON_RECT,e.PE_HORIZON_POLY=o.PeDefs.prototype.PE_HORIZON_POLY,e.PE_HORIZON_LINE=o.PeDefs.prototype.PE_HORIZON_LINE,e.PE_HORIZON_DELTA=o.PeDefs.prototype.PE_HORIZON_DELTA}e.init=t}(s||(s={})),function(e){const t={},r={},n=e=>{if(e){const t=e.getType();switch(t){case s.PE_TYPE_GEOGCS:e=o.castObject(e,o.PeGeogcs);break;case s.PE_TYPE_PROJCS:e=o.castObject(e,o.PeProjcs);break;case s.PE_TYPE_GEOGTRAN:e=o.castObject(e,o.PeGeogtran);break;default:t&s.PE_TYPE_UNIT&&(e=o.castObject(e,o.PeUnit))}}return e};function _(){o.PeFactory.prototype.initialize(null)}function P(e){return E(s.PE_TYPE_COORDSYS,e)}function E(e,r){let _=null,P=t[e];if(P||(P={},t[e]=P),P.hasOwnProperty(String(r)))_=P[r];else{const t=o.PeFactory.prototype.factoryByType(e,r);o.compare(t,o.NULL)||(_=t,P[r]=_)}return _=n(_),_}function i(e,t){let _=null,P=r[e];if(P||(P={},r[e]=P),P.hasOwnProperty(t))_=P[t];else{const r=o.PeFactory.prototype.fromString(e,t);o.compare(r,o.NULL)||(_=r,P[t]=_)}return _=n(_),_}function p(e){return E(s.PE_TYPE_GEOGCS,e)}function u(e){return E(s.PE_TYPE_GEOGTRAN,e)}function a(e){return o.PeFactory.prototype.getCode(e)}function c(e){return E(s.PE_TYPE_PROJCS,e)}function g(e){return E(s.PE_TYPE_UNIT,e)}e.initialize=_,e.coordsys=P,e.factoryByType=E,e.fromString=i,e.geogcs=p,e.geogtran=u,e.getCode=a,e.projcs=c,e.unit=g}(E||(E={}));let i=null;var p,u,a,c,g,T,f,O,S;function l(e){function t(e,t,o){e[t]=o(e[t])}o=e,s.init(),p.init(),g.init(),f.init(),O.init(),i=class extends o.PeGCSExtent{destroy(){o.destroy(this)}};const r=[o.PeDatum,o.PeGeogcs,o.PeGeogtran,o.PeObject,o.PeParameter,o.PePrimem,o.PeProjcs,o.PeSpheroid,o.PeUnit];for(const o of r)t(o.prototype,"getName",(e=>function(){return e.call(this,new Array(s.PE_NAME_MAX))}));for(const P of[o.PeGeogtran,o.PeProjcs])t(P.prototype,"getParameters",(e=>function(){const t=new Array(s.PE_PARM_MAX);let r=e.call(this);for(let e=0;e<t.length;e++){const n=o.getValue(r,"*");t[e]=n?o.wrapPointer(n,o.PeParameter):null,r+=Int32Array.BYTES_PER_ELEMENT}return t}));t(o.PeHorizon.prototype,"getCoord",(e=>function(){const t=this.getSize();if(!t)return null;const o=[];return A(o,t,e.call(this)),o})),t(o.PeGTlistExtendedEntry.prototype,"getEntries",(e=>{const t=o._pe_getPeGTlistExtendedGTsSize();return function(){let r=null;const n=e.call(this);if(!o.compare(n,o.NULL)){r=[n];const e=this.getSteps();if(e>1){const _=o.getPointer(n);for(let n=1;n<e;n++)r.push(o.wrapPointer(_+t*n,o.PeGTlistExtendedGTs))}}return r}}));const n=o._pe_getPeHorizonSize(),_=e=>function(){let t=this._cache;if(t||(t=new Map,this._cache=t),t.has(e))return t.get(e);let r=null;const _=e.call(this);if(!o.compare(_,o.NULL)){r=[_];const e=_.getNump();if(e>1){const t=o.getPointer(_);for(let _=1;_<e;_++)r.push(o.wrapPointer(t+n*_,o.PeHorizon))}}return t.set(e,r),r};t(o.PeProjcs.prototype,"horizonGcsGenerate",_),t(o.PeProjcs.prototype,"horizonPcsGenerate",_),o.PeObject.prototype.toString=function(e=s.PE_STR_OPTS_NONE){o.ensureCache.prepare();const t=o.getPointer(this),r=o.ensureInt8(new Array(s.PE_BUFFER_MAX));return o.UTF8ToString(o._pe_object_to_string_ext(t,e,r))}}function N(e){if(!e)return;const t=o.getClass(e);if(!t)return;const r=o.getCache(t);if(!r)return;const n=o.getPointer(e);n&&delete r[n]}function y(e,t){const r=[],n=new Array(t);for(let _=0;_<e;_++)r.push(o.ensureInt8(n));return r}function M(e){let t;return Array.isArray(e[0])?(t=[],e.forEach((e=>{t.push(e[0],e[1])}))):t=e,t}function A(e,t,r,n=!1){if(n)for(let _=0;_<2*t;_++)e[_]=o.getValue(r+_*Float64Array.BYTES_PER_ELEMENT,"double");else{const n=0===e.length;for(let _=0;_<t;_++)n&&(e[_]=new Array(2)),e[_][0]=o.getValue(r,"double"),e[_][1]=o.getValue(r+Float64Array.BYTES_PER_ELEMENT,"double"),r+=2*Float64Array.BYTES_PER_ELEMENT}}!function(e){let t;function r(){e.PE_GTLIST_OPTS_COMMON=o.PeGTlistExtended.prototype.PE_GTLIST_OPTS_COMMON,t=o._pe_getPeGTlistExtendedEntrySize()}function n(e,r,n,_,P,s){let E=null;const i=new o.PeInteger(s);try{const p=o.PeGTlistExtended.prototype.getGTlist(e,r,n,_,P,i);if((s=i.val)&&(E=[p],s>1)){const e=o.getPointer(p);for(let r=1;r<s;r++)E.push(o.wrapPointer(e+t*r,o.PeGTlistExtendedEntry))}}finally{o.destroy(i)}return E}e.init=r,e.getGTlist=n}(p||(p={})),function(e){function t(e){if(e&&e.length){for(const t of e)N(t),t.getEntries().forEach((e=>{N(e);const t=e.getGeogtran();N(t),t.getParameters().forEach(N),[t.getGeogcs1(),t.getGeogcs2()].forEach((e=>{N(e);const t=e.getDatum();N(t),N(t.getSpheroid()),N(e.getPrimem()),N(e.getUnit())}))}));o.PeGTlistExtendedEntry.prototype.Delete(e[0])}}e.destroy=t}(u||(u={})),function(e){function t(e,t,r,n,_){o.ensureCache.prepare();const P=M(r),s=r===P,E=o.ensureFloat64(P);let i=0;n&&(i=o.ensureFloat64(n));const p=o._pe_geog_to_geog(o.getPointer(e),t,E,i,_);return p&&A(r,t,E,s),p}e.geogToGeog=t}(a||(a={})),function(e){const t=(e,t,r,n,_,P)=>{let E,i;switch(o.ensureCache.prepare(),e){case"dd":E=o._pe_geog_to_dd,i=s.PE_DD_MAX;break;case"ddm":E=o._pe_geog_to_ddm,i=s.PE_DDM_MAX;break;case"dms":E=o._pe_geog_to_dms,i=s.PE_DMS_MAX}let p=0;t&&(p=o.getPointer(t));const u=M(n),a=o.ensureFloat64(u),c=y(r,i),g=E(p,r,a,_,o.ensureInt32(c));if(g)for(let s=0;s<r;s++)P[s]=o.UTF8ToString(c[s]);return g},r=(e,t,r,n,_)=>{let P;switch(o.ensureCache.prepare(),e){case"dd":P=o._pe_dd_to_geog;break;case"ddm":P=o._pe_ddm_to_geog;break;case"dms":P=o._pe_dms_to_geog}let s=0;t&&(s=o.getPointer(t));const E=n.map((e=>o.ensureString(e))),i=o.ensureInt32(E),p=o.ensureFloat64(new Array(2*r)),u=P(s,r,i,p);return u&&A(_,r,p),u};function n(e,o,r,n,_){return t("dms",e,o,r,n,_)}function _(e,t,o,n){return r("dms",e,t,o,n)}function P(e,o,r,n,_){return t("ddm",e,o,r,n,_)}function E(e,t,o,n){return r("ddm",e,t,o,n)}function i(e,o,r,n,_){return t("dd",e,o,r,n,_)}function p(e,t,o,n){return r("dd",e,t,o,n)}e.geogToDms=n,e.dmsToGeog=_,e.geogToDdm=P,e.ddmToGeog=E,e.geogToDd=i,e.ddToGeog=p}(c||(c={})),function(e){function t(){e.PE_MGRS_STYLE_NEW=o.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,e.PE_MGRS_STYLE_OLD=o.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,e.PE_MGRS_STYLE_AUTO=o.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,e.PE_MGRS_180_ZONE_1_PLUS=o.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,e.PE_MGRS_ADD_SPACES=o.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function r(e,t,r,n,_,P,E){o.ensureCache.prepare();let i=0;e&&(i=o.getPointer(e));const p=M(r),u=o.ensureFloat64(p),a=y(t,s.PE_MGRS_MAX),c=o.ensureInt32(a),g=o._pe_geog_to_mgrs_extended(i,t,u,n,_,P,c);if(g)for(let s=0;s<t;s++)E[s]=o.UTF8ToString(a[s]);return g}function n(e,t,r,n,_){o.ensureCache.prepare();let P=0;e&&(P=o.getPointer(e));const s=r.map((e=>o.ensureString(e))),E=o.ensureInt32(s),i=o.ensureFloat64(new Array(2*t)),p=o._pe_mgrs_to_geog_extended(P,t,E,n,i);return p&&A(_,t,i),p}e.init=t,e.geogToMgrsExtended=r,e.mgrsToGeogExtended=n}(g||(g={})),function(e){function t(e,t,r,n,_,P,E){o.ensureCache.prepare();let i=0;e&&(i=o.getPointer(e));const p=M(r),u=o.ensureFloat64(p),a=y(t,s.PE_MGRS_MAX),c=o.ensureInt32(a),g=o._pe_geog_to_usng(i,t,u,n,_,P,c);if(g)for(let s=0;s<t;s++)E[s]=o.UTF8ToString(a[s]);return g}function r(e,t,r,n){o.ensureCache.prepare();let _=0;e&&(_=o.getPointer(e));const P=r.map((e=>o.ensureString(e))),s=o.ensureInt32(P),E=o.ensureFloat64(new Array(2*t)),i=o._pe_usng_to_geog(_,t,s,E);return i&&A(n,t,E),i}e.geogToUsng=t,e.usngToGeog=r}(T||(T={})),function(e){function t(){e.PE_UTM_OPTS_NONE=o.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,e.PE_UTM_OPTS_ADD_SPACES=o.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,e.PE_UTM_OPTS_NS=o.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function r(e,t,r,n,_){o.ensureCache.prepare();let P=0;e&&(P=o.getPointer(e));const E=M(r),i=o.ensureFloat64(E),p=y(t,s.PE_UTM_MAX),u=o.ensureInt32(p),a=o._pe_geog_to_utm(P,t,i,n,u);if(a)for(let s=0;s<t;s++)_[s]=o.UTF8ToString(p[s]);return a}function n(e,t,r,n,_){o.ensureCache.prepare();let P=0;e&&(P=o.getPointer(e));const s=r.map((e=>o.ensureString(e))),E=o.ensureInt32(s),i=o.ensureFloat64(new Array(2*t)),p=o._pe_utm_to_geog(P,t,E,n,i);return p&&A(_,t,i),p}e.init=t,e.geogToUtm=r,e.utmToGeog=n}(f||(f={})),function(e){const t=new Map;function r(){e.PE_PCSINFO_OPTION_NONE=o.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,e.PE_PCSINFO_OPTION_DOMAIN=o.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,e.PE_POLE_OUTSIDE_BOUNDARY=o.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,e.PE_POLE_POINT=o.PePCSInfo.prototype.PE_POLE_POINT}function n(r,n=e.PE_PCSINFO_OPTION_DOMAIN){let _,P;return t.has(r)&&(P=t.get(r),P[n]&&(_=P[n])),_||(_=o.PePCSInfo.prototype.generate(r,n),P||(P=[],t.set(r,P)),P[n]=_),_}e.init=r,e.generate=n}(O||(O={})),function(e){function t(){return o.PeVersion.prototype.version_string()}e.versionString=t}(S||(S={}));const d=Object.freeze(Object.defineProperty({__proto__:null,get _pe(){return o},isLoaded:r,isSupported:n,load:_,get PeCSTransformations(){return P},get PeDefs(){return s},get PeFactory(){return E},get PeGCSExtent(){return i},get PeGTlistExtended(){return p},get PeGTlistExtendedEntry(){return u},get PeGTTransformations(){return a},get PeNotationDms(){return c},get PeNotationMgrs(){return g},get PeNotationUsng(){return T},get PeNotationUtm(){return f},get PePCSInfo(){return O},get PeVersion(){return S},_init:l},Symbol.toStringTag,{value:"Module"}));export{c as P,o as _,n as a,g as b,T as c,f as d,E as e,s as f,P as g,a as h,r as i,O as j,i as k,_ as l,p as m,u as n,S as o,d as p,l as q};
|
|
5
|
+
import{getAssetUrl as e}from"../assets.js";import has from"../core/has.js";let t,o=null;function r(){return!!o}function n(){return!!has("esri-wasm")}function _(){return t||(t=import("./pe-wasm.js").then((e=>e.p)).then((({default:t})=>t({locateFile:t=>e(`esri/geometry/support/${t}`)}))).then((e=>{S(e)})),t)}var P,s,E;!function(e){function t(e,t,r){o.ensureCache.prepare();const n=M(r),_=r===n,P=o.ensureFloat64(n),s=o._pe_geog_to_proj(o.getPointer(e),t,P);return s&&A(r,t,P,_),s}function r(e,o,r,_){switch(_){case s.PE_TRANSFORM_P_TO_G:return n(e,o,r);case s.PE_TRANSFORM_G_TO_P:return t(e,o,r)}return 0}function n(e,t,o){return _(e,t,o,0)}function _(e,t,r,n){o.ensureCache.prepare();const _=M(r),P=r===_,s=o.ensureFloat64(_),E=o._pe_proj_to_geog_center(o.getPointer(e),t,s,n);return E&&A(r,t,s,P),E}e.geogToProj=t,e.projGeog=r,e.projToGeog=n,e.projToGeogCenter=_}(P||(P={})),function(e){function t(){e.PE_BUFFER_MAX=o.PeDefs.prototype.PE_BUFFER_MAX,e.PE_NAME_MAX=o.PeDefs.prototype.PE_NAME_MAX,e.PE_MGRS_MAX=o.PeDefs.prototype.PE_MGRS_MAX,e.PE_USNG_MAX=o.PeDefs.prototype.PE_USNG_MAX,e.PE_DD_MAX=o.PeDefs.prototype.PE_DD_MAX,e.PE_DDM_MAX=o.PeDefs.prototype.PE_DDM_MAX,e.PE_DMS_MAX=o.PeDefs.prototype.PE_DMS_MAX,e.PE_UTM_MAX=o.PeDefs.prototype.PE_UTM_MAX,e.PE_PARM_MAX=o.PeDefs.prototype.PE_PARM_MAX,e.PE_TYPE_NONE=o.PeDefs.prototype.PE_TYPE_NONE,e.PE_TYPE_GEOGCS=o.PeDefs.prototype.PE_TYPE_GEOGCS,e.PE_TYPE_PROJCS=o.PeDefs.prototype.PE_TYPE_PROJCS,e.PE_TYPE_GEOGTRAN=o.PeDefs.prototype.PE_TYPE_GEOGTRAN,e.PE_TYPE_COORDSYS=o.PeDefs.prototype.PE_TYPE_COORDSYS,e.PE_TYPE_UNIT=o.PeDefs.prototype.PE_TYPE_UNIT,e.PE_TYPE_LINUNIT=o.PeDefs.prototype.PE_TYPE_LINUNIT,e.PE_STR_OPTS_NONE=o.PeDefs.prototype.PE_STR_OPTS_NONE,e.PE_STR_AUTH_NONE=o.PeDefs.prototype.PE_STR_AUTH_NONE,e.PE_STR_AUTH_TOP=o.PeDefs.prototype.PE_STR_AUTH_TOP,e.PE_STR_NAME_CANON=o.PeDefs.prototype.PE_STR_NAME_CANON,e.PE_PARM_X0=o.PeDefs.prototype.PE_PARM_X0,e.PE_PARM_ND=o.PeDefs.prototype.PE_PARM_ND,e.PE_TRANSFORM_1_TO_2=o.PeDefs.prototype.PE_TRANSFORM_1_TO_2,e.PE_TRANSFORM_2_TO_1=o.PeDefs.prototype.PE_TRANSFORM_2_TO_1,e.PE_TRANSFORM_P_TO_G=o.PeDefs.prototype.PE_TRANSFORM_P_TO_G,e.PE_TRANSFORM_G_TO_P=o.PeDefs.prototype.PE_TRANSFORM_G_TO_P,e.PE_HORIZON_RECT=o.PeDefs.prototype.PE_HORIZON_RECT,e.PE_HORIZON_POLY=o.PeDefs.prototype.PE_HORIZON_POLY,e.PE_HORIZON_LINE=o.PeDefs.prototype.PE_HORIZON_LINE,e.PE_HORIZON_DELTA=o.PeDefs.prototype.PE_HORIZON_DELTA}e.init=t}(s||(s={})),function(e){const t={},r={},n=e=>{if(e){const t=e.getType();switch(t){case s.PE_TYPE_GEOGCS:e=o.castObject(e,o.PeGeogcs);break;case s.PE_TYPE_PROJCS:e=o.castObject(e,o.PeProjcs);break;case s.PE_TYPE_GEOGTRAN:e=o.castObject(e,o.PeGeogtran);break;default:t&s.PE_TYPE_UNIT&&(e=o.castObject(e,o.PeUnit))}}return e};function _(){o.PeFactory.prototype.initialize(null)}function P(e){return E(s.PE_TYPE_COORDSYS,e)}function E(e,r){let _=null,P=t[e];if(P||(P={},t[e]=P),P.hasOwnProperty(String(r)))_=P[r];else{const t=o.PeFactory.prototype.factoryByType(e,r);o.compare(t,o.NULL)||(_=t,P[r]=_)}return _=n(_),_}function i(e,t){let _=null,P=r[e];if(P||(P={},r[e]=P),P.hasOwnProperty(t))_=P[t];else{const r=o.PeFactory.prototype.fromString(e,t);o.compare(r,o.NULL)||(_=r,P[t]=_)}return _=n(_),_}function p(e){return E(s.PE_TYPE_GEOGCS,e)}function u(e){return E(s.PE_TYPE_GEOGTRAN,e)}function a(e){return o.PeFactory.prototype.getCode(e)}function c(e){return E(s.PE_TYPE_PROJCS,e)}function g(e){return E(s.PE_TYPE_UNIT,e)}e.initialize=_,e.coordsys=P,e.factoryByType=E,e.fromString=i,e.geogcs=p,e.geogtran=u,e.getCode=a,e.projcs=c,e.unit=g}(E||(E={}));let i=null;var p,u,a,c,g,T,f,O,l;function S(e){function t(e,t,o){e[t]=o(e[t])}o=e,s.init(),p.init(),g.init(),f.init(),O.init(),i=class extends o.PeGCSExtent{destroy(){o.destroy(this)}};const r=[o.PeDatum,o.PeGeogcs,o.PeGeogtran,o.PeObject,o.PeParameter,o.PePrimem,o.PeProjcs,o.PeSpheroid,o.PeUnit];for(const o of r)t(o.prototype,"getName",(e=>function(){return e.call(this,new Array(s.PE_NAME_MAX))}));for(const P of[o.PeGeogtran,o.PeProjcs])t(P.prototype,"getParameters",(e=>function(){const t=new Array(s.PE_PARM_MAX);let r=e.call(this);for(let e=0;e<t.length;e++){const n=o.getValue(r,"*");t[e]=n?o.wrapPointer(n,o.PeParameter):null,r+=Int32Array.BYTES_PER_ELEMENT}return t}));t(o.PeHorizon.prototype,"getCoord",(e=>function(){const t=this.getSize();if(!t)return null;const o=[];return A(o,t,e.call(this)),o})),t(o.PeGTlistExtendedEntry.prototype,"getEntries",(e=>{const t=o._pe_getPeGTlistExtendedGTsSize();return function(){let r=null;const n=e.call(this);if(!o.compare(n,o.NULL)){r=[n];const e=this.getSteps();if(e>1){const _=o.getPointer(n);for(let n=1;n<e;n++)r.push(o.wrapPointer(_+t*n,o.PeGTlistExtendedGTs))}}return r}}));const n=o._pe_getPeHorizonSize(),_=e=>function(){let t=this._cache;if(t||(t=new Map,this._cache=t),t.has(e))return t.get(e);let r=null;const _=e.call(this);if(!o.compare(_,o.NULL)){r=[_];const e=_.getNump();if(e>1){const t=o.getPointer(_);for(let _=1;_<e;_++)r.push(o.wrapPointer(t+n*_,o.PeHorizon))}}return t.set(e,r),r};t(o.PeProjcs.prototype,"horizonGcsGenerate",_),t(o.PeProjcs.prototype,"horizonPcsGenerate",_),o.PeObject.prototype.toString=function(e=s.PE_STR_OPTS_NONE){o.ensureCache.prepare();const t=o.getPointer(this),r=o.ensureInt8(new Array(s.PE_BUFFER_MAX));return o.UTF8ToString(o._pe_object_to_string_ext(t,e,r))}}function N(e){if(!e)return;const t=o.getClass(e);if(!t)return;const r=o.getCache(t);if(!r)return;const n=o.getPointer(e);n&&delete r[n]}function y(e,t){const r=[],n=new Array(t);for(let _=0;_<e;_++)r.push(o.ensureInt8(n));return r}function M(e){let t;return Array.isArray(e[0])?(t=[],e.forEach((e=>{t.push(e[0],e[1])}))):t=e,t}function A(e,t,r,n=!1){if(n)for(let _=0;_<2*t;_++)e[_]=o.getValue(r+_*Float64Array.BYTES_PER_ELEMENT,"double");else{const n=0===e.length;for(let _=0;_<t;_++)n&&(e[_]=new Array(2)),e[_][0]=o.getValue(r,"double"),e[_][1]=o.getValue(r+Float64Array.BYTES_PER_ELEMENT,"double"),r+=2*Float64Array.BYTES_PER_ELEMENT}}!function(e){let t;function r(){e.PE_GTLIST_OPTS_COMMON=o.PeGTlistExtended.prototype.PE_GTLIST_OPTS_COMMON,t=o._pe_getPeGTlistExtendedEntrySize()}function n(e,r,n,_,P,s){let E=null;const i=new o.PeInteger(s);try{const p=o.PeGTlistExtended.prototype.getGTlist(e,r,n,_,P,i);if((s=i.val)&&(E=[p],s>1)){const e=o.getPointer(p);for(let r=1;r<s;r++)E.push(o.wrapPointer(e+t*r,o.PeGTlistExtendedEntry))}}finally{o.destroy(i)}return E}e.init=r,e.getGTlist=n}(p||(p={})),function(e){function t(e){if(e&&e.length){for(const t of e)N(t),t.getEntries().forEach((e=>{N(e);const t=e.getGeogtran();N(t),t.getParameters().forEach(N),[t.getGeogcs1(),t.getGeogcs2()].forEach((e=>{N(e);const t=e.getDatum();N(t),N(t.getSpheroid()),N(e.getPrimem()),N(e.getUnit())}))}));o.PeGTlistExtendedEntry.prototype.Delete(e[0])}}e.destroy=t}(u||(u={})),function(e){function t(e,t,r,n,_){o.ensureCache.prepare();const P=M(r),s=r===P,E=o.ensureFloat64(P);let i=0;n&&(i=o.ensureFloat64(n));const p=o._pe_geog_to_geog(o.getPointer(e),t,E,i,_);return p&&A(r,t,E,s),p}e.geogToGeog=t}(a||(a={})),function(e){const t=(e,t,r,n,_,P)=>{let E,i;switch(o.ensureCache.prepare(),e){case"dd":E=o._pe_geog_to_dd,i=s.PE_DD_MAX;break;case"ddm":E=o._pe_geog_to_ddm,i=s.PE_DDM_MAX;break;case"dms":E=o._pe_geog_to_dms,i=s.PE_DMS_MAX}let p=0;t&&(p=o.getPointer(t));const u=M(n),a=o.ensureFloat64(u),c=y(r,i),g=E(p,r,a,_,o.ensureInt32(c));if(g)for(let s=0;s<r;s++)P[s]=o.UTF8ToString(c[s]);return g},r=(e,t,r,n,_)=>{let P;switch(o.ensureCache.prepare(),e){case"dd":P=o._pe_dd_to_geog;break;case"ddm":P=o._pe_ddm_to_geog;break;case"dms":P=o._pe_dms_to_geog}let s=0;t&&(s=o.getPointer(t));const E=n.map((e=>o.ensureString(e))),i=o.ensureInt32(E),p=o.ensureFloat64(new Array(2*r)),u=P(s,r,i,p);return u&&A(_,r,p),u};function n(e,o,r,n,_){return t("dms",e,o,r,n,_)}function _(e,t,o,n){return r("dms",e,t,o,n)}function P(e,o,r,n,_){return t("ddm",e,o,r,n,_)}function E(e,t,o,n){return r("ddm",e,t,o,n)}function i(e,o,r,n,_){return t("dd",e,o,r,n,_)}function p(e,t,o,n){return r("dd",e,t,o,n)}e.geogToDms=n,e.dmsToGeog=_,e.geogToDdm=P,e.ddmToGeog=E,e.geogToDd=i,e.ddToGeog=p}(c||(c={})),function(e){function t(){e.PE_MGRS_STYLE_NEW=o.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,e.PE_MGRS_STYLE_OLD=o.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,e.PE_MGRS_STYLE_AUTO=o.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,e.PE_MGRS_180_ZONE_1_PLUS=o.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,e.PE_MGRS_ADD_SPACES=o.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function r(e,t,r,n,_,P,E){o.ensureCache.prepare();let i=0;e&&(i=o.getPointer(e));const p=M(r),u=o.ensureFloat64(p),a=y(t,s.PE_MGRS_MAX),c=o.ensureInt32(a),g=o._pe_geog_to_mgrs_extended(i,t,u,n,_,P,c);if(g)for(let s=0;s<t;s++)E[s]=o.UTF8ToString(a[s]);return g}function n(e,t,r,n,_){o.ensureCache.prepare();let P=0;e&&(P=o.getPointer(e));const s=r.map((e=>o.ensureString(e))),E=o.ensureInt32(s),i=o.ensureFloat64(new Array(2*t)),p=o._pe_mgrs_to_geog_extended(P,t,E,n,i);return p&&A(_,t,i),p}e.init=t,e.geogToMgrsExtended=r,e.mgrsToGeogExtended=n}(g||(g={})),function(e){function t(e,t,r,n,_,P,E){o.ensureCache.prepare();let i=0;e&&(i=o.getPointer(e));const p=M(r),u=o.ensureFloat64(p),a=y(t,s.PE_MGRS_MAX),c=o.ensureInt32(a),g=o._pe_geog_to_usng(i,t,u,n,_,P,c);if(g)for(let s=0;s<t;s++)E[s]=o.UTF8ToString(a[s]);return g}function r(e,t,r,n){o.ensureCache.prepare();let _=0;e&&(_=o.getPointer(e));const P=r.map((e=>o.ensureString(e))),s=o.ensureInt32(P),E=o.ensureFloat64(new Array(2*t)),i=o._pe_usng_to_geog(_,t,s,E);return i&&A(n,t,E),i}e.geogToUsng=t,e.usngToGeog=r}(T||(T={})),function(e){function t(){e.PE_UTM_OPTS_NONE=o.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,e.PE_UTM_OPTS_ADD_SPACES=o.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,e.PE_UTM_OPTS_NS=o.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function r(e,t,r,n,_){o.ensureCache.prepare();let P=0;e&&(P=o.getPointer(e));const E=M(r),i=o.ensureFloat64(E),p=y(t,s.PE_UTM_MAX),u=o.ensureInt32(p),a=o._pe_geog_to_utm(P,t,i,n,u);if(a)for(let s=0;s<t;s++)_[s]=o.UTF8ToString(p[s]);return a}function n(e,t,r,n,_){o.ensureCache.prepare();let P=0;e&&(P=o.getPointer(e));const s=r.map((e=>o.ensureString(e))),E=o.ensureInt32(s),i=o.ensureFloat64(new Array(2*t)),p=o._pe_utm_to_geog(P,t,E,n,i);return p&&A(_,t,i),p}e.init=t,e.geogToUtm=r,e.utmToGeog=n}(f||(f={})),function(e){const t=new Map;function r(){e.PE_PCSINFO_OPTION_NONE=o.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,e.PE_PCSINFO_OPTION_DOMAIN=o.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,e.PE_POLE_OUTSIDE_BOUNDARY=o.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,e.PE_POLE_POINT=o.PePCSInfo.prototype.PE_POLE_POINT}function n(r,n=e.PE_PCSINFO_OPTION_DOMAIN){let _=null,P=null;return t.has(r)&&(P=t.get(r),P[n]&&(_=P[n])),_||(_=o.PePCSInfo.prototype.generate(r,n),P||(P=[],t.set(r,P)),P[n]=_),_}e.init=r,e.generate=n}(O||(O={})),function(e){function t(){return o.PeVersion.prototype.version_string()}e.versionString=t}(l||(l={}));const d=Object.freeze(Object.defineProperty({__proto__:null,get _pe(){return o},isLoaded:r,isSupported:n,load:_,get PeCSTransformations(){return P},get PeDefs(){return s},get PeFactory(){return E},get PeGCSExtent(){return i},get PeGTlistExtended(){return p},get PeGTlistExtendedEntry(){return u},get PeGTTransformations(){return a},get PeNotationDms(){return c},get PeNotationMgrs(){return g},get PeNotationUsng(){return T},get PeNotationUtm(){return f},get PePCSInfo(){return O},get PeVersion(){return l},_init:S},Symbol.toStringTag,{value:"Module"}));export{c as P,o as _,n as a,g as b,T as c,f as d,E as e,s as f,P as g,a as h,r as i,O as j,i as k,_ as l,p as m,u as n,l as o,d as p,S as q};
|
package/core/Identifiable.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{subclass as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{subclass as r}from"./accessorSupport/decorators/subclass.js";let t=0;const s=s=>{let i=class extends s{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+t++})}};return i=e([r("esri.core.Identifiable")],i),i},i=s=>{let i=class extends s{constructor(...e){super(...e),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:t++})}};return i=e([r("esri.core.NumericIdentifiable")],i),i};let o=class extends(s(class{})){};o=e([r("esri.core.Identifiable")],o);export{o as Identifiable,s as IdentifiableMixin,i as NumericIdentifiableMixin};
|
package/geometry/Circle.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import{convertUnit as r,lengthToDegrees as t}from"../core/unitUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import o from"./Point.js";import c from"./Polygon.js";import{getReferenceEllipsoid as n}from"./projectionEllipsoid.js";import{directGeodeticSolver as a}from"./support/geodesicUtils.js";import{webMercatorToGeographic as p,geographicToWebMercator as l}from"./support/webMercatorUtils.js";import u from"./support/WKIDUnitConversion.js";var d;let h=d=class extends c{constructor(...e){super(...e),this.center=null,this.geodesic=!1,this.numberOfPoints=60,this.radius=1e3,this.radiusUnit="meters"}normalizeCtorArgs(e,r){let t;if(e&&e.center)t=e;else{if(e&&e.rings)return super.normalizeCtorArgs(e,r);t={center:e}}return{...super.normalizeCtorArgs(),...t,...r}}initialize(){const e=this.center,s=this.numberOfPoints;if(this.hasZ=e
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import{convertUnit as r,lengthToDegrees as t}from"../core/unitUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import o from"./Point.js";import c from"./Polygon.js";import{getReferenceEllipsoid as n}from"./projectionEllipsoid.js";import{directGeodeticSolver as a}from"./support/geodesicUtils.js";import{webMercatorToGeographic as p,geographicToWebMercator as l}from"./support/webMercatorUtils.js";import u from"./support/WKIDUnitConversion.js";var d;let h=d=class extends c{constructor(...e){super(...e),this.center=null,this.geodesic=!1,this.numberOfPoints=60,this.radius=1e3,this.radiusUnit="meters"}normalizeCtorArgs(e,r){let t;if(e&&e.center)t=e;else{if(e&&e.rings)return super.normalizeCtorArgs(e,r);t={center:e}}return{...super.normalizeCtorArgs(),...t,...r}}initialize(){const e=this.center,s=this.numberOfPoints;if(this.hasZ=e?.hasZ??!1,0!==this.rings.length||!e)return;const i=r(this.radius,this.radiusUnit,"meters"),o=e.spatialReference;let c,a="geographic";if(o.isWebMercator?a="webMercator":(null!=(o.wkid&&u[o.wkid])||o.wkt&&0===o.wkt.indexOf("PROJCS"))&&(a="projected"),this.geodesic){let r;switch(a){case"webMercator":r=p(e);break;case"projected":console.error("Creating a geodesic circle requires the center to be specified in web mercator or geographic coordinate system");break;case"geographic":r=e}c=this._createGeodesicCircle(r,i,s),"webMercator"===a&&(c=l(c))}else{let r;"webMercator"===a||"projected"===a?r=i/this._convert2Meters(1,e.spatialReference):"geographic"===a&&(r=t(i,"meters",n(e.spatialReference).radius)),c=this._createPlanarCircle(e,r,s)}this.spatialReference=c.spatialReference,this.addRing(c.rings[0])}clone(){const{center:e,numberOfPoints:r,radius:t,radiusUnit:s,geodesic:i}=this;return new d({center:e?.clone(),numberOfPoints:r,radius:t,radiusUnit:s,geodesic:i})}_createGeodesicCircle(e,r,t){let s=0;const i=[];for(;s<360;){const o=[0,0],c=[e.x,e.y];a(o,c,s,r),this.hasZ&&o.push(e.z),i.push(o),s+=360/t}return i.push(i[0]),new c(i)}_createPlanarCircle(e,r,t){const s=[],i=2*Math.PI/t;for(let o=0;o<t;++o){const t=i*o,c=[e.x+Math.cos(-t)*r,e.y+Math.sin(-t)*r];this.hasZ&&c.push(e.z),s.push(c)}return s.push(s[0]),new c({spatialReference:e.spatialReference,rings:[s]})}_convert2Meters(e,r){let t;if(r.wkid&&null!=u[r.wkid])t=u.values[u[r.wkid]];else{const e=r.wkt,s=e.lastIndexOf(",")+1,i=e.lastIndexOf("]]");t=parseFloat(e.substring(s,i))}return e*t}};e([s({type:o})],h.prototype,"center",void 0),e([s()],h.prototype,"geodesic",void 0),e([s()],h.prototype,"numberOfPoints",void 0),e([s()],h.prototype,"radius",void 0),e([s()],h.prototype,"radiusUnit",void 0),h=d=e([i("esri.geometry.Circle")],h);const m=h;export{m as default};
|
package/geometry/Extent.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import{isNone as i}from"../core/maybe.js";import{replace as e}from"../core/string.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import m from"./Geometry.js";import r from"./Point.js";import a from"./SpatialReference.js";import{extentContainsPoint as h,extentContainsExtent as o}from"./support/contains.js";import{getFeatureExtentIntersector as x}from"./support/intersectsBase.js";import{equals as l,getInfo as p}from"./support/spatialReferenceUtils.js";import{canProject as c,geographicToWebMercator as y,webMercatorToGeographic as u}from"./support/webMercatorUtils.js";var f;function d(t){return t&&("esri.geometry.SpatialReference"===t.declaredClass||null!=t.wkid)}function z(t,i,e){return null==i?e:null==e?i:t(i,e)}let M=f=class extends m{constructor(...t){super(...t),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(t,i,e,s,n){return d(t)?{spatialReference:t,xmin:0,ymin:0,xmax:0,ymax:0}:"object"==typeof t?(t.spatialReference=null==t.spatialReference?a.WGS84:t.spatialReference,t):{xmin:t,ymin:i,xmax:e,ymax:s,spatialReference:n??a.WGS84}}static fromBounds(t,i){return new f({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:i})}static fromPoint(t){return new f({xmin:t.x,ymin:t.y,zmin:t.z,xmax:t.x,ymax:t.y,zmax:t.z,spatialReference:t.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const t=new r({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(t.z=.5*(this.zmin+this.zmax)),this.hasM&&(t.m=.5*(this.mmin+this.mmax)),t}get extent(){return this.clone()}get hasM(){return null!=this.mmin&&null!=this.mmax}get hasZ(){return null!=this.zmin&&null!=this.zmax}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(t){const i=this.center;return null!=t.z&&this.hasZ?this.offset(t.x-i.x,t.y-i.y,t.z-i.z):this.offset(t.x-i.x,t.y-i.y)}clone(){const t=new f;return t.xmin=this.xmin,t.ymin=this.ymin,t.xmax=this.xmax,t.ymax=this.ymax,t.spatialReference=this.spatialReference,null!=this.zmin&&(t.zmin=this.zmin,t.zmax=this.zmax),null!=this.mmin&&(t.mmin=this.mmin,t.mmax=this.mmax),t}contains(t){if(!t)return!1;const i=this.spatialReference,e=t.spatialReference;return i&&e&&!i.equals(e)&&c(i,e)&&(t=i.isWebMercator?y(t):u(t,!0)),"point"===t.type?h(this,t):"extent"===t.type&&o(this,t)}equals(t){if(this===t)return!0;if(i(t))return!1;const e=this.spatialReference,s=t.spatialReference;return e&&s&&!e.equals(s)&&c(e,s)&&(t=e.isWebMercator?y(t):u(t,!0)),this.xmin===t.xmin&&this.ymin===t.ymin&&this.zmin===t.zmin&&this.mmin===t.mmin&&this.xmax===t.xmax&&this.ymax===t.ymax&&this.zmax===t.zmax&&this.mmax===t.mmax}expand(t){const i=.5*(1-t),e=this.width*i,s=this.height*i;if(this.xmin+=e,this.ymin+=s,this.xmax-=e,this.ymax-=s,this.hasZ){const t=(this.zmax-this.zmin)*i;this.zmin+=t,this.zmax-=t}if(this.hasM){const t=(this.mmax-this.mmin)*i;this.mmin+=t,this.mmax-=t}return this}intersects(t){if(i(t))return!1;"mesh"===t.type&&(t=t.extent);const e=this.spatialReference,s=t.spatialReference;e&&s&&!l(e,s)&&c(e,s)&&(t=e.isWebMercator?y(t):u(t,!0));return x(t.type)(this,t)}normalize(){const t=this._normalize(!1,!0);return Array.isArray(t)?t:[t]}offset(t,i,e){return this.xmin+=t,this.ymin+=i,this.xmax+=t,this.ymax+=i,null!=e&&(this.zmin+=e,this.zmax+=e),this}shiftCentralMeridian(){return this._normalize(!0)}union(t){return this===t||(this.xmin=Math.min(this.xmin,t.xmin),this.ymin=Math.min(this.ymin,t.ymin),this.xmax=Math.max(this.xmax,t.xmax),this.ymax=Math.max(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=z(Math.min,this.zmin,t.zmin),this.zmax=z(Math.max,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=z(Math.min,this.mmin,t.mmin),this.mmax=z(Math.max,this.mmax,t.mmax))),this}intersection(t){return this===t?this:i(t)||!this.intersects(t)?null:(this.xmin=Math.max(this.xmin,t.xmin),this.ymin=Math.max(this.ymin,t.ymin),this.xmax=Math.min(this.xmax,t.xmax),this.ymax=Math.min(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=z(Math.max,this.zmin,t.zmin),this.zmax=z(Math.min,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=z(Math.max,this.mmin,t.mmin),this.mmax=z(Math.min,this.mmax,t.mmax)),this)}toJSON(t){return this.write({},t)}_shiftCM(t=p(this.spatialReference)){if(!t||!this.spatialReference)return this;const i=this.spatialReference,s=this._getCM(t);if(s){const n=i.isWebMercator?u(s):s;this.xmin-=s.x,this.xmax-=s.x,i.isWebMercator||(n.x=this._normalizeX(n.x,t).x),this.spatialReference=new a(e(i.isWGS84?t.altTemplate:t.wkTemplate,{Central_Meridian:n.x}))}return this}_getCM(t){let i=null;const[e,s]=t.valid,n=this.xmin,m=this.xmax;return n>=e&&n<=s&&(m>=e&&m<=s)||(i=this.center),i}_normalize(t,i,e){const s=this.spatialReference;if(!s)return this;
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{isNone as i}from"../core/maybe.js";import{replace as e}from"../core/string.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import m from"./Geometry.js";import r from"./Point.js";import a from"./SpatialReference.js";import{extentContainsPoint as h,extentContainsExtent as o}from"./support/contains.js";import{getFeatureExtentIntersector as x}from"./support/intersectsBase.js";import{equals as l,getInfo as p}from"./support/spatialReferenceUtils.js";import{canProject as c,geographicToWebMercator as y,webMercatorToGeographic as u}from"./support/webMercatorUtils.js";var f;function d(t){return t&&("esri.geometry.SpatialReference"===t.declaredClass||null!=t.wkid)}function z(t,i,e){return null==i?e:null==e?i:t(i,e)}let M=f=class extends m{constructor(...t){super(...t),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(t,i,e,s,n){return d(t)?{spatialReference:t,xmin:0,ymin:0,xmax:0,ymax:0}:"object"==typeof t?(t.spatialReference=null==t.spatialReference?a.WGS84:t.spatialReference,t):{xmin:t,ymin:i,xmax:e,ymax:s,spatialReference:n??a.WGS84}}static fromBounds(t,i){return new f({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3],spatialReference:i})}static fromPoint(t){return new f({xmin:t.x,ymin:t.y,zmin:t.z,xmax:t.x,ymax:t.y,zmax:t.z,spatialReference:t.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const t=new r({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(t.z=.5*(this.zmin+this.zmax)),this.hasM&&(t.m=.5*(this.mmin+this.mmax)),t}get extent(){return this.clone()}get hasM(){return null!=this.mmin&&null!=this.mmax}get hasZ(){return null!=this.zmin&&null!=this.zmax}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(t){const i=this.center;return null!=t.z&&this.hasZ?this.offset(t.x-i.x,t.y-i.y,t.z-i.z):this.offset(t.x-i.x,t.y-i.y)}clone(){const t=new f;return t.xmin=this.xmin,t.ymin=this.ymin,t.xmax=this.xmax,t.ymax=this.ymax,t.spatialReference=this.spatialReference,null!=this.zmin&&(t.zmin=this.zmin,t.zmax=this.zmax),null!=this.mmin&&(t.mmin=this.mmin,t.mmax=this.mmax),t}contains(t){if(!t)return!1;const i=this.spatialReference,e=t.spatialReference;return i&&e&&!i.equals(e)&&c(i,e)&&(t=i.isWebMercator?y(t):u(t,!0)),"point"===t.type?h(this,t):"extent"===t.type&&o(this,t)}equals(t){if(this===t)return!0;if(i(t))return!1;const e=this.spatialReference,s=t.spatialReference;return e&&s&&!e.equals(s)&&c(e,s)&&(t=e.isWebMercator?y(t):u(t,!0)),this.xmin===t.xmin&&this.ymin===t.ymin&&this.zmin===t.zmin&&this.mmin===t.mmin&&this.xmax===t.xmax&&this.ymax===t.ymax&&this.zmax===t.zmax&&this.mmax===t.mmax}expand(t){const i=.5*(1-t),e=this.width*i,s=this.height*i;if(this.xmin+=e,this.ymin+=s,this.xmax-=e,this.ymax-=s,this.hasZ){const t=(this.zmax-this.zmin)*i;this.zmin+=t,this.zmax-=t}if(this.hasM){const t=(this.mmax-this.mmin)*i;this.mmin+=t,this.mmax-=t}return this}intersects(t){if(i(t))return!1;"mesh"===t.type&&(t=t.extent);const e=this.spatialReference,s=t.spatialReference;e&&s&&!l(e,s)&&c(e,s)&&(t=e.isWebMercator?y(t):u(t,!0));return x(t.type)(this,t)}normalize(){const t=this._normalize(!1,!0);return Array.isArray(t)?t:[t]}offset(t,i,e){return this.xmin+=t,this.ymin+=i,this.xmax+=t,this.ymax+=i,null!=e&&(this.zmin+=e,this.zmax+=e),this}shiftCentralMeridian(){return this._normalize(!0)}union(t){return this===t||(this.xmin=Math.min(this.xmin,t.xmin),this.ymin=Math.min(this.ymin,t.ymin),this.xmax=Math.max(this.xmax,t.xmax),this.ymax=Math.max(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=z(Math.min,this.zmin,t.zmin),this.zmax=z(Math.max,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=z(Math.min,this.mmin,t.mmin),this.mmax=z(Math.max,this.mmax,t.mmax))),this}intersection(t){return this===t?this:i(t)||!this.intersects(t)?null:(this.xmin=Math.max(this.xmin,t.xmin),this.ymin=Math.max(this.ymin,t.ymin),this.xmax=Math.min(this.xmax,t.xmax),this.ymax=Math.min(this.ymax,t.ymax),(this.hasZ||t.hasZ)&&(this.zmin=z(Math.max,this.zmin,t.zmin),this.zmax=z(Math.min,this.zmax,t.zmax)),(this.hasM||t.hasM)&&(this.mmin=z(Math.max,this.mmin,t.mmin),this.mmax=z(Math.min,this.mmax,t.mmax)),this)}toJSON(t){return this.write({},t)}_shiftCM(t=p(this.spatialReference)){if(!t||!this.spatialReference)return this;const i=this.spatialReference,s=this._getCM(t);if(s){const n=i.isWebMercator?u(s):s;this.xmin-=s.x,this.xmax-=s.x,i.isWebMercator||(n.x=this._normalizeX(n.x,t).x),this.spatialReference=new a(e((i.isWGS84?t.altTemplate:null)??t.wkTemplate,{Central_Meridian:n.x}))}return this}_getCM(t){let i=null;const[e,s]=t.valid,n=this.xmin,m=this.xmax;return n>=e&&n<=s&&(m>=e&&m<=s)||(i=this.center),i}_normalize(t,i,e){const s=this.spatialReference;if(!s)return this;const n=e??p(s);if(null==n)return this;const m=this._getParts(n).map((t=>t.extent));if(m.length<2)return m[0]||this;if(m.length>2)return t?this._shiftCM(n):this.set({xmin:n.valid[0],xmax:n.valid[1]});if(t)return this._shiftCM(n);if(i)return m;let r=!0,a=!0;return m.forEach((t=>{t.hasZ||(r=!1),t.hasM||(a=!1)})),{rings:m.map((t=>{const i=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]];if(r){const e=(t.zmax-t.zmin)/2;for(let t=0;t<i.length;t++)i[t].push(e)}if(a){const e=(t.mmax-t.mmin)/2;for(let t=0;t<i.length;t++)i[t].push(e)}return i})),hasZ:r,hasM:a,spatialReference:s}}_getParts(t){let i=this.cache._parts;if(!i){i=[];const{ymin:e,ymax:s,spatialReference:n}=this,m=this.width,r=this.xmin,a=this.xmax;let h;t=t||p(n);const[o,x]=t.valid;h=this._normalizeX(this.xmin,t);const l=h.x,c=h.frameId;h=this._normalizeX(this.xmax,t);const y=h.x,u=h.frameId,d=l===y&&m>0;if(m>2*x){const t=new f(r<a?l:y,e,x,s,n),m=new f(o,e,r<a?y:l,s,n),h=new f(0,e,x,s,n),p=new f(o,e,0,s,n),d=[],z=[];t.contains(h)&&d.push(c),t.contains(p)&&z.push(c),m.contains(h)&&d.push(u),m.contains(p)&&z.push(u);for(let i=c+1;i<u;i++)d.push(i),z.push(i);i.push({extent:t,frameIds:[c]},{extent:m,frameIds:[u]},{extent:h,frameIds:d},{extent:p,frameIds:z})}else l>y||d?i.push({extent:new f(l,e,x,s,n),frameIds:[c]},{extent:new f(o,e,y,s,n),frameIds:[u]}):i.push({extent:new f(l,e,y,s,n),frameIds:[c]});this.cache._parts=i}const e=this.hasZ,s=this.hasM;if(e||s){const t={};e&&(t.zmin=this.zmin,t.zmax=this.zmax),s&&(t.mmin=this.mmin,t.mmax=this.mmax);for(let e=0;e<i.length;e++)i[e].extent.set(t)}return i}_normalizeX(t,i){const[e,s]=i.valid,n=2*s;let m,r=0;return t>s?(m=Math.ceil(Math.abs(t-s)/n),t-=m*n,r=m):t<e&&(m=Math.ceil(Math.abs(t-e)/n),t+=m*n,r=-m),{x:t,frameId:r}}};t([s({readOnly:!0})],M.prototype,"cache",null),t([s({readOnly:!0})],M.prototype,"center",null),t([s({readOnly:!0})],M.prototype,"extent",null),t([s({readOnly:!0,json:{write:{enabled:!1,overridePolicy:null}}})],M.prototype,"hasM",null),t([s({readOnly:!0,json:{write:{enabled:!1,overridePolicy:null}}})],M.prototype,"hasZ",null),t([s({readOnly:!0})],M.prototype,"height",null),t([s({readOnly:!0})],M.prototype,"width",null),t([s({type:Number,json:{type:[Number,String],write:{enabled:!0,allowNull:!0}}})],M.prototype,"xmin",void 0),t([s({type:Number,json:{write:!0}})],M.prototype,"ymin",void 0),t([s({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasM}}}}})],M.prototype,"mmin",void 0),t([s({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasZ}}}}})],M.prototype,"zmin",void 0),t([s({type:Number,json:{write:!0}})],M.prototype,"xmax",void 0),t([s({type:Number,json:{write:!0}})],M.prototype,"ymax",void 0),t([s({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasM}}}}})],M.prototype,"mmax",void 0),t([s({type:Number,json:{origins:{"web-scene":{write:!1}},write:{overridePolicy(){return{enabled:this.hasZ}}}}})],M.prototype,"zmax",void 0),M=f=t([n("esri.geometry.Extent")],M),M.prototype.toJSON.isDefaultToJSON=!0;const w=M;export{w as default};
|
package/geometry/Mesh.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{HandleOwnerMixin as r}from"../core/HandleOwner.js";import o from"../core/Loadable.js";import n from"../core/Logger.js";import{isNone as s,isSome as i}from"../core/maybe.js";import{EsriPromiseMixin as a}from"../core/Promise.js";import{whenOrAbort as l}from"../core/promiseUtils.js";import{watch as c}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{f as h,c as f}from"../chunks/vec3f64.js";import u from"./Extent.js";import d from"./Geometry.js";import g from"./Point.js";import x from"./Polygon.js";import{fromAxisAndAngle as y,compose as b,create as j}from"./support/axisAngleDegrees.js";import w from"./support/MeshComponent.js";import v from"./support/MeshTransform.js";import{MeshVertexAttributes as M}from"./support/MeshVertexAttributes.js";import{triangulate as L}from"./support/triangulationUtils.js";import{centerAt as P}from"./support/meshUtils/centerAt.js";import{loadExternal as R}from"./support/meshUtils/loadExternal.js";import{offset as C}from"./support/meshUtils/offset.js";import{convertUnitGeometry as A,createUnitSizeBox as z,extractSingleFaceOfBox as F,createUnitSizeSphere as O,createUnitSizeCylinder as U,convertPlaneSizeParameter as T,createUnitSizePlane as E}from"./support/meshUtils/primitives.js";import{rotate as G}from"./support/meshUtils/rotate.js";import{scale as S}from"./support/meshUtils/scale.js";var _;const I="esri.geometry.Mesh";let B=_=class extends(r(o.LoadableMixin(a(d)))){constructor(e){super(e),this.components=null,this.transform=null,this.external=null,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new M,this.type="mesh"}initialize(){(s(this.external)||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.handles.add(c((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone())),transform:i(this.transform)?this.transform.clone():null})),(()=>this._set("external",null)),{once:!0,sync:!0}))}))}get hasExtent(){return!this.loaded&&i(this.external)&&i(this.external.extent)||this.loaded&&this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0)}get _boundingInfo(){const e=this.vertexAttributes.position,t=this.spatialReference;if(0===e.length||this.components&&0===this.components.length)return{extent:new u({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t}),center:new g({x:0,y:0,z:0,spatialReference:t})};const r=i(this.transform)?this.transform.project(e,t):e;let o=1/0,n=1/0,s=1/0,a=-1/0,l=-1/0,c=-1/0,p=0,m=0,h=0;const f=r.length,d=1/(f/3);let x=0;for(;x<f;){const e=r[x++],t=r[x++],i=r[x++];o=Math.min(o,e),n=Math.min(n,t),s=Math.min(s,i),a=Math.max(a,e),l=Math.max(l,t),c=Math.max(c,i),p+=d*e,m+=d*t,h+=d*i}return{extent:new u({xmin:o,ymin:n,zmin:s,xmax:a,ymax:l,zmax:c,spatialReference:t}),center:new g({x:p,y:m,z:h,spatialReference:t})}}get anchor(){if(i(this.transform))return this.transform.getOriginPoint(this.spatialReference);const e=this._boundingInfo;return new g({x:e.center.x,y:e.center.y,z:e.extent.zmin,spatialReference:this.spatialReference})}get origin(){return i(this.transform)?this.transform.getOriginPoint(this.spatialReference):this._boundingInfo.center}get extent(){return!this.loaded&&i(this.external)&&i(this.external.extent)?this.external.extent.clone():this._boundingInfo.extent}addComponent(e){this.loaded?(this.components||(this.components=[]),this.components.push(w.from(e)),this.notifyChange("components")):n.getLogger(this.declaredClass).error("addComponent()","Mesh must be loaded before applying operations")}removeComponent(e){if(this.loaded){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}n.getLogger(this.declaredClass).error("removeComponent()","Provided component is not part of the list of components")}else n.getLogger(this.declaredClass).error("removeComponent()","Mesh must be loaded before applying operations")}rotate(e,t,r,o){return y(k.x,e,D),y(k.y,t,W),y(k.z,r,Z),b(D,W,D),b(D,Z,D),G(this,D,o),this}offset(e,t,r,o){return this.loaded?(H[0]=e,H[1]=t,H[2]=r,C(this,H,o),this):(n.getLogger(this.declaredClass).error("offset()","Mesh must be loaded before applying operations"),this)}scale(e,t){return this.loaded?(S(this,e,t),this):(n.getLogger(this.declaredClass).error("scale()","Mesh must be loaded before applying operations"),this)}centerAt(e,t){return this.loaded?(P(this,e,t),this):(n.getLogger(this.declaredClass).error("centerAt()","Mesh must be loaded before applying operations"),this)}load(e){return i(this.external)&&this.addResolvingPromise(R(this,this.external.source,e)),Promise.resolve(this)}clone(){
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{HandleOwnerMixin as r}from"../core/HandleOwner.js";import o from"../core/Loadable.js";import n from"../core/Logger.js";import{isNone as s,isSome as i}from"../core/maybe.js";import{EsriPromiseMixin as a}from"../core/Promise.js";import{whenOrAbort as l}from"../core/promiseUtils.js";import{watch as c}from"../core/reactiveUtils.js";import{property as p}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import"../core/accessorSupport/ensureType.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{f as h,c as f}from"../chunks/vec3f64.js";import u from"./Extent.js";import d from"./Geometry.js";import g from"./Point.js";import x from"./Polygon.js";import{fromAxisAndAngle as y,compose as b,create as j}from"./support/axisAngleDegrees.js";import w from"./support/MeshComponent.js";import v from"./support/MeshTransform.js";import{MeshVertexAttributes as M}from"./support/MeshVertexAttributes.js";import{triangulate as L}from"./support/triangulationUtils.js";import{centerAt as P}from"./support/meshUtils/centerAt.js";import{loadExternal as R}from"./support/meshUtils/loadExternal.js";import{offset as C}from"./support/meshUtils/offset.js";import{convertUnitGeometry as A,createUnitSizeBox as z,extractSingleFaceOfBox as F,createUnitSizeSphere as O,createUnitSizeCylinder as U,convertPlaneSizeParameter as T,createUnitSizePlane as E}from"./support/meshUtils/primitives.js";import{rotate as G}from"./support/meshUtils/rotate.js";import{scale as S}from"./support/meshUtils/scale.js";var _;const I="esri.geometry.Mesh";let B=_=class extends(r(o.LoadableMixin(a(d)))){constructor(e){super(e),this.components=null,this.transform=null,this.external=null,this.hasZ=!0,this.hasM=!1,this.vertexAttributes=new M,this.type="mesh"}initialize(){(s(this.external)||this.vertexAttributes.position.length)&&(this.loadStatus="loaded"),this.when((()=>{this.handles.add(c((()=>({vertexAttributes:this.vertexAttributes,components:this.components?.map((e=>e.clone())),transform:i(this.transform)?this.transform.clone():null})),(()=>this._set("external",null)),{once:!0,sync:!0}))}))}get hasExtent(){return!this.loaded&&i(this.external)&&i(this.external.extent)||this.loaded&&this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0)}get _boundingInfo(){const e=this.vertexAttributes.position,t=this.spatialReference;if(0===e.length||this.components&&0===this.components.length)return{extent:new u({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t}),center:new g({x:0,y:0,z:0,spatialReference:t})};const r=i(this.transform)?this.transform.project(e,t):e;let o=1/0,n=1/0,s=1/0,a=-1/0,l=-1/0,c=-1/0,p=0,m=0,h=0;const f=r.length,d=1/(f/3);let x=0;for(;x<f;){const e=r[x++],t=r[x++],i=r[x++];o=Math.min(o,e),n=Math.min(n,t),s=Math.min(s,i),a=Math.max(a,e),l=Math.max(l,t),c=Math.max(c,i),p+=d*e,m+=d*t,h+=d*i}return{extent:new u({xmin:o,ymin:n,zmin:s,xmax:a,ymax:l,zmax:c,spatialReference:t}),center:new g({x:p,y:m,z:h,spatialReference:t})}}get anchor(){if(i(this.transform))return this.transform.getOriginPoint(this.spatialReference);const e=this._boundingInfo;return new g({x:e.center.x,y:e.center.y,z:e.extent.zmin,spatialReference:this.spatialReference})}get origin(){return i(this.transform)?this.transform.getOriginPoint(this.spatialReference):this._boundingInfo.center}get extent(){return!this.loaded&&i(this.external)&&i(this.external.extent)?this.external.extent.clone():this._boundingInfo.extent}addComponent(e){this.loaded?(this.components||(this.components=[]),this.components.push(w.from(e)),this.notifyChange("components")):n.getLogger(this.declaredClass).error("addComponent()","Mesh must be loaded before applying operations")}removeComponent(e){if(this.loaded){if(this.components){const t=this.components.indexOf(e);if(-1!==t)return this.components.splice(t,1),void this.notifyChange("components")}n.getLogger(this.declaredClass).error("removeComponent()","Provided component is not part of the list of components")}else n.getLogger(this.declaredClass).error("removeComponent()","Mesh must be loaded before applying operations")}rotate(e,t,r,o){return y(k.x,e,D),y(k.y,t,W),y(k.z,r,Z),b(D,W,D),b(D,Z,D),G(this,D,o),this}offset(e,t,r,o){return this.loaded?(H[0]=e,H[1]=t,H[2]=r,C(this,H,o),this):(n.getLogger(this.declaredClass).error("offset()","Mesh must be loaded before applying operations"),this)}scale(e,t){return this.loaded?(S(this,e,t),this):(n.getLogger(this.declaredClass).error("scale()","Mesh must be loaded before applying operations"),this)}centerAt(e,t){return this.loaded?(P(this,e,t),this):(n.getLogger(this.declaredClass).error("centerAt()","Mesh must be loaded before applying operations"),this)}load(e){return i(this.external)&&this.addResolvingPromise(R(this,this.external.source,e)),Promise.resolve(this)}clone(){let e=null;if(this.components){const t=new Map,r=new Map;e=this.components.map((e=>e.cloneWithDeduplication(t,r)))}const t={components:e,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),transform:i(this.transform)?this.transform.clone():null,external:i(this.external)?{source:this.external.source,extent:i(this.external.extent)?this.external.extent.clone():null}:null};return new _(t)}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const{toBinaryGLTF:t}=await import("./support/meshUtils/exporters/gltf/gltfexport.js");return t(this,e)}static createBox(e,t){if(!(e instanceof g))return n.getLogger(I).error(".createBox()","expected location to be a Point instance"),null;const r=new _(A(z(),e,t));return t&&t.imageFace&&"all"!==t.imageFace?F(r,t.imageFace):r}static createSphere(e,t){return e instanceof g?new _(A(O(t&&t.densificationFactor||0),e,t)):(n.getLogger(I).error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(e,t){return e instanceof g?new _(A(U(t&&t.densificationFactor||0),e,t)):(n.getLogger(I).error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(e,t){if(!(e instanceof g))return n.getLogger(I).error(".createPlane()","expected location to be a Point instance"),null;const r=t?.facing??"up",o=T(r,t?.size);return new _(A(E(r),e,{...t,size:o}))}static createFromPolygon(e,t){if(!(e instanceof x))return n.getLogger(I).error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const r=L(e);return new _({vertexAttributes:new M({position:r.position}),components:[new w({faces:r.faces,shading:"flat",material:t?.material??null})],spatialReference:e.spatialReference})}static async createFromGLTF(e,r,o){if(!(e instanceof g))throw n.getLogger(I).error(".createfromGLTF()","expected location to be a Point instance"),new t("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:s}=await l(import("./support/meshUtils/loadGLTFMesh.js"),o);return new _(await s(e,r,o))}static createWithExternalSource(e,t,r){const o=r?.extent??null,n=r?.transform?.clone()??new v;n.origin=[e.x,e.y,e.z??0];const s=e.spatialReference;return new _({external:{source:t,extent:o},transform:n,spatialReference:s})}static createIncomplete(e,r){const o=r?.transform?.clone()??new v;o.origin=[e.x,e.y,e.z??0];const n=e.spatialReference,s=new _({transform:o,spatialReference:n});return s.addResolvingPromise(Promise.reject(new t("mesh-incomplete","Mesh resources are not complete"))),s}};e([p({type:[w],json:{write:!0}})],B.prototype,"components",void 0),e([p({type:v,json:{write:!0}})],B.prototype,"transform",void 0),e([p({constructOnly:!0})],B.prototype,"external",void 0),e([p({readOnly:!0})],B.prototype,"hasExtent",null),e([p({readOnly:!0})],B.prototype,"_boundingInfo",null),e([p({readOnly:!0})],B.prototype,"anchor",null),e([p({readOnly:!0})],B.prototype,"origin",null),e([p({readOnly:!0,json:{read:!1}})],B.prototype,"extent",null),e([p({readOnly:!0,json:{read:!1,write:!0,default:!0}})],B.prototype,"hasZ",void 0),e([p({readOnly:!0,json:{read:!1,write:!0,default:!1}})],B.prototype,"hasM",void 0),e([p({type:M,nonNullable:!0,json:{write:!0}})],B.prototype,"vertexAttributes",void 0),B=_=e([m(I)],B);const k={x:h(1,0,0),y:h(0,1,0),z:h(0,0,1)},D=j(),W=j(),Z=j(),H=f(),N=B;export{N as default};
|
package/geometry/Multipoint.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import{clone as s}from"../core/lang.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{writer as r}from"../core/accessorSupport/decorators/writer.js";import
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{clone as s}from"../core/lang.js";import{property as e}from"../core/accessorSupport/decorators/property.js";import"../core/accessorSupport/ensureType.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import{writer as r}from"../core/accessorSupport/decorators/writer.js";import o from"./Extent.js";import n from"./Geometry.js";import a from"./Point.js";import{updateSupportFromPoint as p}from"./support/zmUtils.js";var h;function l(t){return(s,e)=>null==s?e:null==e?s:t(s,e)}function c(t){return t&&("esri.geometry.SpatialReference"===t.declaredClass||null!=t.wkid)}let m=h=class extends n{constructor(...t){super(...t),this.points=[],this.type="multipoint"}normalizeCtorArgs(t,s){if(!t&&!s)return{};const e={};Array.isArray(t)?(e.points=t,e.spatialReference=s):c(t)?e.spatialReference=t:(t.points&&(e.points=t.points),t.spatialReference&&(e.spatialReference=t.spatialReference),t.hasZ&&(e.hasZ=t.hasZ),t.hasM&&(e.hasM=t.hasM));const i=e.points&&e.points[0];return i&&(void 0===e.hasZ&&void 0===e.hasM?(e.hasZ=i.length>2,e.hasM=!1):void 0===e.hasZ?e.hasZ=i.length>3:void 0===e.hasM&&(e.hasM=i.length>3)),e}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const t=this.points;if(!t.length)return null;const s=new o,e=this.hasZ,i=this.hasM,r=e?3:2,n=t[0],a=l(Math.min),p=l(Math.max);let h,c,m,u,[f,y]=n,[d,g]=n;for(let o=0,l=t.length;o<l;o++){const s=t[o],[n,l]=s;if(f=a(f,n),y=a(y,l),d=p(d,n),g=p(g,l),e&&s.length>2){const t=s[2];h=a(h,t),m=p(m,t)}if(i&&s.length>r){const t=s[r];c=a(c,t),u=p(u,t)}}return s.xmin=f,s.ymin=y,s.xmax=d,s.ymax=g,s.spatialReference=this.spatialReference,e?(s.zmin=h,s.zmax=m):(s.zmin=void 0,s.zmax=void 0),i?(s.mmin=c,s.mmax=u):(s.mmin=void 0,s.mmax=void 0),s}writePoints(t,e){e.points=s(this.points)}addPoint(t){return p(this,t),Array.isArray(t)?this.points.push(t):this.points.push(t.toArray()),this.notifyChange("points"),this}clone(){const t={points:s(this.points),spatialReference:this.spatialReference};return this.hasZ&&(t.hasZ=!0),this.hasM&&(t.hasM=!0),new h(t)}getPoint(t){if(!this._validateInputs(t))return null;const s=this.points[t],e={x:s[0],y:s[1],spatialReference:this.spatialReference};let i=2;return this.hasZ&&(e.z=s[2],i=3),this.hasM&&(e.m=s[i]),new a(e)}removePoint(t){if(!this._validateInputs(t))return null;const s=new a(this.points.splice(t,1)[0],this.spatialReference);return this.notifyChange("points"),s}setPoint(t,s){return this._validateInputs(t)?(p(this,s),Array.isArray(s)||(s=s.toArray()),this.points[t]=s,this.notifyChange("points"),this):this}toJSON(t){return this.write({},t)}_validateInputs(t){return null!=t&&t>=0&&t<this.points.length}};t([e({readOnly:!0})],m.prototype,"cache",null),t([e()],m.prototype,"extent",null),t([e({type:[[Number]],json:{write:{isRequired:!0}}})],m.prototype,"points",void 0),t([r("points")],m.prototype,"writePoints",null),m=h=t([i("esri.geometry.Multipoint")],m),m.prototype.toJSON.isDefaultToJSON=!0;const u=m;export{u as default};
|
package/geometry/Point.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Logger.js";import{isNone as r}from"../core/maybe.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as i}from"../core/accessorSupport/decorators/cast.js";import{reader as o}from"../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../core/accessorSupport/decorators/writer.js";import{ensureNumber as n}from"../core/accessorSupport/ensureType.js";import c from"./Geometry.js";import
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Logger.js";import{isNone as r}from"../core/maybe.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/has.js";import{cast as i}from"../core/accessorSupport/decorators/cast.js";import{reader as o}from"../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../core/accessorSupport/decorators/writer.js";import{ensureNumber as n}from"../core/accessorSupport/ensureType.js";import c from"./Geometry.js";import u from"./SpatialReference.js";import{distance as p}from"./support/pointUtils.js";import{getInfo as h}from"./support/spatialReferenceUtils.js";import{lngLatToXY as d,xyToLngLat as y}from"./support/webMercatorUtils.js";var m;const f=[0,0];function g(e){return e&&("esri.geometry.SpatialReference"===e.declaredClass||null!=e.wkid)}let x=m=class extends c{constructor(...e){super(...e),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}static copy(e,t){t._set("x",e._get("x")),t._set("y",e._get("y")),t._set("z",e._get("z")),t._set("m",e._get("m"));const r=e._get("spatialReference");t._set("spatialReference",Object.isFrozen(r)?r:r.clone())}normalizeCtorArgs(e,r,s,i,o){let a;if(Array.isArray(e))a=e,o=r,e=a[0],r=a[1],s=a[2],i=a[3];else if(e&&"object"==typeof e){if(a=e,e=null!=a.x?a.x:a.longitude,r=null!=a.y?a.y:a.latitude,s=a.z,i=a.m,(o=a.spatialReference)&&"esri.geometry.SpatialReference"!==o.declaredClass&&(o=new u(o)),null!=a.longitude||null!=a.latitude)if(null==a.longitude)t.getLogger(this.declaredClass).warn(".longitude=","Latitude was defined without longitude");else if(null==a.latitude)t.getLogger(this.declaredClass).warn(".latitude=","Longitude was defined without latitude");else if(!a.declaredClass&&o&&o.isWebMercator){const t=d(a.longitude,a.latitude,f);e=t[0],r=t[1]}}else g(s)?(o=s,s=null):g(i)&&(o=i,i=null);const l={x:e,y:r};return null==l.x&&null!=l.y?t.getLogger(this.declaredClass).warn(".y=","Y coordinate was defined without an X coordinate"):null==l.y&&null!=l.x&&t.getLogger(this.declaredClass).warn(".x=","X coordinate was defined without a Y coordinate"),null!=o&&(l.spatialReference=o),null!=s&&(l.z=s),null!=i&&(l.m=i),l}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return void 0!==this.m}set hasM(e){e!==(void 0!==this._get("m"))&&(this._set("m",e?0:void 0),this._set("hasM",e))}get hasZ(){return void 0!==this.z}set hasZ(e){e!==(void 0!==this._get("z"))&&(this._set("z",e?0:void 0),this._set("hasZ",e))}get latitude(){const{spatialReference:e,x:t,y:r}=this;if(e){if(e.isWebMercator)return y(t,r,f)[1];if(e.isGeographic)return r}return null}set latitude(e){const{spatialReference:t,x:r}=this;null!=e&&t&&(t.isWebMercator?this._set("y",d(r,e,f)[1]):t.isGeographic&&this._set("y",e),this._set("latitude",e))}get longitude(){const{x:e,y:t,spatialReference:r}=this;if(r){if(r.isWebMercator)return y(e,t,f)[0];if(r.isGeographic)return e}return null}set longitude(e){const{y:t,spatialReference:r}=this;null!=e&&r&&(r.isWebMercator?this._set("x",d(e,t,f)[0]):r.isGeographic&&this._set("x",e),this._set("longitude",e))}writeX(e,t,r){t[r]=isNaN(e)?"NaN":e}readX(e){return"string"==typeof e?NaN:e}clone(){const e=new m;return e.x=this.x,e.y=this.y,e.z=this.z,e.m=this.m,e.spatialReference=this.spatialReference,e}copy(e){return m.copy(e,this),this}equals(e){if(r(e))return!1;const{x:t,y:s,z:i,m:o,spatialReference:a}=this,{z:l,m:n}=e;let{x:c,y:u,spatialReference:p}=e;if(!a.equals(p))if(a.isWebMercator&&p.isWGS84)[c,u]=d(c,u),p=a;else{if(!a.isWGS84||!p.isWebMercator)return!1;[c,u]=y(c,u),p=a}return t===c&&s===u&&i===l&&o===n&&a.wkid===p.wkid}offset(e,t,r){return this.x+=e,this.y+=t,null!=r&&(this.z=(this.z??0)+r),this}normalize(){if(!this.spatialReference)return this;const e=h(this.spatialReference);if(!e)return this;let t=this.x;const[r,s]=e.valid,i=2*s;let o;return t>s?(o=Math.ceil(Math.abs(t-s)/i),t-=o*i):t<r&&(o=Math.ceil(Math.abs(t-r)/i),t+=o*i),this._set("x",t),this}distance(e){return p(this,e)}toArray(){const e=this.hasZ,t=this.hasM;return e&&t?[this.x,this.y,this.z,this.m]:e?[this.x,this.y,this.z]:t?[this.x,this.y,this.m]:[this.x,this.y]}toJSON(e){return this.write({},e)}};e([s({readOnly:!0})],x.prototype,"cache",null),e([s({type:Boolean,json:{read:!1,write:{enabled:!1,overridePolicy:null}}})],x.prototype,"hasM",null),e([s({type:Boolean,json:{read:!1,write:{enabled:!1,overridePolicy:null}}})],x.prototype,"hasZ",null),e([s({type:Number})],x.prototype,"latitude",null),e([s({type:Number})],x.prototype,"longitude",null),e([s({type:Number,json:{type:[Number,String],write:{isRequired:!0,allowNull:!0}}}),i((e=>isNaN(e)?e:n(e)))],x.prototype,"x",void 0),e([l("x")],x.prototype,"writeX",null),e([o("x")],x.prototype,"readX",null),e([s({type:Number,json:{write:!0}})],x.prototype,"y",void 0),e([s({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],x.prototype,"z",void 0),e([s({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],x.prototype,"m",void 0),x=m=e([a("esri.geometry.Point")],x),x.prototype.toJSON.isDefaultToJSON=!0;const w=x;export{w as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{G as n}from"../chunks/geometryEngineBase.js";import{hydratedAdapter as e}from"./geometryAdapters/hydrated.js";function
|
|
5
|
+
import{G as n}from"../chunks/geometryEngineBase.js";import{hydratedAdapter as e}from"./geometryAdapters/hydrated.js";function t(n){return Array.isArray(n)?n[0].spatialReference:n&&n.spatialReference}function r(e){return n.extendedSpatialReferenceInfo(e)}function u(r,u){return n.clip(e,t(r),r,u)}function i(r,u){return n.cut(e,t(r),r,u)}function c(r,u){return n.contains(e,t(r),r,u)}function o(r,u){return n.crosses(e,t(r),r,u)}function f(r,u,i){return n.distance(e,t(r),r,u,i)}function s(r,u){return n.equals(e,t(r),r,u)}function a(r,u){return n.intersects(e,t(r),r,u)}function l(r,u){return n.touches(e,t(r),r,u)}function p(r,u){return n.within(e,t(r),r,u)}function d(r,u){return n.disjoint(e,t(r),r,u)}function m(r,u){return n.overlaps(e,t(r),r,u)}function g(r,u,i){return n.relate(e,t(r),r,u,i)}function h(r){return n.isSimple(e,t(r),r)}function w(r){return n.simplify(e,t(r),r)}function R(r,u=!1){return n.convexHull(e,t(r),r,u)}function x(r,u){return n.difference(e,t(r),r,u)}function y(r,u){return n.symmetricDifference(e,t(r),r,u)}function S(r,u){return n.intersect(e,t(r),r,u)}function A(r,u=null){return n.union(e,t(r),r,u)}function D(r,u,i,c,o,f){return n.offset(e,t(r),r,u,i,c,o,f)}function j(r,u,i,c=!1){return n.buffer(e,t(r),r,u,i,c)}function E(r,u,i,c,o,f){return n.geodesicBuffer(e,t(r),r,u,i,c,o,f)}function J(r,u,i=!0){return n.nearestCoordinate(e,t(r),r,u,i)}function L(r,u){return n.nearestVertex(e,t(r),r,u)}function N(r,u,i,c){return n.nearestVertices(e,t(r),r,u,i,c)}function O(n){return"xmin"in n?"center"in n?n.center:null:"x"in n?n:"extent"in n?n.extent?.center??null:null}function T(e,t,r){if(null==e)throw new F;const u=e.spatialReference;if(null==(r=r??O(e)))throw new F;const i=e.constructor.fromJSON(n.rotate(e,t,r));return i.spatialReference=u,i}function V(e,t){if(null==e)throw new F;const r=e.spatialReference;if(null==(t=t??O(e)))throw new F;const u=e.constructor.fromJSON(n.flipHorizontal(e,t));return u.spatialReference=r,u}function v(e,t){if(null==e)throw new F;const r=e.spatialReference;if(null==(t=t??O(e)))throw new F;const u=e.constructor.fromJSON(n.flipVertical(e,t));return u.spatialReference=r,u}function z(r,u,i,c){return n.generalize(e,t(r),r,u,i,c)}function B(r,u,i){return n.densify(e,t(r),r,u,i)}function H(r,u,i,c=0){return n.geodesicDensify(e,t(r),r,u,i,c)}function I(r,u){return n.planarArea(e,t(r),r,u)}function b(r,u){return n.planarLength(e,t(r),r,u)}function k(r,u,i){return n.geodesicArea(e,t(r),r,u,i)}function q(r,u,i){return n.geodesicLength(e,t(r),r,u,i)}function C(r,u){return n.intersectLinesToPoints(e,t(r),r,u)}function G(e,t){n.changeDefaultSpatialReferenceTolerance(e,t)}function P(e){n.clearDefaultSpatialReferenceTolerance(e)}class F extends Error{constructor(){super("Illegal Argument Exception")}}export{j as buffer,G as changeDefaultSpatialReferenceTolerance,P as clearDefaultSpatialReferenceTolerance,u as clip,c as contains,R as convexHull,o as crosses,i as cut,B as densify,x as difference,d as disjoint,f as distance,s as equals,r as extendedSpatialReferenceInfo,V as flipHorizontal,v as flipVertical,z as generalize,k as geodesicArea,E as geodesicBuffer,H as geodesicDensify,q as geodesicLength,S as intersect,C as intersectLinesToPoints,a as intersects,h as isSimple,J as nearestCoordinate,L as nearestVertex,N as nearestVertices,D as offset,m as overlaps,I as planarArea,b as planarLength,g as relate,T as rotate,w as simplify,y as symmetricDifference,l as touches,A as union,p as within};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../geometry.js";import{open as n}from"../core/workers/workers.js";import t from"./Point.js";import{fromJSON as
|
|
5
|
+
import"../geometry.js";import{open as n}from"../core/workers/workers.js";import t from"./Point.js";import{fromJSON as e}from"./support/jsonUtils.js";function r(n){return Array.isArray(n)?n[0]?.spatialReference:n?.spatialReference}function a(n){return n?Array.isArray(n)?n.map(a):n.toJSON?n.toJSON():n:n}function i(n){return Array.isArray(n)?n.map((n=>e(n))):e(n)}function o(n,t){let e;return Array.isArray(n)?e=n:(e=[],e.push(n),null!=t&&e.push(t)),e}let c;async function u(){return c||(c=n("geometryEngineWorker",{strategy:"distributed"})),c}async function s(n,t){return(await u()).invoke("executeGEOperation",{operation:n,parameters:a(t)})}async function f(n,t){const e=await u();return Promise.all(e.broadcast("executeGEOperation",{operation:n,parameters:a(t)}))}function l(n){return s("extendedSpatialReferenceInfo",[n])}async function y(n,t){return i(await s("clip",[r(n),n,t]))}async function w(n,t){return i(await s("cut",[r(n),n,t]))}function p(n,t){return s("contains",[r(n),n,t])}function m(n,t){return s("crosses",[r(n),n,t])}function d(n,t,e){return s("distance",[r(n),n,t,e])}function g(n,t){return s("equals",[r(n),n,t])}function h(n,t){return s("intersects",[r(n),n,t])}function S(n,t){return s("touches",[r(n),n,t])}function x(n,t){return s("within",[r(n),n,t])}function A(n,t){return s("disjoint",[r(n),n,t])}function O(n,t){return s("overlaps",[r(n),n,t])}function R(n,t,e){return s("relate",[r(n),n,t,e])}function J(n){return s("isSimple",[r(n),n])}async function N(n){return i(await s("simplify",[r(n),n]))}async function j(n,t=!1){return i(await s("convexHull",[r(n),n,t]))}async function E(n,t){return i(await s("difference",[r(n),n,t]))}async function k(n,t){return i(await s("symmetricDifference",[r(n),n,t]))}async function D(n,t){return i(await s("intersect",[r(n),n,t]))}async function b(n,t=null){const e=o(n,t);return i(await s("union",[r(e),e]))}async function v(n,t,e,a,o,c){return i(await s("offset",[r(n),n,t,e,a,o,c]))}async function L(n,t,e,a=!1){const o=[r(n),n,t,e,a];return i(await s("buffer",o))}async function P(n,t,e,a,o,c){const u=[r(n),n,t,e,a,o,c];return i(await s("geodesicBuffer",u))}async function T(n,e,a=!0){const i=await s("nearestCoordinate",[r(n),n,e,a]);return{...i,coordinate:t.fromJSON(i.coordinate)}}async function V(n,e){const a=await s("nearestVertex",[r(n),n,e]);return{...a,coordinate:t.fromJSON(a.coordinate)}}async function z(n,e,a,i){return(await s("nearestVertices",[r(n),n,e,a,i])).map((n=>({...n,coordinate:t.fromJSON(n.coordinate)})))}function G(n){return"xmin"in n?n.center:"x"in n?n:n.extent?.center}async function H(n,t,e){if(null==n)throw new Z;const r=n.spatialReference;if(null==(e=e??G(n)))throw new Z;const a=n.constructor.fromJSON(await s("rotate",[r,n,t,e]));return a.spatialReference=r,a}async function I(n,t){if(null==n)throw new Z;const e=n.spatialReference;if(null==(t=t??G(n)))throw new Z;const r=n.constructor.fromJSON(await s("flipHorizontal",[e,n,t]));return r.spatialReference=e,r}async function q(n,t){if(null==n)throw new Z;const e=n.spatialReference;if(null==(t=t??G(n)))throw new Z;const r=n.constructor.fromJSON(await s("flipVertical",[e,n,t]));return r.spatialReference=e,r}async function B(n,t,e,a){return i(await s("generalize",[r(n),n,t,e,a]))}async function C(n,t,e){return i(await s("densify",[r(n),n,t,e]))}async function U(n,t,e,a=0){return i(await s("geodesicDensify",[r(n),n,t,e,a]))}function W(n,t){return s("planarArea",[r(n),n,t])}function F(n,t){return s("planarLength",[r(n),n,t])}function K(n,t,e){return s("geodesicArea",[r(n),n,t,e])}function M(n,t,e){return s("geodesicLength",[r(n),n,t,e])}async function Q(n,t){return i(await s("intersectLinesToPoints",[r(n),n,t]))}async function X(n,t){await f("changeDefaultSpatialReferenceTolerance",[n,t])}async function Y(n){await f("clearDefaultSpatialReferenceTolerance",[n])}class Z extends Error{constructor(){super("Illegal Argument Exception")}}export{L as buffer,X as changeDefaultSpatialReferenceTolerance,Y as clearDefaultSpatialReferenceTolerance,y as clip,p as contains,j as convexHull,m as crosses,w as cut,C as densify,E as difference,A as disjoint,d as distance,g as equals,l as extendedSpatialReferenceInfo,I as flipHorizontal,q as flipVertical,B as generalize,K as geodesicArea,P as geodesicBuffer,U as geodesicDensify,M as geodesicLength,D as intersect,Q as intersectLinesToPoints,h as intersects,J as isSimple,T as nearestCoordinate,V as nearestVertex,z as nearestVertices,v as offset,O as overlaps,W as planarArea,F as planarLength,R as relate,H as rotate,N as simplify,k as symmetricDifference,S as touches,b as union,x as within};
|
package/geometry/projection.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import n from"../core/Error.js";import{clamp as e,deg2rad as t,rad2deg as r,asinClamped as l}from"../core/mathUtils.js";import{isNone as u,unwrap as o,isSome as s}from"../core/maybe.js";import{throwIfAborted as i,waitTick as a}from"../core/promiseUtils.js";import{getMetersPerUnitForSR as c}from"../core/unitUtils.js";import{trackAccess as E}from"../core/accessorSupport/tracking.js";import{SimpleObservable as C}from"../core/accessorSupport/tracking/SimpleObservable.js";import{f as R,i as A,t as f}from"../chunks/mat4.js";import{c as _,a as S,b as P,n as L,l as M,s as O}from"../chunks/vec3.js";import{c as p}from"../chunks/vec3f64.js";import N from"./Extent.js";import G from"./Multipoint.js";import{l as h,p as W,i as m}from"../chunks/pe.js";import T from"./Point.js";import F from"./Polygon.js";import I from"./Polyline.js";import{SphericalECEFSpatialReference as d,WGS84ECEFSpatialReference as H,SphericalPCPFMars as g,SphericalPCPFMoon as B}from"./projectionEllipsoid.js";import{copy as j}from"./support/aaBoundingRect.js";import{earth as y,moon as w,mars as U}from"./support/Ellipsoid.js";import{earthEllipsoidConstants as x}from"./support/geodesicConstants.js";import K from"./support/GeographicTransformation.js";import{equals as b,isValid as k,isWGS84 as z,isWebMercator as v,isPlateCarree as q,isMars as Z,isMoon as V}from"./support/spatialReferenceUtils.js";import{SupportedGCSWkids as X}from"./support/SupportedGCSWkids.js";import{getGeometryZScaler as D}from"./support/zscale.js";let J=null,Q=null,Y=null,$={};const nn=new C;function en(){return!!J&&m()}function tn(n){return u(Y)&&(Y=Promise.all([h(),import("../chunks/geometryEngineBase.js").then((n=>n.g)),import("./geometryAdapters/hydrated.js")])),Y.then((([,e,{hydratedAdapter:t}])=>{i(n),Q=t,J=e.default,J._enableProjection(W),nn.notify()}))}function rn(n,e,t=null,r=null){return Array.isArray(n)?0===n.length?[]:ln(Q,n,n[0].spatialReference,e,t,r):ln(Q,[n],n.spatialReference,e,t,r)[0]}function ln(n,e,t,r,l=null,i=null){if(u(t)||u(r))return e;if(An(t,r,l))return e.map((n=>o(Sn(n,t,r))));if(u(l)){const n=K.cacheKey(t,r);void 0!==$[n]?l=$[n]:(l=on(t,r,null),u(l)&&(l=new K),$[n]=l)}if(u(J))throw new an;return s(i)?J._project(n,e,t,r,l,i):J._project(n,e,t,r,l)}function un(n,e){return u(n)?{pending:null,geometry:null}:b(n.spatialReference,e)?{pending:null,geometry:n}:k(n.spatialReference)&&k(e)?An(n.spatialReference,e)||en()?{pending:null,geometry:Rn(n,e)}:(E(nn),{pending:tn(),geometry:null}):{pending:null,geometry:null}}function on(n,e,t=null){if(u(J))throw new an;if(u(n)||u(e))return null;const r=J._getTransformation(Q,n,e,t,t?.spatialReference);return null!==r?K.fromGE(r):null}function sn(n,e,t=null){if(u(J))throw new an;const r=J._getTransformationBySuitability(Q,n,e,t,t?.spatialReference);if(null!==r){const n=[];for(const e of r)n.push(K.fromGE(e));return n}return[]}class an extends n{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}var cn;function En(){J=null,Q=null,Y=null,$={}}!function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",n[n.WGS84=2]="WGS84",n[n.WEB_MERCATOR=3]="WEB_MERCATOR",n[n.WGS84_ECEF=4]="WGS84_ECEF",n[n.CGCS2000=5]="CGCS2000",n[n.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",n[n.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",n[n.GCSMARS2000=8]="GCSMARS2000",n[n.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",n[n.GCSMOON2000=10]="GCSMOON2000",n[n.LON_LAT=11]="LON_LAT",n[n.PLATE_CARREE=12]="PLATE_CARREE"}(cn||(cn={}));const Cn={get loadPromise(){return Y}};function Rn(n,e){try{const t=rn(n,e);if(null==t)return null;"xmin"in n&&"xmin"in t&&(t.zmin=n.zmin,t.zmax=n.zmax);const r=D(t.type,n.spatialReference,e);return s(r)&&r(t),t}catch(t){if(!(t instanceof an))throw t;return null}}function An(n,e,t){return!t&&(!!b(n,e)||k(n)&&k(e)&&!!Ie(n,e,je))}async function fn(n,e,t,r){if(en())return a(r);if(Array.isArray(n)){for(const{source:l,dest:u,geographicTransformation:o}of n)if(!An(l,u,o))return tn(r)}else if(!An(n,e,t))return tn(r);return a(r)}function _n(n,e){switch(Ie(n,e,je)){case Jn:return"copy3";case Se:return"wgs84ToSphericalECEF";case ee:return"wgs84ToWebMercator";case le:return"wgs84ToPlateCarree";case he:return"wgs84ToWGS84ECEF";case Qn:return"webMercatorToWGS84";case Yn:return"webMercatorToSphericalECEF";case $n:return"webMercatorToWGS84ECEF";case oe:return"webMercatorToPlateCarree";case We:return"wgs84ECEFToWGS84";case me:return"wgs84ECEFToSphericalECEF";case Te:return"wgs84ECEFToWebMercator";case Oe:return"sphericalECEFToWGS84";case pe:return"sphericalECEFToWebMercator";case Me:return"sphericalMarsPCPFToMars2000";case Le:return"sphericalMoonPCPFToMoon2000";case Ne:return"sphericalECEFToWGS84ECEF";case _e:return"mars2000ToSphericalPCPF";case fe:return"moon2000ToSphericalPCPF";default:return null}}function Sn(n,e,t){return n?"x"in n?Ln(n,e,new T,t,0):"xmin"in n?Fn(n,e,new N,t,0):"rings"in n?mn(n,e,new F,t,0):"paths"in n?Nn(n,e,new I,t,0):"points"in n?On(n,e,new G,t,0):null:null}function Pn(n,e,t=e.spatialReference,r=0){return!u(t)&&s(Ln(n,n.spatialReference,e,t,r))}function Ln(n,e,t,r,l){ke[0]=n.x,ke[1]=n.y;const u=n.z;return ke[2]=void 0!==u?u:l,Un(ke,e,0,ke,r,0,1)?(t.x=ke[0],t.y=ke[1],t.spatialReference=r,void 0===u?(t.z=void 0,t.hasZ=!1):(t.z=ke[2],t.hasZ=!0),void 0===n.m?(t.m=void 0,t.hasM=!1):(t.m=n.m,t.hasM=!0),t):null}function Mn(n,e,t=e.spatialReference,r=0){return!u(t)&&s(On(n,n.spatialReference,e,t,r))}function On(n,e,t,r,l){const{points:u,hasZ:o,hasM:s}=n,i=[],a=u.length,c=[];for(const E of u)c.push(E[0],E[1],o?E[2]:l);if(!Un(c,e,0,c,r,0,a))return null;for(let E=0;E<a;++E){const n=3*E,e=c[n],t=c[n+1];o&&s?i.push([e,t,c[n+2],u[E][3]]):o?i.push([e,t,c[n+2]]):s?i.push([e,t,u[E][2]]):i.push([e,t])}return t.points=i,t.spatialReference=r,t.hasZ=o,t.hasM=s,t}function pn(n,e,t=e.spatialReference,r=0){return s(t)&&s(Nn(n,n.spatialReference,e,t,r))}function Nn(n,e,t,r,l){const{paths:u,hasZ:o,hasM:s}=n,i=[];return Kn(u,o,s,e,i,r,l)?(t.paths=i,t.spatialReference=r,t.hasZ=o,t.hasM=s,t):null}function Gn({hasZ:n,spatialReference:e,paths:t},r,l=0){const o=Dn(e,ge),s=Fe[o][cn.WGS84_COMPARABLE_LON_LAT];if(u(s))return!1;const i=n?n=>n:n=>O(ke,n[0],n[1],l);for(const u of t){const n=[];for(const e of u){const t=[0,0,l];s(i(e),0,t,0),n.push(t)}r.push(n)}return!0}function hn({hasZ:n,spatialReference:e,rings:t},r,l=0){const o=Dn(e,ge),s=Fe[o][cn.WGS84_COMPARABLE_LON_LAT];if(u(s))return!1;const i=n?n=>n:n=>O(ke,n[0],n[1],l);for(const u of t){const n=[];for(const e of u){const t=[0,0,l];s(i(e),0,t,0),n.push(t)}r.push(n)}return!0}function Wn(n,e,t=e.spatialReference,r=0){return s(t)&&s(mn(n,n.spatialReference,e,t,r))}function mn(n,e,t,r,l){const{rings:u,hasZ:o,hasM:s}=n,i=[];return Kn(u,o,s,e,i,r,l)?(t.rings=i,t.spatialReference=r,t.hasZ=o,t.hasM=s,t):null}function Tn(n,e,t=e.spatialReference,r=0){return s(t)&&s(Fn(n,n.spatialReference,e,t,r))}function Fn(n,e,t,r,l){const{xmin:u,ymin:o,xmax:s,ymax:i,hasZ:a,hasM:c}=n;if(!gn(u,o,a?n.zmin:l,e,ke,r))return null;t.xmin=ke[0],t.ymin=ke[1],a&&(t.zmin=ke[2]);return gn(s,i,a?n.zmax:l,e,ke,r)?(t.xmax=ke[0],t.ymax=ke[1],a&&(t.zmax=ke[2]),c&&(t.mmin=n.mmin,t.mmax=n.mmax),t.spatialReference=r,t):null}function In(n,e,t){if(u(e)||u(t))return null;const r=new T({spatialReference:t});return Un(n,e,0,ke,t,0,1)?(r.x=ke[0],r.y=ke[1],r.z=ke[2],r):null}function dn(n,e,t){return Un(n,e,0,ke,t.spatialReference,0,1)?(t.x=ke[0],t.y=ke[1],t.z=ke[2],t):null}function Hn(n,e,t,r=0){ke[0]=n.x,ke[1]=n.y;const l=n.z;return ke[2]=void 0!==l?l:r,Un(ke,n.spatialReference,0,e,t,0,1)}function gn(n,e,t,r,l,u){return xe[0]=n,xe[1]=e,xe[2]=t,Un(xe,r,0,l,u,0,1)}function Bn(n,e,t,r){return!(u(e)||u(r)||n.length<2)&&(2===n.length&&(xe[0]=n[0],xe[1]=n[1],xe[2]=0,n=xe),Un(n,e,0,t,r,0,1))}function jn(n,e){ke[0]=n.x,ke[1]=n.y;const t=n.z;return ke[2]=void 0!==t?t:0,yn(ke,n.spatialReference,e)}function yn(n,e,t){return wn(n,e,t)}function wn(n,e,t){if(u(e))return!1;const r=Dn(e,ge),l=Fe[r][cn.WGS84_COMPARABLE_LON_LAT];return!u(l)&&(l(n,0,xe,0),t!==xe&&(t[0]=xe[0],t[1]=xe[1],t.length>2&&(t[2]=xe[2])),!0)}function Un(n,e,t,r,l,o,s=1){const i=Ie(e,l,je);if(u(i))return!1;if(i===Jn){if(n===r&&t===o)return!0;const e=t+3*s;for(let l=t,u=o;l<e;l++,u++)r[u]=n[l];return!0}const a=t+3*s;for(let u=t,c=o;u<a;u+=3,c+=3)i(n,u,r,c);return!0}function xn(n,e,t,r,l){_(ke,n),S(ze,n,e),Bn(ke,t,ke,l),Bn(ze,t,ze,l),P(r,ze,ke),L(r,r)}function Kn(n,e,t,r,l,u,o=0){const s=new Array;for(const a of n)for(const n of a)s.push(n[0],n[1],e?n[2]:o);if(!Un(s,r,0,s,u,0,s.length/3))return!1;let i=0;l.length=0;for(const a of n){const n=new Array;for(const r of a)e&&t?n.push([s[i++],s[i++],s[i++],r[3]]):e?n.push([s[i++],s[i++],s[i++]]):t?(n.push([s[i++],s[i++],r[2]]),i++):(n.push([s[i++],s[i++]]),i++);l.push(n)}return!0}function bn(n,e,t,r){if(u(e)||u(r))return!1;const l=de(e,r,ye);if(l.projector===Jn)return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],!0;if(u(l.projector))return!1;const{source:o,dest:i}=l;if(i.spatialReferenceId===cn.WEB_MERCATOR){const e=Fe[o.spatialReferenceId][cn.WGS84];return!u(e)&&(e(n,0,Ke,0),ee(Ke,0,t,0),t[3]=kn(Ke[1],n[2],n[3],y.radius),!0)}if(o.spatialReferenceId!==cn.WGS84&&o.spatialReferenceId!==cn.CGCS2000||i.spatialReferenceId!==cn.PLATE_CARREE)l.projector(n,0,t,0),t[3]=n[3]*o.metersPerUnit/i.metersPerUnit;else{const e=Fe[o.spatialReferenceId][cn.SPHERICAL_ECEF],r=Fe[cn.SPHERICAL_ECEF][cn.PLATE_CARREE];let u=n[3];s(e)&&s(r)&&(u=kn(n[1],n[2],n[3],y.radius)),l.projector(n,0,t,0),t[3]=u}return!0}function kn(n,e,t,r){const l=r+e;if(l<r/2||t>l)return Number.MAX_VALUE;const u=Math.abs(we*n)+Math.asin(t/l);return u>=Math.PI/2?Number.MAX_VALUE:t/Math.cos(u)}function zn(n,e,t,r){return null!=n&&(b(e,r)?(j(t,n),!0):(xe[0]=n[0],xe[1]=n[1],xe[2]=0,!!Un(xe,e,0,xe,r,0,1)&&(t[0]=xe[0],t[1]=xe[1],xe[0]=n[2],xe[1]=n[3],xe[2]=0,!!Un(xe,e,0,xe,r,0,1)&&(t[2]=xe[0],t[3]=xe[1],!0))))}function vn(n,e,t,r){if(u(e)||u(r))return!1;const l=Dn(e,ge),o=Dn(r,Be);if(l===o&&l!==cn.UNKNOWN||b(e,r))return t[0]=1,t[1]=1,t[2]=1,!0;if(l===cn.SPHERICAL_ECEF){const e=M(n),r=e/Math.sqrt(n[0]*n[0]+n[1]*n[1]),l=e/y.radius;if(o===cn.WEB_MERCATOR)return t[0]=r*l,t[1]=r*l,t[2]=1,!0;if(o===cn.WGS84||o===cn.CGCS2000){const n=re;return t[0]=n*r*l,t[1]=n*l,t[2]=1,!0}}else if(l===cn.PLATE_CARREE){if(o===cn.WGS84||o===cn.CGCS2000)return t[0]=re,t[1]=re,t[2]=1,!0;if(o===cn.WEB_MERCATOR){const e=n[1]/y.radius;return t[0]=1,t[1]=1/Math.cos(e),t[2]=1,!0}}return!1}function qn(n,e,t,r){if(u(n)||u(r))return!1;const l=Dn(n,ge),o=Dn(r,Be);if(l===o&&!Zn(o)&&(l!==cn.UNKNOWN||b(n,r)))return R(t,e),!0;if(Zn(o)){const n=Fe[l][cn.LON_LAT],r=Fe[cn.LON_LAT][o];return!u(n)&&!u(r)&&(n(e,0,Ke,0),r(Ke,0,be,0),Vn(we*Ke[0],we*Ke[1],t),t[12]=be[0],t[13]=be[1],t[14]=be[2],!0)}if((o===cn.WEB_MERCATOR||o===cn.PLATE_CARREE)&&(l===cn.WGS84||l===cn.CGCS2000&&o===cn.PLATE_CARREE||l===cn.SPHERICAL_ECEF||l===cn.WEB_MERCATOR)){const n=Fe[l][cn.LON_LAT],r=Fe[cn.LON_LAT][o];return!u(n)&&!u(r)&&(n(e,0,Ke,0),r(Ke,0,be,0),l===cn.SPHERICAL_ECEF?Xn(we*Ke[0],we*Ke[1],t):A(t),t[12]=be[0],t[13]=be[1],t[14]=be[2],!0)}return!1}function Zn(n){return n===cn.SPHERICAL_ECEF||n===cn.SPHERICAL_MARS_PCPF||n===cn.SPHERICAL_MOON_PCPF}function Vn(n,e,t){const r=Math.sin(n),l=Math.cos(n),u=Math.sin(e),o=Math.cos(e),s=t;return s[0]=-r,s[4]=-u*l,s[8]=o*l,s[12]=0,s[1]=l,s[5]=-u*r,s[9]=o*r,s[13]=0,s[2]=0,s[6]=o,s[10]=u,s[14]=0,s[3]=0,s[7]=0,s[11]=0,s[15]=1,s}function Xn(n,e,t){return Vn(n,e,t),f(t,t),t}function Dn(n,e){return e.spatialReference===n?e.spatialReferenceId:(e.spatialReference=n,"metersPerUnit"in e&&(e.metersPerUnit=c(n,1)),n.wkt===d.wkt?e.spatialReferenceId=cn.SPHERICAL_ECEF:z(n)?e.spatialReferenceId=cn.WGS84:v(n)?e.spatialReferenceId=cn.WEB_MERCATOR:q(n)?e.spatialReferenceId=cn.PLATE_CARREE:n.wkt===H.wkt?e.spatialReferenceId=cn.WGS84_ECEF:n.wkid===X.CGCS2000?e.spatialReferenceId=cn.CGCS2000:n.wkt===g.wkt?e.spatialReferenceId=cn.SPHERICAL_MARS_PCPF:n.wkt===B.wkt?e.spatialReferenceId=cn.SPHERICAL_MOON_PCPF:Z(n)?e.spatialReferenceId=cn.GCSMARS2000:V(n)?e.spatialReferenceId=cn.GCSMOON2000:e.spatialReferenceId=cn.UNKNOWN)}function Jn(n,e,t,r){n!==t&&(t[r++]=n[e++],t[r++]=n[e++],t[r]=n[e])}function Qn(n,e,t,r){t[r++]=Ue*(n[e++]/y.radius),t[r++]=Ue*(Math.PI/2-2*Math.atan(Math.exp(-n[e++]/y.radius))),t[r]=n[e]}function Yn(n,e,t,r){Qn(n,e,t,r),Se(t,r,t,r)}function $n(n,e,t,r){Qn(n,e,t,r),he(t,r,t,r)}function ne(n,t,r,l,u){const o=.4999999*Math.PI,s=e(we*n[t+1],-o,o),i=Math.sin(s);r[l++]=we*n[t]*u.radius,r[l++]=u.halfSemiMajorAxis*Math.log((1+i)/(1-i)),r[l]=n[t+2]}function ee(n,e,t,r){ne(n,e,t,r,y)}const te=y.radius*Math.PI/180,re=180/(y.radius*Math.PI);function le(n,e,t,r){t[r]=n[e]*te,t[r+1]=n[e+1]*te,t[r+2]=n[e+2]}function ue(n,e,t,r){t[r]=n[e]*re,t[r+1]=n[e+1]*re,t[r+2]=n[e+2]}function oe(n,e,t,r){Qn(n,e,t,r),le(t,r,t,r)}function se(n,e,t,r){We(n,e,t,r),le(t,r,t,r)}function ie(n,e,t,r){Oe(n,e,t,r),le(t,r,t,r)}function ae(n,e,t,r){ue(n,e,t,r),Se(t,r,t,r)}function ce(n,e,t,r){ue(n,e,t,r),ee(t,r,t,r)}function Ee(n,e,t,r){ue(n,e,t,r),he(t,r,t,r)}function Ce(n){if(u(n))return!1;const e=Dn(n,ge);return!!Fe[e][cn.WGS84_COMPARABLE_LON_LAT]}function Re(n,e,t,r){const l=Math.cos(t);n[0]=Math.cos(e)*l*r,n[1]=Math.sin(e)*l*r,n[2]=Math.sin(t)*r}function Ae(n,e,t,r,l){const u=l+n[e+2],o=we*n[e+1],s=we*n[e],i=Math.cos(o);t[r++]=Math.cos(s)*i*u,t[r++]=Math.sin(s)*i*u,t[r]=Math.sin(o)*u}function fe(n,e,t,r){Ae(n,e,t,r,w.radius)}function _e(n,e,t,r){Ae(n,e,t,r,U.radius)}function Se(n,e,t,r){Ae(n,e,t,r,y.radius)}function Pe(n,e,t,r,u){const o=n[e],s=n[e+1],i=n[e+2],a=Math.sqrt(o*o+s*s+i*i),c=l(i/(0===a?1:a)),E=Math.atan2(s,o);t[r++]=Ue*E,t[r++]=Ue*c,t[r]=a-u}function Le(n,e,t,r){Pe(n,e,t,r,w.radius)}function Me(n,e,t,r){Pe(n,e,t,r,U.radius)}function Oe(n,e,t,r){Pe(n,e,t,r,y.radius)}function pe(n,e,t,r){Oe(n,e,t,r),ee(t,r,t,r)}function Ne(n,e,t,r){Oe(n,e,t,r),he(t,r,t,r)}function Ge(n,e,t,r,l){const u=we*n[e],o=we*n[e+1],s=n[e+2],i=Math.sin(o),a=Math.cos(o),c=l.radius/Math.sqrt(1-l.eccentricitySquared*i*i);t[r++]=(c+s)*a*Math.cos(u),t[r++]=(c+s)*a*Math.sin(u),t[r++]=(c*(1-l.eccentricitySquared)+s)*i}function he(n,e,t,r){Ge(n,e,t,r,y)}function We(n,e,t,r){const l=x,u=n[e],o=n[e+1],s=n[e+2];let i,a,c,E,C,R,A,f,_,S,P,L,M,O,p,N,G,h,W,m,T;i=Math.abs(s),a=u*u+o*o,c=Math.sqrt(a),E=a+s*s,C=Math.sqrt(E),m=Math.atan2(o,u),R=s*s/E,A=a/E,O=l.a2/C,p=l.a3-l.a4/C,A>.3?(f=i/C*(1+A*(l.a1+O+R*p)/C),W=Math.asin(f),S=f*f,_=Math.sqrt(1-S)):(_=c/C*(1-R*(l.a5-O-A*p)/C),W=Math.acos(_),S=1-_*_,f=Math.sqrt(S)),P=1-y.eccentricitySquared*S,L=y.radius/Math.sqrt(P),M=l.a6*L,O=c-L*_,p=i-M*f,G=_*O+f*p,N=_*p-f*O,h=N/(M/P+G),W+=h,T=G+N*h/2,s<0&&(W=-W),t[r++]=Ue*m,t[r++]=Ue*W,t[r]=T}function me(n,e,t,r){We(n,e,t,r),Se(t,r,t,r)}function Te(n,e,t,r){We(n,e,t,r),ee(t,r,t,r)}const Fe={[cn.WGS84]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:Jn,[cn.SPHERICAL_ECEF]:Se,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:ee,[cn.PLATE_CARREE]:le,[cn.WGS84]:Jn,[cn.WGS84_ECEF]:he},[cn.CGCS2000]:{[cn.CGCS2000]:Jn,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:Jn,[cn.SPHERICAL_ECEF]:Se,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:le,[cn.WGS84]:null,[cn.WGS84_ECEF]:he},[cn.GCSMARS2000]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:Jn,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:null,[cn.SPHERICAL_ECEF]:null,[cn.SPHERICAL_MARS_PCPF]:_e,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:null,[cn.WGS84]:null,[cn.WGS84_ECEF]:null},[cn.GCSMOON2000]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:Jn,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:null,[cn.SPHERICAL_ECEF]:null,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:fe,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:null,[cn.WGS84]:null,[cn.WGS84_ECEF]:null},[cn.WEB_MERCATOR]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Qn,[cn.WGS84_COMPARABLE_LON_LAT]:Qn,[cn.SPHERICAL_ECEF]:Yn,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:Jn,[cn.PLATE_CARREE]:oe,[cn.WGS84]:Qn,[cn.WGS84_ECEF]:$n},[cn.WGS84_ECEF]:{[cn.CGCS2000]:We,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:We,[cn.WGS84_COMPARABLE_LON_LAT]:We,[cn.SPHERICAL_ECEF]:me,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:Te,[cn.PLATE_CARREE]:se,[cn.WGS84]:We,[cn.WGS84_ECEF]:Jn},[cn.SPHERICAL_ECEF]:{[cn.CGCS2000]:Oe,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Oe,[cn.WGS84_COMPARABLE_LON_LAT]:Oe,[cn.SPHERICAL_ECEF]:Jn,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:pe,[cn.PLATE_CARREE]:ie,[cn.WGS84]:Oe,[cn.WGS84_ECEF]:Ne},[cn.SPHERICAL_MARS_PCPF]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:Me,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Me,[cn.WGS84_COMPARABLE_LON_LAT]:null,[cn.SPHERICAL_ECEF]:null,[cn.SPHERICAL_MARS_PCPF]:Jn,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:null,[cn.WGS84]:null,[cn.WGS84_ECEF]:null},[cn.SPHERICAL_MOON_PCPF]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:Le,[cn.LON_LAT]:Le,[cn.WGS84_COMPARABLE_LON_LAT]:null,[cn.SPHERICAL_ECEF]:null,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:Jn,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:null,[cn.WGS84]:null,[cn.WGS84_ECEF]:null},[cn.UNKNOWN]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:null,[cn.WGS84_COMPARABLE_LON_LAT]:null,[cn.SPHERICAL_ECEF]:null,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:Jn,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:null,[cn.WGS84]:null,[cn.WGS84_ECEF]:null},[cn.LON_LAT]:{[cn.CGCS2000]:Jn,[cn.GCSMARS2000]:Jn,[cn.GCSMOON2000]:Jn,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:Jn,[cn.SPHERICAL_ECEF]:Se,[cn.SPHERICAL_MARS_PCPF]:_e,[cn.SPHERICAL_MOON_PCPF]:fe,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:ee,[cn.PLATE_CARREE]:le,[cn.WGS84]:Jn,[cn.WGS84_ECEF]:he},[cn.WGS84_COMPARABLE_LON_LAT]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:Jn,[cn.SPHERICAL_ECEF]:Se,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:le,[cn.WGS84]:Jn,[cn.WGS84_ECEF]:he},[cn.PLATE_CARREE]:{[cn.CGCS2000]:ue,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:ue,[cn.WGS84_COMPARABLE_LON_LAT]:ue,[cn.SPHERICAL_ECEF]:ae,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:ce,[cn.PLATE_CARREE]:Jn,[cn.WGS84]:ue,[cn.WGS84_ECEF]:Ee}};function Ie(n,e,t=He()){return u(n)||u(e)?null:de(n,e,t).projector}function de(n,e,t){if(u(n)||u(e)||t.source.spatialReference===n&&t.dest.spatialReference===e)return t;const r=Dn(n,t.source),l=Dn(e,t.dest);return r===cn.UNKNOWN&&l===cn.UNKNOWN?b(n,e)?t.projector=Jn:t.projector=null:t.projector=Fe[r][l],t}function He(){return{source:{spatialReference:null,spatialReferenceId:cn.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:cn.UNKNOWN,metersPerUnit:1},projector:Jn}}const ge={spatialReference:null,spatialReferenceId:cn.UNKNOWN},Be={spatialReference:null,spatialReferenceId:cn.UNKNOWN},je=He(),ye=He(),we=t(1),Ue=r(1),xe=p(),Ke=p(),be=p(),ke=p(),ze=p();export{Ce as canProjectToWGS84ComparableLonLat,An as canProjectWithoutEngine,Vn as computeENUToSphericalPCPFLocalRotation,Xn as computeSphericalPCPFToENULocalRotation,qn as computeTranslationToOriginAndRotation,_n as getProjectorName,on as getTransformation,sn as getTransformations,fn as initializeProjection,en as isLoaded,tn as load,vn as localLinearScaleFactors,Re as lonLatToSphericalPCPF,ne as lonLatToWebMercatorComparable,rn as project,zn as projectBoundingRect,bn as projectBoundingSphere,Un as projectBuffer,xn as projectDirection,Tn as projectExtent,ln as projectMany,Mn as projectMultipoint,un as projectOrLoad,Pn as projectPoint,Hn as projectPointToVector,jn as projectPointToWGS84ComparableLonLat,Wn as projectPolygon,hn as projectPolygonToWGS84ComparableLonLat,pn as projectPolyline,Gn as projectPolylineToWGS84ComparableLonLat,dn as projectVectorToDehydratedPoint,In as projectVectorToPoint,Bn as projectVectorToVector,yn as projectVectorToWGS84ComparableLonLat,Sn as projectWithoutEngine,gn as projectXYZToVector,Pe as sphericalPCPFtoLonLatElevation,Cn as test,Rn as tryProjectWithZConversion,En as unload};
|
|
5
|
+
import n from"../core/Error.js";import{clamp as e,deg2rad as t,rad2deg as r,asinClamped as l}from"../core/mathUtils.js";import{isNone as u,unwrap as o,isSome as s}from"../core/maybe.js";import{throwIfAborted as a,waitTick as i}from"../core/promiseUtils.js";import{getMetersPerUnitForSR as c}from"../core/unitUtils.js";import{trackAccess as E}from"../core/accessorSupport/tracking.js";import{SimpleObservable as C}from"../core/accessorSupport/tracking/SimpleObservable.js";import{f as R,i as A,t as f}from"../chunks/mat4.js";import{c as _,a as S,b as P,n as L,l as p,s as O}from"../chunks/vec3.js";import{c as M}from"../chunks/vec3f64.js";import N from"./Extent.js";import G from"./Multipoint.js";import{l as h,p as W,i as m}from"../chunks/pe.js";import T from"./Point.js";import F from"./Polygon.js";import I from"./Polyline.js";import{SphericalECEFSpatialReference as d,WGS84ECEFSpatialReference as H,SphericalPCPFMars as g,SphericalPCPFMoon as B}from"./projectionEllipsoid.js";import{copy as j}from"./support/aaBoundingRect.js";import{earth as y,moon as w,mars as U}from"./support/Ellipsoid.js";import{earthEllipsoidConstants as x}from"./support/geodesicConstants.js";import K from"./support/GeographicTransformation.js";import{equals as b,isValid as k,isWGS84 as z,isWebMercator as v,isPlateCarree as q,isMars as Z,isMoon as V}from"./support/spatialReferenceUtils.js";import{SupportedGCSWkids as X}from"./support/SupportedGCSWkids.js";import{getGeometryZScaler as D}from"./support/zscale.js";let J=null,Q=null,Y=null,$={};const nn=new C;function en(){return!!J&&m()}function tn(n){return u(Y)&&(Y=Promise.all([h(),import("../chunks/geometryEngineBase.js").then((n=>n.g)),import("./geometryAdapters/hydrated.js")])),Y.then((([,e,{hydratedAdapter:t}])=>{a(n),Q=t,J=e.default,J._enableProjection(W),nn.notify()}))}function rn(n,e,t=null,r=null){return Array.isArray(n)?0===n.length?[]:ln(Q,n,n[0].spatialReference,e,t,r):ln(Q,[n],n.spatialReference,e,t,r)[0]}function ln(n,e,t,r,l=null,a=null){if(u(t)||u(r))return e;if(An(t,r,l))return e.map((n=>o(Sn(n,t,r))));if(u(l)){const n=K.cacheKey(t,r);void 0!==$[n]?l=$[n]:(l=on(t,r,void 0),u(l)&&(l=new K),$[n]=l)}if(u(J)||u(n))throw new an;return s(a)?J._project(n,e,t,r,l,a):J._project(n,e,t,r,l)}function un(n,e){return u(n)?{pending:null,geometry:null}:b(n.spatialReference,e)?{pending:null,geometry:n}:k(n.spatialReference)&&k(e)?An(n.spatialReference,e)||en()?{pending:null,geometry:Rn(n,e)}:(E(nn),{pending:tn(),geometry:null}):{pending:null,geometry:null}}function on(n,e,t=null){if(u(n)||u(e))return null;if(u(J)||u(Q))throw new an;const r=J._getTransformation(Q,n,e,t,t?.spatialReference);return null!==r?K.fromGE(r):null}function sn(n,e,t=null){if(u(J)||u(Q))throw new an;const r=J._getTransformationBySuitability(Q,n,e,t,t?.spatialReference);if(null!==r){const n=[];for(const e of r)n.push(K.fromGE(e));return n}return[]}class an extends n{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}var cn;function En(){J=null,Q=null,Y=null,$={}}!function(n){n[n.UNKNOWN=0]="UNKNOWN",n[n.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",n[n.WGS84=2]="WGS84",n[n.WEB_MERCATOR=3]="WEB_MERCATOR",n[n.WGS84_ECEF=4]="WGS84_ECEF",n[n.CGCS2000=5]="CGCS2000",n[n.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",n[n.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",n[n.GCSMARS2000=8]="GCSMARS2000",n[n.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",n[n.GCSMOON2000=10]="GCSMOON2000",n[n.LON_LAT=11]="LON_LAT",n[n.PLATE_CARREE=12]="PLATE_CARREE"}(cn||(cn={}));const Cn={get loadPromise(){return Y}};function Rn(n,e){try{const t=rn(n,e);if(null==t)return null;"xmin"in n&&"xmin"in t&&(t.zmin=n.zmin,t.zmax=n.zmax);const r=D(t.type,n.spatialReference,e);return s(r)&&r(t),t}catch(t){if(!(t instanceof an))throw t;return null}}function An(n,e,t){return!t&&(!!b(n,e)||k(n)&&k(e)&&!!Ie(n,e,je))}async function fn(n,e,t,r){if(en())return i(r);if(Array.isArray(n)){for(const{source:l,dest:u,geographicTransformation:o}of n)if(!An(l,u,o))return tn(r)}else if(!An(n,e,t))return tn(r);return i(r)}function _n(n,e){switch(Ie(n,e,je)){case Jn:return"copy3";case Se:return"wgs84ToSphericalECEF";case ee:return"wgs84ToWebMercator";case le:return"wgs84ToPlateCarree";case he:return"wgs84ToWGS84ECEF";case Qn:return"webMercatorToWGS84";case Yn:return"webMercatorToSphericalECEF";case $n:return"webMercatorToWGS84ECEF";case oe:return"webMercatorToPlateCarree";case We:return"wgs84ECEFToWGS84";case me:return"wgs84ECEFToSphericalECEF";case Te:return"wgs84ECEFToWebMercator";case Oe:return"sphericalECEFToWGS84";case Me:return"sphericalECEFToWebMercator";case pe:return"sphericalMarsPCPFToMars2000";case Le:return"sphericalMoonPCPFToMoon2000";case Ne:return"sphericalECEFToWGS84ECEF";case _e:return"mars2000ToSphericalPCPF";case fe:return"moon2000ToSphericalPCPF";default:return null}}function Sn(n,e,t){return n?"x"in n?Ln(n,e,new T,t,0):"xmin"in n?Fn(n,e,new N,t,0):"rings"in n?mn(n,e,new F,t,0):"paths"in n?Nn(n,e,new I,t,0):"points"in n?On(n,e,new G,t,0):null:null}function Pn(n,e,t=e.spatialReference,r=0){return s(t)&&s(n.spatialReference)&&s(Ln(n,n.spatialReference,e,t,r))}function Ln(n,e,t,r,l){ke[0]=n.x,ke[1]=n.y;const u=n.z;return ke[2]=void 0!==u?u:l,Un(ke,e,0,ke,r,0,1)?(t.x=ke[0],t.y=ke[1],t.spatialReference=r,void 0===u?(t.z=void 0,t.hasZ=!1):(t.z=ke[2],t.hasZ=!0),void 0===n.m?(t.m=void 0,t.hasM=!1):(t.m=n.m,t.hasM=!0),t):null}function pn(n,e,t=e.spatialReference,r=0){return s(n.spatialReference)&&s(t)&&s(On(n,n.spatialReference,e,t,r))}function On(n,e,t,r,l){const{points:u,hasZ:o,hasM:s}=n,a=[],i=u.length,c=[];for(const E of u)c.push(E[0],E[1],o?E[2]:l);if(!Un(c,e,0,c,r,0,i))return null;for(let E=0;E<i;++E){const n=3*E,e=c[n],t=c[n+1];o&&s?a.push([e,t,c[n+2],u[E][3]]):o?a.push([e,t,c[n+2]]):s?a.push([e,t,u[E][2]]):a.push([e,t])}return t.points=a,t.spatialReference=r,t.hasZ=o,t.hasM=s,t}function Mn(n,e,t=e.spatialReference,r=0){return s(n.spatialReference)&&s(t)&&s(Nn(n,n.spatialReference,e,t,r))}function Nn(n,e,t,r,l){const{paths:u,hasZ:o,hasM:s}=n,a=[];return Kn(u,o??!1,s??!1,e,a,r,l)?(t.paths=a,t.spatialReference=r,t.hasZ=o,t.hasM=s,t):null}function Gn({hasZ:n,spatialReference:e,paths:t},r,l=0){const o=Dn(e,ge),s=Fe[o][cn.WGS84_COMPARABLE_LON_LAT];if(u(s))return!1;const a=n?n=>n:n=>O(ke,n[0],n[1],l);for(const u of t){const n=[];for(const e of u){const t=[0,0,l];s(a(e),0,t,0),n.push(t)}r.push(n)}return!0}function hn({hasZ:n,spatialReference:e,rings:t},r,l=0){const o=Dn(e,ge),s=Fe[o][cn.WGS84_COMPARABLE_LON_LAT];if(u(s))return!1;const a=n?n=>n:n=>O(ke,n[0],n[1],l);for(const u of t){const n=[];for(const e of u){const t=[0,0,l];s(a(e),0,t,0),n.push(t)}r.push(n)}return!0}function Wn(n,e,t=e.spatialReference,r=0){return s(n.spatialReference)&&s(t)&&s(mn(n,n.spatialReference,e,t,r))}function mn(n,e,t,r,l){const{rings:u,hasZ:o,hasM:s}=n,a=[];return Kn(u,o??!1,s??!1,e,a,r,l)?(t.rings=a,t.spatialReference=r,t.hasZ=o,t.hasM=s,t):null}function Tn(n,e,t=e.spatialReference,r=0){return s(n.spatialReference)&&s(t)&&s(Fn(n,n.spatialReference,e,t,r))}function Fn(n,e,t,r,l){const{xmin:u,ymin:o,xmax:s,ymax:a,hasZ:i,hasM:c}=n;if(!gn(u,o,i?n.zmin:l,e,ke,r))return null;t.xmin=ke[0],t.ymin=ke[1],i&&(t.zmin=ke[2]);return gn(s,a,i?n.zmax:l,e,ke,r)?(t.xmax=ke[0],t.ymax=ke[1],i&&(t.zmax=ke[2]),c&&(t.mmin=n.mmin,t.mmax=n.mmax),t.spatialReference=r,t):null}function In(n,e,t){if(u(e)||u(t))return null;const r=new T({spatialReference:t});return Un(n,e,0,ke,t,0,1)?(r.x=ke[0],r.y=ke[1],r.z=ke[2],r):null}function dn(n,e,t){return Un(n,e,0,ke,t.spatialReference,0,1)?(t.x=ke[0],t.y=ke[1],t.z=ke[2],t):null}function Hn(n,e,t,r=0){ke[0]=n.x,ke[1]=n.y;const l=n.z;return ke[2]=void 0!==l?l:r,Un(ke,n.spatialReference,0,e,t,0,1)}function gn(n,e,t,r,l,u){return xe[0]=n,xe[1]=e,xe[2]=t,Un(xe,r,0,l,u,0,1)}function Bn(n,e,t,r){return!(u(e)||u(r)||n.length<2)&&(2===n.length&&(xe[0]=n[0],xe[1]=n[1],xe[2]=0,n=xe),Un(n,e,0,t,r,0,1))}function jn(n,e){ke[0]=n.x,ke[1]=n.y;const t=n.z;return ke[2]=void 0!==t?t:0,yn(ke,n.spatialReference,e)}function yn(n,e,t){return wn(n,e,t)}function wn(n,e,t){if(u(e))return!1;const r=Dn(e,ge),l=Fe[r][cn.WGS84_COMPARABLE_LON_LAT];return!u(l)&&(l(n,0,xe,0),t!==xe&&(t[0]=xe[0],t[1]=xe[1],t.length>2&&(t[2]=xe[2])),!0)}function Un(n,e,t,r,l,o,s=1){const a=Ie(e,l,je);if(u(a))return!1;if(a===Jn){if(n===r&&t===o)return!0;const e=t+3*s;for(let l=t,u=o;l<e;l++,u++)r[u]=n[l];return!0}const i=t+3*s;for(let u=t,c=o;u<i;u+=3,c+=3)a(n,u,r,c);return!0}function xn(n,e,t,r,l){_(ke,n),S(ze,n,e),Bn(ke,t,ke,l),Bn(ze,t,ze,l),P(r,ze,ke),L(r,r)}function Kn(n,e,t,r,l,u,o=0){const s=new Array;for(const i of n)for(const n of i)s.push(n[0],n[1],e?n[2]:o);if(!Un(s,r,0,s,u,0,s.length/3))return!1;let a=0;l.length=0;for(const i of n){const n=new Array;for(const r of i)e&&t?n.push([s[a++],s[a++],s[a++],r[3]]):e?n.push([s[a++],s[a++],s[a++]]):t?(n.push([s[a++],s[a++],r[2]]),a++):(n.push([s[a++],s[a++]]),a++);l.push(n)}return!0}function bn(n,e,t,r){if(u(e)||u(r))return!1;const l=de(e,r,ye);if(l.projector===Jn)return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],!0;if(u(l.projector))return!1;const{source:o,dest:a}=l;if(a.spatialReferenceId===cn.WEB_MERCATOR){const e=Fe[o.spatialReferenceId][cn.WGS84];return!u(e)&&(e(n,0,Ke,0),ee(Ke,0,t,0),t[3]=kn(Ke[1],n[2],n[3],y.radius),!0)}if(o.spatialReferenceId!==cn.WGS84&&o.spatialReferenceId!==cn.CGCS2000||a.spatialReferenceId!==cn.PLATE_CARREE){l.projector(n,0,t,0);const e=o.metersPerUnit??1,r=a.metersPerUnit??1;t[3]=n[3]*e/r}else{const e=Fe[o.spatialReferenceId][cn.SPHERICAL_ECEF],r=Fe[cn.SPHERICAL_ECEF][cn.PLATE_CARREE];let u=n[3];s(e)&&s(r)&&(u=kn(n[1],n[2],n[3],y.radius)),l.projector(n,0,t,0),t[3]=u}return!0}function kn(n,e,t,r){const l=r+e;if(l<r/2||t>l)return Number.MAX_VALUE;const u=Math.abs(we*n)+Math.asin(t/l);return u>=Math.PI/2?Number.MAX_VALUE:t/Math.cos(u)}function zn(n,e,t,r){return null!=n&&(b(e,r)?(j(t,n),!0):(xe[0]=n[0],xe[1]=n[1],xe[2]=0,!!Un(xe,e,0,xe,r,0,1)&&(t[0]=xe[0],t[1]=xe[1],xe[0]=n[2],xe[1]=n[3],xe[2]=0,!!Un(xe,e,0,xe,r,0,1)&&(t[2]=xe[0],t[3]=xe[1],!0))))}function vn(n,e,t,r){if(u(e)||u(r))return!1;const l=Dn(e,ge),o=Dn(r,Be);if(l===o&&l!==cn.UNKNOWN||b(e,r))return t[0]=1,t[1]=1,t[2]=1,!0;if(l===cn.SPHERICAL_ECEF){const e=p(n),r=e/Math.sqrt(n[0]*n[0]+n[1]*n[1]),l=e/y.radius;if(o===cn.WEB_MERCATOR)return t[0]=r*l,t[1]=r*l,t[2]=1,!0;if(o===cn.WGS84||o===cn.CGCS2000){const n=re;return t[0]=n*r*l,t[1]=n*l,t[2]=1,!0}}else if(l===cn.PLATE_CARREE){if(o===cn.WGS84||o===cn.CGCS2000)return t[0]=re,t[1]=re,t[2]=1,!0;if(o===cn.WEB_MERCATOR){const e=n[1]/y.radius;return t[0]=1,t[1]=1/Math.cos(e),t[2]=1,!0}}return!1}function qn(n,e,t,r){if(u(n)||u(r))return!1;const l=Dn(n,ge),o=Dn(r,Be);if(l===o&&!Zn(o)&&(l!==cn.UNKNOWN||b(n,r)))return R(t,e),!0;if(Zn(o)){const n=Fe[l][cn.LON_LAT],r=Fe[cn.LON_LAT][o];return!u(n)&&!u(r)&&(n(e,0,Ke,0),r(Ke,0,be,0),Vn(we*Ke[0],we*Ke[1],t),t[12]=be[0],t[13]=be[1],t[14]=be[2],!0)}if((o===cn.WEB_MERCATOR||o===cn.PLATE_CARREE)&&(l===cn.WGS84||l===cn.CGCS2000&&o===cn.PLATE_CARREE||l===cn.SPHERICAL_ECEF||l===cn.WEB_MERCATOR)){const n=Fe[l][cn.LON_LAT],r=Fe[cn.LON_LAT][o];return!u(n)&&!u(r)&&(n(e,0,Ke,0),r(Ke,0,be,0),l===cn.SPHERICAL_ECEF?Xn(we*Ke[0],we*Ke[1],t):A(t),t[12]=be[0],t[13]=be[1],t[14]=be[2],!0)}return!1}function Zn(n){return n===cn.SPHERICAL_ECEF||n===cn.SPHERICAL_MARS_PCPF||n===cn.SPHERICAL_MOON_PCPF}function Vn(n,e,t){const r=Math.sin(n),l=Math.cos(n),u=Math.sin(e),o=Math.cos(e),s=t;return s[0]=-r,s[4]=-u*l,s[8]=o*l,s[12]=0,s[1]=l,s[5]=-u*r,s[9]=o*r,s[13]=0,s[2]=0,s[6]=o,s[10]=u,s[14]=0,s[3]=0,s[7]=0,s[11]=0,s[15]=1,s}function Xn(n,e,t){return Vn(n,e,t),f(t,t),t}function Dn(n,e){return n?e.spatialReference===n?e.spatialReferenceId:(e.spatialReference=n,"metersPerUnit"in e&&(e.metersPerUnit=c(n,1)),n.wkt===d.wkt?e.spatialReferenceId=cn.SPHERICAL_ECEF:z(n)?e.spatialReferenceId=cn.WGS84:v(n)?e.spatialReferenceId=cn.WEB_MERCATOR:q(n)?e.spatialReferenceId=cn.PLATE_CARREE:n.wkt===H.wkt?e.spatialReferenceId=cn.WGS84_ECEF:n.wkid===X.CGCS2000?e.spatialReferenceId=cn.CGCS2000:n.wkt===g.wkt?e.spatialReferenceId=cn.SPHERICAL_MARS_PCPF:n.wkt===B.wkt?e.spatialReferenceId=cn.SPHERICAL_MOON_PCPF:Z(n)?e.spatialReferenceId=cn.GCSMARS2000:V(n)?e.spatialReferenceId=cn.GCSMOON2000:e.spatialReferenceId=cn.UNKNOWN):cn.UNKNOWN}function Jn(n,e,t,r){n!==t&&(t[r++]=n[e++],t[r++]=n[e++],t[r]=n[e])}function Qn(n,e,t,r){t[r++]=Ue*(n[e++]/y.radius),t[r++]=Ue*(Math.PI/2-2*Math.atan(Math.exp(-n[e++]/y.radius))),t[r]=n[e]}function Yn(n,e,t,r){Qn(n,e,t,r),Se(t,r,t,r)}function $n(n,e,t,r){Qn(n,e,t,r),he(t,r,t,r)}function ne(n,t,r,l,u){const o=.4999999*Math.PI,s=e(we*n[t+1],-o,o),a=Math.sin(s);r[l++]=we*n[t]*u.radius,r[l++]=u.halfSemiMajorAxis*Math.log((1+a)/(1-a)),r[l]=n[t+2]}function ee(n,e,t,r){ne(n,e,t,r,y)}const te=y.radius*Math.PI/180,re=180/(y.radius*Math.PI);function le(n,e,t,r){t[r]=n[e]*te,t[r+1]=n[e+1]*te,t[r+2]=n[e+2]}function ue(n,e,t,r){t[r]=n[e]*re,t[r+1]=n[e+1]*re,t[r+2]=n[e+2]}function oe(n,e,t,r){Qn(n,e,t,r),le(t,r,t,r)}function se(n,e,t,r){We(n,e,t,r),le(t,r,t,r)}function ae(n,e,t,r){Oe(n,e,t,r),le(t,r,t,r)}function ie(n,e,t,r){ue(n,e,t,r),Se(t,r,t,r)}function ce(n,e,t,r){ue(n,e,t,r),ee(t,r,t,r)}function Ee(n,e,t,r){ue(n,e,t,r),he(t,r,t,r)}function Ce(n){if(u(n))return!1;const e=Dn(n,ge);return!!Fe[e][cn.WGS84_COMPARABLE_LON_LAT]}function Re(n,e,t,r){const l=Math.cos(t);n[0]=Math.cos(e)*l*r,n[1]=Math.sin(e)*l*r,n[2]=Math.sin(t)*r}function Ae(n,e,t,r,l){const u=l+n[e+2],o=we*n[e+1],s=we*n[e],a=Math.cos(o);t[r++]=Math.cos(s)*a*u,t[r++]=Math.sin(s)*a*u,t[r]=Math.sin(o)*u}function fe(n,e,t,r){Ae(n,e,t,r,w.radius)}function _e(n,e,t,r){Ae(n,e,t,r,U.radius)}function Se(n,e,t,r){Ae(n,e,t,r,y.radius)}function Pe(n,e,t,r,u){const o=n[e],s=n[e+1],a=n[e+2],i=Math.sqrt(o*o+s*s+a*a),c=l(a/(0===i?1:i)),E=Math.atan2(s,o);t[r++]=Ue*E,t[r++]=Ue*c,t[r]=i-u}function Le(n,e,t,r){Pe(n,e,t,r,w.radius)}function pe(n,e,t,r){Pe(n,e,t,r,U.radius)}function Oe(n,e,t,r){Pe(n,e,t,r,y.radius)}function Me(n,e,t,r){Oe(n,e,t,r),ee(t,r,t,r)}function Ne(n,e,t,r){Oe(n,e,t,r),he(t,r,t,r)}function Ge(n,e,t,r,l){const u=we*n[e],o=we*n[e+1],s=n[e+2],a=Math.sin(o),i=Math.cos(o),c=l.radius/Math.sqrt(1-l.eccentricitySquared*a*a);t[r++]=(c+s)*i*Math.cos(u),t[r++]=(c+s)*i*Math.sin(u),t[r++]=(c*(1-l.eccentricitySquared)+s)*a}function he(n,e,t,r){Ge(n,e,t,r,y)}function We(n,e,t,r){const l=x,u=n[e],o=n[e+1],s=n[e+2];let a,i,c,E,C,R,A,f,_,S,P,L,p,O,M,N,G,h,W,m,T;a=Math.abs(s),i=u*u+o*o,c=Math.sqrt(i),E=i+s*s,C=Math.sqrt(E),m=Math.atan2(o,u),R=s*s/E,A=i/E,O=l.a2/C,M=l.a3-l.a4/C,A>.3?(f=a/C*(1+A*(l.a1+O+R*M)/C),W=Math.asin(f),S=f*f,_=Math.sqrt(1-S)):(_=c/C*(1-R*(l.a5-O-A*M)/C),W=Math.acos(_),S=1-_*_,f=Math.sqrt(S)),P=1-y.eccentricitySquared*S,L=y.radius/Math.sqrt(P),p=l.a6*L,O=c-L*_,M=a-p*f,G=_*O+f*M,N=_*M-f*O,h=N/(p/P+G),W+=h,T=G+N*h/2,s<0&&(W=-W),t[r++]=Ue*m,t[r++]=Ue*W,t[r]=T}function me(n,e,t,r){We(n,e,t,r),Se(t,r,t,r)}function Te(n,e,t,r){We(n,e,t,r),ee(t,r,t,r)}const Fe={[cn.WGS84]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:Jn,[cn.SPHERICAL_ECEF]:Se,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:ee,[cn.PLATE_CARREE]:le,[cn.WGS84]:Jn,[cn.WGS84_ECEF]:he},[cn.CGCS2000]:{[cn.CGCS2000]:Jn,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:Jn,[cn.SPHERICAL_ECEF]:Se,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:le,[cn.WGS84]:null,[cn.WGS84_ECEF]:he},[cn.GCSMARS2000]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:Jn,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:null,[cn.SPHERICAL_ECEF]:null,[cn.SPHERICAL_MARS_PCPF]:_e,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:null,[cn.WGS84]:null,[cn.WGS84_ECEF]:null},[cn.GCSMOON2000]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:Jn,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:null,[cn.SPHERICAL_ECEF]:null,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:fe,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:null,[cn.WGS84]:null,[cn.WGS84_ECEF]:null},[cn.WEB_MERCATOR]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Qn,[cn.WGS84_COMPARABLE_LON_LAT]:Qn,[cn.SPHERICAL_ECEF]:Yn,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:Jn,[cn.PLATE_CARREE]:oe,[cn.WGS84]:Qn,[cn.WGS84_ECEF]:$n},[cn.WGS84_ECEF]:{[cn.CGCS2000]:We,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:We,[cn.WGS84_COMPARABLE_LON_LAT]:We,[cn.SPHERICAL_ECEF]:me,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:Te,[cn.PLATE_CARREE]:se,[cn.WGS84]:We,[cn.WGS84_ECEF]:Jn},[cn.SPHERICAL_ECEF]:{[cn.CGCS2000]:Oe,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Oe,[cn.WGS84_COMPARABLE_LON_LAT]:Oe,[cn.SPHERICAL_ECEF]:Jn,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:Me,[cn.PLATE_CARREE]:ae,[cn.WGS84]:Oe,[cn.WGS84_ECEF]:Ne},[cn.SPHERICAL_MARS_PCPF]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:pe,[cn.GCSMOON2000]:null,[cn.LON_LAT]:pe,[cn.WGS84_COMPARABLE_LON_LAT]:null,[cn.SPHERICAL_ECEF]:null,[cn.SPHERICAL_MARS_PCPF]:Jn,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:null,[cn.WGS84]:null,[cn.WGS84_ECEF]:null},[cn.SPHERICAL_MOON_PCPF]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:Le,[cn.LON_LAT]:Le,[cn.WGS84_COMPARABLE_LON_LAT]:null,[cn.SPHERICAL_ECEF]:null,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:Jn,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:null,[cn.WGS84]:null,[cn.WGS84_ECEF]:null},[cn.UNKNOWN]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:null,[cn.WGS84_COMPARABLE_LON_LAT]:null,[cn.SPHERICAL_ECEF]:null,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:Jn,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:null,[cn.WGS84]:null,[cn.WGS84_ECEF]:null},[cn.LON_LAT]:{[cn.CGCS2000]:Jn,[cn.GCSMARS2000]:Jn,[cn.GCSMOON2000]:Jn,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:Jn,[cn.SPHERICAL_ECEF]:Se,[cn.SPHERICAL_MARS_PCPF]:_e,[cn.SPHERICAL_MOON_PCPF]:fe,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:ee,[cn.PLATE_CARREE]:le,[cn.WGS84]:Jn,[cn.WGS84_ECEF]:he},[cn.WGS84_COMPARABLE_LON_LAT]:{[cn.CGCS2000]:null,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:Jn,[cn.WGS84_COMPARABLE_LON_LAT]:Jn,[cn.SPHERICAL_ECEF]:Se,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:null,[cn.PLATE_CARREE]:le,[cn.WGS84]:Jn,[cn.WGS84_ECEF]:he},[cn.PLATE_CARREE]:{[cn.CGCS2000]:ue,[cn.GCSMARS2000]:null,[cn.GCSMOON2000]:null,[cn.LON_LAT]:ue,[cn.WGS84_COMPARABLE_LON_LAT]:ue,[cn.SPHERICAL_ECEF]:ie,[cn.SPHERICAL_MARS_PCPF]:null,[cn.SPHERICAL_MOON_PCPF]:null,[cn.UNKNOWN]:null,[cn.WEB_MERCATOR]:ce,[cn.PLATE_CARREE]:Jn,[cn.WGS84]:ue,[cn.WGS84_ECEF]:Ee}};function Ie(n,e,t=He()){return u(n)||u(e)?null:de(n,e,t).projector}function de(n,e,t){if(u(n)||u(e)||t.source.spatialReference===n&&t.dest.spatialReference===e)return t;const r=Dn(n,t.source),l=Dn(e,t.dest);return r===cn.UNKNOWN&&l===cn.UNKNOWN?b(n,e)?t.projector=Jn:t.projector=null:t.projector=Fe[r][l],t}function He(){return{source:{spatialReference:null,spatialReferenceId:cn.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:cn.UNKNOWN,metersPerUnit:1},projector:Jn}}const ge={spatialReference:null,spatialReferenceId:cn.UNKNOWN},Be={spatialReference:null,spatialReferenceId:cn.UNKNOWN},je=He(),ye=He(),we=t(1),Ue=r(1),xe=M(),Ke=M(),be=M(),ke=M(),ze=M();export{Ce as canProjectToWGS84ComparableLonLat,An as canProjectWithoutEngine,Vn as computeENUToSphericalPCPFLocalRotation,Xn as computeSphericalPCPFToENULocalRotation,qn as computeTranslationToOriginAndRotation,_n as getProjectorName,on as getTransformation,sn as getTransformations,fn as initializeProjection,en as isLoaded,tn as load,vn as localLinearScaleFactors,Re as lonLatToSphericalPCPF,ne as lonLatToWebMercatorComparable,rn as project,zn as projectBoundingRect,bn as projectBoundingSphere,Un as projectBuffer,xn as projectDirection,Tn as projectExtent,ln as projectMany,pn as projectMultipoint,un as projectOrLoad,Pn as projectPoint,Hn as projectPointToVector,jn as projectPointToWGS84ComparableLonLat,Wn as projectPolygon,hn as projectPolygonToWGS84ComparableLonLat,Mn as projectPolyline,Gn as projectPolylineToWGS84ComparableLonLat,dn as projectVectorToDehydratedPoint,In as projectVectorToPoint,Bn as projectVectorToVector,yn as projectVectorToWGS84ComparableLonLat,Sn as projectWithoutEngine,gn as projectXYZToVector,Pe as sphericalPCPFtoLonLatElevation,Cn as test,Rn as tryProjectWithZConversion,En as unload};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isNone as n}from"../../core/maybe.js";import t from"../Extent.js";import{create as r}from"./aaBoundingRect.js";function i(n){return n}function a(n=
|
|
5
|
+
import{isNone as n}from"../../core/maybe.js";import t from"../Extent.js";import{create as r}from"./aaBoundingRect.js";function i(n){return n}function a(n=D){return i([n[0],n[1],n[2],n[3],n[4],n[5]])}function u(n,t,r,i,u,e,m=a()){return m[0]=n,m[1]=t,m[2]=r,m[3]=i,m[4]=u,m[5]=e,m}function e(n,t=a()){return t[0]=n.xmin,t[1]=n.ymin,t[2]=n.hasZ?n.zmin:-1/0,t[3]=n.xmax,t[4]=n.ymax,t[5]=n.hasZ?n.zmax:1/0,t}function m(n,r){const i=isFinite(n[2])||isFinite(n[5]);return new t(i?{xmin:n[0],xmax:n[3],ymin:n[1],ymax:n[4],zmin:n[2],zmax:n[5],spatialReference:r}:{xmin:n[0],xmax:n[3],ymin:n[1],ymax:n[4],spatialReference:r})}function o(n,t,r=a()){return r[0]=n[0],r[1]=n[1],r[2]=n[2],r[3]=t[0],r[4]=t[1],r[5]=t[2],r}function f(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.min(n[2],t[2]),n[3]=Math.max(n[3],t[3]),n[4]=Math.max(n[4],t[4]),n[5]=Math.max(n[5],t[5])}function h(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[3]=Math.max(n[3],t[2]),n[4]=Math.max(n[4],t[3])}function c(n,t){n[0]=Math.min(n[0],t[0]),n[1]=Math.min(n[1],t[1]),n[2]=Math.min(n[2],t[2]),n[3]=Math.max(n[3],t[0]),n[4]=Math.max(n[4],t[1]),n[5]=Math.max(n[5],t[2])}function M(n,t,r=0,i=t.length/3){let a=n[0],u=n[1],e=n[2],m=n[3],o=n[4],f=n[5];for(let h=0;h<i;h++)a=Math.min(a,t[r+3*h]),u=Math.min(u,t[r+3*h+1]),e=Math.min(e,t[r+3*h+2]),m=Math.max(m,t[r+3*h]),o=Math.max(o,t[r+3*h+1]),f=Math.max(f,t[r+3*h+2]);n[0]=a,n[1]=u,n[2]=e,n[3]=m,n[4]=o,n[5]=f}function x(n,t,r,i){n[0]=Math.min(n[0],n[0]+t),n[3]=Math.max(n[3],n[3]+t),n[1]=Math.min(n[1],n[1]+r),n[4]=Math.max(n[4],n[4]+r),n[2]=Math.min(n[2],n[2]+i),n[5]=Math.max(n[5],n[5]+i)}function s(n,t,r){const i=t.length;let a=n[0],u=n[1],e=n[2],m=n[3],o=n[4],f=n[5];if(r)for(let h=0;h<i;h++){const n=t[h];a=Math.min(a,n[0]),u=Math.min(u,n[1]),e=Math.min(e,n[2]),m=Math.max(m,n[0]),o=Math.max(o,n[1]),f=Math.max(f,n[2])}else for(let h=0;h<i;h++){const n=t[h];a=Math.min(a,n[0]),u=Math.min(u,n[1]),m=Math.max(m,n[0]),o=Math.max(o,n[1])}n[0]=a,n[1]=u,n[2]=e,n[3]=m,n[4]=o,n[5]=f}function l(n){for(let t=0;t<6;t++)if(!isFinite(n[t]))return!1;return!0}function I(n){return n[0]>=n[3]?0:n[3]-n[0]}function y(n){return n[1]>=n[4]?0:n[4]-n[1]}function N(n){return n[2]>=n[5]?0:n[5]-n[2]}function g(n){const t=I(n),r=N(n),i=y(n);return Math.sqrt(t*t+r*r+i*i)}function p(n,t=[0,0,0]){return t[0]=n[0]+I(n)/2,t[1]=n[1]+y(n)/2,t[2]=n[2]+N(n)/2,t}function F(n,t=[0,0,0]){return t[0]=I(n),t[1]=y(n),t[2]=N(n),t}function z(n){return Math.max(I(n),N(n),y(n))}function E(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[0]<=n[3]&&t[1]<=n[4]&&t[2]<=n[5]}function T(n,t,r){return t[0]>=n[0]-r&&t[1]>=n[1]-r&&t[2]>=n[2]-r&&t[0]<=n[3]+r&&t[1]<=n[4]+r&&t[2]<=n[5]+r}function b(n,t){return t[0]>=n[0]&&t[1]>=n[1]&&t[2]>=n[2]&&t[3]<=n[3]&&t[4]<=n[4]&&t[5]<=n[5]}function j(n,t){return Math.max(t[0],n[0])<=Math.min(t[3],n[3])&&Math.max(t[1],n[1])<=Math.min(t[4],n[4])&&Math.max(t[2],n[2])<=Math.min(t[5],n[5])}function R(t,r){return!!n(r)||j(t,r)}function V(n,t,r,i,a=n){return a[0]=n[0]+t,a[1]=n[1]+r,a[2]=n[2]+i,a[3]=n[3]+t,a[4]=n[4]+r,a[5]=n[5]+i,a}function Y(n,t,r=n){const i=n[0]+I(n)/2,a=n[1]+y(n)/2,u=n[2]+N(n)/2;return r[0]=i+(n[0]-i)*t,r[1]=a+(n[1]-a)*t,r[2]=u+(n[2]-u)*t,r[3]=i+(n[3]-i)*t,r[4]=a+(n[4]-a)*t,r[5]=u+(n[5]-u)*t,r}function Z(n,t){return t[0]=n[0],t[1]=n[1],t[2]=n[2],t}function _(n,t){return t[0]=n[3],t[1]=n[4],t[2]=n[5],t}function d(n,t,r=n){return r[0]=t[0],r[1]=t[1],r[2]=t[2],r!==n&&(r[3]=n[3],r[4]=n[4],r[5]=n[5]),r}function q(n,t,r=n){return r[3]=t[0],r[4]=t[1],r[5]=t[2],r!==n&&(r[0]=n[0],r[1]=n[1],r[2]=n[2]),n}function w(n,t){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n}function A(n){return n?w(n,C):a(C)}function B(n,t){return t||(t=r()),t[0]=n[0],t[1]=n[1],t[2]=n[3],t[3]=n[4],t}function G(n,t){return n[0]=t[0],n[1]=t[1],n[2]=Number.NEGATIVE_INFINITY,n[3]=t[2],n[4]=t[3],n[5]=Number.POSITIVE_INFINITY,n}function O(n){return 6===n.length}function P(n){return 0===I(n)&&0===y(n)&&0===N(n)}function S(t,r,i){if(n(t)||n(r))return t===r;if(!O(t)||!O(r))return!1;if(i){for(let n=0;n<t.length;n++)if(!i(t[n],r[n]))return!1}else for(let n=0;n<t.length;n++)if(t[n]!==r[n])return!1;return!0}function k(n,t,r,i,a,e){return u(n,t,r,i,a,e,H)}const v=i([-1/0,-1/0,-1/0,1/0,1/0,1/0]),C=i([1/0,1/0,1/0,-1/0,-1/0,-1/0]),D=i([0,0,0,0,0,0]),H=a();export{C as NEGATIVE_INFINITY,v as POSITIVE_INFINITY,D as ZERO,l as allFinite,p as center,b as contains,E as containsPoint,T as containsPointWithMargin,a as create,y as depth,g as diameter,A as empty,S as equals,f as expandWithAABB,M as expandWithBuffer,s as expandWithNestedArray,x as expandWithOffset,h as expandWithRect,c as expandWithVec3,e as fromExtent,o as fromMinMax,G as fromRect,u as fromValues,_ as getMax,Z as getMin,N as height,j as intersects,R as intersectsClippingArea,O as is,P as isPoint,z as maximumDimension,V as offset,Y as scale,w as set,q as setMax,d as setMin,F as size,m as toExtent,B as toRect,I as width,k as wrap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
function n(n){return void 0!==n.xmin&&void 0!==n.ymin&&void 0!==n.xmax&&void 0!==n.ymax}function t(n){return void 0!==n.points}function e(n){return void 0!==n.x&&void 0!==n.y}function o(n){return void 0!==n.paths}function
|
|
5
|
+
function n(n){return void 0!==n.xmin&&void 0!==n.ymin&&void 0!==n.xmax&&void 0!==n.ymax}function t(n){return void 0!==n.points}function e(n){return void 0!==n.x&&void 0!==n.y}function o(n){return void 0!==n.paths}function r(n){return void 0!==n.rings}function i(n){function t(t,e){return null==t?e:null==e?t:n(t,e)}return t}const l=i(Math.min),u=i(Math.max);function c(i,l){return o(l)?h(i,l.paths,!1,!1):r(l)?h(i,l.rings,!1,!1):t(l)?s(i,l.points,!1,!1,!1,!1):n(l)?g(i,l):(e(l)&&(i[0]=l.x,i[1]=l.y,i[2]=l.x,i[3]=l.y),i)}function f(i,l){return o(l)?h(i,l.paths,!0,!1):r(l)?h(i,l.rings,!0,!1):t(l)?s(i,l.points,!0,!1,!0,!1):n(l)?g(i,l,!0,!1,!0,!1):(e(l)&&(i[0]=l.x,i[1]=l.y,i[2]=l.z,i[3]=l.x,i[4]=l.y,i[5]=l.z),i)}function h(n,t,e,o){const r=e?3:2;if(!t.length||!t[0].length)return null;let i,c,f,h,[g,s]=t[0][0],[x,m]=t[0][0];for(let a=0;a<t.length;a++){const n=t[a];for(let t=0;t<n.length;t++){const a=n[t],[d,v]=a;if(g=l(g,d),s=l(s,v),x=u(x,d),m=u(m,v),e&&a.length>2){const n=a[2];i=l(i,n),c=u(c,n)}if(o&&a.length>r){const n=a[r];f=l(i,n),h=u(c,n)}}}return e?o?(n[0]=g,n[1]=s,n[2]=i,n[3]=f,n[4]=x,n[5]=m,n[6]=c,n[7]=h,n.length=8,n):(n[0]=g,n[1]=s,n[2]=i,n[3]=x,n[4]=m,n[5]=c,n.length=6,n):o?(n[0]=g,n[1]=s,n[2]=f,n[3]=x,n[4]=m,n[5]=h,n.length=6,n):(n[0]=g,n[1]=s,n[2]=x,n[3]=m,n.length=4,n)}function g(n,t,e,o,r,i){const l=t.xmin,u=t.xmax,c=t.ymin,f=t.ymax;let h=t.zmin,g=t.zmax,s=t.mmin,x=t.mmax;return r?(h=h||0,g=g||0,i?(s=s||0,x=x||0,n[0]=l,n[1]=c,n[2]=h,n[3]=s,n[4]=u,n[5]=f,n[6]=g,n[7]=x,n):(n[0]=l,n[1]=c,n[2]=h,n[3]=u,n[4]=f,n[5]=g,n)):i?(s=s||0,x=x||0,n[0]=l,n[1]=c,n[2]=s,n[3]=u,n[4]=f,n[5]=x,n):(n[0]=l,n[1]=c,n[2]=u,n[3]=f,n)}function s(n,t,e,o,r,i){const c=e?3:2,f=o&&i,h=e&&r;if(!t.length||!t[0].length)return null;let g,s,x,m,[a,d]=t[0],[v,y]=t[0];for(let p=0;p<t.length;p++){const n=t[p],[e,o]=n;if(a=l(a,e),d=l(d,o),v=u(v,e),y=u(y,o),h&&n.length>2){const t=n[2];g=l(g,t),s=u(s,t)}if(f&&n.length>c){const t=n[c];x=l(g,t),m=u(s,t)}}return r?(g=g||0,s=s||0,i?(x=x||0,m=m||0,n[0]=a,n[1]=d,n[2]=g,n[3]=x,n[4]=v,n[5]=y,n[6]=s,n[7]=m,n):(n[0]=a,n[1]=d,n[2]=g,n[3]=v,n[4]=y,n[5]=s,n)):i?(x=x||0,m=m||0,n[0]=a,n[1]=d,n[2]=x,n[3]=v,n[4]=y,n[5]=m,n):(n[0]=a,n[1]=d,n[2]=v,n[3]=y,n)}function x(n){if(!n.length||!n[0].length)return null;let[t]=n[0],[e]=n[0];for(let o=0;o<n.length;o++){const r=n[o],[i]=r;t=l(t,i),e=u(e,i)}return e-t}function m(n){if(!n.length||!n[0].length)return null;let[t]=n[0],[e]=n[0];for(let o=0;o<n.length;o++){const r=n[o],[i]=r;t=l(t,i),e=u(e,i)}return t+.5*(e-t)}export{c as getBoundsXY,f as getBoundsXYZ,g as getExtentBounds,s as getPointsBounds,m as getPointsBoundsCenterX,x as getPointsBoundsWidth,h as getRingsOrPathsBounds};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getLength as n,getMidpoint as t}from"./coordsUtils.js";function l(n){return n?n.hasZ?[n.xmax-n.xmin/2,n.ymax-n.ymin/2,n.zmax-n.zmin/2]:[n.xmax-n.xmin/2,n.ymax-n.ymin/2]:null}function e(n){return n?
|
|
5
|
+
import{getLength as n,getMidpoint as t}from"./coordsUtils.js";function l(n){return n?n.hasZ?[n.xmax-n.xmin/2,n.ymax-n.ymin/2,n.zmax-n.zmin/2]:[n.xmax-n.xmin/2,n.ymax-n.ymin/2]:null}function e(n){return n?r(n.rings,n.hasZ??!1):null}function r(n,t){if(!n||!n.length)return null;const l=[],e=[],r=t?[1/0,-1/0,1/0,-1/0,1/0,-1/0]:[1/0,-1/0,1/0,-1/0];for(let h=0,u=n.length;h<u;h++){const l=o(n[h],t,r);l&&e.push(l)}if(e.sort(((n,l)=>{let e=n[2]-l[2];return 0===e&&t&&(e=n[4]-l[4]),e})),e.length&&(l[0]=e[0][0],l[1]=e[0][1],t&&(l[2]=e[0][3]),(l[0]<r[0]||l[0]>r[1]||l[1]<r[2]||l[1]>r[3]||t&&(l[2]<r[4]||l[2]>r[5]))&&(l.length=0)),!l.length){const e=n[0]&&n[0].length?h(n[0],t):null;if(!e)return null;l[0]=e[0],l[1]=e[1],t&&e.length>2&&(l[2]=e[2])}return l}function o(n,t,l){let e=0,r=0,o=0,h=0,u=0;const g=n.length?n[0][0]:0,i=n.length?n[0][1]:0,s=n.length&&t?n[0][2]:0;for(let f=0;f<n.length;f++){const c=n[f],m=n[(f+1)%n.length],[x,a,y]=c,p=x-g,z=a-i,[Z,d,j]=m,U=Z-g,b=d-i,k=p*b-U*z;if(h+=k,e+=(p+U)*k,r+=(z+b)*k,t&&c.length>2&&m.length>2){const n=y-s,t=j-s,l=p*t-U*n;o+=(n+t)*l,u+=l}x<l[0]&&(l[0]=x),x>l[1]&&(l[1]=x),a<l[2]&&(l[2]=a),a>l[3]&&(l[3]=a),t&&(y<l[4]&&(l[4]=y),y>l[5]&&(l[5]=y))}if(h>0&&(h*=-1),u>0&&(u*=-1),!h)return null;h*=.5,u*=.5;const c=[e/(6*h)+g,r/(6*h)+i,h];return t&&(l[4]===l[5]||0===u?(c[3]=(l[4]+l[5])/2,c[4]=0):(c[3]=o/(6*u)+s,c[4]=u)),c}function h(l,e){const r=e?[0,0,0]:[0,0],o=e?[0,0,0]:[0,0];let h=0,u=0,g=0,i=0;for(let s=0,c=l.length;s<c-1;s++){const c=l[s],f=l[s+1];if(c&&f){r[0]=c[0],r[1]=c[1],o[0]=f[0],o[1]=f[1],e&&c.length>2&&f.length>2&&(r[2]=c[2],o[2]=f[2]);const l=n(r,o);if(l){h+=l;const n=t(c,f);u+=l*n[0],g+=l*n[1],e&&n.length>2&&(i+=l*n[2])}}}return h>0?e?[u/h,g/h,i/h]:[u/h,g/h]:l.length?l[0]:null}export{l as extentCentroid,h as lineCentroid,e as polygonCentroid,r as ringsCentroid};
|
package/geometry/support/cut.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.25/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{create as s}from"./aaBoundingRect.js";import{getBoundsXY as t,getPointsBoundsCenterX as e,getPointsBounds as n,getPointsBoundsWidth as o}from"./boundsUtils.js";import{isPolygon as f,isPolyline as r}from"./jsonUtils.js";import{getInfo as
|
|
5
|
+
import{create as s}from"./aaBoundingRect.js";import{getBoundsXY as t,getPointsBoundsCenterX as e,getPointsBounds as n,getPointsBoundsWidth as o}from"./boundsUtils.js";import{isPolygon as f,isPolyline as r}from"./jsonUtils.js";import{getInfo as l}from"./spatialReferenceUtils.js";function i(s){if(!s)return null;if(!s.spatialReference)return s;const t=l(s.spatialReference);if(!t)return s;const e=t.valid[1];return f(s)?u(s,e):r(s)?h(s,e):s}function h(n,o){let f={paths:[],spatialReference:n.spatialReference};const[r,,l]=t(s(),n);let i=Math.ceil((r-o)/(2*o))*(2*o)+o;if(i>l)f=n;else{let s,t;for(;i<l;){const e=p(n,i);if(s=e[0],t=e[1],s)for(const t of s.paths)f.paths.push(t);if(null==t)break;n=t,i+=2*o}if(t)for(const e of t.paths)f.paths.push(e)}for(const s of f.paths){const t=j(e(s),o);for(const e of s)e[0]-=2*t*o}return f}function u(n,o){let f={rings:[],spatialReference:n.spatialReference};const[r,,l]=t(s(),n);let i=Math.ceil((r-o)/(2*o))*(2*o)+o;if(i>l)f=n;else{let s,t;for(;i<l;){if([s,t]=a(n,i),s)for(const t of s.rings)f.rings.push(t);if(null==t)break;n=t,i+=2*o}if(t)for(const e of t.rings)f.rings.push(e)}for(const s of f.rings){const t=j(e(s),o);for(const e of s)e[0]-=2*t*o}return f}const c=s();function p(s,e){const[o,,f]=t(c,s);let r,l;if(f<=e)r=s;else if(o>=e)l=s;else{r={paths:[]},l={paths:[]};const t=r.paths,o=l.paths;for(const f of s.paths){const[s,,r]=n(c,f);if(r<=e)t.push(f);else if(s>=e)o.push(f);else{let s=f[0],n=m(s,e),r=[];r.push(s);for(let l=1;l<f.length;l++){const i=f[l],h=m(i,e);if(h===n)r.push(i);else{const f=R(s,i,e);r.push(f),n?t.push(r):o.push(r),r=[f,i],n=h}s=i}n?t.push(r):o.push(r)}}}return[r,l]}function a(e,o){let f,r;const[l,,i]=t(s(),e);if(i<=o)f=e;else if(l>=o)r=e;else{const t=[],l=[],i=[];for(const f of e.rings){const[e,,r]=n(s(),f);if(r<=o)t.push(f);else if(e>=o)l.push(f);else{let s=f[f.length-1],e=m(s,o),n=[];for(const r of f){const f=m(r,o);if(f===e)n.push(r);else{const h=R(s,r,o);n.push(h),e?t.push(n):l.push(n),i.push(h[1]),n=[],n.push([h[0],h[1]]),n.push(r),e=f}s=r}e?t.push(n):l.push(n)}}i.sort(((s,t)=>s-t));for(let s=0;s<i.length-1;s+=2){const e=[];e.push([o,i[s]]),e.push([o,i[s+1]]),t.length>0&&t.push(e),l.length>0&&l.push(e)}t.length>0&&(f=g(t)),l.length>0&&(r=g(l))}return[f,r]}function g(s){let t;const e={rings:[]};for(;s.length>0;){const n=s[0];let f=!1;const[r,l]=n[0],[i,h]=n[n.length-1];if(r!==i||l!==h)for(let u=1;u<s.length;u++){const c=s[u],[p,a]=c[0],[g,m]=c[c.length-1];if(h===a&&i===p){for(t=1;t<c.length;t++)n.push([c[t][0],c[t][1]]);f=!0}else if(h===m&&i===g){for(t=c.length-2;t>=0;t--)n.push([c[t][0],c[t][1]]);f=!0}else if(l===m&&r===g){for(t=0;t<c.length-1;t++)n.splice(t,0,[c[t][0],c[t][1]]);f=!0}else if(l===a&&r===p){for(t=1;t<c.length;t++)n.unshift([c[t][0],c[t][1]]);f=!0}if(f){if(s.splice(u,1),b(n[0],n[n.length-1])){s.shift();const t=o(n);null!=t&&t>0&&e.rings.push(n)}break}}f||(s.shift(),n.length,e.rings.push(n))}return e}function m([s],t){return s<t}function R([s,t],[e,n],o){return[o,t+(n-t)/(e-s)*(o-s)]}function j(s,t){let e=(s+t)/(2*t);return e%2==1&&e--,Math.floor(e)}function b([s,t],[e,n]){return s===e&&t===n}export{i as normalize};
|