@arcgis/core 4.33.0-next.20250409 → 4.33.0-next.20250410
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/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{f92d521ed3df3c9f737b.js → 26fcbe053194bd78fcc3.js} +1 -1
- package/assets/esri/core/workers/chunks/4046ec636723c20d3e28.js +1 -0
- package/assets/esri/core/workers/chunks/{3b2bda2e8c08f486de27.js → 4bbe6160eda3fb5d58ec.js} +1 -1
- package/assets/esri/core/workers/chunks/{4de3d692557120a4bbf7.js → 95379fdd6917c8a84c71.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/chunks/Theme.js +1 -1
- package/chunks/bundle.js +5 -0
- package/layers/ParquetLayer.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/support/rasterDatasets/RawBlockCache.js +1 -1
- package/layers/support/rasterFunctions/RemapFunction.js +1 -1
- package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
- package/libs/parquet/loadParquetModule.js +5 -0
- package/libs/parquet/parquet.js +1 -1
- package/package.json +1 -1
- package/support/revision.js +1 -1
- package/views/3d/layers/ElevationLayerView3D.js +1 -1
- package/views/3d/layers/ElevationLayerView3DModifications.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolCreationContext.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Feature/FeatureMedia/xyChart.js +1 -1
- package/widgets/Popup.js +1 -1
- package/assets/esri/core/workers/chunks/39bcfc9cd3a12a35316c.js +0 -1
- package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
package/chunks/bundle.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
let t;const e=new Array(128).fill(void 0);function _(t){return e[t]}e.push(void 0,null,!0,!1);let n=e.length;function r(t){n===e.length&&e.push(e.length+1);const _=n;return n=e[_],e[_]=t,_}function i(e,_){try{return e.apply(this,_)}catch(n){t.__wbindgen_exn_store(r(n))}}const o="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&o.decode();let s=null;function a(){return null!==s&&0!==s.byteLength||(s=new Uint8Array(t.memory.buffer)),s}function g(t,e){return t>>>=0,o.decode(a().subarray(t,t+e))}let c=0;const d="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},u="function"==typeof d.encodeInto?function(t,e){return d.encodeInto(t,e)}:function(t,e){const _=d.encode(t);return e.set(_),{read:t.length,written:_.length}};function w(t,e,_){if(void 0===_){const _=d.encode(t),n=e(_.length,1)>>>0;return a().subarray(n,n+_.length).set(_),c=_.length,n}let n=t.length,r=e(n,1)>>>0;const i=a();let o=0;for(;o<n;o++){const e=t.charCodeAt(o);if(e>127)break;i[r+o]=e}if(o!==n){0!==o&&(t=t.slice(o)),r=_(r,n,n=o+3*t.length,1)>>>0;const e=a().subarray(r+o,r+n);o+=u(t,e).written,r=_(r,n,o,1)>>>0}return c=o,r}let l=null;function b(){return(null===l||!0===l.buffer.detached||void 0===l.buffer.detached&&l.buffer!==t.memory.buffer)&&(l=new DataView(t.memory.buffer)),l}function p(t){return null==t}function f(t){t<132||(e[t]=n,n=t)}function y(t){const e=_(t);return f(t),e}const h="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>{t.__wbindgen_export_4.get(e.dtor)(e.a,e.b)}));function m(e,_,n,r){const i={a:e,b:_,cnt:1,dtor:n},o=(...e)=>{i.cnt++;const _=i.a;i.a=0;try{return r(_,i.b,...e)}finally{0==--i.cnt?(t.__wbindgen_export_4.get(i.dtor)(_,i.b),h.unregister(i)):i.a=_}};return o.original=i,h.register(o,i,i),o}function k(t,e){return t>>>=0,a().subarray(t/1,t/1+e)}function I(){t.enableTracing()}let F=null;function v(){return null!==F&&0!==F.byteLength||(F=new Float64Array(t.memory.buffer)),F}function T(t,e){return t>>>=0,v().subarray(t/8,t/8+e)}let x=null;function z(){return null!==x&&0!==x.byteLength||(x=new Uint32Array(t.memory.buffer)),x}function q(t,e){return t>>>=0,z().subarray(t/4,t/4+e)}function R(t,e){t>>>=0;const _=b(),n=[];for(let r=t;r<t+4*e;r+=4)n.push(y(_.getUint32(r,!0)));return n}let O=null;function M(){return null!==O&&0!==O.byteLength||(O=new Uint16Array(t.memory.buffer)),O}function A(t,e){const _=e(2*t.length,2)>>>0;return M().set(t,_/2),c=t.length,_}function j(e,_,n){const i=w(e,t.__wbindgen_malloc,t.__wbindgen_realloc),o=c;return y(t.readMetadata(i,o,r(_),r(n)))}function W(t,e){const _=e(1*t.length,1)>>>0;return a().set(t,_/1),c=t.length,_}function C(e){const _=W(e,t.__wbindgen_malloc),n=c;return y(t.readMetadataFromFile(_,n))}function L(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`)}function B(e,_,n,i,o){const s=w(e,t.__wbindgen_malloc,t.__wbindgen_realloc),a=c;L(i,N);var g=i.__destroy_into_raw();let d=0;p(o)||(L(o,J),d=o.__destroy_into_raw());return y(t.readFile(s,a,r(_),r(n),g,d))}function S(e,_){let n=0;p(e)||(L(e,J),n=e.__destroy_into_raw());const r=W(_,t.__wbindgen_malloc),i=c;return y(t.readFileFromBinary(n,r,i))}function U(e,_,n){t._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h94c9328f486d7193(e,_,r(n))}function D(e,_,n,i){t.wasm_bindgen__convert__closures__invoke2_mut__ha20fd0c25f0fd1fd(e,_,r(n),r(i))}const E=Object.freeze({Point:0,0:"Point",Polygon:1,1:"Polygon",Polyline:2,2:"Polyline",Multipoint:3,3:"Multipoint"}),P=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],G="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>t.__wbg_columndescriptor_free(e>>>0,1)));class V{static __wrap(t){t>>>=0;const e=Object.create(V.prototype);return e.__wbg_ptr=t,G.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,G.unregister(this),t}free(){const e=this.__destroy_into_raw();t.__wbg_columndescriptor_free(e,0)}name(){let e,_;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.columndescriptor_name(i,this.__wbg_ptr);var n=b().getInt32(i+0,!0),r=b().getInt32(i+4,!0);return e=n,_=r,g(n,r)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,_,1)}}physicalType(){let e,_;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.columndescriptor_physicalType(i,this.__wbg_ptr);var n=b().getInt32(i+0,!0),r=b().getInt32(i+4,!0);return e=n,_=r,g(n,r)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,_,1)}}logicalType(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.columndescriptor_logicalType(n,this.__wbg_ptr);var e=b().getInt32(n+0,!0),_=b().getInt32(n+4,!0);let r;return 0!==e&&(r=g(e,_).slice(),t.__wbindgen_free(e,1*_,1)),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}encodings(){try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.columndescriptor_encodings(r,this.__wbg_ptr);var e=b().getInt32(r+0,!0),_=b().getInt32(r+4,!0),n=R(e,_).slice();return t.__wbindgen_free(e,4*_,4),n}finally{t.__wbindgen_add_to_stack_pointer(16)}}pageEncodings(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.columndescriptor_pageEncodings(n,this.__wbg_ptr);var e=b().getInt32(n+0,!0),_=b().getInt32(n+4,!0);let r;return 0!==e&&(r=R(e,_).slice(),t.__wbindgen_free(e,4*_,4)),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}numValues(){return t.columndescriptor_numValues(this.__wbg_ptr)}compression(){let e,_;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.columndescriptor_compression(i,this.__wbg_ptr);var n=b().getInt32(i+0,!0),r=b().getInt32(i+4,!0);return e=n,_=r,g(n,r)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,_,1)}}compressedSize(){return t.columndescriptor_compressedSize(this.__wbg_ptr)}uncompressedSize(){return t.columndescriptor_uncompressedSize(this.__wbg_ptr)}nullCount(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.columndescriptor_nullCount(n,this.__wbg_ptr);var e=b().getInt32(n+0,!0),_=b().getBigInt64(n+8,!0);return 0===e?void 0:_}finally{t.__wbindgen_add_to_stack_pointer(16)}}distinctCount(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.columndescriptor_distinctCount(n,this.__wbg_ptr);var e=b().getInt32(n+0,!0),_=b().getBigInt64(n+8,!0);return 0===e?void 0:_}finally{t.__wbindgen_add_to_stack_pointer(16)}}minValue(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.columndescriptor_minValue(n,this.__wbg_ptr);var e=b().getInt32(n+0,!0),_=b().getInt32(n+4,!0);let r;return 0!==e&&(r=k(e,_).slice(),t.__wbindgen_free(e,1*_,1)),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}maxValue(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.columndescriptor_maxValue(n,this.__wbg_ptr);var e=b().getInt32(n+0,!0),_=b().getInt32(n+4,!0);let r;return 0!==e&&(r=k(e,_).slice(),t.__wbindgen_free(e,1*_,1)),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}}const X="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>t.__wbg_fieldmetadata_free(e>>>0,1)));class Y{static __wrap(t){t>>>=0;const e=Object.create(Y.prototype);return e.__wbg_ptr=t,X.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,X.unregister(this),t}free(){const e=this.__destroy_into_raw();t.__wbg_fieldmetadata_free(e,0)}get name(){let e,_;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.fieldmetadata_name(i,this.__wbg_ptr);var n=b().getInt32(i+0,!0),r=b().getInt32(i+4,!0);return e=n,_=r,g(n,r)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,_,1)}}get index(){return t.fieldmetadata_index(this.__wbg_ptr)}get type(){const e=t.fieldmetadata_esri_type(this.__wbg_ptr);return P[e]}get physicalType(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.fieldmetadata_physical_type(n,this.__wbg_ptr);var e=b().getInt32(n+0,!0),_=b().getInt32(n+4,!0);let r;return 0!==e&&(r=g(e,_).slice(),t.__wbindgen_free(e,1*_,1)),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}get logicalType(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.fieldmetadata_logical_type(n,this.__wbg_ptr);var e=b().getInt32(n+0,!0),_=b().getInt32(n+4,!0);let r;return 0!==e&&(r=g(e,_).slice(),t.__wbindgen_free(e,1*_,1)),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}}const H="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>t.__wbg_filemetadata_free(e>>>0,1)));class N{static __wrap(t){t>>>=0;const e=Object.create(N.prototype);return e.__wbg_ptr=t,H.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),t}free(){const e=this.__destroy_into_raw();t.__wbg_filemetadata_free(e,0)}version(){return t.filemetadata_version(this.__wbg_ptr)}numRows(){return t.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return t.filemetadata_numFields(this.__wbg_ptr)>>>0}numColumns(){return t.filemetadata_numColumns(this.__wbg_ptr)>>>0}createdBy(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.filemetadata_createdBy(n,this.__wbg_ptr);var e=b().getInt32(n+0,!0),_=b().getInt32(n+4,!0);let r;return 0!==e&&(r=g(e,_).slice(),t.__wbindgen_free(e,1*_,1)),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}keyValueMetadata(e){try{const r=t.__wbindgen_add_to_stack_pointer(-16),i=w(e,t.__wbindgen_malloc,t.__wbindgen_realloc),o=c;t.filemetadata_keyValueMetadata(r,this.__wbg_ptr,i,o);var _=b().getInt32(r+0,!0),n=b().getInt32(r+4,!0);let s;return 0!==_&&(s=g(_,n).slice(),t.__wbindgen_free(_,1*n,1)),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}keys(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.filemetadata_keys(n,this.__wbg_ptr);var e=b().getInt32(n+0,!0),_=b().getInt32(n+4,!0);let r;return 0!==e&&(r=R(e,_).slice(),t.__wbindgen_free(e,4*_,4)),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(e){const _=w(e,t.__wbindgen_malloc,t.__wbindgen_realloc),n=c,r=t.filemetadata_getFieldIndex(this.__wbg_ptr,_,n);return 16777215===r?void 0:r}getFieldByIndex(e){const _=t.filemetadata_getFieldByIndex(this.__wbg_ptr,e);return 0===_?void 0:Y.__wrap(_)}getFields(){try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.filemetadata_getFields(r,this.__wbg_ptr);var e=b().getInt32(r+0,!0),_=b().getInt32(r+4,!0),n=R(e,_).slice();return t.__wbindgen_free(e,4*_,4),n}finally{t.__wbindgen_add_to_stack_pointer(16)}}}const $="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>t.__wbg_geometryinfodescriptor_free(e>>>0,1)));class J{static __wrap(t){t>>>=0;const e=Object.create(J.prototype);return e.__wbg_ptr=t,$.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,$.unregister(this),t}free(){const e=this.__destroy_into_raw();t.__wbg_geometryinfodescriptor_free(e,0)}get geometryType(){const e=t.__wbg_get_geometryinfodescriptor_geometryType(this.__wbg_ptr);return 4===e?void 0:e}set geometryType(e){t.__wbg_set_geometryinfodescriptor_geometryType(this.__wbg_ptr,p(e)?4:e)}get wkbIndex(){const e=t.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set wkbIndex(e){t.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,p(e)?16777215:e)}get lngIndex(){const e=t.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set lngIndex(e){t.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,p(e)?16777215:e)}get latIndex(){const e=t.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set latIndex(e){t.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,p(e)?16777215:e)}get xIndex(){const e=t.__wbg_get_geometryinfodescriptor_xIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set xIndex(e){t.__wbg_set_geometryinfodescriptor_xIndex(this.__wbg_ptr,p(e)?16777215:e)}get inWkid(){const e=t.__wbg_get_geometryinfodescriptor_inWkid(this.__wbg_ptr);return 4294967297===e?void 0:e}set inWkid(e){t.__wbg_set_geometryinfodescriptor_inWkid(this.__wbg_ptr,p(e)?4294967297:e>>>0)}get outWkid(){const e=t.__wbg_get_geometryinfodescriptor_outWkid(this.__wbg_ptr);return 4294967297===e?void 0:e}set outWkid(e){t.__wbg_set_geometryinfodescriptor_outWkid(this.__wbg_ptr,p(e)?4294967297:e>>>0)}static new(){const e=t.geometryinfodescriptor_new();return J.__wrap(e)}setMultiscaleInfo(e){L(e,Q);var _=e.__destroy_into_raw();t.geometryinfodescriptor_setMultiscaleInfo(this.__wbg_ptr,_)}}const K="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>t.__wbg_multiscaleinfo_free(e>>>0,1)));class Q{static __wrap(t){t>>>=0;const e=Object.create(Q.prototype);return e.__wbg_ptr=t,K.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),t}free(){const e=this.__destroy_into_raw();t.__wbg_multiscaleinfo_free(e,0)}static new(){const e=t.multiscaleinfo_new();return Q.__wrap(e)}push(e,_,n,r,i){t.multiscaleinfo_push(this.__wbg_ptr,e,_,n,r,i)}}const Z="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>t.__wbg_pageencodingdescriptor_free(e>>>0,1)));class tt{static __wrap(t){t>>>=0;const e=Object.create(tt.prototype);return e.__wbg_ptr=t,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),t}free(){const e=this.__destroy_into_raw();t.__wbg_pageencodingdescriptor_free(e,0)}pageType(){let e,_;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.pageencodingdescriptor_pageType(i,this.__wbg_ptr);var n=b().getInt32(i+0,!0),r=b().getInt32(i+4,!0);return e=n,_=r,g(n,r)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,_,1)}}encoding(){let e,_;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.pageencodingdescriptor_encoding(i,this.__wbg_ptr);var n=b().getInt32(i+0,!0),r=b().getInt32(i+4,!0);return e=n,_=r,g(n,r)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_free(e,_,1)}}count(){return t.pageencodingdescriptor_count(this.__wbg_ptr)}}const et="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>t.__wbg_parquetchunk_free(e>>>0,1)));class _t{static __wrap(t){t>>>=0;const e=Object.create(_t.prototype);return e.__wbg_ptr=t,et.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,et.unregister(this),t}free(){const e=this.__destroy_into_raw();t.__wbg_parquetchunk_free(e,0)}size(){return t.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(e){return 0!==t.parquetchunk_hasField(this.__wbg_ptr,e)}readX(e){return t.parquetchunk_readX(this.__wbg_ptr,e)}readY(e){return t.parquetchunk_readY(this.__wbg_ptr,e)}readCoords(e){try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.parquetchunk_readCoords(r,this.__wbg_ptr,e);var _=b().getInt32(r+0,!0),n=b().getInt32(r+4,!0);let i;return 0!==_&&(i=T(_,n).slice(),t.__wbindgen_free(_,8*n,8)),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}readLengths(e){try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.parquetchunk_readLengths(r,this.__wbg_ptr,e);var _=b().getInt32(r+0,!0),n=b().getInt32(r+4,!0);let i;return 0!==_&&(i=q(_,n).slice(),t.__wbindgen_free(_,4*n,4)),i}finally{t.__wbindgen_add_to_stack_pointer(16)}}readGeometryTransformed(e,_,n,r,i){const o=t.parquetchunk_readGeometryTransformed(this.__wbg_ptr,e,_,n,r,i);return 0===o?void 0:ot.__wrap(o)}boundsXMin(e){return t.parquetchunk_boundsXMin(this.__wbg_ptr,e)}boundsYMin(e){return t.parquetchunk_boundsYMin(this.__wbg_ptr,e)}boundsXMax(e){return t.parquetchunk_boundsXMax(this.__wbg_ptr,e)}boundsYMax(e){return t.parquetchunk_boundsYMax(this.__wbg_ptr,e)}readAttribute(e,_){return y(t.parquetchunk_readAttribute(this.__wbg_ptr,e,_))}}const nt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>t.__wbg_parquetfile_free(e>>>0,1)));class rt{static __wrap(t){t>>>=0;const e=Object.create(rt.prototype);return e.__wbg_ptr=t,nt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,nt.unregister(this),t}free(){const e=this.__destroy_into_raw();t.__wbg_parquetfile_free(e,0)}metadata(){const e=t.parquetfile_metadata(this.__wbg_ptr);return N.__wrap(e)}rowGroups(){try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.parquetfile_rowGroups(r,this.__wbg_ptr);var e=b().getInt32(r+0,!0),_=b().getInt32(r+4,!0),n=R(e,_).slice();return t.__wbindgen_free(e,4*_,4),n}finally{t.__wbindgen_add_to_stack_pointer(16)}}readChunksWithCallback(e,_){const n=A(e,t.__wbindgen_malloc),i=c;return y(t.parquetfile_readChunksWithCallback(this.__wbg_ptr,n,i,r(_)))}readFirstChunk(e){const _=A(e,t.__wbindgen_malloc),n=c;return y(t.parquetfile_readFirstChunk(this.__wbg_ptr,_,n))}readAllChunks(e){const _=A(e,t.__wbindgen_malloc),n=c;return y(t.parquetfile_readAllChunks(this.__wbg_ptr,_,n))}updateChunks(e){const _=A(e,t.__wbindgen_malloc),n=c;return y(t.parquetfile_updateChunks(this.__wbg_ptr,_,n))}}const it="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>t.__wbg_quantizedgeometry_free(e>>>0,1)));class ot{static __wrap(t){t>>>=0;const e=Object.create(ot.prototype);return e.__wbg_ptr=t,it.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,it.unregister(this),t}free(){const e=this.__destroy_into_raw();t.__wbg_quantizedgeometry_free(e,0)}readCoordsUnsafe(){return y(t.quantizedgeometry_readCoordsUnsafe(this.__wbg_ptr))}readLengthsUnsafe(){return y(t.quantizedgeometry_readLengthsUnsafe(this.__wbg_ptr))}}const st="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>t.__wbg_rangeproviderjs_free(e>>>0,1)));class at{static __wrap(t){t>>>=0;const e=Object.create(at.prototype);return e.__wbg_ptr=t,st.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,st.unregister(this),t}free(){const e=this.__destroy_into_raw();t.__wbg_rangeproviderjs_free(e,0)}static new(e,_){const n=t.rangeproviderjs_new(r(e),r(_));return at.__wrap(n)}static withFetch(){const e=t.rangeproviderjs_withFetch();return at.__wrap(e)}}const gt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>t.__wbg_rowgroup_free(e>>>0,1)));class ct{static __wrap(t){t>>>=0;const e=Object.create(ct.prototype);return e.__wbg_ptr=t,gt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,gt.unregister(this),t}free(){const e=this.__destroy_into_raw();t.__wbg_rowgroup_free(e,0)}columns(){try{const r=t.__wbindgen_add_to_stack_pointer(-16);t.rowgroup_columns(r,this.__wbg_ptr);var e=b().getInt32(r+0,!0),_=b().getInt32(r+4,!0),n=R(e,_).slice();return t.__wbindgen_free(e,4*_,4),n}finally{t.__wbindgen_add_to_stack_pointer(16)}}}async function dt(t,e){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(_){if("application/wasm"==t.headers.get("Content-Type"))throw _;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",_)}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}{const _=await WebAssembly.instantiate(t,e);return _ instanceof WebAssembly.Instance?{instance:_,module:t}:_}}function ut(){const e={wbg:{}};return e.wbg.__wbg_buffer_609cc3eee51ed158=function(t){return r(_(t).buffer)},e.wbg.__wbg_call_672a4d21634d4a24=function(){return i((function(t,e){return r(_(t).call(_(e)))}),arguments)},e.wbg.__wbg_call_7cccdd69e0791ae2=function(){return i((function(t,e,n){return r(_(t).call(_(e),_(n)))}),arguments)},e.wbg.__wbg_call_b8adc8b1d0a0d8eb=function(){return i((function(t,e,n,i,o){return r(_(t).call(_(e),_(n),_(i),_(o)))}),arguments)},e.wbg.__wbg_columndescriptor_new=function(t){return r(V.__wrap(t))},e.wbg.__wbg_error_7534b8e9a36f1ab4=function(e,_){let n,r;try{n=e,r=_,console.error(g(e,_))}finally{t.__wbindgen_free(n,r,1)}},e.wbg.__wbg_fieldmetadata_new=function(t){return r(Y.__wrap(t))},e.wbg.__wbg_filemetadata_new=function(t){return r(N.__wrap(t))},e.wbg.__wbg_length_a446193dc22c12f8=function(t){return _(t).length},e.wbg.__wbg_new_23a2665fac83c611=function(t,e){try{var _={a:t,b:e},n=(t,e)=>{const n=_.a;_.a=0;try{return D(n,_.b,t,e)}finally{_.a=n}};return r(new Promise(n))}finally{_.a=_.b=0}},e.wbg.__wbg_new_8a6f238a6ece86ea=function(){return r(new Error)},e.wbg.__wbg_new_a12002a7f91c75be=function(t){return r(new Uint8Array(_(t)))},e.wbg.__wbg_newnoargs_105ed471475aaf50=function(t,e){return r(new Function(g(t,e)))},e.wbg.__wbg_newwithbyteoffsetandlength_f1dead44d1fc7212=function(t,e,n){return r(new Uint32Array(_(t),e>>>0,n>>>0))},e.wbg.__wbg_newwithbyteoffsetandlength_f254047f7e80e7ff=function(t,e,n){return r(new Int16Array(_(t),e>>>0,n>>>0))},e.wbg.__wbg_pageencodingdescriptor_new=function(t){return r(tt.__wrap(t))},e.wbg.__wbg_parquetchunk_new=function(t){return r(_t.__wrap(t))},e.wbg.__wbg_parquetfile_new=function(t){return r(rt.__wrap(t))},e.wbg.__wbg_queueMicrotask_98e746b9f850fe3d=function(t){queueMicrotask(_(t))},e.wbg.__wbg_queueMicrotask_c847cc8372bec908=function(t){return r(_(t).queueMicrotask)},e.wbg.__wbg_resolve_4851785c9c5f573d=function(t){return r(Promise.resolve(_(t)))},e.wbg.__wbg_rowgroup_new=function(t){return r(ct.__wrap(t))},e.wbg.__wbg_set_65595bdd868b3009=function(t,e,n){_(t).set(_(e),n>>>0)},e.wbg.__wbg_stack_0ed75d68575b0f3c=function(e,n){const r=w(_(n).stack,t.__wbindgen_malloc,t.__wbindgen_realloc),i=c;b().setInt32(e+4,i,!0),b().setInt32(e+0,r,!0)},e.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07=function(){const t="undefined"==typeof global?null:global;return p(t)?0:r(t)},e.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0=function(){const t="undefined"==typeof globalThis?null:globalThis;return p(t)?0:r(t)},e.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819=function(){const t="undefined"==typeof self?null:self;return p(t)?0:r(t)},e.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40=function(){const t="undefined"==typeof window?null:window;return p(t)?0:r(t)},e.wbg.__wbg_then_44b73946d2fb3e7d=function(t,e){return r(_(t).then(_(e)))},e.wbg.__wbg_then_48b406749878a531=function(t,e,n){return r(_(t).then(_(e),_(n)))},e.wbg.__wbg_valueOf_fdbb54fcdfe33477=function(t){return _(t).valueOf()},e.wbg.__wbindgen_array_new=function(){return r([])},e.wbg.__wbindgen_array_push=function(t,e){_(t).push(y(e))},e.wbg.__wbindgen_cb_drop=function(t){const e=y(t).original;if(1==e.cnt--)return e.a=0,!0;return!1},e.wbg.__wbindgen_closure_wrapper1479=function(t,e,_){return r(m(t,e,79,U))},e.wbg.__wbindgen_is_function=function(t){return"function"==typeof _(t)},e.wbg.__wbindgen_is_undefined=function(t){return void 0===_(t)},e.wbg.__wbindgen_memory=function(){return r(t.memory)},e.wbg.__wbindgen_number_new=function(t){return r(t)},e.wbg.__wbindgen_object_clone_ref=function(t){return r(_(t))},e.wbg.__wbindgen_object_drop_ref=function(t){y(t)},e.wbg.__wbindgen_string_new=function(t,e){return r(g(t,e))},e.wbg.__wbindgen_throw=function(t,e){throw new Error(g(t,e))},e.wbg.__wbindgen_uint8_array_new=function(e,_){var n=k(e,_).slice();t.__wbindgen_free(e,1*_,1);return r(n)},e}function wt(e,_){return t=e.exports,bt.__wbindgen_wasm_module=_,l=null,F=null,O=null,x=null,s=null,t.__wbindgen_start(),t}function lt(e){if(void 0!==t)return t;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module:e}=e):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const _=ut();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));return wt(new WebAssembly.Instance(e,_),e)}async function bt(e){if(void 0!==t)return t;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module_or_path:e}=e):console.warn("using deprecated parameters for the initialization function; pass a single object instead"));const _=ut();("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));const{instance:n,module:r}=await dt(await e,_);return wt(n,r)}export{V as ColumnDescriptor,Y as FieldMetadata,N as FileMetadata,J as GeometryInfoDescriptor,E as GeometryType,Q as MultiScaleInfo,tt as PageEncodingDescriptor,_t as ParquetChunk,rt as ParquetFile,ot as QuantizedGeometry,at as RangeProviderJs,ct as RowGroup,bt as default,I as enableTracing,lt as initSync,B as readFile,S as readFileFromBinary,j as readMetadata,C as readMetadataFromFile};
|
package/layers/ParquetLayer.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import r from"../PopupTemplate.js";import t from"../core/Clonable.js";import o from"../core/Collection.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import n from"../geometry/SpatialReference.js";import l from"./Layer.js";import{ParquetSource as a}from"./graphics/sources/ParquetSource.js";import{
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import r from"../PopupTemplate.js";import t from"../core/Clonable.js";import o from"../core/Collection.js";import{MultiOriginJSONMixin as i}from"../core/MultiOriginJSONSupport.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{subclass as p}from"../core/accessorSupport/decorators/subclass.js";import n from"../geometry/SpatialReference.js";import l from"./Layer.js";import{ParquetSource as a}from"./graphics/sources/ParquetSource.js";import{createCapabilities as m}from"./graphics/sources/support/clientSideDefaults.js";import{BlendLayer as d}from"./mixins/BlendLayer.js";import{CustomParametersMixin as u}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as y}from"./mixins/DisplayFilteredLayer.js";import{FeatureEffectLayer as f}from"./mixins/FeatureEffectLayer.js";import{FeatureReductionLayer as c}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{OrderedLayer as h}from"./mixins/OrderedLayer.js";import{PortalLayer as g}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as I}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as v}from"./mixins/TemporalLayer.js";import{labelsVisible as b}from"./support/commonProperties.js";import x from"./support/FeatureTemplate.js";import S from"./support/Field.js";import{defineFieldProperties as F}from"./support/fieldProperties.js";import{fixRendererFields as P,fixTimeInfoFields as w}from"./support/fieldUtils.js";import L from"./support/LabelClass.js";import{reader as O}from"./support/labelingInfo.js";import{parquetGeometryTypeKebabDict as T}from"./support/parquetLayerUtils.js";import{rendererTypes as R}from"../renderers/support/typeUtils.js";import q from"../rest/support/Query.js";import{createPopupTemplate as D}from"../support/popupUtils.js";const C=F();let _=class extends(y(c(f(d(h(v(I(j(g(i(u(t.ClonableMixin(l))))))))))))){constructor(e){super(e),this.capabilities=m(!1,!1),this.copyright=null,this.fields=null,this.fieldsIndex=null,this.geometrySourceInfo=null,this.metadata=null,this.labelsVisible=!0,this.labelingInfo=null,this.objectIdField=null,this.outFields=null,this.popupTemplate=null,this.source=null,this.spatialReference=n.WGS84,this.templates=null,this.title="Parquet",this.type="parquet",this.urls=new o}async load(e){return this.addResolvingPromise(this._load(e)),this}get defaultPopupTemplate(){return this.createPopupTemplate()}get geometryType(){return this.source.geometryInfo.geometryType}set renderer(e){P(e,this.fieldsIndex),this._set("renderer",e)}createPopupTemplate(e){return D(this,e)}createQuery(){const e=new q;return e.returnGeometry=!0,e.outFields=["*"],e}async createSource(e){const r=new a({loadOptions:{objectIdField:this.objectIdField,geometrySourceInfo:this.geometrySourceInfo,url:this.urls.getItemAt(0)??"",metadata:this.metadata},customParameters:this.customParameters??void 0});return await r.load(e),r}getFieldDomain(e,r){return null}getField(e){return this.fieldsIndex.get(e)}async _load(e){const r=await this.createSource(e);this._set("source",r),this.read(r.sourceJSON,{origin:"service"}),this.revert(["objectIdField","fields","timeInfo"],"service"),P(this.renderer,this.fieldsIndex),w(this.timeInfo,this.fieldsIndex)}};e([s({readOnly:!0,json:{read:!1,write:!1}})],_.prototype,"capabilities",void 0),e([s({type:String})],_.prototype,"copyright",void 0),e([s({readOnly:!0})],_.prototype,"defaultPopupTemplate",null),e([s({type:[S],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],_.prototype,"fields",void 0),e([s(C.fieldsIndex)],_.prototype,"fieldsIndex",void 0),e([s({type:Object})],_.prototype,"geometrySourceInfo",void 0),e([s({json:{read:{reader:T.read}}})],_.prototype,"geometryType",null),e([s()],_.prototype,"metadata",void 0),e([s(b)],_.prototype,"labelsVisible",void 0),e([s({type:[L],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:O},write:!0}})],_.prototype,"labelingInfo",void 0),e([s({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],_.prototype,"objectIdField",void 0),e([s(C.outFields)],_.prototype,"outFields",void 0),e([s({type:r,json:{name:"popupInfo",write:!0}})],_.prototype,"popupTemplate",void 0),e([s({types:R,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"}}}})],_.prototype,"renderer",null),e([s({json:{read:!1},cast:null,type:a,readOnly:!0})],_.prototype,"source",void 0),e([s({type:n})],_.prototype,"spatialReference",void 0),e([s({type:[x]})],_.prototype,"templates",void 0),e([s()],_.prototype,"title",void 0),e([s({json:{read:!1},readOnly:!0})],_.prototype,"type",void 0),e([s({type:o.ofType(String)})],_.prototype,"urls",void 0),_=e([p("esri.layers.ParquetLayer")],_);const U=_;export{U 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import i from"../../core/Error.js";import r from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{Integer as n,ensureClass as o}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as a}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as u}from"../../core/accessorSupport/decorators/subclass.js";import m from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{getInfo as c}from"../../geometry/support/spatialReferenceUtils.js";import{sanitizeUrl as d}from"../support/arcgisLayerUrl.js";import{url as h}from"../support/commonProperties.js";import f from"../support/DimensionalDefinition.js";import y from"../support/MultidimensionalSubset.js";import{interpolationKebab as g}from"../support/rasterEnums.js";import R from"../support/RasterFunction.js";import b from"../support/TileInfo.js";import{isFunctionRaster as I}from"../support/rasterDatasets/datasetUtils.js";import x from"../support/rasterDatasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as S,getDefaultVariableInfo as F,isMultiSliceOrRangeDefinition as w,convertOleDateTimeToEpoch as v,getSubsetVariablesFromMdInfo as _,getDefaultMultidimensionalDefinition as j}from"../support/rasterDatasets/multidimensionalUtils.js";import{snapToRaster as D,clip as J}from"../support/rasterFunctions/clipUtils.js";import{create as N}from"../support/rasterFunctions/rasterFunctionHelper.js";import{load as T,projectExtent as O,projectPolygon as z}from"../support/rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as H}from"../support/rasterFunctions/stretchUtils.js";import{getVariableRasterInfo as P,getDefaultInterpolation as E,matchPresetRenderer as C,getDefaultBandCombination as M,getFunctionColorRamp as U,createDefaultRenderer as L,normalizeRendererJSON as k}from"../../renderers/support/rasterRendererHelper.js";import q from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as A,websceneRasterRendererTypes as B,read as V}from"../../renderers/support/rasterTypeUtils.js";import $ from"../../rest/support/ImageHistogramParameters.js";import G from"../../rest/support/ImageSample.js";import W from"../../rest/support/ImageSampleParameters.js";import K from"../../rest/support/ImageSampleResult.js";const Q=1e3,X=X=>{let Y=class extends X{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=I(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",d(e,r.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer;return V(r,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=o($,e).clone();const{serviceRasterInfo:r}=this;if(null==r)throw new i("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:a}=r;s.spatialReference.equals(a)||(await T(),n="extent"===s.type?O(s,a):z(s,a));const l=e.pixelSize??new m({x:r.pixelSize.x,y:r.pixelSize.y,spatialReference:a}),{extent:u,width:p,height:c}=D(r,n,l),d=await this.fetchPixels(u,p,c,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new i("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await J(d.pixelBlock,u,n),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):H(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=S({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:r}=this.raster,s=F(r,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,o=P(r,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const r=e?.pixelBlock;if(!(null!=r&&r.pixels&&r.pixels.length>0))return null;await this.updateRenderer();const s=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:s,symbolizer:this.symbolizer},i);return n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const r=c(e);return b.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,i,r,s={}){if(Z(this),s.requestAsImageElement){const n=this.getTileUrl(e,i,r);return t(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const t=s.tileInfo||n.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,i,r,t),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,i,r,s)}async fetchPixels(e,t,i,r={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,r))}async getSamples(e,t){if(await this.load(),(e=o(W,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new i("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const r=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:r},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),a=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new K({samples:a})}async identify(e,t={}){await this.load();const{raster:r,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo){if(!(s.hasMultidimensionalTranspose&&!!(w(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new i("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return r.identify(e,t)}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(v(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return _(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=j(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&I(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then((async()=>{if(!this._rasterJobHandler)return;Z(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,I(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{}))}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:i,type:r}=t;if("multipoint"===r)return t.points.map((e=>new m({x:e[0],y:e[1],spatialReference:i})));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const i=await import("../../geometry/operators/densifyOperator.js"),s=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),n=Math.min(e.sampleCount||100,Q);let o=e.sampleDistance;if(!o){o=s/(n+(2===r.paths[0].length?1:0))}r=i.execute(t,o,{unit:"meters"})}return r.paths.flatMap((e=>e.map((e=>new m({x:e[0],y:e[1],spatialReference:i})))))}const s=Math.min(e.sampleCount||100,Q),n="extent"===t.type,o=n?t:t.extent,a=Math.sqrt(o.width*o.height/s),l=o.height/a,u=o.width/a,{xmin:p,ymax:c}=o,d=[];for(let h=0;h<l;h++)for(let e=0;e<u;e++){const r=new m({x:p+(e+.5)*a,y:c-(h+.5)*a,spatialReference:i});(n||t.contains(r))&&d.push(r)}return d}_configDefaultInterpolation(){if(null==this.interpolation){Z(this);const{raster:e}=this,t=E(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){Z(this);const{rasterInfo:t}=this.raster,i=F(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=C({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??M(t)),!this.renderer||"override"===e){const e=U(this.raster),i=n?.renderer??L(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(a>1e24||l<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const o=k({...this.renderer.toJSON(),variableName:s}),a=P(t,s);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new q({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=L(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else r.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&I(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",R.fromJSON(e)))}let e,t=this.raster,i=!1;I(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:r}=this;if(r){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const s=N(r.functionDefinition?.toJSON()??r.toJSON(),i),n=new x({rasterFunction:s});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!r)return;const{bandIds:s}=this,{bandCount:n}=this.raster.rasterInfo,o=s?.length?s.some((e=>e>=n)):n>=3;s&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,r=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),s=(i.pixelSize.x+i.pixelSize.y)/2*r;if(!e.dataSeries?.length)return[new G({location:e.location,pixelValue:e.value,locationId:t,resolution:s})];const n=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:r},o)=>{const a={Variables:r[0].variableName,Dimensions:r.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of r){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];a[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const l=new G({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:s,attributes:a});n.push(l)})),n}};function Z(e){if(!e.raster||!e.serviceRasterInfo)throw new i("imagery-tile","no raster")}return e([s({clonable:!1})],Y.prototype,"_cachedRasterFunctionJson",void 0),e([s({clonable:!1})],Y.prototype,"_compatibleFullExtent",void 0),e([s({clonable:!1})],Y.prototype,"_isConstructedFromFunctionRaster",void 0),e([s({clonable:!1})],Y.prototype,"_rasterFunctionUpdatePromise",void 0),e([s({type:[n],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Y.prototype,"bandIds",void 0),e([s({json:{origins:{service:{read:{source:"copyrightText"}}}}})],Y.prototype,"copyright",void 0),e([s({json:{read:!1}})],Y.prototype,"fullExtent",null),e([s({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),a(g)],Y.prototype,"interpolation",void 0),e([s()],Y.prototype,"ioConfig",void 0),e([s({type:[f],json:{write:!0}})],Y.prototype,"multidimensionalDefinition",null),e([s({type:y,json:{write:!0}})],Y.prototype,"multidimensionalSubset",void 0),e([s()],Y.prototype,"raster",void 0),e([s({type:R})],Y.prototype,"rasterFunction",null),e([s()],Y.prototype,"serviceRasterInfo",void 0),e([s()],Y.prototype,"sourceJSON",void 0),e([s({readOnly:!0,type:p,json:{read:!1}})],Y.prototype,"spatialReference",void 0),e([s({type:b})],Y.prototype,"tileInfo",void 0),e([s(h)],Y.prototype,"url",null),e([s()],Y.prototype,"renderer",null),e([s({types:A,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:B,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],Y.prototype,"internalRenderer",null),e([l("internalRenderer")],Y.prototype,"readRenderer",null),e([s({clonable:!1})],Y.prototype,"symbolizer",void 0),Y=e([u("esri.layers.mixins.ImageryTileMixin")],Y),Y};export{X as ImageryTileMixin};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../request.js";import i from"../../core/Error.js";import r from"../../core/Logger.js";import{property as s}from"../../core/accessorSupport/decorators/property.js";import{Integer as n,ensureClass as o}from"../../core/accessorSupport/ensureType.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{enumeration as a}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../../core/accessorSupport/decorators/subclass.js";import u from"../../geometry/Point.js";import p from"../../geometry/SpatialReference.js";import{getInfo as c}from"../../geometry/support/spatialReferenceUtils.js";import{sanitizeUrl as d}from"../support/arcgisLayerUrl.js";import{url as h}from"../support/commonProperties.js";import f from"../support/DimensionalDefinition.js";import y from"../support/MultidimensionalSubset.js";import{interpolationKebab as g}from"../support/rasterEnums.js";import b from"../support/RasterFunction.js";import R from"../support/TileInfo.js";import{isFunctionRaster as I}from"../support/rasterDatasets/datasetUtils.js";import x from"../support/rasterDatasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as S,getDefaultVariableInfo as w,isMultiSliceOrRangeDefinition as F,convertOleDateTimeToEpoch as v,getSubsetVariablesFromMdInfo as _,getDefaultMultidimensionalDefinition as j}from"../support/rasterDatasets/multidimensionalUtils.js";import{snapToRaster as D,clip as J}from"../support/rasterFunctions/clipUtils.js";import{create as N}from"../support/rasterFunctions/rasterFunctionHelper.js";import{load as T,projectExtent as O,projectPolygon as z}from"../support/rasterFunctions/rasterProjectionHelper.js";import{computeStatisticsHistograms as H}from"../support/rasterFunctions/stretchUtils.js";import{getVariableRasterInfo as P,getDefaultInterpolation as E,matchPresetRenderer as C,getDefaultBandCombination as M,getFunctionColorRamp as U,createDefaultRenderer as L,normalizeRendererJSON as k}from"../../renderers/support/rasterRendererHelper.js";import q from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as A,websceneRasterRendererTypes as B,read as V}from"../../renderers/support/rasterTypeUtils.js";import $ from"../../rest/support/ImageHistogramParameters.js";import G from"../../rest/support/ImageSample.js";import W from"../../rest/support/ImageSampleParameters.js";import K from"../../rest/support/ImageSampleResult.js";const Q=1e3,X=X=>{let Y=class extends X{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=I(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",d(e,r.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find((({name:t})=>t===e));return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer;return V(r,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=o($,e).clone();const{serviceRasterInfo:r}=this;if(null==r)throw new i("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:a}=r;if(!s.spatialReference.equals(a)){await T();const e="extent"===s.type?O(s,a):z(s,a);if(null==e)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const l=e.pixelSize??new u({x:r.pixelSize.x,y:r.pixelSize.y,spatialReference:a}),{extent:m,width:p,height:c}=D(r,n,l),d=await this.fetchPixels(m,p,c,{...t,interpolation:"nearest"});if(null==d.pixelBlock)throw new i("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await J(d.pixelBlock,m,n),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):H(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=S({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:r}=this.raster,s=w(r,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,o=P(r,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const r=e?.pixelBlock;if(!(null!=r&&r.pixels&&r.pixels.length>0))return null;await this.updateRenderer();const s=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:s,symbolizer:this.symbolizer},i);return n}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const r=c(e);return R.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,i,r,s={}){if(Z(this),s.requestAsImageElement){const n=this.getTileUrl(e,i,r);return t(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then((e=>e.data))}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const t=s.tileInfo||n.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(e,i,r,t),pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,i,r,s)}async fetchPixels(e,t,i,r={}){return null!=this.serviceRasterInfo.multidimensionalInfo&&null==(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition?{extent:e,pixelBlock:null}:(await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i),this.raster.fetchPixels(e,t,i,r))}async getSamples(e,t){if(await this.load(),(e=o(W,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new i("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const r=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:r},n=(await this._getSampleLocations(e)).map((e=>this.identify(e,s).then((t=>(t.location=e,t))))),a=(await Promise.all(n)).flatMap(((e,t)=>this._convertRasterIdentifyResultToSample(e,t)));return new K({samples:a})}async identify(e,t={}){await this.load();const{raster:r,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo){if(!(s.hasMultidimensionalTranspose&&!!(F(t.multidimensionalDefinition)||t.transposedVariableName||t.timeExtent))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new i("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");return r.identify(e,t)}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some((e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some((e=>"StdTime"===e.name)))))}getStandardTimeValue(e){return new Date(v(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return _(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=j(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&I(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then((async()=>{if(!this._rasterJobHandler)return;Z(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,I(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch((()=>{})),this.renderer&&this.updateRenderer()})).catch((()=>{}))}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:i,type:r}=t;if("multipoint"===r)return t.points.map((e=>new u({x:e[0],y:e[1],spatialReference:i})));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const i=await import("../../geometry/operators/densifyOperator.js"),s=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),n=Math.min(e.sampleCount||100,Q);let o=e.sampleDistance;if(!o){o=s/(n+(2===r.paths[0].length?1:0))}r=i.execute(t,o,{unit:"meters"})}return r.paths.flatMap((e=>e.map((e=>new u({x:e[0],y:e[1],spatialReference:i})))))}const s=Math.min(e.sampleCount||100,Q),n="extent"===t.type,o=n?t:t.extent,a=Math.sqrt(o.width*o.height/s),l=o.height/a,m=o.width/a,{xmin:p,ymax:c}=o,d=[];for(let h=0;h<l;h++)for(let e=0;e<m;e++){const r=new u({x:p+(e+.5)*a,y:c-(h+.5)*a,spatialReference:i});(n||t.contains(r))&&d.push(r)}return d}_configDefaultInterpolation(){if(null==this.interpolation){Z(this);const{raster:e}=this,t=E(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){Z(this);const{rasterInfo:t}=this.raster,i=w(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=C({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??M(t)),!this.renderer||"override"===e){const e=U(this.raster),i=n?.renderer??L(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(a>1e24||l<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const o=k({...this.renderer.toJSON(),variableName:s}),a=P(t,s);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new q({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=L(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else r.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&I(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",b.fromJSON(e)))}let e,t=this.raster,i=!1;I(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:r}=this;if(r){const i={raster:t};e.length>1&&e.forEach((e=>i[e.url]=e));const s=N(r.functionDefinition?.toJSON()??r.toJSON(),i),n=new x({rasterFunction:s});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!r)return;const{bandIds:s}=this,{bandCount:n}=this.raster.rasterInfo,o=s?.length?s.some((e=>e>=n)):n>=3;s&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,r=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),s=(i.pixelSize.x+i.pixelSize.y)/2*r;if(!e.dataSeries?.length)return[new G({location:e.location,pixelValue:e.value,locationId:t,resolution:s})];const n=[];return e.dataSeries.forEach((({value:i,multidimensionalDefinition:r},o)=>{const a={Variables:r[0].variableName,Dimensions:r.flatMap((({dimensionName:e})=>e)).join(",")};for(const{dimensionName:e,values:t}of r){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];a[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const l=new G({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:s,attributes:a});n.push(l)})),n}};function Z(e){if(!e.raster||!e.serviceRasterInfo)throw new i("imagery-tile","no raster")}return e([s({clonable:!1})],Y.prototype,"_cachedRasterFunctionJson",void 0),e([s({clonable:!1})],Y.prototype,"_compatibleFullExtent",void 0),e([s({clonable:!1})],Y.prototype,"_isConstructedFromFunctionRaster",void 0),e([s({clonable:!1})],Y.prototype,"_rasterFunctionUpdatePromise",void 0),e([s({type:[n],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Y.prototype,"bandIds",void 0),e([s({json:{origins:{service:{read:{source:"copyrightText"}}}}})],Y.prototype,"copyright",void 0),e([s({json:{read:!1}})],Y.prototype,"fullExtent",null),e([s({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),a(g)],Y.prototype,"interpolation",void 0),e([s()],Y.prototype,"ioConfig",void 0),e([s({type:[f],json:{write:!0}})],Y.prototype,"multidimensionalDefinition",null),e([s({type:y,json:{write:!0}})],Y.prototype,"multidimensionalSubset",void 0),e([s()],Y.prototype,"raster",void 0),e([s({type:b})],Y.prototype,"rasterFunction",null),e([s()],Y.prototype,"serviceRasterInfo",void 0),e([s()],Y.prototype,"sourceJSON",void 0),e([s({readOnly:!0,type:p,json:{read:!1}})],Y.prototype,"spatialReference",void 0),e([s({type:R})],Y.prototype,"tileInfo",void 0),e([s(h)],Y.prototype,"url",null),e([s()],Y.prototype,"renderer",null),e([s({types:A,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:B,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type&&"flow"!==e.type})}}}}})],Y.prototype,"internalRenderer",null),e([l("internalRenderer")],Y.prototype,"readRenderer",null),e([s({clonable:!1})],Y.prototype,"symbolizer",void 0),Y=e([m("esri.layers.mixins.ImageryTileMixin")],Y),Y};export{X as ImageryTileMixin};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../geometry/Point.js";import t from"./EphemeralBlockCache.js";import{projectExtent as n,projectResolution as o,snapPyramid as l}from"../rasterFunctions/rasterProjectionHelper.js";const r=new Map,c=new t;function i(e,t){return null==t?e:`${e}?sliceId=${t}`}function u(e,t){const n={extent:null,rasterInfo:t,cache:new Map},o=r.get(e);return o?(o.push(n),o.length-1):(r.set(e,[n]),0)}function a(e,t){const n=r.get(e);n&&(n[t]=null,n.some((e=>null!=e))||r.delete(e))}function f(e){r.delete(e)}function s(e,t,n){const o=r.get(e);if(!o)return null==t?c.decreaseRefCount(e,n):0;if(null==t||null==o[t])return c.decreaseRefCount(e,n);const l=o[t]?.cache,i=l?.get(n);if(l&&i){if(i.refCount--,0===i.refCount){l.delete(n);for(let e=0;e<o.length;e++)o[e]?.cache.delete(n);i.controller&&i.controller.abort()}return i.refCount}return 0}function m(e,t,n){const o=r.get(e);if(!o)return null==t?c.getBlock(e,n):null;if(null==t||null==o[t]){for(let e=0;e<o.length;e++){const t=o[e]?.cache.get(n);if(t)return t.refCount++,t.block}return c.getBlock(e,n)}const l=o[t]?.cache.get(n);if(l)return l.refCount++,l.block;for(let r=0;r<o.length;r++){if(r===t||!o[r])continue;const e=o[r]?.cache,l=e?.get(n);if(e&&l)return l.refCount++,e.set(n,l),l.block}return null}function h(e,t,n,o,l=null){const i=r.get(e);if(!i)return void(null==t&&c.putBlock(e,n,o,l));if(null==t||null==i[t])return void c.putBlock(e,n,o,l);const u={refCount:1,block:o,isResolved:!1,isRejected:!1,controller:l};o.then((()=>u.isResolved=!0)).catch((()=>u.isRejected=!0)),i[t]?.cache.set(n,u)}function x(e,t,n){const o=r.get(e);o?null!=t&&null!=o[t]?o[t]?.cache.delete(n):c.deleteBlock(e,n):null==t&&c.deleteBlock(e,n)}function d(e,t){const n=r.get(e);return n?n[t]??null:null}function g(t,r,c,i,u,a,f=null){const s=d(t,r);if(!s)return;const m=s.extent,{cache:h,rasterInfo:x}=s;if(m&&m.xmin===c.xmin&&m.xmax===c.xmax&&m.ymin===c.ymin&&m.ymax===c.ymax)return;i=i??0;const g=c.clone().normalize(),{spatialReference:y,transform:p}=x,k=new Set;for(let d=0;d<g.length;d++){const t=g[d];if(t.xmax-t.xmin<=i||t.ymax-t.ymin<=i)continue;let r=n(t,y,f);null!=p&&(r=p.inverseTransform(r));const c=new e({x:i,y:i,spatialReference:t.spatialReference});if(null==u&&!(u=o(c,y,t,f)))return;const{pyramidLevel:s,pyramidResolution:m,excessiveReading:h}=l(u,x,a||"closest");if(h)return;const{storageInfo:M}=x,{origin:R}=M,{x:C,y:B}=m,b=Math.max(0,Math.floor((r.xmin-R.x)/C)),v=Math.max(0,Math.floor((R.y-r.ymax)/B)),w=Math.ceil(r.width/C-.1),j=Math.ceil(r.height/B-.1),$=s>0?M.pyramidBlockWidth:M.blockWidth,I=s>0?M.pyramidBlockHeight:M.blockHeight,H=M.blockBoundary[s];if(!H)continue;const E=1,P=Math.max(H.minCol,Math.floor(b/$)-E),W=Math.max(H.minRow,Math.floor(v/I)-E),z=Math.min(H.maxCol,Math.floor((b+w-1)/$)+E),F=Math.min(H.maxRow,Math.floor((v+j-1)/I)+E);for(let e=W;e<=F;e++)for(let t=P;t<=z;t++)k.add(`${s}/${e}/${t}`)}h.forEach(((e,t)=>{if(!k.has(t)){const e=h.get(t);(null==e||e.isResolved||e.isRejected)&&h.delete(t)}})),s.extent={xmin:c.xmin,ymin:c.ymin,xmax:c.xmax,ymax:c.ymax}}export{s as decreaseRefCount,x as deleteBlock,f as deleteRaster,m as getBlock,i as getRasterId,h as putBlock,u as register,a as unregister,g as update};
|
|
5
|
+
import e from"../../../geometry/Point.js";import t from"./EphemeralBlockCache.js";import{projectExtent as n,projectResolution as o,snapPyramid as l}from"../rasterFunctions/rasterProjectionHelper.js";const r=new Map,c=new t;function i(e,t){return null==t?e:`${e}?sliceId=${t}`}function u(e,t){const n={extent:null,rasterInfo:t,cache:new Map},o=r.get(e);return o?(o.push(n),o.length-1):(r.set(e,[n]),0)}function a(e,t){const n=r.get(e);n&&(n[t]=null,n.some((e=>null!=e))||r.delete(e))}function f(e){r.delete(e)}function s(e,t,n){const o=r.get(e);if(!o)return null==t?c.decreaseRefCount(e,n):0;if(null==t||null==o[t])return c.decreaseRefCount(e,n);const l=o[t]?.cache,i=l?.get(n);if(l&&i){if(i.refCount--,0===i.refCount){l.delete(n);for(let e=0;e<o.length;e++)o[e]?.cache.delete(n);i.controller&&i.controller.abort()}return i.refCount}return 0}function m(e,t,n){const o=r.get(e);if(!o)return null==t?c.getBlock(e,n):null;if(null==t||null==o[t]){for(let e=0;e<o.length;e++){const t=o[e]?.cache.get(n);if(t)return t.refCount++,t.block}return c.getBlock(e,n)}const l=o[t]?.cache.get(n);if(l)return l.refCount++,l.block;for(let r=0;r<o.length;r++){if(r===t||!o[r])continue;const e=o[r]?.cache,l=e?.get(n);if(e&&l)return l.refCount++,e.set(n,l),l.block}return null}function h(e,t,n,o,l=null){const i=r.get(e);if(!i)return void(null==t&&c.putBlock(e,n,o,l));if(null==t||null==i[t])return void c.putBlock(e,n,o,l);const u={refCount:1,block:o,isResolved:!1,isRejected:!1,controller:l};o.then((()=>u.isResolved=!0)).catch((()=>u.isRejected=!0)),i[t]?.cache.set(n,u)}function x(e,t,n){const o=r.get(e);o?null!=t&&null!=o[t]?o[t]?.cache.delete(n):c.deleteBlock(e,n):null==t&&c.deleteBlock(e,n)}function d(e,t){const n=r.get(e);return n?n[t]??null:null}function g(t,r,c,i,u,a,f=null){const s=d(t,r);if(!s)return;const m=s.extent,{cache:h,rasterInfo:x}=s;if(m&&m.xmin===c.xmin&&m.xmax===c.xmax&&m.ymin===c.ymin&&m.ymax===c.ymax)return;i=i??0;const g=c.clone().normalize(),{spatialReference:y,transform:p}=x,k=new Set;for(let d=0;d<g.length;d++){const t=g[d];if(t.xmax-t.xmin<=i||t.ymax-t.ymin<=i)continue;let r=n(t,y,f);if(null==r)continue;if(null!=p&&(r=p.inverseTransform(r),null==r))continue;const c=new e({x:i,y:i,spatialReference:t.spatialReference});if(null==u&&!(u=o(c,y,t,f)))return;const{pyramidLevel:s,pyramidResolution:m,excessiveReading:h}=l(u,x,a||"closest");if(h)return;const{storageInfo:M}=x,{origin:R}=M,{x:C,y:B}=m,b=Math.max(0,Math.floor((r.xmin-R.x)/C)),v=Math.max(0,Math.floor((R.y-r.ymax)/B)),w=Math.ceil(r.width/C-.1),j=Math.ceil(r.height/B-.1),$=s>0?M.pyramidBlockWidth:M.blockWidth,I=s>0?M.pyramidBlockHeight:M.blockHeight,H=M.blockBoundary[s];if(!H)continue;const E=1,P=Math.max(H.minCol,Math.floor(b/$)-E),W=Math.max(H.minRow,Math.floor(v/I)-E),z=Math.min(H.maxCol,Math.floor((b+w-1)/$)+E),F=Math.min(H.maxRow,Math.floor((v+j-1)/I)+E);for(let e=W;e<=F;e++)for(let t=P;t<=z;t++)k.add(`${s}/${e}/${t}`)}h.forEach(((e,t)=>{if(!k.has(t)){const e=h.get(t);(null==e||e.isResolved||e.isRejected)&&h.delete(t)}})),s.extent={xmin:c.xmin,ymin:c.ymin,xmax:c.xmax,ymax:c.ymax}}export{s as decreaseRefCount,x as deleteBlock,f as deleteRaster,m as getBlock,i as getRasterId,h as putBlock,u as register,a as unregister,g as update};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{numberMaxFloat32 as e}from"../../../core/mathUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getPixelValueRange as o}from"../rasterFormats/pixelRangeUtils.js";import a from"./BaseRasterFunction.js";import{createRemapLUT as u,maxMapSizeGpu as r,lookupPixels as i,lookupBandValues as l,remap as p,createRangeMaps as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{numberMaxFloat32 as e}from"../../../core/mathUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{getPixelValueRange as o}from"../rasterFormats/pixelRangeUtils.js";import a from"./BaseRasterFunction.js";import{createRemapLUT as u,maxMapSizeGpu as r,lookupPixels as i,lookupBandValues as l,remap as p,createRangeMaps as m}from"./pixelUtils.js";import c from"./RemapFunctionArguments.js";let g=class extends a{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:e}=t;this.outputPixelType=this._getOutputPixelType(e),t.pixelType=this.outputPixelType,t.bandCount=1;const{statistics:s}=t;this._removeStatsHistColormapVAT(t);const{allowUnmatched:n,replacementValue:o,outputValues:a,inputRanges:i,noDataRanges:l,isLastInputRangeInclusive:p}=this.functionArguments;if(null!=s&&s.length&&a?.length)if(n&&null==o){const e=Math.min.apply(null,[...a,s[0].min]),n=Math.max.apply(null,[...a,s[0].max]);t.statistics=[{...s[0],min:e,max:n}]}else{let e=a[0],u=e;for(let t=0;t<a.length;t++)e=e>a[t]?a[t]:e,u=u>a[t]?u:a[t];n&&null!=o&&(e=Math.min(e,o),u=Math.max(u,o)),t.statistics=[{...s[0],min:e,max:u}]}this.rasterInfo=t,this.lookup=n?null:u({srcPixelType:e,inputRanges:i,outputValues:a,noDataRanges:l,allowUnmatched:n,isLastInputRangeInclusive:p,outputPixelType:this.outputPixelType});return{success:!0,supportsGPU:(!a||a.length<=r)&&(!l||l.length<=r)}}_processPixels(t){const e=t.pixelBlocks?.[0];if(null==e)return null;const{lookup:s,outputPixelType:n}=this;if(s){const t=i(e,{lut:[s.lut],offset:s.offset,outputPixelType:n});return null!=t&&s.mask&&(t.mask=l(e.pixels[0],e.mask,s.mask,s.offset,"u8")),t}const{inputRanges:o,outputValues:a,noDataRanges:u,allowUnmatched:r,isLastInputRangeInclusive:m,replacementValue:c}=this.functionArguments;return p(e,{inputRanges:o,outputValues:a,noDataRanges:u,outputPixelType:n,allowUnmatched:r,isLastInputRangeInclusive:m,replacementValue:c})}_getWebGLParameters(){const{allowUnmatched:t,noDataRanges:s,isLastInputRangeInclusive:n}=this.functionArguments,a=this.functionArguments.inputRanges??[],u=this.functionArguments.outputValues??[],i=m(a,u,n),l=new Float32Array(2*r);l.fill(e),s?.length&&l.set(s);return{allowUnmatched:t,rangeMaps:i,noDataRanges:l,clampRange:o(this.outputPixelType),replacementValue:this.functionArguments.replacementValue}}};t([s({json:{write:!0,name:"rasterFunction"}})],g.prototype,"functionName",void 0),t([s({type:c,json:{write:!0,name:"rasterFunctionArguments"}})],g.prototype,"functionArguments",void 0),t([s()],g.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],g.prototype,"lookup",void 0),g=t([n("esri.layers.support.rasterFunctions.RemapFunction")],g);const h=g;export{h 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{createResolver as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../../../core/unitUtils.js";import i from"../../../geometry/Extent.js";import{P as r,a as s,g as a,h as l,j as c}from"../../../chunks/pe.js";import f from"../../../geometry/Point.js";import u from"../../../geometry/Polygon.js";import{projectWithoutEngine as m}from"../../../geometry/projection.js";import x from"../../../geometry/SpatialReference.js";import{getInfo as h}from"../../../geometry/support/spatialReferenceUtils.js";var p;function g(){if(!j)throw new t("rasterprojectionhelper-project","projection operator is not loaded")}!function(e){e[e.None=0]="None",e[e.North=1]="North",e[e.South=2]="South",e[e.Both=3]="Both"}(p||(p={}));const y=(e,t,n,o=0)=>{if(1===n[0])return[0,0];let i=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(i=i>e[g]?e[g]:i,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-i)/l/n[0],u=(a-s)/c/n[1],m=2*o;let x=0,h=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,o=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,i=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((o-e[n+2*c+2])/f),s=Math.abs((i-e[n+2*c+3])/u);if(r+s>x&&(x=r+s,p=[r,s]),m&&x>m){h=!0;break}}if(h)break}return p},d={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},w=32,M=4,R=M,S=new Map,P=new Map,b=500,G=39.37,k=96;let N,E,T,j=!1;async function v(){return N||(N=n(),E=await import("../../../geometry/operators/projectOperator.js"),T=await import("../../../geometry/operators/support/geographicTransformationUtils.js"),E.isLoaded()||await E.load(),T.isLoaded()||await T.load(),j=!0,N.resolve()),N.promise}function C(e,t,n){if(g(),n){const n=E.execute(e,t);return T.getTransformation(t,e.spatialReference,n)}return T.getTransformation(e.spatialReference,t,e)}function _(e,t,n,o){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;g();const s=n.center,a=new i({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=E.execute(a,t,{geographicTransformation:o}),c=ee(t);return null==l||null!=c&&l.width>=c?z(e,r,t):{x:l.width,y:l.height}}function z(e,t,n){const i=o(t)/o(n);return{x:e.x*i,y:e.y*i}}function L(e,n,i){const{spatialReference:r}=i;if(!r||!n||r.equals(n))return e;if(r.isGeographic&&n.isGeographic)return z(e,r,n);if(g(),!j)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*o(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const f=256,m=s*f/2,x=a*f/2,{x:h,y:p}=i.center,y=[];for(let t=0;t<=f;t++)y.push([h-m,p-x+t*a]);for(let t=1;t<=f;t++)y.push([h-m+t*s,p+x]);for(let t=1;t<=f;t++)y.push([h+m,p+x-t*a]);for(let t=1;t<f;t++)y.push([h+m-t*s,p-x]);y.push(y[0]);const d=new u({rings:[y],spatialReference:r}),w=E.execute(d,n);if(!w)return z(e,r,n);const M=w.extent,R=ee(n);if(null==M||null!=R&&M.width>=R)return z(e,r,n);const S=he(w.rings),P=s*a*f*f,b=Math.sqrt(S/P)/c,G={x:M.width/c/f,y:M.height/c/f},k={x:s*b,y:a*b},N=G.x*G.y;return Math.abs(N-k.x*k.y)/N<.1?G:k}function I(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*o(t)*k*G}function O(e,t){const{pixelSize:n,extent:o}=e;return I(L(n,t,o),t)}function W(e,t=.01){return o(e)?t/o(e):0}function A(e,t,n,o=!0){const i=e.spatialReference;if(i.equals(t))return e;g();const r=E.execute(e,t,{geographicTransformation:n});return o&&r?(B([e],[r],i,t),r):r}function B(e,t,n,o){const i=te(n,!0),r=te(o,!0),s=W(n,b),a=W(o,b);if(s&&null!=i&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:o}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(o-i[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(o-i[1])<s&&(n.x+=r[1]-r[0])}}function F(e){const{inSR:t,outSR:n,preferPE:o}=e;if(t.equals(n)){const{points:t}=K(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return U(e);if(o){if(t.isGeographic)return Y(e);if(null!=J(t))return Y(e)}return q(e)}function q(e){const{points:t}=K(e,null),{inSR:n,outSR:o,datumTransformation:i}=e,r=t.map((e=>new f(e[0],e[1],n))),s=E.executeMany(r,o,{geographicTransformation:i});return i&&B(r,s,n,o),s.map((e=>e?[e.x,e.y]:[NaN,NaN]))}function Y(e){const{inSR:t,outSR:n,datumTransformation:o}=e,i=J(t),{points:c,mask:f}=K(e,i);if(!t.isGeographic){const e=t.wkid?r.coordsys(t.wkid):r.fromString(t.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,t.wkt2||t.wkt);a.projToGeog(e,c.length,c)}if(null!=o&&o.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=c.map((([e])=>e>t?1:e<-179.9955?-1:0))),o.steps.forEach((e=>{const t=e.wkid?r.geogtran(e.wkid):r.fromString(s.PE_TYPE_GEOGTRAN,e.wkt);l.geogToGeog(t,c.length,c,null,e.isInverse?s.PE_TRANSFORM_2_TO_1:s.PE_TRANSFORM_1_TO_2)})),e)for(let n=0;n<c.length;n++){const o=e[n],i=c[n][0],r=i>t?1:i<-179.9955?-1:0;o&&r&&o!==r&&(c[n][0]=o>0?i+360:i-360)}}if(!n.isGeographic){const e=J(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];D(c,t);const o=n.wkid?r.coordsys(n.wkid):r.fromString(n.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,n.wkt2||n.wkt);a.geogToProj(o,c.length,c)}let u=c;if(f&&c.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(c[t++]):u.push([NaN,NaN])}return u}function U(e){const{cols:t,rows:n,xres:o,yres:i,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:c}=e;r&&(l+=o/2,c-=i/2);const u=[],x=[],h=Math.max(t,n);for(let g=0;g<h;g++){const e=l+o*Math.min(t,g),r=c-i*Math.min(n,g),h=m(new f({x:e,y:r,spatialReference:s}),s,a);g<=t&&u.push(h.x),g<=n&&x.push(h.y)}const p=[];for(let f=0;f<t;f++)for(let e=0;e<n;e++)p.push([u[f],x[e]]);return p}function J(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),S.has(n)){const e=S.get(n);return t?e?.gcs:e?.pcs}const o=e.wkid?r.coordsys(e.wkid):r.fromString(e.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,e.wkt2||e.wkt),i=X(o,W(e,1e-4)),a=X(o,0,!0);return S.set(n,{pcs:i,gcs:a}),t?a:i}function X(e,t=0,n=!1){const o=c.generate(e),i=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!o||!i?.length)return null;let r=!1,s=i.find((e=>1===e.getInclusive()&&1===e.getKind()));if(!s){if(s=i.find((e=>1===e.getInclusive()&&0===e.getKind())),!s)return null;r=!0}const a=n?0:(2===o.getNorthPoleLocation()?1:0)|(2===o.getSouthPoleLocation()?2:0),l=o.isPannableRectangle(),f=s.getCoord();if(r)return{isEnvelope:r,isPannable:l,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:a};let u=0;const m=[];let[x,h]=f[0],[p,g]=f[0];for(let c=0,y=f.length;c<y;c++){u++,u===y&&(u=0);const[e,t]=f[c],[n,o]=f[u];if(o===t)m.push([e,n,t,o,2]);else{const i=(n-e)/(o-t||1e-4),r=e-i*t;t<o?m.push([i,r,t,o,0]):m.push([i,r,o,t,1])}x=x<e?x:e,h=h<t?h:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:l,vertices:f,coef:m,bbox:[x,h,p,g],poleLocation:a}}function K(e,t){const n=[],{cols:o,rows:i,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<o;e++)for(let t=0;t<i;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(o*i);if(t.isEnvelope){const{bbox:[e,a,u,m]}=t;for(let x=0,h=0;x<o;x++){const o=l+r*x,p=t.isPannable||o>=e&&o<=u;for(let e=0;e<i;e++,h++){const t=c-s*e;p&&t>=a&&t<=m&&(n.push([o,t]),f[h]=1)}}return{points:n,mask:f}}const u=t.coef,m=[];for(let x=0;x<i;x++){const e=c-s*x,t=[],n=[];for(let i=0;i<u.length;i++){const[o,r,s,a,l]=u[i];if(e===s&&s===a)t.push(o),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const i=o*e+r;t.push(i),n.push(l)}}let o=t;if(t.length>2){let e=2===n[0]?0:n[0],i=t[0];o=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(o.push(0===e?Math.min(i,t[r-1]):Math.max(i,t[r-1])),e=n[r],i=t[r]),r===n.length-1&&o.push(0===n[r]?Math.min(i,t[r]):Math.max(i,t[r])));o.sort(((e,t)=>e-t))}else t[0]>t[1]&&(o=[t[1],t[0]]);m.push(o)}for(let x=0,h=0;x<o;x++){const e=l+r*x;for(let t=0;t<i;t++,h++){const o=c-s*t,i=m[t];if(2===i.length)e>=i[0]&&e<=i[1]&&(n.push([e,o]),f[h]=1);else if(i.length>2){let t=!1;for(let n=0;n<i.length;n+=2)if(e>=i[n]&&e<=i[n+1]){t=!0;break}t&&(n.push([e,o]),f[h]=1)}}}return{points:n,mask:f}}function D(e,t){const[n,o]=t;for(let i=0;i<e.length;i++){const t=e[i][1];(t<n||t>o)&&(e[i]=[NaN,NaN])}}function H(e,t){const n=ee(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??W(e[0].spatialReference),1===(e=e.filter((e=>e.width>t))).length)return e[0];let{xmin:o,xmax:r,ymin:s,ymax:a}=e[0];for(let i=1;i<e.length;i++){const t=e[i];r=t.xmax+n*i,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new i({xmin:o,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function Q(t,n,o=null,r=!0){const s=t.spatialReference;if(s.equals(n)||!n)return t;const a=oe(t),l=ee(s,!0),c=ee(n);if(0===a||null==l||null==c){const e=$(t,n,o,r);if(null==l&&null!=c&&Math.abs(e.width-c)<W(n)&&E.isLoaded()){const o=J(s);if(null!=o&&o.poleLocation===p.None&&t.width<(o.bbox[2]-o.bbox[0])/2)return Z(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>W(s)){const{xmin:e,xmax:n}=t;for(let o=0;o<=a;o++){const r=0===o?e:-l/2,c=o===a?n-l*o:l/2;f[o]=new i({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}return H(f.map((e=>$(e,n,o,r))).filter(e))}function V(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:o,ymax:i,spatialReference:r}=e;e=new u({rings:[[[t,i],[o,i],[o,n],[t,n],[t,i]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(g(),E.execute(e,t,{geographicTransformation:n}))}function Z(e,t){const n=ee(t);if(null==n)return null;let{xmin:o,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new u({spatialReference:l,rings:[[[o,r],[s,r],[s,a],[o,a],[o,r]]]}),f=E.execute(c,t);if(2!==f.rings.length||!f.rings[0].length||!f.rings[1].length)return null;const{rings:m}=f,x=W(l),h=new i({spatialReference:t});for(let i=0;i<2;i++){o=s=m[i][0][0],r=a=m[i][0][1];for(let e=0;e<m[i].length;e++)o=o>m[i][e][0]?m[i][e][0]:o,s=s<m[i][e][0]?m[i][e][0]:s,r=r>m[i][e][1]?m[i][e][1]:r,a=a<m[i][e][1]?m[i][e][1]:a;if(0===i)h.ymin=r,h.ymax=a,h.xmin=o,h.xmax=s;else if(h.ymin=Math.min(h.ymin,r),h.ymax=Math.max(h.ymax,a),Math.abs(s-n/2)<x)h.xmin=o,h.xmax=h.xmax+n;else{if(!(Math.abs(o+n/2)<x))return null;h.xmax=s+n}}return h}function $(e,t,n,o=!0,i=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;g();const s=E.execute(e,t,{geographicTransformation:n});if(i&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!o||!s)return s;const a=te(r,!0),l=te(t,!0);if(null==a||null==l)return s;const c=W(r,.001),u=W(r,b),m=W(t,.001);if(Math.abs(s.xmin-l[0])<m&&Math.abs(s.xmax-l[1])<m){const o=Math.abs(e.xmin-a[0]),i=Math.abs(a[1]-e.xmax);if(o<c&&i>u){s.xmin=l[0];const o=[];o.push(new f(e.xmax,e.ymin,r)),o.push(new f(e.xmax,(e.ymin+e.ymax)/2,r)),o.push(new f(e.xmax,e.ymax,r));const i=o.map((e=>A(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmax=Math.max.apply(null,i)}if(i<c&&o>u){s.xmax=l[1];const o=[];o.push(new f(e.xmin,e.ymin,r)),o.push(new f(e.xmin,(e.ymin+e.ymax)/2,r)),o.push(new f(e.xmin,e.ymax,r));const i=o.map((e=>A(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmin=Math.min.apply(null,i)}}else{const e=W(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function ee(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*d[e.wkid]||null}function te(e,t=!1){if(e.isGeographic)return[-180,180];const n=ee(e,t);return null!=n?[-n/2,n/2]:null}function ne(e,t,n,o){let i=(e-t)/n;return i-Math.floor(i)!=0?i=Math.floor(i):o&&(i-=1),i}function oe(e,t=!1){const n=ee(e.spatialReference);if(null==n)return 0;const o=t?0:-(n/2),i=W(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<i?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<i?-n/2:e.xmin;return ne(r,o,n,!0)-ne(s,o,n,!1)}function ie(e){const t=e.storageInfo.origin.x,n=ee(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const o=n/2,{nativePixelSize:i,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=i.x;const u=[],m=null!=e.transform&&"gcs-shift"===e.transform.type,x=t+(m?0:o),h=m?n-t:o-t;for(let p=0;p<=a;p++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)==0?e:Math.ceil(e),o=h/f/l,i=o-Math.floor(o)==0?o:Math.ceil(o),r=Math.floor(x/f/l),a=Math.round(x/f)%l,m=(l-Math.round(h/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:i,leftMargin:a,rightPadding:m,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:o,pyramidsInfo:u,hasGCSSShiftTransform:m}}function re(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(P.has(t))n=P.get(t);else{n=(e.wkid?r.coordsys(e.wkid):r.fromString(s.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),P.set(t,n)}return new x({wkid:n})}function se(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[w,w],o=ae(e),i={cols:o.size[0]+1,rows:o.size[1]+1};const r=o.outofBoundPointCount>0&&o.outofBoundPointCount<o.offsets.length/2;let s=o.outofBoundPointCount===o.offsets.length/2||t&&r?[0,0]:y(o.offsets,i,n,R);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>R)&&(l.isGeographic||J(l),n=[M,M],o=ae({...e,spacing:n}),i={cols:o.size[0]+1,rows:o.size[1]+1},s=y(o.offsets,i,n,R)),o.error=s,n[0]>1&&(o.coefficients=le(o.offsets,i,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)o.gcsGrid={offsets:o.offsets,coefficients:o.coefficients,spacing:n};else{const t=J(l);if(null!=t&&!t.isEnvelope){const t=re(l),s=Q(e.projectedExtent,t),{offsets:a}=ae({...e,srcBufferExtent:s,spacing:n}),c=le(a,i,r);o.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return o}function ae(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:o,datumTransformation:i,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference;g();const{xmin:l,ymin:c,xmax:u,ymax:m}=t,x=ee(a),h=null!=x&&(e.hasWrapAround||"gcs-shift"===r?.type),p=e.spacing||[w,w],y=p[0]*o.x,d=p[1]*o.y,R=1===p[0],S=Math.ceil((u-l)/y-.1/p[0])+(R?0:1),P=Math.ceil((m-c)/d-.1/p[1])+(R?0:1),G=F({cols:S,rows:P,xmin:l,ymax:m,xres:y,yres:d,inSR:s,outSR:a,datumTransformation:i,preferPE:p[0]<=M,usePixelCenter:R}),k=[];let N,E=0;const T=R?-1:NaN,{xmin:j,xmax:v,ymax:C,width:_,height:z}=n,L=W(a,b),I=null!=x&&j>0&&v>x/2,O=J(s),A=null!=O&&O.poleLocation>0;for(let g=0;g<S;g++){const e=[];for(let t=0;t<P;t++){let n=G[g*P+t];if(h&&n[0]>v&&n[0]>x/2-L?n[0]-=x:h&&0===g&&n[0]<0&&I&&!r&&(n[0]+=x),!n||isNaN(n[0])||isNaN(n[1]))k.push(T),k.push(T),e.push(null),E++;else{if(r){const e=r.inverseTransform(new f({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),g>0&&h&&N[t]&&n[0]<N[t][0]&&(n[0]+=x,A&&n[0]>v&&n[0]>x&&(n[0]-=x)),k.push((n[0]-j)/_),k.push((C-n[1])/z)}}N=e}return{offsets:k,error:null,coefficients:null,outofBoundPointCount:E,spacing:p,size:R?[S,P]:[S-1,P-1]}}function le(e,t,n){const{cols:o,rows:i}=t,r=new Float32Array((o-1)*(i-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<o-1;l++){for(let t=0;t<i-1;t++){let n=l*i*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],m=e[n+3];n+=2*i;const x=e[n],h=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(o-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*m+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*x+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function ce(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:H(n,t)}function fe(e){const{spatialReference:t}=e,n=h(t);if(!n)return e;const[o,r]=n.valid,s=r-o;let a=0;if(e.xmin<o){const t=o-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new i({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function ue(e,t,n){const{storageInfo:i,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=i,c="mixed"===i.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,i.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/c;if(null!=l&&l.length){const e=l[l.length-1],i=(e.x+e.y)/2,c=(r.x+r.y)/2;if(u<=c)s=0;else if(u>=i)s=l.length,a=u/i>8;else{let e,t=c;for(let o=1;o<=l.length;o++){if(e=(l[o-1].x+l[o-1].y)/2,u<=e){u===e?s=o:"down"===n?(s=o-1,a=u/t>8):s="up"===n||u-t>e-u||u/t>2?o:o-1;break}t=e}}const m=0===s?r:l[s-1];if(a){Math.min(m.x,m.y)*o(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new f({x:m.x,y:m.y,spatialReference:t.spatialReference}),excessiveReading:a}}const m=Math.log(e.x/r.x)/Math.LN2,x=Math.log(e.y/r.y)/Math.LN2,h=t.storageInfo.maximumPyramidLevel||0;s="down"===n?Math.floor(Math.min(m,x)):"up"===n?Math.ceil(Math.max(m,x)):Math.round((m+x)/2),s<0?s=0:s>h&&(a=s>h+3,s=h);const p=2**s;return{pyramidLevel:s,pyramidResolution:new f({x:p*t.nativePixelSize.x,y:p*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function me(e,t,n=!1){const{pixelSize:o,extent:i}=e,r=C(i,t,!1),s=Q(ce(i,(o.x+o.y)/16),t,r);return n||0===oe(s)?s:$(i,t,r)}function xe(e,t,n){const o=n?.tileSize??512,i=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,spatialReference:a,pixelSize:l}=e,c=L(l,t,s);if(null==c)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const f=(c.x+c.y)/2,u=I(f,t),m=t.isGeographic?256/o*295828763.7958547:256/o*591657527.591555;let h="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const p=me(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(m/2/u)/Math.LN2));if(!h&&i&&(t.isGeographic||t.isWebMercator)){const n=ee(t);if(h=oe(p)>0||null!=n&&p.width>n/4,!h&&null!=n){let t=-1;if(g<3)t=2**g*f*o;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:i=2}=e.storageInfo;t=i**n*f*o}const i=Math.ceil(n/t);h=1===i||2===i&&n/2-p.xmax<t}}let y,d=u;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(h){d=m;const n=t.isGeographic?1341104507446289e-21:.29858214164761665,o=I(n,t),i=t.isGeographic?4326:3857;y=L({x:n,y:n},a,me(e,new x({wkid:i}),!0)),y.x*=d/o,y.y*=d/o}else{y={x:l.x,y:l.y};let e=0;for(;d<m*(w/2)&&e<g;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,m)/Math.min(d,m)<=w&&(d=m)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,u)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*l.x;let t=S.findIndex((t=>t.x>=l.x-e&&t.x<=l.x+e));t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex((t=>t.x<=l.x+e)),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:c,scales:R,srcResolutions:S,isCustomTilingScheme:!h}}function he(e){let t=0;for(const n of e){const e=n.length;let o=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)o+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=o/2}return Math.abs(t)}export{xe as computeProjectedScales,w as defaultGridSpacing,R as defaultProjectionToleranceInPixels,C as getDefaultDatumTransformationForDataset,F as getProjectedGridPoints,se as getProjectionOffsetGrid,ie as getRasterDatasetAlignmentInfo,O as getSourceScale,ee as getWorldWidth,oe as getWorldWrapCount,v as load,M as minimumGridSpacing,me as projectDatasetExtent,L as projectDatasetResolution,Q as projectExtent,A as projectPoint,V as projectPolygon,_ as projectResolution,fe as shiftExtent,ce as snapExtent,ue as snapPyramid};
|
|
5
|
+
import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{createResolver as n}from"../../../core/promiseUtils.js";import{getMetersPerUnitForSR as o}from"../../../core/unitUtils.js";import i from"../../../geometry/Extent.js";import{P as r,a as s,g as a,h as l,j as c}from"../../../chunks/pe.js";import f from"../../../geometry/Point.js";import u from"../../../geometry/Polygon.js";import{projectWithoutEngine as m}from"../../../geometry/projection.js";import x from"../../../geometry/SpatialReference.js";import{getInfo as h}from"../../../geometry/support/spatialReferenceUtils.js";var p;function g(){if(!j)throw new t("rasterprojectionhelper-project","projection operator is not loaded")}!function(e){e[e.None=0]="None",e[e.North=1]="North",e[e.South=2]="South",e[e.Both=3]="Both"}(p||(p={}));const y=(e,t,n,o=0)=>{if(1===n[0])return[0,0];let i=1,r=-1,s=1,a=-1;for(let g=0;g<e.length;g+=2)isNaN(e[g])||(i=i>e[g]?e[g]:i,r=r>e[g]?r:e[g],s=s>e[g+1]?e[g+1]:s,a=a>e[g+1]?a:e[g+1]);const{cols:l,rows:c}=t,f=(r-i)/l/n[0],u=(a-s)/c/n[1],m=2*o;let x=0,h=!1,p=[0,0];for(let g=0;g<l-3;g++){for(let t=0;t<c-3;t++){const n=g*c*2+2*t,o=(e[n]+e[n+4]+e[n+4*c]+e[n+4*c+4])/4,i=(e[n+1]+e[n+5]+e[n+4*c+1]+e[n+4*c+5])/4,r=Math.abs((o-e[n+2*c+2])/f),s=Math.abs((i-e[n+2*c+3])/u);if(r+s>x&&(x=r+s,p=[r,s]),m&&x>m){h=!0;break}}if(h)break}return p},d={3395:20037508.342789244,3410:17334193.943686873,3857:20037508.342788905,3975:17367530.445161372,4087:20037508.342789244,4088:20015108.787169147,6933:17367530.445161372,32662:20037508.342789244,53001:20015086.79602057,53002:10007543.39801029,53003:20015086.79602057,53004:20015086.79602057,53016:14152803.599503474,53017:17333573.624304302,53034:20015086.79602057,53079:20015114.352186374,53080:20015114.352186374,54001:20037508.342789244,54002:10018754.171394624,54003:20037508.342789244,54004:20037508.342789244,54016:14168658.027268292,54017:17367530.44516137,54034:20037508.342789244,54079:20037508.342789244,54080:20037508.342789244,54100:20037508.342789244,54101:20037508.342789244},w=32,M=4,R=M,S=new Map,P=new Map,b=500,G=39.37,k=96;let N,E,T,j=!1;async function v(){return N||(N=n(),E=await import("../../../geometry/operators/projectOperator.js"),T=await import("../../../geometry/operators/support/geographicTransformationUtils.js"),E.isLoaded()||await E.load(),T.isLoaded()||await T.load(),j=!0,N.resolve()),N.promise}function C(e,t,n){if(g(),n){const n=E.execute(e,t);return T.getTransformation(t,e.spatialReference,n)}return T.getTransformation(e.spatialReference,t,e)}function _(e,t,n,o){const r=e.spatialReference;if(!r||!t||r.equals(t))return e;g();const s=n.center,a=new i({xmin:s.x-e.x/2,xmax:s.x+e.x/2,ymin:s.y-e.y/2,ymax:s.y+e.y/2,spatialReference:r}),l=E.execute(a,t,{geographicTransformation:o}),c=ee(t);return null==l||null!=c&&l.width>=c?z(e,r,t):{x:l.width,y:l.height}}function z(e,t,n){const i=o(t)/o(n);return{x:e.x*i,y:e.y*i}}function L(e,n,i){const{spatialReference:r}=i;if(!r||!n||r.equals(n))return e;if(r.isGeographic&&n.isGeographic)return z(e,r,n);if(g(),!j)throw new t("raster-projection-helper:project-dataset-resolution","geometry engine is not loaded");let{x:s,y:a}=e;const l=(s+a)/2*o(r);let c=1;l>30&&(c=30/l,s*=c,a*=c);const f=256,m=s*f/2,x=a*f/2,{x:h,y:p}=i.center,y=[];for(let t=0;t<=f;t++)y.push([h-m,p-x+t*a]);for(let t=1;t<=f;t++)y.push([h-m+t*s,p+x]);for(let t=1;t<=f;t++)y.push([h+m,p+x-t*a]);for(let t=1;t<f;t++)y.push([h+m-t*s,p-x]);y.push(y[0]);const d=new u({rings:[y],spatialReference:r}),w=E.execute(d,n);if(!w)return z(e,r,n);const M=w.extent,R=ee(n);if(null==M||null!=R&&M.width>=R)return z(e,r,n);const S=he(w.rings),P=s*a*f*f,b=Math.sqrt(S/P)/c,G={x:M.width/c/f,y:M.height/c/f},k={x:s*b,y:a*b},N=G.x*G.y;return Math.abs(N-k.x*k.y)/N<.1?G:k}function I(e,t){return("number"==typeof e?e:(e.x+e.y)/2)*o(t)*k*G}function O(e,t){const{pixelSize:n,extent:o}=e;return I(L(n,t,o),t)}function W(e,t=.01){return o(e)?t/o(e):0}function A(e,t,n,o=!0){const i=e.spatialReference;if(i.equals(t))return e;g();const r=E.execute(e,t,{geographicTransformation:n});return o&&r?(B([e],[r],i,t),r):r}function B(e,t,n,o){const i=te(n,!0),r=te(o,!0),s=W(n,b),a=W(o,b);if(s&&null!=i&&null!=r)for(let l=0;l<e.length;l++){const n=t[l];if(!n)continue;const{x:o}=e[l],{x:c}=n;c>=r[1]-a&&Math.abs(o-i[0])<s?n.x-=r[1]-r[0]:c<=r[0]+a&&Math.abs(o-i[1])<s&&(n.x+=r[1]-r[0])}}function F(e){const{inSR:t,outSR:n,preferPE:o}=e;if(t.equals(n)){const{points:t}=K(e,null);return t}if(t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator)return U(e);if(o){if(t.isGeographic)return Y(e);if(null!=J(t))return Y(e)}return q(e)}function q(e){const{points:t}=K(e,null),{inSR:n,outSR:o,datumTransformation:i}=e,r=t.map((e=>new f(e[0],e[1],n))),s=E.executeMany(r,o,{geographicTransformation:i});return i&&B(r,s,n,o),s.map((e=>e?[e.x,e.y]:[NaN,NaN]))}function Y(e){const{inSR:t,outSR:n,datumTransformation:o}=e,i=J(t),{points:c,mask:f}=K(e,i);if(!t.isGeographic){const e=t.wkid?r.coordsys(t.wkid):r.fromString(t.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,t.wkt2||t.wkt);a.projToGeog(e,c.length,c)}if(null!=o&&o.steps.length){let e;const t=179.9955;if(n.isGeographic&&(e=c.map((([e])=>e>t?1:e<-179.9955?-1:0))),o.steps.forEach((e=>{const t=e.wkid?r.geogtran(e.wkid):r.fromString(s.PE_TYPE_GEOGTRAN,e.wkt);l.geogToGeog(t,c.length,c,null,e.isInverse?s.PE_TRANSFORM_2_TO_1:s.PE_TRANSFORM_1_TO_2)})),e)for(let n=0;n<c.length;n++){const o=e[n],i=c[n][0],r=i>t?1:i<-179.9955?-1:0;o&&r&&o!==r&&(c[n][0]=o>0?i+360:i-360)}}if(!n.isGeographic){const e=J(n,!0),t=null!=e&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90];D(c,t);const o=n.wkid?r.coordsys(n.wkid):r.fromString(n.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,n.wkt2||n.wkt);a.geogToProj(o,c.length,c)}let u=c;if(f&&c.length!==f.length){u=[];for(let e=0,t=0;e<f.length;e++)f[e]?u.push(c[t++]):u.push([NaN,NaN])}return u}function U(e){const{cols:t,rows:n,xres:o,yres:i,usePixelCenter:r,inSR:s,outSR:a}=e;let{xmin:l,ymax:c}=e;r&&(l+=o/2,c-=i/2);const u=[],x=[],h=Math.max(t,n);for(let g=0;g<h;g++){const e=l+o*Math.min(t,g),r=c-i*Math.min(n,g),h=m(new f({x:e,y:r,spatialReference:s}),s,a);g<=t&&u.push(h.x),g<=n&&x.push(h.y)}const p=[];for(let f=0;f<t;f++)for(let e=0;e<n;e++)p.push([u[f],x[e]]);return p}function J(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),S.has(n)){const e=S.get(n);return t?e?.gcs:e?.pcs}const o=e.wkid?r.coordsys(e.wkid):r.fromString(e.isGeographic?s.PE_TYPE_GEOGCS:s.PE_TYPE_PROJCS,e.wkt2||e.wkt),i=X(o,W(e,1e-4)),a=X(o,0,!0);return S.set(n,{pcs:i,gcs:a}),t?a:i}function X(e,t=0,n=!1){const o=c.generate(e),i=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!o||!i?.length)return null;let r=!1,s=i.find((e=>1===e.getInclusive()&&1===e.getKind()));if(!s){if(s=i.find((e=>1===e.getInclusive()&&0===e.getKind())),!s)return null;r=!0}const a=n?0:(2===o.getNorthPoleLocation()?1:0)|(2===o.getSouthPoleLocation()?2:0),l=o.isPannableRectangle(),f=s.getCoord();if(r)return{isEnvelope:r,isPannable:l,vertices:f,coef:null,bbox:[f[0][0]-t,f[0][1]-t,f[1][0]+t,f[1][1]+t],poleLocation:a};let u=0;const m=[];let[x,h]=f[0],[p,g]=f[0];for(let c=0,y=f.length;c<y;c++){u++,u===y&&(u=0);const[e,t]=f[c],[n,o]=f[u];if(o===t)m.push([e,n,t,o,2]);else{const i=(n-e)/(o-t||1e-4),r=e-i*t;t<o?m.push([i,r,t,o,0]):m.push([i,r,o,t,1])}x=x<e?x:e,h=h<t?h:t,p=p>e?p:e,g=g>t?g:t}return{isEnvelope:!1,isPannable:l,vertices:f,coef:m,bbox:[x,h,p,g],poleLocation:a}}function K(e,t){const n=[],{cols:o,rows:i,xres:r,yres:s,usePixelCenter:a}=e;let{xmin:l,ymax:c}=e;if(a&&(l+=r/2,c-=s/2),null==t){for(let e=0;e<o;e++)for(let t=0;t<i;t++)n.push([l+r*e,c-s*t]);return{points:n}}const f=new Uint8Array(o*i);if(t.isEnvelope){const{bbox:[e,a,u,m]}=t;for(let x=0,h=0;x<o;x++){const o=l+r*x,p=t.isPannable||o>=e&&o<=u;for(let e=0;e<i;e++,h++){const t=c-s*e;p&&t>=a&&t<=m&&(n.push([o,t]),f[h]=1)}}return{points:n,mask:f}}const u=t.coef,m=[];for(let x=0;x<i;x++){const e=c-s*x,t=[],n=[];for(let i=0;i<u.length;i++){const[o,r,s,a,l]=u[i];if(e===s&&s===a)t.push(o),t.push(r),n.push(2),n.push(2);else if(e>=s&&e<=a){const i=o*e+r;t.push(i),n.push(l)}}let o=t;if(t.length>2){let e=2===n[0]?0:n[0],i=t[0];o=[];for(let r=1;r<n.length;r++)2===n[r]&&r!==n.length-1||(n[r]!==e&&(o.push(0===e?Math.min(i,t[r-1]):Math.max(i,t[r-1])),e=n[r],i=t[r]),r===n.length-1&&o.push(0===n[r]?Math.min(i,t[r]):Math.max(i,t[r])));o.sort(((e,t)=>e-t))}else t[0]>t[1]&&(o=[t[1],t[0]]);m.push(o)}for(let x=0,h=0;x<o;x++){const e=l+r*x;for(let t=0;t<i;t++,h++){const o=c-s*t,i=m[t];if(2===i.length)e>=i[0]&&e<=i[1]&&(n.push([e,o]),f[h]=1);else if(i.length>2){let t=!1;for(let n=0;n<i.length;n+=2)if(e>=i[n]&&e<=i[n+1]){t=!0;break}t&&(n.push([e,o]),f[h]=1)}}}return{points:n,mask:f}}function D(e,t){const[n,o]=t;for(let i=0;i<e.length;i++){const t=e[i][1];(t<n||t>o)&&(e[i]=[NaN,NaN])}}function H(e,t){const n=ee(e[0].spatialReference);if(e.length<2||null==n)return e[0];if(t=t??W(e[0].spatialReference),1===(e=e.filter((e=>e.width>t))).length)return e[0];let{xmin:o,xmax:r,ymin:s,ymax:a}=e[0];for(let i=1;i<e.length;i++){const t=e[i];r=t.xmax+n*i,s=Math.min(s,t.ymin),a=Math.max(a,t.ymax)}return new i({xmin:o,xmax:r,ymin:s,ymax:a,spatialReference:e[0].spatialReference})}function Q(t,n,o=null,r=!0){const s=t.spatialReference;if(s.equals(n)||!n)return t;const a=oe(t),l=ee(s,!0),c=ee(n);if(0===a||null==l||null==c){const e=$(t,n,o,r);if(e&&null==l&&null!=c&&Math.abs(e.width-c)<W(n)&&E.isLoaded()){const o=J(s);if(null!=o&&o.poleLocation===p.None&&t.width<(o.bbox[2]-o.bbox[0])/2)return Z(t,n)||e}return e}const f=t.clone().normalize();if(1===f.length&&t.xmax<l&&t.xmax-l/2>W(s)){const{xmin:e,xmax:n}=t;for(let o=0;o<=a;o++){const r=0===o?e:-l/2,c=o===a?n-l*o:l/2;f[o]=new i({xmin:r,xmax:c,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}const u=f.map((e=>$(e,n,o,r))).filter(e);return 0===u.length?null:H(u)}function V(e,t,n){if("extent"===e.type){const{xmin:t,ymin:n,xmax:o,ymax:i,spatialReference:r}=e;e=new u({rings:[[[t,i],[o,i],[o,n],[t,n],[t,i]]],spatialReference:r})}return e.spatialReference.equals(t)?e:(g(),E.execute(e,t,{geographicTransformation:n}))}function Z(e,t){const n=ee(t);if(null==n)return null;let{xmin:o,ymin:r,xmax:s,ymax:a}=e;const l=e.spatialReference,c=new u({spatialReference:l,rings:[[[o,r],[s,r],[s,a],[o,a],[o,r]]]}),f=E.execute(c,t);if(2!==f.rings.length||!f.rings[0].length||!f.rings[1].length)return null;const{rings:m}=f,x=W(l),h=new i({spatialReference:t});for(let i=0;i<2;i++){o=s=m[i][0][0],r=a=m[i][0][1];for(let e=0;e<m[i].length;e++)o=o>m[i][e][0]?m[i][e][0]:o,s=s<m[i][e][0]?m[i][e][0]:s,r=r>m[i][e][1]?m[i][e][1]:r,a=a<m[i][e][1]?m[i][e][1]:a;if(0===i)h.ymin=r,h.ymax=a,h.xmin=o,h.xmax=s;else if(h.ymin=Math.min(h.ymin,r),h.ymax=Math.max(h.ymax,a),Math.abs(s-n/2)<x)h.xmin=o,h.xmax=h.xmax+n;else{if(!(Math.abs(o+n/2)<x))return null;h.xmax=s+n}}return h}function $(e,t,n,o=!0,i=!0){const r=e.spatialReference;if(r.equals(t)||!t)return e;g();const s=E.execute(e,t,{geographicTransformation:n});if(i&&t.isWebMercator&&s&&(s.ymax=Math.min(20037508.342787,s.ymax),s.ymin=Math.max(-20037508.342787,s.ymin),s.ymin>=s.ymax))return null;if(!o||!s)return s;const a=te(r,!0),l=te(t,!0);if(null==a||null==l)return s;const c=W(r,.001),u=W(r,b),m=W(t,.001);if(Math.abs(s.xmin-l[0])<m&&Math.abs(s.xmax-l[1])<m){const o=Math.abs(e.xmin-a[0]),i=Math.abs(a[1]-e.xmax);if(o<c&&i>u){s.xmin=l[0];const o=[];o.push(new f(e.xmax,e.ymin,r)),o.push(new f(e.xmax,(e.ymin+e.ymax)/2,r)),o.push(new f(e.xmax,e.ymax,r));const i=o.map((e=>A(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmax=Math.max.apply(null,i)}if(i<c&&o>u){s.xmax=l[1];const o=[];o.push(new f(e.xmin,e.ymin,r)),o.push(new f(e.xmin,(e.ymin+e.ymax)/2,r)),o.push(new f(e.xmin,e.ymax,r));const i=o.map((e=>A(e,t,n))).filter((e=>!isNaN(e?.x))).map((e=>e.x));s.xmin=Math.min.apply(null,i)}}else{const e=W(t,.001);Math.abs(s.xmin-l[0])<e&&(s.xmin=l[0]),Math.abs(s.xmax-l[1])<e&&(s.xmax=l[1])}return s}function ee(e,t=!1){if(!e)return null;const n=t?20037508.342787:20037508.342788905;return e.isWebMercator?2*n:e.wkid&&e.isGeographic?360:2*d[e.wkid]||null}function te(e,t=!1){if(e.isGeographic)return[-180,180];const n=ee(e,t);return null!=n?[-n/2,n/2]:null}function ne(e,t,n,o){let i=(e-t)/n;return i-Math.floor(i)!=0?i=Math.floor(i):o&&(i-=1),i}function oe(e,t=!1){const n=ee(e.spatialReference);if(null==n)return 0;const o=t?0:-(n/2),i=W(e.spatialReference),r=!t&&Math.abs(e.xmax-n/2)<i?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<i?-n/2:e.xmin;return ne(r,o,n,!0)-ne(s,o,n,!1)}function ie(e){const t=e.storageInfo.origin.x,n=ee(e.spatialReference,!0);if(null==n)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};const o=n/2,{nativePixelSize:i,storageInfo:r,extent:s}=e,{maximumPyramidLevel:a,blockWidth:l,pyramidScalingFactor:c}=r;let f=i.x;const u=[],m=null!=e.transform&&"gcs-shift"===e.transform.type,x=t+(m?0:o),h=m?n-t:o-t;for(let p=0;p<=a;p++){const e=(s.xmax-t)/f/l,n=e-Math.floor(e)==0?e:Math.ceil(e),o=h/f/l,i=o-Math.floor(o)==0?o:Math.ceil(o),r=Math.floor(x/f/l),a=Math.round(x/f)%l,m=(l-Math.round(h/f)%l)%l;u.push({resolutionX:f,blockWidth:l,datasetColumnCount:n,worldColumnCountFromOrigin:i,leftMargin:a,rightPadding:m,originColumnOffset:r}),f*=c}return{originX:t,halfWorldWidth:o,pyramidsInfo:u,hasGCSSShiftTransform:m}}function re(e){if(!e||e.isGeographic)return e;const t=String(e.wkid||e.wkt2||e.wkt);let n;if(P.has(t))n=P.get(t);else{n=(e.wkid?r.coordsys(e.wkid):r.fromString(s.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),P.set(t,n)}return new x({wkid:n})}function se(e){const t=e.isAdaptive&&null==e.spacing;let n=e.spacing||[w,w],o=ae(e),i={cols:o.size[0]+1,rows:o.size[1]+1};const r=o.outofBoundPointCount>0&&o.outofBoundPointCount<o.offsets.length/2;let s=o.outofBoundPointCount===o.offsets.length/2||t&&r?[0,0]:y(o.offsets,i,n,R);const a=(s[0]+s[1])/2,l=e.projectedExtent.spatialReference,c=e.srcBufferExtent.spatialReference;if(t&&(r||a>R)&&(l.isGeographic||J(l),n=[M,M],o=ae({...e,spacing:n}),i={cols:o.size[0]+1,rows:o.size[1]+1},s=y(o.offsets,i,n,R)),o.error=s,n[0]>1&&(o.coefficients=le(o.offsets,i,r)),e.includeGCSGrid&&!l.isGeographic&&!l.isWebMercator)if(c.isGeographic)o.gcsGrid={offsets:o.offsets,coefficients:o.coefficients,spacing:n};else{const t=J(l);if(null!=t&&!t.isEnvelope){const t=re(l),s=Q(e.projectedExtent,t),{offsets:a}=ae({...e,srcBufferExtent:s,spacing:n}),c=le(a,i,r);o.gcsGrid={offsets:a,coefficients:c,spacing:n}}}return o}function ae(e){const{projectedExtent:t,srcBufferExtent:n,pixelSize:o,datumTransformation:i,rasterTransform:r}=e,s=t.spatialReference,a=n.spatialReference;g();const{xmin:l,ymin:c,xmax:u,ymax:m}=t,x=ee(a),h=null!=x&&(e.hasWrapAround||"gcs-shift"===r?.type),p=e.spacing||[w,w],y=p[0]*o.x,d=p[1]*o.y,R=1===p[0],S=Math.ceil((u-l)/y-.1/p[0])+(R?0:1),P=Math.ceil((m-c)/d-.1/p[1])+(R?0:1),G=F({cols:S,rows:P,xmin:l,ymax:m,xres:y,yres:d,inSR:s,outSR:a,datumTransformation:i,preferPE:p[0]<=M,usePixelCenter:R}),k=[];let N,E=0;const T=R?-1:NaN,{xmin:j,xmax:v,ymax:C,width:_,height:z}=n,L=W(a,b),I=null!=x&&j>0&&v>x/2,O=J(s),A=null!=O&&O.poleLocation>0;for(let g=0;g<S;g++){const e=[];for(let t=0;t<P;t++){let n=G[g*P+t];if(h&&n[0]>v&&n[0]>x/2-L?n[0]-=x:h&&0===g&&n[0]<0&&I&&!r&&(n[0]+=x),!n||isNaN(n[0])||isNaN(n[1]))k.push(T),k.push(T),e.push(null),E++;else{if(r){const e=r.inverseTransform(new f({x:n[0],y:n[1],spatialReference:a}));n=[e.x,e.y]}e.push(n),g>0&&h&&N[t]&&n[0]<N[t][0]&&(n[0]+=x,A&&n[0]>v&&n[0]>x&&(n[0]-=x)),k.push((n[0]-j)/_),k.push((C-n[1])/z)}}N=e}return{offsets:k,error:null,coefficients:null,outofBoundPointCount:E,spacing:p,size:R?[S,P]:[S-1,P-1]}}function le(e,t,n){const{cols:o,rows:i}=t,r=new Float32Array((o-1)*(i-1)*2*6),s=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),a=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let l=0;l<o-1;l++){for(let t=0;t<i-1;t++){let n=l*i*2+2*t;const c=e[n],f=e[n+1],u=e[n+2],m=e[n+3];n+=2*i;const x=e[n],h=e[n+1],p=e[n+2],g=e[n+3];let y=0,d=12*(t*(o-1)+l);for(let e=0;e<3;e++)r[d++]=s[y++]*c+s[y++]*u+s[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=s[y++]*f+s[y++]*m+s[y++]*g;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*c+a[y++]*x+a[y++]*p;y=0;for(let e=0;e<3;e++)r[d++]=a[y++]*f+a[y++]*h+a[y++]*g}if(n)for(let e=0;e<r.length;e++)isNaN(r[e])&&(r[e]=-1)}return r}function ce(e,t){const n=e.clone().normalize();return 1===n.length?n[0]:H(n,t)}function fe(e){const{spatialReference:t}=e,n=h(t);if(!n)return e;const[o,r]=n.valid,s=r-o;let a=0;if(e.xmin<o){const t=o-e.xmin;a=Math.ceil(t/s)}else if(e.xmin>r){const t=e.xmin-r;a=-Math.ceil(t/s)}return new i({spatialReference:e.spatialReference,xmin:e.xmin+a*s,ymin:e.ymin,xmax:e.xmax+a*s,ymax:e.ymax})}function ue(e,t,n){const{storageInfo:i,pixelSize:r}=t;let s=0,a=!1;const{pyramidResolutions:l}=i,c="mixed"===i.tileInfo.format?.toLowerCase()?Math.max(1,Math.min(3,i.tileInfo.dpi/96)):1,u=(e.x+e.y)/2/c;if(null!=l&&l.length){const e=l[l.length-1],i=(e.x+e.y)/2,c=(r.x+r.y)/2;if(u<=c)s=0;else if(u>=i)s=l.length,a=u/i>8;else{let e,t=c;for(let o=1;o<=l.length;o++){if(e=(l[o-1].x+l[o-1].y)/2,u<=e){u===e?s=o:"down"===n?(s=o-1,a=u/t>8):s="up"===n||u-t>e-u||u/t>2?o:o-1;break}t=e}}const m=0===s?r:l[s-1];if(a){Math.min(m.x,m.y)*o(t.spatialReference)>19567&&(a=!1)}return{pyramidLevel:s,pyramidResolution:new f({x:m.x,y:m.y,spatialReference:t.spatialReference}),excessiveReading:a}}const m=Math.log(e.x/r.x)/Math.LN2,x=Math.log(e.y/r.y)/Math.LN2,h=t.storageInfo.maximumPyramidLevel||0;s="down"===n?Math.floor(Math.min(m,x)):"up"===n?Math.ceil(Math.max(m,x)):Math.round((m+x)/2),s<0?s=0:s>h&&(a=s>h+3,s=h);const p=2**s;return{pyramidLevel:s,pyramidResolution:new f({x:p*t.nativePixelSize.x,y:p*t.nativePixelSize.y,spatialReference:t.spatialReference}),excessiveReading:a}}function me(e,t,n=!1){const{pixelSize:o,extent:i}=e,r=C(i,t,!1),s=Q(ce(i,(o.x+o.y)/16),t,r);return!s||n||0===oe(s)?s:$(i,t,r)}function xe(e,t,n){const o=n?.tileSize??512,i=n?.alignGlobalDatasetWithAGOL??!0,r=!!n?.limitToSrcResolution,{extent:s,spatialReference:a,pixelSize:l}=e,c=L(l,t,s);if(null==c)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const f=(c.x+c.y)/2,u=I(f,t),m=t.isGeographic?256/o*295828763.7958547:256/o*591657527.591555;let h="vector-magdir"===e.dataType||"vector-uv"===e.dataType;const p=me(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(m/2/u)/Math.LN2));if(!h&&p&&i&&(t.isGeographic||t.isWebMercator)){const n=ee(t);if(h=oe(p)>0||null!=n&&p.width>n/4,!h&&null!=n){let t=-1;if(g<3)t=2**g*f*o;else if(e.storageInfo){const{maximumPyramidLevel:n=0,pyramidScalingFactor:i=2}=e.storageInfo;t=i**n*f*o}const i=Math.ceil(n/t);h=1===i||2===i&&n/2-p.xmax<t}}let y,d=u;const w=1.001,M=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(h){d=m;const n=t.isGeographic?1341104507446289e-21:.29858214164761665,o=I(n,t),i=t.isGeographic?4326:3857;y=L({x:n,y:n},a,me(e,new x({wkid:i}),!0)),y.x*=d/o,y.y*=d/o}else{y={x:l.x,y:l.y};let e=0;for(;d<m*(w/2)&&e<g;)e++,d*=M,y.x*=M,y.y*=M;Math.max(d,m)/Math.min(d,m)<=w&&(d=m)}const R=[d],S=[{x:y.x,y:y.y}],P=70.5310735,b=Math.min(P,u)/w;for(;d>=b;)d/=M,y.x/=M,y.y/=M,R.push(d),S.push({x:y.x,y:y.y});if(r){const e=.001*l.x;let t=S.findIndex((t=>t.x>=l.x-e&&t.x<=l.x+e));t>-1?(S.length=t+1,R.length=t+1):(t=S.findIndex((t=>t.x<=l.x+e)),t>0&&(S.length=t,R.length=t))}return{projectedPixelSize:c,scales:R,srcResolutions:S,isCustomTilingScheme:!h}}function he(e){let t=0;for(const n of e){const e=n.length;let o=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)o+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=o/2}return Math.abs(t)}export{xe as computeProjectedScales,w as defaultGridSpacing,R as defaultProjectionToleranceInPixels,C as getDefaultDatumTransformationForDataset,F as getProjectedGridPoints,se as getProjectionOffsetGrid,ie as getRasterDatasetAlignmentInfo,O as getSourceScale,ee as getWorldWidth,oe as getWorldWrapCount,v as load,M as minimumGridSpacing,me as projectDatasetExtent,L as projectDatasetResolution,Q as projectExtent,A as projectPoint,V as projectPolygon,_ as projectResolution,fe as shiftExtent,ce as snapExtent,ue as snapPyramid};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/*
|
|
2
|
+
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
|
+
*/
|
|
5
|
+
import{getAssetUrl as t}from"../../assets.js";let n=null;async function s(){return n||(n=a()),n}async function a(){const n=await import("../../chunks/bundle.js");return await n.default({module_or_path:t("esri/libs/parquet/pkg/bundle_bg.wasm")}),n}export{s as loadParquetModule};
|
package/libs/parquet/parquet.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getAssetUrl as t}from"../../assets.js";import e from"../../request.js";let _;const n=new Array(128).fill(void 0);function r(t){return n[t]}n.push(void 0,null,!0,!1);let i=n.length;function o(t){t<132||(n[t]=i,i=t)}function a(t){const e=r(t);return o(t),e}function s(t){i===n.length&&n.push(n.length+1);const e=i;return i=n[e],n[e]=t,e}const g="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&g.decode();let d=null;function c(){return null!==d&&0!==d.byteLength||(d=new Uint8Array(_.memory.buffer)),d}function w(t,e){return t>>>=0,g.decode(c().subarray(t,t+e))}function l(t,e){return t>>>=0,c().subarray(t/1,t/1+e)}const u="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>{_.__wbindgen_export_1.get(t.dtor)(t.a,t.b)}));function b(t,e,n,r){const i={a:t,b:e,cnt:1,dtor:n},o=(...t)=>{i.cnt++;const e=i.a;i.a=0;try{return r(e,i.b,...t)}finally{0==--i.cnt?(_.__wbindgen_export_1.get(i.dtor)(e,i.b),u.unregister(i)):i.a=e}};return o.original=i,u.register(o,i,i),o}function p(t,e,n){_._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h6f3c6e2a403d1e3d(t,e,s(n))}function f(){_.enable_tracing()}let y=0;const h="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},m="function"==typeof h.encodeInto?function(t,e){return h.encodeInto(t,e)}:function(t,e){const _=h.encode(t);return e.set(_),{read:t.length,written:_.length}};function I(t,e,_){if(void 0===_){const _=h.encode(t),n=e(_.length,1)>>>0;return c().subarray(n,n+_.length).set(_),y=_.length,n}let n=t.length,r=e(n,1)>>>0;const i=c();let o=0;for(;o<n;o++){const e=t.charCodeAt(o);if(e>127)break;i[r+o]=e}if(o!==n){0!==o&&(t=t.slice(o)),r=_(r,n,n=o+3*t.length,1)>>>0;const e=c().subarray(r+o,r+n);o+=m(t,e).written,r=_(r,n,o,1)>>>0}return y=o,r}let k=null;function F(){return(null===k||!0===k.buffer.detached||void 0===k.buffer.detached&&k.buffer!==_.memory.buffer)&&(k=new DataView(_.memory.buffer)),k}function v(t,e){try{return t.apply(this,e)}catch(n){_.__wbindgen_exn_store(s(n))}}function R(t,e,n,r){_.wasm_bindgen__convert__closures__invoke2_mut__h367b7e3d952c2b06(t,e,s(n),s(r))}let x=null;function z(){return null!==x&&0!==x.byteLength||(x=new Float64Array(_.memory.buffer)),x}function T(t,e){return t>>>=0,z().subarray(t/8,t/8+e)}let P=null;function M(){return null!==P&&0!==P.byteLength||(P=new Uint32Array(_.memory.buffer)),P}function q(t,e){return t>>>=0,M().subarray(t/4,t/4+e)}function O(t,e){t>>>=0;const _=F(),n=[];for(let r=t;r<t+4*e;r+=4)n.push(a(_.getUint32(r,!0)));return n}let j=null;function C(){return null!==j&&0!==j.byteLength||(j=new Uint16Array(_.memory.buffer)),j}function B(t,e){const _=e(2*t.length,2)>>>0;return C().set(t,_/2),y=t.length,_}function A(t,e){const _=e(4*t.length,4)>>>0,n=F();for(let r=0;r<t.length;r++)n.setUint32(_+4*r,s(t[r]),!0);return y=t.length,_}function S(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`);return t.ptr}function W(t,e){const _=e(8*t.length,8)>>>0;return z().set(t,_/8),y=t.length,_}function G(t,e){const _=e(4*t.length,4)>>>0;return M().set(t,_/4),y=t.length,_}function E(t){return null==t}function U(t,e){const _=e(1*t.length,1)>>>0;return c().set(t,_/1),y=t.length,_}function D(t,e,n){const r=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),i=y;return a(_.readMetadata(r,i,s(e),s(n)))}function L(t){const e=U(t,_.__wbindgen_malloc),n=y;return a(_.readMetadataFromFile(e,n))}function V(t,e,n,r,i){const o=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),g=y;S(r,tt);var d=r.__destroy_into_raw();let c=0;E(i)||(S(i,rt),c=i.__destroy_into_raw());return a(_.readFile(o,g,s(e),s(n),d,c))}function N(t,e){let n=0;E(t)||(S(t,rt),n=t.__destroy_into_raw());const r=U(e,_.__wbindgen_malloc),i=y;return a(_.readFileFromBinary(n,r,i))}const X=Object.freeze({None:0,0:"None",Snappy:1,1:"Snappy"}),Y=Object.freeze({Point:0,0:"Point",Polygon:1,1:"Polygon",Polyline:2,2:"Polyline",Multipoint:3,3:"Multipoint"}),$=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],J="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_columndescriptor_free(t>>>0,1)));class Q{static __wrap(t){t>>>=0;const e=Object.create(Q.prototype);return e.__wbg_ptr=t,J.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,J.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_columndescriptor_free(t,0)}name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}physicalType(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_physicalType(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}logicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_logicalType(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}encodings(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_encodings(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}pageEncodings(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_pageEncodings(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=O(t,e).slice(),_.__wbindgen_free(t,4*e,4)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}numValues(){return _.columndescriptor_numValues(this.__wbg_ptr)}compression(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_compression(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}compressedSize(){return _.columndescriptor_compressedSize(this.__wbg_ptr)}uncompressedSize(){return _.columndescriptor_uncompressedSize(this.__wbg_ptr)}nullCount(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_nullCount(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getBigInt64(n+8,!0);return 0===t?void 0:e}finally{_.__wbindgen_add_to_stack_pointer(16)}}distinctCount(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_distinctCount(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getBigInt64(n+8,!0);return 0===t?void 0:e}finally{_.__wbindgen_add_to_stack_pointer(16)}}minValue(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_minValue(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=l(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}maxValue(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.columndescriptor_maxValue(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=l(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const K="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_fieldmetadata_free(t>>>0,1)));class H{static __wrap(t){t>>>=0;const e=Object.create(H.prototype);return e.__wbg_ptr=t,K.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_fieldmetadata_free(t,0)}get name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}get index(){return _.fieldmetadata_index(this.__wbg_ptr)}get type(){const t=_.fieldmetadata_esri_type(this.__wbg_ptr);return $[t]}get physicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_physical_type(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}get logicalType(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.fieldmetadata_logical_type(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const Z="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_filemetadata_free(t>>>0,1)));class tt{static __wrap(t){t>>>=0;const e=Object.create(tt.prototype);return e.__wbg_ptr=t,Z.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_filemetadata_free(t,0)}version(){return _.filemetadata_version(this.__wbg_ptr)}numRows(){return _.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return _.filemetadata_numFields(this.__wbg_ptr)>>>0}numColumns(){return _.filemetadata_numColumns(this.__wbg_ptr)>>>0}createdBy(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_createdBy(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=w(t,e).slice(),_.__wbindgen_free(t,1*e,1)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}keyValueMetadata(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),o=y;_.filemetadata_keyValueMetadata(r,this.__wbg_ptr,i,o);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let a;return 0!==e&&(a=w(e,n).slice(),_.__wbindgen_free(e,1*n,1)),a}finally{_.__wbindgen_add_to_stack_pointer(16)}}keys(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_keys(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);let r;return 0!==t&&(r=O(t,e).slice(),_.__wbindgen_free(t,4*e,4)),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(t){const e=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),n=y,r=_.filemetadata_getFieldIndex(this.__wbg_ptr,e,n);return 16777215===r?void 0:r}getFieldByIndex(t){const e=_.filemetadata_getFieldByIndex(this.__wbg_ptr,t);return 0===e?void 0:H.__wrap(e)}getFields(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.filemetadata_getFields(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const et="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_filewriter_free(t>>>0,1)));class _t{static __wrap(t){t>>>=0;const e=Object.create(_t.prototype);return e.__wbg_ptr=t,et.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,et.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_filewriter_free(t,0)}static new(t,e){const n=A(t,_.__wbindgen_malloc),r=y,i=_.filewriter_new(n,r,e);return _t.__wrap(i)}writeKeyValue(t,e){const n=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),r=y,i=I(e,_.__wbindgen_malloc,_.__wbindgen_realloc),o=y;_.filewriter_writeKeyValue(this.__wbg_ptr,n,r,i,o)}writeI32Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,pt);var n=e.__destroy_into_raw();_.filewriter_writeI32Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeI64Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,yt);var n=e.__destroy_into_raw();_.filewriter_writeI64Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeF32Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,dt);var n=e.__destroy_into_raw();_.filewriter_writeF32Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeF64Page(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,wt);var n=e.__destroy_into_raw();_.filewriter_writeF64Page(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeGeometryPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,ut);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeStringPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,mt);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeBytesPage(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16);S(e,st);var n=e.__destroy_into_raw();_.filewriter_writeBytesPage(i,this.__wbg_ptr,t,n);var r=F().getInt32(i+0,!0);if(F().getInt32(i+4,!0))throw a(r)}finally{_.__wbindgen_add_to_stack_pointer(16)}}finish(){try{const i=this.__destroy_into_raw(),o=_.__wbindgen_add_to_stack_pointer(-16);_.filewriter_finish(o,i);var t=F().getInt32(o+0,!0),e=F().getInt32(o+4,!0),n=F().getInt32(o+8,!0);if(F().getInt32(o+12,!0))throw a(n);var r=l(t,e).slice();return _.__wbindgen_free(t,1*e,1),r}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const nt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_geometryinfodescriptor_free(t>>>0,1)));class rt{static __wrap(t){t>>>=0;const e=Object.create(rt.prototype);return e.__wbg_ptr=t,nt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,nt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_geometryinfodescriptor_free(t,0)}get geometryType(){const t=_.__wbg_get_geometryinfodescriptor_geometryType(this.__wbg_ptr);return 4===t?void 0:t}set geometryType(t){_.__wbg_set_geometryinfodescriptor_geometryType(this.__wbg_ptr,E(t)?4:t)}get wkbIndex(){const t=_.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set wkbIndex(t){_.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,E(t)?16777215:t)}get lngIndex(){const t=_.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set lngIndex(t){_.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,E(t)?16777215:t)}get latIndex(){const t=_.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set latIndex(t){_.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,E(t)?16777215:t)}get xIndex(){const t=_.__wbg_get_geometryinfodescriptor_xIndex(this.__wbg_ptr);return 16777215===t?void 0:t}set xIndex(t){_.__wbg_set_geometryinfodescriptor_xIndex(this.__wbg_ptr,E(t)?16777215:t)}get inWkid(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.__wbg_get_geometryinfodescriptor_inWkid(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);return 0===t?void 0:e>>>0}finally{_.__wbindgen_add_to_stack_pointer(16)}}set inWkid(t){_.__wbg_set_geometryinfodescriptor_inWkid(this.__wbg_ptr,!E(t),E(t)?0:t)}get outWkid(){try{const n=_.__wbindgen_add_to_stack_pointer(-16);_.__wbg_get_geometryinfodescriptor_outWkid(n,this.__wbg_ptr);var t=F().getInt32(n+0,!0),e=F().getInt32(n+4,!0);return 0===t?void 0:e>>>0}finally{_.__wbindgen_add_to_stack_pointer(16)}}set outWkid(t){_.__wbg_set_geometryinfodescriptor_outWkid(this.__wbg_ptr,!E(t),E(t)?0:t)}static new(){const t=_.geometryinfodescriptor_new();return rt.__wrap(t)}setMultiscaleInfo(t){S(t,ot);var e=t.__destroy_into_raw();_.geometryinfodescriptor_setMultiscaleInfo(this.__wbg_ptr,e)}}const it="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_multiscaleinfo_free(t>>>0,1)));class ot{static __wrap(t){t>>>=0;const e=Object.create(ot.prototype);return e.__wbg_ptr=t,it.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,it.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_multiscaleinfo_free(t,0)}static new(){const t=_.multiscaleinfo_new();return ot.__wrap(t)}push(t,e,n,r,i){_.multiscaleinfo_push(this.__wbg_ptr,t,e,n,r,i)}}const at="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderbytes_free(t>>>0,1)));class st{static __wrap(t){t>>>=0;const e=Object.create(st.prototype);return e.__wbg_ptr=t,at.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,at.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderbytes_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return st.__wrap(t)}push(t){var e=E(t)?0:U(t,_.__wbindgen_malloc),n=y;_.pagebuilderbytes_push(this.__wbg_ptr,e,n)}}const gt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderf32_free(t>>>0,1)));class dt{static __wrap(t){t>>>=0;const e=Object.create(dt.prototype);return e.__wbg_ptr=t,gt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,gt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderf32_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return dt.__wrap(t)}push(t){_.pagebuilderf32_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ct="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderf64_free(t>>>0,1)));class wt{static __wrap(t){t>>>=0;const e=Object.create(wt.prototype);return e.__wbg_ptr=t,ct.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ct.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderf64_free(t,0)}static new(){const t=_.multiscaleinfo_new();return wt.__wrap(t)}push(t){_.pagebuilderf64_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const lt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuildergeometry_free(t>>>0,1)));class ut{static __wrap(t){t>>>=0;const e=Object.create(ut.prototype);return e.__wbg_ptr=t,lt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,lt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuildergeometry_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return ut.__wrap(t)}writeXY(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.pagebuildergeometry_writeXY(r,this.__wbg_ptr,t,e);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePBF(t,e,n,r){try{const o=_.__wbindgen_add_to_stack_pointer(-16),s=W(t,_.__wbindgen_malloc),g=y,d=G(e,_.__wbindgen_malloc),c=y;_.pagebuildergeometry_writePBF(o,this.__wbg_ptr,s,g,d,c,n,r);var i=F().getInt32(o+0,!0);if(F().getInt32(o+4,!0))throw a(i)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePolygon(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writePolygon(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writePolyline(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writePolyline(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeMultipoint(t,e){try{const r=_.__wbindgen_add_to_stack_pointer(-16),i=W(t,_.__wbindgen_malloc),o=y,s=G(e,_.__wbindgen_malloc),g=y;_.pagebuildergeometry_writeMultipoint(r,this.__wbg_ptr,i,o,s,g);var n=F().getInt32(r+0,!0);if(F().getInt32(r+4,!0))throw a(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}writeNone(){_.pagebuildergeometry_writeNone(this.__wbg_ptr)}}const bt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderi32_free(t>>>0,1)));class pt{static __wrap(t){t>>>=0;const e=Object.create(pt.prototype);return e.__wbg_ptr=t,bt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,bt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderi32_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return pt.__wrap(t)}push(t){_.pagebuilderi32_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ft="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderi64_free(t>>>0,1)));class yt{static __wrap(t){t>>>=0;const e=Object.create(yt.prototype);return e.__wbg_ptr=t,ft.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ft.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderi64_free(t,0)}static new(){const t=_.multiscaleinfo_new();return yt.__wrap(t)}push(t){_.pagebuilderi64_push(this.__wbg_ptr,!E(t),E(t)?0:t)}}const ht="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pagebuilderstring_free(t>>>0,1)));class mt{static __wrap(t){t>>>=0;const e=Object.create(mt.prototype);return e.__wbg_ptr=t,ht.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,ht.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pagebuilderstring_free(t,0)}static new(){const t=_.pagebuilderbytes_new();return mt.__wrap(t)}push(t){var e=E(t)?0:I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),n=y;_.pagebuilderstring_push(this.__wbg_ptr,e,n)}}const It="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_pageencodingdescriptor_free(t>>>0,1)));class kt{static __wrap(t){t>>>=0;const e=Object.create(kt.prototype);return e.__wbg_ptr=t,It.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,It.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_pageencodingdescriptor_free(t,0)}pageType(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.pageencodingdescriptor_pageType(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}encoding(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.pageencodingdescriptor_encoding(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}count(){return _.pageencodingdescriptor_count(this.__wbg_ptr)}}const Ft="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_parquetchunk_free(t>>>0,1)));class vt{static __wrap(t){t>>>=0;const e=Object.create(vt.prototype);return e.__wbg_ptr=t,Ft.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Ft.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_parquetchunk_free(t,0)}size(){return _.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(t){return 0!==_.parquetchunk_hasField(this.__wbg_ptr,t)}readX(t){return _.parquetchunk_readX(this.__wbg_ptr,t)}readY(t){return _.parquetchunk_readY(this.__wbg_ptr,t)}readCoords(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetchunk_readCoords(r,this.__wbg_ptr,t);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let i;return 0!==e&&(i=T(e,n).slice(),_.__wbindgen_free(e,8*n,8)),i}finally{_.__wbindgen_add_to_stack_pointer(16)}}readLengths(t){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetchunk_readLengths(r,this.__wbg_ptr,t);var e=F().getInt32(r+0,!0),n=F().getInt32(r+4,!0);let i;return 0!==e&&(i=q(e,n).slice(),_.__wbindgen_free(e,4*n,4)),i}finally{_.__wbindgen_add_to_stack_pointer(16)}}readGeometryTransformed(t,e,n,r,i){const o=_.parquetchunk_readGeometryTransformed(this.__wbg_ptr,t,e,n,r,i);return 0===o?void 0:Tt.__wrap(o)}boundsXMin(t){return _.parquetchunk_boundsXMin(this.__wbg_ptr,t)}boundsYMin(t){return _.parquetchunk_boundsYMin(this.__wbg_ptr,t)}boundsXMax(t){return _.parquetchunk_boundsXMax(this.__wbg_ptr,t)}boundsYMax(t){return _.parquetchunk_boundsYMax(this.__wbg_ptr,t)}readAttribute(t,e){return a(_.parquetchunk_readAttribute(this.__wbg_ptr,t,e))}}const Rt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_parquetfile_free(t>>>0,1)));let xt=class t{static __wrap(e){e>>>=0;const _=Object.create(t.prototype);return _.__wbg_ptr=e,Rt.register(_,_.__wbg_ptr,_),_}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Rt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_parquetfile_free(t,0)}metadata(){const t=_.parquetfile_metadata(this.__wbg_ptr);return tt.__wrap(t)}rowGroups(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.parquetfile_rowGroups(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}readChunksWithCallback(t,e){const n=B(t,_.__wbindgen_malloc),r=y;return a(_.parquetfile_readChunksWithCallback(this.__wbg_ptr,n,r,s(e)))}readFirstChunk(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_readFirstChunk(this.__wbg_ptr,e,n))}readAllChunks(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_readAllChunks(this.__wbg_ptr,e,n))}updateChunks(t){const e=B(t,_.__wbindgen_malloc),n=y;return a(_.parquetfile_updateChunks(this.__wbg_ptr,e,n))}};const zt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_quantizedgeometry_free(t>>>0,1)));class Tt{static __wrap(t){t>>>=0;const e=Object.create(Tt.prototype);return e.__wbg_ptr=t,zt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,zt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_quantizedgeometry_free(t,0)}readCoordsUnsafe(){return a(_.quantizedgeometry_readCoordsUnsafe(this.__wbg_ptr))}readLengthsUnsafe(){return a(_.quantizedgeometry_readLengthsUnsafe(this.__wbg_ptr))}}const Pt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_rangeproviderjs_free(t>>>0,1)));class Mt{static __wrap(t){t>>>=0;const e=Object.create(Mt.prototype);return e.__wbg_ptr=t,Pt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,Pt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_rangeproviderjs_free(t,0)}static new(t,e){const n=_.rangeproviderjs_new(s(t),s(e));return Mt.__wrap(n)}static withFetch(){const t=_.rangeproviderjs_withFetch();return Mt.__wrap(t)}}const qt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_rowgroup_free(t>>>0,1)));class Ot{static __wrap(t){t>>>=0;const e=Object.create(Ot.prototype);return e.__wbg_ptr=t,qt.register(e,e.__wbg_ptr,e),e}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,qt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_rowgroup_free(t,0)}columns(){try{const r=_.__wbindgen_add_to_stack_pointer(-16);_.rowgroup_columns(r,this.__wbg_ptr);var t=F().getInt32(r+0,!0),e=F().getInt32(r+4,!0),n=O(t,e).slice();return _.__wbindgen_free(t,4*e,4),n}finally{_.__wbindgen_add_to_stack_pointer(16)}}}const jt="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((t=>_.__wbg_schemafield_free(t>>>0,1)));class Ct{static __wrap(t){t>>>=0;const e=Object.create(Ct.prototype);return e.__wbg_ptr=t,jt.register(e,e.__wbg_ptr,e),e}static __unwrap(t){return t instanceof Ct?t.__destroy_into_raw():0}__destroy_into_raw(){const t=this.__wbg_ptr;return this.__wbg_ptr=0,jt.unregister(this),t}free(){const t=this.__destroy_into_raw();_.__wbg_schemafield_free(t,0)}static tryNew(t,e){try{const i=_.__wbindgen_add_to_stack_pointer(-16),o=I(t,_.__wbindgen_malloc,_.__wbindgen_realloc),s=y,g=I(e,_.__wbindgen_malloc,_.__wbindgen_realloc),d=y;_.schemafield_tryNew(i,o,s,g,d);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);if(F().getInt32(i+8,!0))throw a(r);return Ct.__wrap(n)}finally{_.__wbindgen_add_to_stack_pointer(16)}}name(){let t,e;try{const i=_.__wbindgen_add_to_stack_pointer(-16);_.schemafield_name(i,this.__wbg_ptr);var n=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return t=n,e=r,w(n,r)}finally{_.__wbindgen_add_to_stack_pointer(16),_.__wbindgen_free(t,e,1)}}}async function Bt(t,e){if("function"==typeof Response&&t instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(t,e)}catch(_){if("application/wasm"==t.headers.get("Content-Type"))throw _;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",_)}const n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}{const _=await WebAssembly.instantiate(t,e);return _ instanceof WebAssembly.Instance?{instance:_,module:t}:_}}function At(){const t={wbg:{}};return t.wbg.__wbg_new_abda76e883ba8a5f=function(){return s(new Error)},t.wbg.__wbg_stack_658279fe44541cf6=function(t,e){const n=I(r(e).stack,_.__wbindgen_malloc,_.__wbindgen_realloc),i=y;F().setInt32(t+4,i,!0),F().setInt32(t+0,n,!0)},t.wbg.__wbg_error_f851667af71bcfc6=function(t,e){let n,r;try{n=t,r=e,console.error(w(t,e))}finally{_.__wbindgen_free(n,r,1)}},t.wbg.__wbindgen_object_drop_ref=function(t){a(t)},t.wbg.__wbindgen_is_function=function(t){return"function"==typeof r(t)},t.wbg.__wbg_self_3093d5d1f7bcb682=function(){return v((function(){return s(self.self)}),arguments)},t.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return v((function(){return s(window.window)}),arguments)},t.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return v((function(){return s(globalThis.globalThis)}),arguments)},t.wbg.__wbg_global_e5a3fe56f8be9485=function(){return v((function(){return s(global.global)}),arguments)},t.wbg.__wbindgen_is_undefined=function(t){return void 0===r(t)},t.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(t,e){return s(new Function(w(t,e)))},t.wbg.__wbindgen_object_clone_ref=function(t){return s(r(t))},t.wbg.__wbindgen_number_new=function(t){return s(t)},t.wbg.__wbindgen_string_new=function(t,e){return s(w(t,e))},t.wbg.__wbg_call_1084a111329e68ce=function(){return v((function(t,e){return s(r(t).call(r(e)))}),arguments)},t.wbg.__wbg_call_89af060b4e1523f2=function(){return v((function(t,e,_){return s(r(t).call(r(e),r(_)))}),arguments)},t.wbg.__wbg_call_7de908392845a9a5=function(){return v((function(t,e,_,n,i){return s(r(t).call(r(e),r(_),r(n),r(i)))}),arguments)},t.wbg.__wbg_valueOf_563b3487b1b116aa=function(t){return r(t).valueOf()},t.wbg.__wbg_buffer_b7b08af79b0b0974=function(t){return s(r(t).buffer)},t.wbg.__wbg_new_b85e72ed1bfd57f9=function(t,e){try{var _={a:t,b:e},n=(t,e)=>{const n=_.a;_.a=0;try{return R(n,_.b,t,e)}finally{_.a=n}};return s(new Promise(n))}finally{_.a=_.b=0}},t.wbg.__wbg_resolve_570458cb99d56a43=function(t){return s(Promise.resolve(r(t)))},t.wbg.__wbg_then_95e6edc0f89b73b1=function(t,e){return s(r(t).then(r(e)))},t.wbg.__wbg_then_876bb3c633745cc6=function(t,e,_){return s(r(t).then(r(e),r(_)))},t.wbg.__wbg_newwithbyteoffsetandlength_b5293b0eedbac651=function(t,e,_){return s(new Int16Array(r(t),e>>>0,_>>>0))},t.wbg.__wbg_new_ea1883e1e5e86686=function(t){return s(new Uint8Array(r(t)))},t.wbg.__wbg_newwithbyteoffsetandlength_874df3e29cb555f9=function(t,e,_){return s(new Uint32Array(r(t),e>>>0,_>>>0))},t.wbg.__wbg_length_8339fcf5d8ecd12e=function(t){return r(t).length},t.wbg.__wbg_set_d1e79e2388520f18=function(t,e,_){r(t).set(r(e),_>>>0)},t.wbg.__wbindgen_throw=function(t,e){throw new Error(w(t,e))},t.wbg.__wbindgen_memory=function(){return s(_.memory)},t.wbg.__wbindgen_array_new=function(){return s([])},t.wbg.__wbindgen_array_push=function(t,e){r(t).push(a(e))},t.wbg.__wbindgen_uint8_array_new=function(t,e){var n=l(t,e).slice();_.__wbindgen_free(t,1*e,1);return s(n)},t.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(t){return s(r(t).queueMicrotask)},t.wbg.__wbindgen_cb_drop=function(t){const e=a(t).original;if(1==e.cnt--)return e.a=0,!0;return!1},t.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(t){queueMicrotask(r(t))},t.wbg.__wbg_parquetchunk_new=function(t){return s(vt.__wrap(t))},t.wbg.__wbg_parquetfile_new=function(t){return s(xt.__wrap(t))},t.wbg.__wbg_filemetadata_new=function(t){return s(tt.__wrap(t))},t.wbg.__wbg_fieldmetadata_new=function(t){return s(H.__wrap(t))},t.wbg.__wbg_rowgroup_new=function(t){return s(Ot.__wrap(t))},t.wbg.__wbg_schemafield_unwrap=function(t){return Ct.__unwrap(a(t))},t.wbg.__wbg_columndescriptor_new=function(t){return s(Q.__wrap(t))},t.wbg.__wbg_pageencodingdescriptor_new=function(t){return s(kt.__wrap(t))},t.wbg.__wbindgen_closure_wrapper1832=function(t,e,_){return s(b(t,e,163,p))},t}function St(t,e){return _=t.exports,Gt.__wbindgen_wasm_module=e,k=null,x=null,j=null,P=null,d=null,_.__wbindgen_start(),_}function Wt(t){if(void 0!==_)return _;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module:t}=t):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const e=At();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));return St(new WebAssembly.Instance(t,e),t)}async function Gt(t){if(void 0!==_)return _;void 0!==t&&(Object.getPrototypeOf(t)===Object.prototype?({module_or_path:t}=t):console.warn("using deprecated parameters for the initialization function; pass a single object instead"));const e=At();("string"==typeof t||"function"==typeof Request&&t instanceof Request||"function"==typeof URL&&t instanceof URL)&&(t=fetch(t));const{instance:n,module:r}=await Bt(await t,e);return St(n,r)}const Et=Object.freeze(Object.defineProperty({__proto__:null,ColumnDescriptor:Q,CompressMode:X,FieldMetadata:H,FileMetadata:tt,FileWriter:_t,GeometryInfoDescriptor:rt,GeometryType:Y,MultiScaleInfo:ot,PageBuilderBytes:st,PageBuilderF32:dt,PageBuilderF64:wt,PageBuilderGeometry:ut,PageBuilderI32:pt,PageBuilderI64:yt,PageBuilderString:mt,PageEncodingDescriptor:kt,ParquetChunk:vt,ParquetFile:xt,QuantizedGeometry:Tt,RangeProviderJs:Mt,RowGroup:Ot,SchemaField:Ct,default:Gt,enable_tracing:f,initSync:Wt,readFile:V,readFileFromBinary:N,readMetadata:D,readMetadataFromFile:L},Symbol.toStringTag,{value:"Module"}));let Ut=null;async function Dt(){return Ut||(Ut=Lt()),Ut}async function Lt(){const e=await Promise.resolve().then((()=>Et));return await e.default({module_or_path:t("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),e}const Vt=t=>async function(_,n,r){const i=t(),{data:o}=await e(_,{responseType:"array-buffer",query:i,headers:{range:`bytes=${n}-${r}`},useRequestQueue:!0});return o},Nt=t=>async function(_){const n=t(),{data:r}=await e(_,{responseType:"native",method:"head",query:n,useRequestQueue:!0}),i=r.headers.get("Content-Length");if(null==i)throw new Error("Unable to parse content length");return parseInt(i,10)};class Xt{static async create(t,e){const _=await Dt(),n=await _.readMetadata(t,Vt(e),Nt(e));return Xt.fromFileMetadata(n)}static fromFileMetadata(t){const e=[];for(let _=0;_<t.numFields();_++){const n=t.getFieldByIndex(_);e.push({name:n.name,type:n.type,alias:n.name,index:n.index}),n.free()}return new Xt(t,e)}constructor(t,e){this._inner=t,this.fields=e}destroy(){this._inner.free()}[Symbol.dispose](){this.destroy()}get size(){return this._inner.numRows()}getFieldIndex(t){return this._inner.getFieldIndex(t)}tryReadGeoMetadata(){const t=this._inner.keyValueMetadata("geo");return null==t?null:JSON.parse(t)}tryReadEsriMetadata(){const t=this._inner.keyValueMetadata("esri");return null==t?null:JSON.parse(t)}}function Yt(t){switch(t){case"esriGeometryPoint":return Y.Point;case"esriGeometryPolygon":return Y.Polygon;case"esriGeometryPolyline":return Y.Polyline;case"esriGeometryMultipoint":return Y.Multipoint;default:throw new Error(`InternalError: Found unexpected GeometryType: ${t}`)}}function $t(t,e,_){const n=rt.new();if(n.geometryType=Yt(t.geometryType),"location"===t.type)n.latIndex=e.getFieldIndex(t.latitudeFieldName),n.lngIndex=e.getFieldIndex(t.longitudeFieldName);else{if(null==t.primaryFieldName)throw new Error("InternalError: A primary field name or set of location fields must be defined");if(n.wkbIndex=e.getFieldIndex(t.primaryFieldName),t.multiscale){const _=ot.new();for(const n of t.multiscale.levels){const[t,r]=n.transform.translate,[i,o]=n.transform.scale,a=e.getFieldIndex(n.column);_.push(a,t,r,i,o)}n.setMultiscaleInfo(_)}}return n.inWkid=t.spatialReference.wkid,_&&(n.outWkid=_.wkid),n}class Jt{static async create(t,e){const _=await Dt(),n=Vt(e.getCustomParameters),r=Nt(e.getCustomParameters),i=await D(t,n,r),o=$t(e.geometryInfo,i,e.outSpatialReference),a=await _.readFile(t,n,r,i,o);return new Jt(a,Xt.fromFileMetadata(a.metadata()))}static async fromFile(t,e,_){const n=await Dt(),r=await n.readMetadataFromFile(t),i=e?$t(e,r,_):void 0,o=await n.readFileFromBinary(i,t);return new Jt(o,Xt.fromFileMetadata(o.metadata()))}constructor(t,e){this.inner=t,this.metadata=e}destroy(){this.inner.free(),this.metadata.destroy()}[Symbol.dispose](){this.destroy()}}export{Jt as ParquetFile,Xt as ParquetMetadata};
|
|
5
|
+
import e from"../../request.js";import{loadParquetModule as t}from"./loadParquetModule.js";import{GeometryInfoDescriptor as a,MultiScaleInfo as r,GeometryType as n}from"../../chunks/bundle.js";const i=t=>async function(a,r,n){const i=t(),{data:s}=await e(a,{responseType:"array-buffer",query:i,headers:{range:`bytes=${r}-${n}`},useRequestQueue:!0});return s},s=t=>async function(a){const r=t(),{data:n}=await e(a,{responseType:"native",method:"head",query:r,useRequestQueue:!0}),i=n.headers.get("Content-Length");if(null==i)throw new Error("Unable to parse content length");return parseInt(i,10)};class o{static async create(e,a){const r=await t(),n=await r.readMetadata(e,i(a),s(a));return o.fromFileMetadata(n)}static fromFileMetadata(e){const t=[];for(let a=0;a<e.numFields();a++){const r=e.getFieldByIndex(a);t.push({name:r.name,type:r.type,alias:r.name,index:r.index}),r.free()}return new o(e,t)}constructor(e,t){this._inner=e,this.fields=t}destroy(){this._inner.free()}[Symbol.dispose](){this.destroy()}get size(){return this._inner.numRows()}getFieldIndex(e){return this._inner.getFieldIndex(e)}tryReadGeoMetadata(){const e=this._inner.keyValueMetadata("geo");return null==e?null:JSON.parse(e)}tryReadEsriMetadata(){const e=this._inner.keyValueMetadata("esri");return null==e?null:JSON.parse(e)}}function l(e){switch(e){case"esriGeometryPoint":return n.Point;case"esriGeometryPolygon":return n.Polygon;case"esriGeometryPolyline":return n.Polyline;case"esriGeometryMultipoint":return n.Multipoint;default:throw new Error(`InternalError: Found unexpected GeometryType: ${e}`)}}function d(e,t,n){const i=a.new();if(i.geometryType=l(e.geometryType),"location"===e.type)i.latIndex=t.getFieldIndex(e.latitudeFieldName),i.lngIndex=t.getFieldIndex(e.longitudeFieldName);else{if(null==e.primaryFieldName)throw new Error("InternalError: A primary field name or set of location fields must be defined");if(i.wkbIndex=t.getFieldIndex(e.primaryFieldName),e.multiscale){const a=r.new();for(const r of e.multiscale.levels){const[e,n]=r.transform.translate,[i,s]=r.transform.scale,o=t.getFieldIndex(r.column);a.push(o,e,n,i,s)}i.setMultiscaleInfo(a)}}return i.inWkid=e.spatialReference.wkid,n&&(i.outWkid=n.wkid),i}class u{static async create(e,a){const r=await t(),n=i(a.getCustomParameters),l=s(a.getCustomParameters),c=await r.readMetadata(e,n,l),m=d(a.geometryInfo,c,a.outSpatialReference),y=await r.readFile(e,n,l,c,m);return new u(y,o.fromFileMetadata(y.metadata()))}static async fromFile(e,a,r){const n=await t(),i=await n.readMetadataFromFile(e),s=a?d(a,i,r):void 0,l=await n.readFileFromBinary(s,e);return new u(l,o.fromFileMetadata(l.metadata()))}constructor(e,t){this.inner=e,this.metadata=t}destroy(){this.inner.free(),this.metadata.destroy()}[Symbol.dispose](){this.destroy()}}export{u as ParquetFile,o as ParquetMetadata};
|
package/package.json
CHANGED
package/support/revision.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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const
|
|
5
|
+
const a="20250410",c="028c7a4f5cf8bd1a22848eb730441de04a3129a5";export{a as buildDate,c as commitHash};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import o from"../../../core/Error.js";import i from"../../../core/Logger.js";import{releaseMaybe as t}from"../../../core/maybe.js";import{isAborted as r}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationTileData as n}from"../../../layers/support/ElevationTileData.js";import{acquireDecoder as l}from"../../../layers/support/LercDecoder.js";import{ElevationLayerView3DModifications as c,ElevationLayerView3DModification as m}from"./ElevationLayerView3DModifications.js";import{LayerView3D as p}from"./LayerView3D.js";import{TiledLayerView3D as d}from"./TiledLayerView3D.js";import{elevationNoDataValue as y}from"../terrain/TerrainConst.js";import{useFetchTileForLayer as f}from"../terrain/terrainUtils.js";import h from"../../layers/LayerView.js";let g=class extends(d(p(h))){constructor(){super(...arguments),this.type="elevation-3d",this.modifications=new c,this._simplifyOperatorPromise=null}get tileInfo(){return this.layer.tileInfo}initialize(){const e=this.view,i=e.map?.allLayers,t=i&&i.includes(this.layer),r=e.map?.ground?.layers,s=r&&r.includes(this.layer);if(t&&!s){const e=new o("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`);this.addResolvingPromise(Promise.reject(e))}this._lercDecoder=l(e.resourceController),this._addTilingSchemeMatchPromise()}destroy(){this._lercDecoder=t(this._lercDecoder)}async fetchElevationTile(e,o){const i=await this._fetchTileData(e.lij,o);return i?this.modifications.applyToElevation(i,e):i}async _fetchTileData(e,o){const t=this.layer;if(f(t)){const s=await t.fetchTile(e[0],e[1],e[2],{noDataValue:y,signal:o.signal});return r(o)?void i.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."):s}const s=this.getTileUrl(e),a=await o.requester.request(s,"binary",o),l=await this._lercDecoder.decode(a,{noDataValue:y},o.signal);if(l)return new n(l);throw new Error("LERC decoding failed")}async setModifications(e){if(this.modifications.modifications.length=0,!e||0===e.length)return;this._simplifyOperatorPromise??=import("../../../geometry/operators/simplifyOperator.js");const o=await this._simplifyOperatorPromise;for(const t of e){const e=t.geometry;if("polygon"===e?.type){const r=o.execute(e);if("polygon"===r?.type){const e=new m(t.type,r);this.modifications.modifications.push(e)}else i.getLogger(this).warn("Failed to simplify modification polygon")}else i.getLogger(this).warn("Invalid modification added to elevation layer: "+(e?`non polygon geometry ${e.type}`:"no geometry"))}}};e([s()],g.prototype,"layer",void 0),e([s()],g.prototype,"tileInfo",null),e([s()],g.prototype,"modifications",void 0),g=e([a("esri.views.3d.layers.ElevationLayerView3D")],g);const u=g;export{u as default};
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import o from"../../../core/Error.js";import i from"../../../core/Logger.js";import{releaseMaybe as t}from"../../../core/maybe.js";import{isAborted as r}from"../../../core/promiseUtils.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{ElevationTileData as n}from"../../../layers/support/ElevationTileData.js";import{acquireDecoder as l}from"../../../layers/support/LercDecoder.js";import{ElevationLayerView3DModifications as c,ElevationLayerView3DModification as m}from"./ElevationLayerView3DModifications.js";import{LayerView3D as p}from"./LayerView3D.js";import{TiledLayerView3D as d}from"./TiledLayerView3D.js";import{elevationNoDataValue as y}from"../terrain/TerrainConst.js";import{useFetchTileForLayer as f}from"../terrain/terrainUtils.js";import h from"../../layers/LayerView.js";let g=class extends(d(p(h))){constructor(){super(...arguments),this.type="elevation-3d",this.modifications=new c,this._simplifyOperatorPromise=null}get tileInfo(){return this.layer.tileInfo}initialize(){const e=this.view,i=e.map?.allLayers,t=i&&i.includes(this.layer),r=e.map?.ground?.layers,s=r&&r.includes(this.layer);if(t&&!s){const e=new o("layerview:elevation-layer-only",`3D elevation layer '${this.layer.id}' can only be added to layers in map.ground`);this.addResolvingPromise(Promise.reject(e))}this._lercDecoder=l(e.resourceController),this._addTilingSchemeMatchPromise()}destroy(){this._lercDecoder=t(this._lercDecoder)}async fetchElevationTile(e,o){const i=await this._fetchTileData(e.lij,o);if(r(o))return;return i?await this.modifications.applyToElevation(i,e,o.signal):i}async _fetchTileData(e,o){const t=this.layer;if(f(t)){const s=await t.fetchTile(e[0],e[1],e[2],{noDataValue:y,signal:o.signal});return r(o)?void i.getLogger(this).warnOnce("A call to fetchTile resolved even though the request was aborted. fetchTile should not resolve if options.signal.aborted is true."):s}const s=this.getTileUrl(e),a=await o.requester.request(s,"binary",o),l=await this._lercDecoder.decode(a,{noDataValue:y},o.signal);if(l)return new n(l);throw new Error("LERC decoding failed")}async setModifications(e){if(this.modifications.modifications.length=0,!e||0===e.length)return;this._simplifyOperatorPromise??=import("../../../geometry/operators/simplifyOperator.js");const o=await this._simplifyOperatorPromise;for(const t of e){const e=t.geometry;if("polygon"===e?.type){const r=o.execute(e);if("polygon"===r?.type){const e=new m(t.type,r);this.modifications.modifications.push(e)}else i.getLogger(this).warn("Failed to simplify modification polygon")}else i.getLogger(this).warn("Invalid modification added to elevation layer: "+(e?`non polygon geometry ${e.type}`:"no geometry"))}}};e([s()],g.prototype,"layer",void 0),e([s()],g.prototype,"tileInfo",null),e([s()],g.prototype,"modifications",void 0),g=e([a("esri.views.3d.layers.ElevationLayerView3D")],g);const u=g;export{u 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.33/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../geometry/Extent.js";import{ElevationTileData as
|
|
5
|
+
import{isAborted as e}from"../../../core/promiseUtils.js";import t from"../../../geometry/Extent.js";import{ElevationTileData as o}from"../../../layers/support/ElevationTileData.js";class r{constructor(){this.modifications=[]}async applyToElevation(t,o,r){let a=t;if(this.modifications.length>0){if(n.operatorLoadPromise??=Promise.all([import("../../../geometry/operators/containsOperator.js"),import("../../../geometry/operators/intersectsOperator.js"),import("../../../geometry/operators/intersectionOperator.js")]),n.operators=await n.operatorLoadPromise,e(r))return a;for(const e of this.modifications)a=e.applyOneModificationToElevation(a,o)}return a}}class n{constructor(e,t){this.type=e,this.polygon=t}applyOneModificationToElevation(e,r){const{polygon:s}=this,[l,c,f]=n.operators;if("replace"===this.type){l.accelerateGeometry(s),c.accelerateGeometry(s),f.accelerateGeometry(s);const[n,p,m,y]=r.extent,{spatialReference:u}=r,h=new t({xmin:n,ymin:p,xmax:m,ymax:y,spatialReference:u});if(!c.execute(s,h))return e;const{width:d,height:x,noDataValue:g}=e,w=new Float32Array(d*x),v=s.rings.reduce(((e,t)=>Math.min(e,t.reduce(((e,t)=>Math.min(e,t[2]??1/0)),1/0))),1/0),P=v===1/0?0:v;if(l.execute(s,h))w.fill(P);else{const t=a(r,s,[d,x]);if(!t)return e;if(t.rings.every((e=>0===e.length)))return e;const o=i(r,t,[d,x]),n=e.values;for(let e=x-1;e>=0;--e)for(let t=0;t<d;++t){const r=(e+1)*(d+2)+(t+1);let a=0;for(let e=-1;e<=1;++e){const t=r+e*(d+2);for(let e=-1;e<=1;++e)a=Math.max(a,o[t+e])}const i=e*d+t;w[i]=0===a?n[i]:P}}return new o(w,d,x,g)}return e}static{this.operatorLoadPromise=null}static{this.operators=null}}function a(e,o,r){const[a,i,s,l]=e.extent,{spatialReference:c}=e,[f,p]=r,m=2,y=(s-a)/(f-1),u=(l-i)/(p-1),h=new t({xmin:a-m*y,ymin:i-m*u,xmax:s+m*y,ymax:l+m*u,spatialReference:c}),d=n.operators[2].execute(o,h);return"polygon"===d?.type?d:null}function i(e,t,o){const[r,n]=o,a=new OffscreenCanvas(r+2,n+2).getContext("2d",{willReadFrequently:!0});if(!a)throw new Error("failed to create canvas");const[i,l,c,f]=e.extent,p=c-i,m=f-l;a.fillStyle="black",a.clearRect(0,0,r,n);const y=new Path2D;for(const x of t.rings)if(x.length>0){const e=new Path2D;let t=!0;for(const[o,a]of x){const l=(o-i)/p*(r-1)+1+s,c=(f-a)/m*(n-1)+1+s;t?(t=!1,e.moveTo(l,c)):e.lineTo(l,c)}e.closePath(),y.addPath(e)}a.fillStyle="white",a.fill(y,"evenodd");const u=a.getImageData(0,0,r+2,n+2),h=(r+2)*(n+2),d=new Uint8Array(h);for(let s=0;s<h;++s)d[s]=u.data[4*s+0]>0?1:0;return d}const s=.5;export{n as ElevationLayerView3DModification,r as ElevationLayerView3DModifications};
|