@arcgis/core 5.2.1 → 5.2.2
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/{67e533748435253aaba6.js → 0284f608d25c654fcc11.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d9a1f23ec6ce90723ac.js → 0d99bfb75dcb9fa29080.js} +1 -1
- package/assets/esri/core/workers/chunks/0fa29352f2ecf0c515e8.js +1 -0
- package/assets/esri/core/workers/chunks/10ad7b35b6800d40444e.js +1 -0
- package/assets/esri/core/workers/chunks/1132e28aaa5825b10b6e.js +1 -0
- package/assets/esri/core/workers/chunks/{10878932826ddb60fac4.js → 1fcc998421c7c16de2ca.js} +1 -1
- package/assets/esri/core/workers/chunks/21e1d423ee33f916547e.js +1 -0
- package/assets/esri/core/workers/chunks/251f706d226b1d47ba99.js +1 -0
- package/assets/esri/core/workers/chunks/{ba38231193919e093917.js → 2529f12fc16e98c014ca.js} +1 -1
- package/assets/esri/core/workers/chunks/2b4dd42920d37b1ff0a9.js +2 -0
- package/assets/esri/core/workers/chunks/2b804b5d7ce10f0f0cf0.js +1 -0
- package/assets/esri/core/workers/chunks/3537fe95b83a13b156cc.js +1 -0
- package/assets/esri/core/workers/chunks/36f31416132de434ec00.js +1 -0
- package/assets/esri/core/workers/chunks/3e29ab5ec136e669b633.js +1 -0
- package/assets/esri/core/workers/chunks/{36c780a9527c75b36725.js → 40d7e54529d13fdd2bf1.js} +1 -1
- package/assets/esri/core/workers/chunks/{2cb209bc51a19487692d.js → 43aef67452fa6ff8d8f9.js} +2 -2
- package/assets/esri/core/workers/chunks/449a2dee17b54946f245.js +1 -0
- package/assets/esri/core/workers/chunks/{5d42f0898bf30ae940ea.js → 46071e59290bf06bb614.js} +1 -1
- package/assets/esri/core/workers/chunks/46d91cd99558304da0c7.js +1 -0
- package/assets/esri/core/workers/chunks/4cf72dcccf2be353a701.js +1 -0
- package/assets/esri/core/workers/chunks/{e3a742dc0c291b47ba56.js → 510c2eb78f5e12f77bbc.js} +1 -1
- package/assets/esri/core/workers/chunks/{98d1efb6f2439c6344cf.js → 5b2d1c8763a1716677c0.js} +1 -1
- package/assets/esri/core/workers/chunks/5bf7de2e2faa55e53629.js +1 -0
- package/assets/esri/core/workers/chunks/{042614bf65b7d63025cb.js → 5f49233d5b67a9ad71d7.js} +1 -1
- package/assets/esri/core/workers/chunks/604433b02a165d187953.js +1 -0
- package/assets/esri/core/workers/chunks/61d36730564c5ac5edab.js +1 -0
- package/assets/esri/core/workers/chunks/{094eb9677cdebfaa9e1b.js → 648d5cdfc3e92be3db55.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc6fdd9faf8ed54be0cb.js → 6694e2b27fd6ddf44e21.js} +1 -1
- package/assets/esri/core/workers/chunks/70268d790c2f1cb83d43.js +1 -0
- package/assets/esri/core/workers/chunks/7b45ac83e279fe9516a5.js +1 -0
- package/assets/esri/core/workers/chunks/8102f0bf5707c3be3310.js +1 -0
- package/assets/esri/core/workers/chunks/{d56fdf5ce5ff53dc0e69.js → 84495695313b01832369.js} +1 -1
- package/assets/esri/core/workers/chunks/{31640b41e0ecdff892fa.js → 85b63811ae7bcb6f74b6.js} +2 -2
- package/assets/esri/core/workers/chunks/{c4bbe4707e90b7cd0379.js → 8ac4a043a4f185db271f.js} +1 -1
- package/assets/esri/core/workers/chunks/8d01dd92f5c897193ab5.js +1 -0
- package/assets/esri/core/workers/chunks/900c8569596609183f19.js +2 -0
- package/assets/esri/core/workers/chunks/{d1d6154b4af1c9cc497b.js → 934e1f2153e6fad6ed23.js} +1 -1
- package/assets/esri/core/workers/chunks/95c9c5677bbe7fd0420a.js +1 -0
- package/assets/esri/core/workers/chunks/{b70885deebc6106597ad.js → 983b85727e09c54bede0.js} +1 -1
- package/assets/esri/core/workers/chunks/{d20dcd4ce4b0111d924f.js → 9bbc8e5d42921a8050bb.js} +1 -1
- package/assets/esri/core/workers/chunks/a07070de96e143a329a4.js +1 -0
- package/assets/esri/core/workers/chunks/a17fb26d6ac4895e51a3.js +2 -0
- package/assets/esri/core/workers/chunks/{0d52e1b6d38f2670658c.js → a6f74bd1a9c87b9836ca.js} +1 -1
- package/assets/esri/core/workers/chunks/{a85cdafbaf1848bb924b.js → a846c94d49df8d4cd5be.js} +1 -1
- package/assets/esri/core/workers/chunks/aa4f12fcb9f4ed3dba18.js +1 -0
- package/assets/esri/core/workers/chunks/ac10c7d2c4829a150037.js +1 -0
- package/assets/esri/core/workers/chunks/{509a74e9334f31b931d4.js → b54ba2bd6b1b90dcc0cc.js} +1 -1
- package/assets/esri/core/workers/chunks/bde8f3b3ce5b1d3ee774.js +1 -0
- package/assets/esri/core/workers/chunks/c25ae83fd790f181bb42.js +1 -0
- package/assets/esri/core/workers/chunks/{dc51dcaa4e2f9a90f5bd.js → c2cbe0f5e8958cf18e58.js} +2 -2
- package/assets/esri/core/workers/chunks/c4c55d8a98ba3f51f63c.js +1 -0
- package/assets/esri/core/workers/chunks/c5bf19da62a3d31009fe.js +2 -0
- package/assets/esri/core/workers/chunks/{2226c20c38e20713bcb5.js.LICENSE.txt → c5bf19da62a3d31009fe.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{2a2a4650dd9b953d317c.js → c93343a91161c4e40c28.js} +1 -1
- package/assets/esri/core/workers/chunks/cb4c5544382eb8c4a87f.js +1 -0
- package/assets/esri/core/workers/chunks/{2d83ba260dd6bbe38206.js → d05665ddc8d31403aed3.js} +1 -1
- package/assets/esri/core/workers/chunks/d24dea0bdb17db07e2b3.js +1 -0
- package/assets/esri/core/workers/chunks/d3412518a7b518860fbb.js +1 -0
- package/assets/esri/core/workers/chunks/d4bc6d65dff5d0cc93ba.js +1 -0
- package/assets/esri/core/workers/chunks/{3048e74e6246324ce6fc.js → d5916500514a41a4758f.js} +1 -1
- package/assets/esri/core/workers/chunks/{aea44253c80493ef5755.js → e7b168ba31142c00f765.js} +1 -1
- package/assets/esri/core/workers/chunks/{a504a5e06cb89a620799.js → ec8b7476eac4718eb0ac.js} +1 -1
- package/assets/esri/core/workers/chunks/f497968055af459c5da4.js +1 -0
- package/assets/esri/core/workers/chunks/{d53cc574a21031436c45.js → f79494829a5b65b5b4c9.js} +1 -1
- package/assets/esri/core/workers/chunks/{26261b21d1edf476ea49.js → f7ec3b7f2eccd9c4c2e5.js} +1 -1
- package/assets/esri/core/workers/chunks/{20ee2f36f0fd0ae01e15.js → f88cbf9b1d1d7400c060.js} +1 -1
- package/assets/esri/core/workers/chunks/{bf4d913e523eae2fda28.js → fa7b189e9b2cc8d4a77f.js} +1 -1
- package/assets/esri/core/workers/chunks/fcb4707c2e95099b9f30.js +1 -0
- package/assets/esri/core/workers/chunks/{735c1dffc3439bdba3cc.js → fd172c96d2b36032a1d9.js} +1 -1
- package/config.js +1 -1
- package/core/workers.d.ts +1 -0
- package/kernel.js +1 -1
- package/layers/CSVLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/sources/CSVSource.js +1 -1
- package/layers/graphics/sources/GeoJSONSource.js +1 -1
- package/layers/graphics/sources/MemorySource.js +2 -2
- package/layers/graphics/sources/support/QueryTask.js +1 -1
- package/layers/graphics/sources/support/timeQueryUtils.js +2 -0
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/raster/functions/rasterProjectionHelper.js +1 -1
- package/layers/support/TimeInformation.js +1 -1
- package/layers/support/timeInfoUtils.js +2 -0
- package/package.json +4 -4
- package/rest/query/executeAttributeBinsQuery.js +1 -1
- package/rest/query/executeForExtent.js +1 -1
- package/rest/query/executeForTopCount.js +1 -1
- package/rest/query/executeForTopExtents.js +1 -1
- package/rest/query/executeForTopIds.js +1 -1
- package/rest/query/executeTopFeaturesQuery.js +1 -1
- package/rest/query/operations/query.js +1 -1
- package/rest/query/operations/queryAttributeBins.js +1 -1
- package/rest/query/operations/queryTopFeatures.js +1 -1
- package/rest/support/timeUtils.js +1 -1
- package/symbols/TextSymbol.d.ts +0 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/3d/environment/SunLighting.d.ts +10 -8
- package/views/3d/environment/VirtualLighting.d.ts +10 -8
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/queries.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/utils.js +1 -1
- package/widgets/OrientedImageryViewer.js +2 -2
- package/assets/esri/core/workers/chunks/20a698709c3c11ff2c16.js +0 -1
- package/assets/esri/core/workers/chunks/2226c20c38e20713bcb5.js +0 -2
- package/assets/esri/core/workers/chunks/2a570ce6b99dac6ee996.js +0 -1
- package/assets/esri/core/workers/chunks/2b6684d057d9ad17ac13.js +0 -1
- package/assets/esri/core/workers/chunks/2e66c969bf4209c957b5.js +0 -2
- package/assets/esri/core/workers/chunks/377595b23379b0c8fe95.js +0 -1
- package/assets/esri/core/workers/chunks/379ef56f6b32494832a6.js +0 -1
- package/assets/esri/core/workers/chunks/38d852676677e5697864.js +0 -1
- package/assets/esri/core/workers/chunks/3c881b1adc8a5dea9a90.js +0 -1
- package/assets/esri/core/workers/chunks/4e6656a5f29e31902fca.js +0 -2
- package/assets/esri/core/workers/chunks/50e8943d2c0b96fab2c1.js +0 -1
- package/assets/esri/core/workers/chunks/5a9b7eb26f936f03d02e.js +0 -1
- package/assets/esri/core/workers/chunks/5f07f52bb8b7721f08d3.js +0 -1
- package/assets/esri/core/workers/chunks/60c79934799927114074.js +0 -1
- package/assets/esri/core/workers/chunks/63b5418a1c3fe0a97a86.js +0 -1
- package/assets/esri/core/workers/chunks/6ddc29a144640acb1192.js +0 -1
- package/assets/esri/core/workers/chunks/6f73e41e14817acfaead.js +0 -1
- package/assets/esri/core/workers/chunks/7dfbc31f3b56728485a4.js +0 -1
- package/assets/esri/core/workers/chunks/822f83d7c09ef0a9bbdf.js +0 -1
- package/assets/esri/core/workers/chunks/844eedda8f749972f707.js +0 -2
- package/assets/esri/core/workers/chunks/8b8118ab56cc808b5a71.js +0 -1
- package/assets/esri/core/workers/chunks/8d86b0cb0e004ad72040.js +0 -1
- package/assets/esri/core/workers/chunks/98760040f0c9d47c718d.js +0 -1
- package/assets/esri/core/workers/chunks/a2f0894218e665780a21.js +0 -1
- package/assets/esri/core/workers/chunks/a65951f1d5702cfd996e.js +0 -1
- package/assets/esri/core/workers/chunks/ab6506a3c16f8717fc00.js +0 -1
- package/assets/esri/core/workers/chunks/c45edd0a7d57263bb7d6.js +0 -1
- package/assets/esri/core/workers/chunks/c52466eb1f3c33ae1f5a.js +0 -1
- package/assets/esri/core/workers/chunks/c570b90995c65bbb2e14.js +0 -1
- package/assets/esri/core/workers/chunks/c576bef77e34920af188.js +0 -1
- package/assets/esri/core/workers/chunks/c80a3b039e510c118399.js +0 -1
- package/assets/esri/core/workers/chunks/c88a70f68c8ce8c30e9b.js +0 -1
- package/assets/esri/core/workers/chunks/cf1ec61eb2ad147bb931.js +0 -1
- package/assets/esri/core/workers/chunks/daae21cf77864f3293ef.js +0 -1
- package/assets/esri/core/workers/chunks/e9cdb0b0f074583edebd.js +0 -1
- package/assets/esri/core/workers/chunks/f5cc78291b53931b91e8.js +0 -1
- /package/assets/esri/core/workers/chunks/{844eedda8f749972f707.js.LICENSE.txt → 2b4dd42920d37b1ff0a9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2cb209bc51a19487692d.js.LICENSE.txt → 43aef67452fa6ff8d8f9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{31640b41e0ecdff892fa.js.LICENSE.txt → 85b63811ae7bcb6f74b6.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{4e6656a5f29e31902fca.js.LICENSE.txt → 900c8569596609183f19.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{2e66c969bf4209c957b5.js.LICENSE.txt → a17fb26d6ac4895e51a3.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{dc51dcaa4e2f9a90f5bd.js.LICENSE.txt → c2cbe0f5e8958cf18e58.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Error.js";import has from"../../../../core/has.js";import{whenOrAbort as r}from"../../../../core/promiseUtils.js";import{urlToObject as i}from"../../../../core/urlUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{equals as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{getGltfQueryFormat as c}from"../../../support/infoFor3D.js";import{parseUrl as l}from"../../../../rest/utils.js";import{dynamicDataSourceTypes as u}from"../../../../rest/layerSources/typeUtils.js";import{executeForCount as d}from"../../../../rest/query/executeForCount.js";import{executeForExtent as f}from"../../../../rest/query/executeForExtent.js";import{executeForIds as p}from"../../../../rest/query/executeForIds.js";import{executeRawQueryJSON as m}from"../../../../rest/query/executeQueryJSON.js";import{executeRawQueryPBF as h}from"../../../../rest/query/executeQueryPBF.js";import g from"../../../../rest/support/FeatureSet.js";import _ from"../../../../rest/support/Query.js";let v=class extends t{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.pbfSupportedWithCurves=!1,this.queryAttachmentsSupported=!1,this.relativeTimeBinWindow=0,this.sourceSpatialReference=null,this.timeInformation=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return i(this.url)}async execute(e,t){let n=await this.executeJSON(e,t);return this.featureSetFromJSON(e,n,t)}async executeJSON(e,t){let n=this._normalizeQuery(e),r=e.outStatistics?.[0]!=null,i=has(`featurelayer-pbf-statistics`),a=this.pbfSupported&&(!r||i)&&(!e.returnTrueCurves||this.pbfSupportedWithCurves),o;if(a)try{o=await h(this.url,n,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}catch(e){if(e.name===`query:parsing-pbf`)this.pbfSupported=!1;else throw e}return o??=await m(this.url,n,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields}),this._normalizeFields(o.fields),o}async featureSetFromJSON(e,t,n){if(!this._queryGet3DObjectFormat(e)||this.infoFor3D==null||!t.features)return g.fromJSON(t);let{meshFeatureSetFromJSON:i}=await r(import(`../../../../rest/support/meshFeatureSet.js`),n);return i(e,this.infoFor3D,t)}executeForCount(e,t){return d(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}executeForExtent(e,t){return f(this.url,this._normalizeQuery(e),t)}executeForIds(e,t){return p(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeRelationshipQuery(e,t){let[{default:n},{executeRelationshipQuery:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeRelationshipQueryForCount(e,t){let[{default:n},{executeRelationshipQueryForCount:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeAttachmentQuery(e,t){let{executeAttachmentQuery:n,fetchAttachments:i,processAttachmentQueryResult:a}=await r(import(`../../../../rest/query/operations/queryAttachments.js`),t),o=l(this.url);return a(o,await(this.queryAttachmentsSupported?n(o,e,t):i(o,e,t)))}async executeAttributeBinsQuery(e,t){let{executeAttributeBinsQuery:n}=await r(import(`../../../../rest/query/executeAttributeBinsQuery.js`),t);return n(this.parsedUrl,e,t)}async executePivotQuery(e,t){let{executePivotQuery:n}=await r(import(`../../../../rest/query/executePivotQuery.js`),t);return n(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){let{executeTopFeaturesQuery:n}=await r(import(`../../../../rest/query/executeTopFeaturesQuery.js`),t);return n(this.parsedUrl,e,this.sourceSpatialReference,t)}async executeForTopIds(e,t){let{executeForTopIds:n}=await r(import(`../../../../rest/query/executeForTopIds.js`),t);return n(this.parsedUrl,e,t)}async executeForTopExtents(e,t){let{executeForTopExtents:n}=await r(import(`../../../../rest/query/executeForTopExtents.js`),t);return n(this.parsedUrl,e,t)}async executeForTopCount(e,t){let{executeForTopCount:n}=await r(import(`../../../../rest/query/executeForTopCount.js`),t);return n(this.parsedUrl,e,t)}_normalizeQuery(e){let t=_.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource);let{infoFor3D:r}=this,i=this._queryGet3DObjectFormat(e);if(r!=null&&i){if(t=t===e?t.clone():t,t.formatOf3DObjects=i,t.outSpatialReference&&!s(t.outSpatialReference,this.sourceSpatialReference))throw new n(`query:unsupported-out-spatial-reference`,`3D object feature services do not support projection of geometries`);if(t.outFields==null||!t.outFields.includes(`*`)){t=t===e?t.clone():t,t.outFields??(t.outFields=[]);let{originX:n,originY:i,originZ:a,translationX:o,translationY:s,translationZ:c,scaleX:l,scaleY:u,scaleZ:d,rotationX:f,rotationY:p,rotationZ:m,rotationDeg:h}=r.transformFieldRoles;t.outFields.push(n,i,a,o,s,c,l,u,d,f,p,m,h)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(let t of e){let e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryGet3DObjectFormat({returnGeometry:e,multipatchOption:t,outStatistics:n}){return e===!0&&t!==`xyFootprint`&&!n?c(this.infoFor3D):null}};e([a({types:u})],v.prototype,`dynamicDataSource`,void 0),e([a()],v.prototype,`fieldsIndex`,void 0),e([a()],v.prototype,`gdbVersion`,void 0),e([a()],v.prototype,`infoFor3D`,void 0),e([a({readOnly:!0})],v.prototype,`parsedUrl`,null),e([a()],v.prototype,`pbfSupported`,void 0),e([a()],v.prototype,`pbfSupportedWithCurves`,void 0),e([a()],v.prototype,`queryAttachmentsSupported`,void 0),e([a()],v.prototype,`relativeTimeBinWindow`,void 0),e([a()],v.prototype,`sourceSpatialReference`,void 0),e([a()],v.prototype,`timeInformation`,void 0),e([a()],v.prototype,`uniqueIdFields`,void 0),e([a({type:String})],v.prototype,`url`,void 0),v=e([o(`esri.layers.graphics.sources.support.QueryTask`)],v);export{v as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import n from"../../../../core/Error.js";import has from"../../../../core/has.js";import{whenOrAbort as r}from"../../../../core/promiseUtils.js";import{urlToObject as i}from"../../../../core/urlUtils.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{equals as s}from"../../../../geometry/support/spatialReferenceUtils.js";import{getGltfQueryFormat as c}from"../../../support/infoFor3D.js";import{parseUrl as l}from"../../../../rest/utils.js";import{dynamicDataSourceTypes as u}from"../../../../rest/layerSources/typeUtils.js";import{executeForCount as d}from"../../../../rest/query/executeForCount.js";import{executeForExtent as f}from"../../../../rest/query/executeForExtent.js";import{executeForIds as p}from"../../../../rest/query/executeForIds.js";import{executeRawQueryJSON as m}from"../../../../rest/query/executeQueryJSON.js";import{executeRawQueryPBF as h}from"../../../../rest/query/executeQueryPBF.js";import g from"../../../../rest/support/FeatureSet.js";import _ from"../../../../rest/support/Query.js";let v=class extends t{constructor(e){super(e),this.dynamicDataSource=null,this.fieldsIndex=null,this.gdbVersion=null,this.infoFor3D=null,this.pbfSupported=!1,this.pbfSupportedWithCurves=!1,this.queryAttachmentsSupported=!1,this.relativeTimeBinWindow=0,this.sourceSpatialReference=null,this.timeInformation=null,this.uniqueIdFields=null,this.url=null}get parsedUrl(){return i(this.url)}async execute(e,t){let n=await this.executeJSON(e,t);return this.featureSetFromJSON(e,n,t)}async executeJSON(e,t){let n=this._normalizeQuery(e),r=e.outStatistics?.[0]!=null,i=has(`featurelayer-pbf-statistics`),a=this.pbfSupported&&(!r||i)&&(!e.returnTrueCurves||this.pbfSupportedWithCurves),o;if(a)try{o=await h(this.url,n,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}catch(e){if(e.name===`query:parsing-pbf`)this.pbfSupported=!1;else throw e}return o??=await m(this.url,n,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields}),this._normalizeFields(o.fields),o}async featureSetFromJSON(e,t,n){if(!this._queryGet3DObjectFormat(e)||this.infoFor3D==null||!t.features)return g.fromJSON(t);let{meshFeatureSetFromJSON:i}=await r(import(`../../../../rest/support/meshFeatureSet.js`),n);return i(e,this.infoFor3D,t)}executeForCount(e,t){return d(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}executeForExtent(e,t){return f(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}executeForIds(e,t){return p(this.url,this._normalizeQuery(e),t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeRelationshipQuery(e,t){let[{default:n},{executeRelationshipQuery:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeRelationshipQueryForCount(e,t){let[{default:n},{executeRelationshipQueryForCount:i}]=await r(Promise.all([import(`../../../../rest/support/RelationshipQuery.js`),import(`../../../../rest/query/executeRelationshipQuery.js`)]),t),a=n.from(e);return(this.gdbVersion||this.dynamicDataSource)&&(a=a.clone(),a.gdbVersion=a.gdbVersion||this.gdbVersion,a.dynamicDataSource=a.dynamicDataSource||this.dynamicDataSource),i(this.url,a,t)}async executeAttachmentQuery(e,t){let{executeAttachmentQuery:n,fetchAttachments:i,processAttachmentQueryResult:a}=await r(import(`../../../../rest/query/operations/queryAttachments.js`),t),o=l(this.url);return a(o,await(this.queryAttachmentsSupported?n(o,e,t):i(o,e,t)))}async executeAttributeBinsQuery(e,t){let{executeAttributeBinsQuery:n}=await r(import(`../../../../rest/query/executeAttributeBinsQuery.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executePivotQuery(e,t){let{executePivotQuery:n}=await r(import(`../../../../rest/query/executePivotQuery.js`),t);return n(this.parsedUrl,e,t)}async executeTopFeaturesQuery(e,t){let{executeTopFeaturesQuery:n}=await r(import(`../../../../rest/query/executeTopFeaturesQuery.js`),t);return n(this.parsedUrl,e,this.sourceSpatialReference,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeForTopIds(e,t){let{executeForTopIds:n}=await r(import(`../../../../rest/query/executeForTopIds.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeForTopExtents(e,t){let{executeForTopExtents:n}=await r(import(`../../../../rest/query/executeForTopExtents.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}async executeForTopCount(e,t){let{executeForTopCount:n}=await r(import(`../../../../rest/query/executeForTopCount.js`),t);return n(this.parsedUrl,e,t,{timeInformation:this.timeInformation,uniqueIdFields:this.uniqueIdFields})}_normalizeQuery(e){let t=_.from(e);t.sourceSpatialReference=t.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(t=t===e?t.clone():t,t.gdbVersion=e.gdbVersion||this.gdbVersion,t.dynamicDataSource=e.dynamicDataSource||this.dynamicDataSource);let{infoFor3D:r}=this,i=this._queryGet3DObjectFormat(e);if(r!=null&&i){if(t=t===e?t.clone():t,t.formatOf3DObjects=i,t.outSpatialReference&&!s(t.outSpatialReference,this.sourceSpatialReference))throw new n(`query:unsupported-out-spatial-reference`,`3D object feature services do not support projection of geometries`);if(t.outFields==null||!t.outFields.includes(`*`)){t=t===e?t.clone():t,t.outFields??(t.outFields=[]);let{originX:n,originY:i,originZ:a,translationX:o,translationY:s,translationZ:c,scaleX:l,scaleY:u,scaleZ:d,rotationX:f,rotationY:p,rotationZ:m,rotationDeg:h}=r.transformFieldRoles;t.outFields.push(n,i,a,o,s,c,l,u,d,f,p,m,h)}}return t}_normalizeFields(e){if(this.fieldsIndex!=null&&e!=null)for(let t of e){let e=this.fieldsIndex.get(t.name);e&&Object.assign(t,e.toJSON())}}_queryGet3DObjectFormat({returnGeometry:e,multipatchOption:t,outStatistics:n}){return e===!0&&t!==`xyFootprint`&&!n?c(this.infoFor3D):null}};e([a({types:u})],v.prototype,`dynamicDataSource`,void 0),e([a()],v.prototype,`fieldsIndex`,void 0),e([a()],v.prototype,`gdbVersion`,void 0),e([a()],v.prototype,`infoFor3D`,void 0),e([a({readOnly:!0})],v.prototype,`parsedUrl`,null),e([a()],v.prototype,`pbfSupported`,void 0),e([a()],v.prototype,`pbfSupportedWithCurves`,void 0),e([a()],v.prototype,`queryAttachmentsSupported`,void 0),e([a()],v.prototype,`relativeTimeBinWindow`,void 0),e([a()],v.prototype,`sourceSpatialReference`,void 0),e([a()],v.prototype,`timeInformation`,void 0),e([a()],v.prototype,`uniqueIdFields`,void 0),e([a({type:String})],v.prototype,`url`,void 0),v=e([o(`esri.layers.graphics.sources.support.QueryTask`)],v);export{v as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
+
import e from"../../../support/TimeInfo.js";import{hasSameTimeFields as t}from"../../../support/timeInfoUtils.js";import{timeExtentToSQL as n}from"../../../../rest/support/timeUtils.js";function r(r,i,a,o){if(!r.timeExtent||!i&&!a)return r;let s=r.clone();if(i&&a){if(!t(i,e.fromJSON(a))){let e=n(r.timeExtent,i,o,r.where);e&&(s.where=e,s.timeExtent=void 0)}return s}return!i&&a?(s.timeExtent=void 0,s):i&&!a?(s.where=n(r.timeExtent,i,o,r.where),s.timeExtent=void 0,s):s}export{r as applyTimeExtentToQuery};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import n from"../../request.js";import r from"../../core/Error.js";import{clone as i}from"../../core/lang.js";import a from"../../core/Logger.js";import{QueueProcessor as o}from"../../core/QueueProcessor.js";import{watch as s}from"../../core/reactiveUtils.js";import{urlToObject as c}from"../../core/urlUtils.js";import{property as l,subclass as u}from"../../core/accessorSupport/decorators.js";import{Integer as d,ensureClass as f}from"../../core/accessorSupport/ensureType.js";import{runUntracked as p}from"../../core/accessorSupport/tracking.js";import m from"../../geometry/Extent.js";import h from"../../geometry/Polygon.js";import g from"../../geometry/SpatialReference.js";import{srToRESTValue as _}from"../../geometry/support/spatialReferenceUtils.js";import{intersectMultimensionalSubset as v,getEffectiveMultidimensionalDefinition as y,getSubsetVariablesFromMdInfo as b,getDefaultMultidimensionalDefinition as x}from"../raster/datasets/multidimensionalUtils.js";import{decode as S,getFormat as C}from"../raster/formats/RasterCodec.js";import{mosaicPixelData as w}from"../raster/functions/pixelUtils.js";import{uvComponentToVector as T}from"../raster/functions/vectorFieldUtils.js";import{opacity as E,url as D}from"../support/commonProperties.js";import O from"../support/DimensionalDefinition.js";import{ExportImageServiceParameters as k}from"../support/ExportImageServiceParameters.js";import A from"../support/Field.js";import j from"../support/FieldsIndex.js";import{createBitmap as M}from"../support/imageBitmapUtils.js";import{isSupportedRendererType as ee}from"../support/imageryRendererUtils.js";import N from"../support/MosaicRule.js";import te from"../support/MultidimensionalSubset.js";import P from"../support/PixelBlock.js";import{interpolationKebab as F,noDataInterpretationKebab as I,pixelTypeKebabDict as L}from"../support/rasterEnums.js";import{getServicePixelValueField as ne,getItemPixelValueField as re,getRawServicePixelValueField as ie,getProcessedServicePixelValueField as ae,getMagnitudeField as oe,getDirectionField as se,getMultidimensionalFields as ce,getRasterAttributeTableFields as le,addMultidimensionalFieldValues as ue,commonRasterFieldNames as R,rasterFieldPrefix as de}from"../support/rasterFieldUtils.js";import z from"../support/RasterFunction.js";import fe from"../support/RasterInfo.js";import{createDefaultRenderer as B,getDefaultBandCombination as V,getSupportedRendererTypes as H,getField as U,matchPresetRenderer as pe,normalizeRendererJSON as me}from"../../renderers/support/rasterRendererHelper.js";import W from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as G,websceneRasterRendererTypes as he,read as ge}from"../../renderers/support/rasterTypeUtils.js";import{calculateVolume as _e,computeAngles as ve,computePixelSpaceLocations as ye,computeHistograms as be,computeStatisticsHistograms as xe,measureHeight as Se,measureAreaAndPerimeter as Ce,measureDistanceAndAngle as we,measurePointOrCentroid as Te,measureLengthFromImage as Ee,measureAreaFromImage as De,getImageSpatialReferenceQueryParameter as Oe,getSamples as ke,identify as K,imageToMap as Ae,imageToMapMultiray as je,mapToImage as Me,findImages as Ne,getImageUrl as Pe,queryBoundary as Fe,queryGPSInfo as Ie}from"../../rest/imageService.js";import{fetchServiceRasterInfo as q,generateRasterInfo as Le,patchServiceInfo as Re}from"../../rest/imageService/fetchRasterInfo.js";import{getCatalogItemRasterInfo as ze}from"../../rest/imageService/getCatalogItemRasterInfo.js";import{executeForCount as Be}from"../../rest/query/executeForCount.js";import{executeForExtent as Ve}from"../../rest/query/executeForExtent.js";import{executeForIds as He}from"../../rest/query/executeForIds.js";import{executeQueryJSON as Ue}from"../../rest/query/executeQueryJSON.js";import We from"../../rest/support/FeatureSet.js";import Ge from"../../rest/support/ImageIdentifyParameters.js";import J from"../../rest/support/Query.js";import{reader as Y}from"../../core/accessorSupport/decorators/reader.js";import{writer as X}from"../../core/accessorSupport/decorators/writer.js";const Ke=4096,qe=new Set([`png`,`png8`,`png24`,`png32`,`jpg`,`bmp`,`gif`,`jpgpng`,`lerc`,`tiff`]);function Je(e){let t=JSON.stringify(e),n=t.includes(`"rasterFunctionDefinition":{`),r=(n?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi))?.map(e=>n?e.slice(8,-18):e.slice(18,-1));return r?r.join(`/`):null}const Z=Z=>{let Ye=Z,Q=class extends Ye{constructor(){super(...arguments),this._functionRasterInfos={},this._serviceSupportsMosaicRule=null,this._exportTileQueue=new o({concurrency:4,process:(e,t)=>this._fetchPixels(e.extent,e.width,e.height,{...e.options,signal:t})}),this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType=`polygon`,this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set(`exportImageServiceParameters`,new k({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){let e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,`_`),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(e=>typeof e==`number`))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,n){e!=null&&this.format!==`lerc`&&(t[n]=e)}writeCompressionTolerance(e,t,n){this.format===`lerc`&&e!=null&&(t[n]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?p(()=>N.fromJSON(t)):null}get fieldsIndex(){return this.fields?new j(this.fields):null}set format(e){e&&qe.has(e.toLowerCase())&&this._set(`format`,e.toLowerCase())}readFormat(e,t){return t.serviceDataType===`esriImageServiceDataTypeVector-UV`||t.serviceDataType===`esriImageServiceDataTypeVector-MagDir`||this.pixelFilter!=null||t.allowRasterFunction===!1?`lerc`:`jpgpng`}get isRenderedFormat(){return!this.format||this.format.includes(`jpg`)||this.format.includes(`png`)}readMinScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}readMaxScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}set mosaicRule(e){let t=e;t?.mosaicMethod&&(t=N.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set(`mosaicRule`,t)}readMosaicRule(e,t){let n=e||t.mosaicRule;return n?N.fromJSON(n):this._isMosaicRuleSupported(t)?N.fromJSON(t):null}writeMosaicRule(e,t,n){let{mosaicRule:r}=this;this._isValidCustomizedMosaicRule(r)&&(t[n]=r.toJSON())}readObjectIdField(e,t){return e||=t.fields.find(e=>e.type===`esriFieldTypeOID`||e.type===`oid`)?.name,e}get parsedUrl(){return c(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?`mosaic-dataset`:`raster-dataset`}get renderer(){let{activePresetRendererName:e,presetRenderers:t}=this;return e?(t?.find(({name:t})=>t===e))?.renderer.clone():this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set(`internalRenderer`,e)}readRenderer(e,t,n){let r=t?.layerDefinition?.drawingInfo?.renderer,i=ge(r,n);return i==null?null:(i.type===`vector-field`&&t.symbolTileSize&&!r.symbolTileSize&&(i.symbolTileSize=t.symbolTileSize),ee(i)||a.getLogger(this).warn(`ArcGISImageService`,`Imagery layer doesn't support given renderer type.`),i)}writeRenderer(e,t,n){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON()}get rasterFields(){let e=this.fields?.map(e=>e.clone())??[];e.push(ne()),this.sourceType===`mosaic-dataset`&&this.fields?.length&&e.push(re()),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(({name:e})=>e.toLowerCase()===`none`)&&e.push(ie()),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(({name:e})=>e.toLowerCase()!==`none`).forEach(({name:t})=>e.push(ae(t)));let{rasterInfo:t}=this;if(this._isVectorDataSet()){let n=t?.multidimensionalInfo?.variables[0].unit?.trim(),r=oe(n),i=se();e.push(r,i)}if(t?.multidimensionalInfo&&this.sourceType===`raster-dataset`){let n=ce(t.multidimensionalInfo);e.push(...n)}let n=t?.attributeTable;if(n!=null){let t=le(n);e.push(...t)}return e}set rasterFunction(e){let t=e;t?.rasterFunction&&(t=z.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set(`rasterFunction`,t)}readRasterFunction(e,t){let n=t.rasterFunctionInfos,r=t.renderingRule,i=r!=null&&Object.keys(r).length>0;return!i&&(!n?.length||n[0].name===`None`)?null:this._isRFTJson(r)?z.fromJSON({rasterFunctionDefinition:r}):z.fromJSON(i?r:{rasterFunctionInfos:n})}readSpatialReference(e,t){let n=e||t.extent.spatialReference;return n?g.fromJSON(n):null}writePixelType(e,t,n){(this.serviceRasterInfo==null||this.pixelType!==this.serviceRasterInfo.pixelType)&&(t[n]=L.toJSON(e))}readVersion(e,t){let n=t.currentVersion;return n||=t.hasOwnProperty(`fields`)||t.hasOwnProperty(`timeInfo`)?10:9.3,n}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let n=e,{renderer:r,symbolizer:i,pixelFilter:a}=this,{isRawData:o}=e;if(o&&this.format!==`lerc`&&(r??=B(this.rasterInfo,{bandIds:this.bandIds,variableName:this.rasterFunction?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}),i||=(this.symbolizer=new W({rendererJSON:r.toJSON(),rasterInfo:this.rasterInfo}),this.symbolizer)),(o||!this.isRenderedFormat)&&r&&i&&!a){await this._updateSymbolizer(i,r);let a=this.bandIds?.length?this.bandIds:V(this.rasterInfo);n=await this._symbolize({pixelData:e,bandIds:a,symbolizer:i},t)}return n}destroy(){this._shutdownJobHandler()}async calculateVolume(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsCalculateVolume)throw new r(`imagery-layer:compute-pixel-space-locations`,`this operation is not supported on the input image service`);return e=i(e),this.mosaicRule&&e.mosaicRule==null&&(e.mosaicRule=this.mosaicRule),_e(this.url,e,this._getRequestOptions(t))}async computeAngles(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeAngles)throw new r(`imagery-layer:compute-angles`,`this operation is not supported on the input image service`);return ve(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputePixelLocation)throw new r(`imagery-layer:compute-pixel-space-locations`,`this operation is not supported on the input image service`);return ye(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeHistograms)throw new r(`imagery-layer:compute-histograms`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicAndRenderingRules(e),be(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeStatisticsHistograms)throw new r(`imagery-layer:compute-statistics-histograms`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicAndRenderingRules(e),xe(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){let n=await this._fetchCapabilities(t?.signal);if(!(e.operationType===`base-and-top`?n.mensuration.supportsHeightFromBaseAndTop:e.operationType===`base-and-top-shadow`?n.mensuration.supportsHeightFromBaseAndTopShadow:n.mensuration.supportsHeightFromTopAndTopShadow))throw new r(`imagery-layer:measure-height`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicRule(e),Se(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){let n=await this._fetchCapabilities(t?.signal);if(!n.mensuration.supportsAreaAndPerimeter||e.is3D&&!n.mensuration.supports3D)throw new r(`imagery-layer:measure-area-and-perimeter`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicRule(e),Ce(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){let n=await this._fetchCapabilities(t?.signal);if(!n.mensuration.supportsDistanceAndAngle||e.is3D&&!n.mensuration.supports3D)throw new r(`imagery-layer:measure-distance-and-angle`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicRule(e),we(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){let n=await this._fetchCapabilities(t?.signal);if(!n.mensuration.supportsPointOrCentroid||e.is3D&&!n.mensuration.supports3D)throw new r(`imagery-layer:measure-point-or-centroid`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicRule(e),Te(this.url,e,this._getRequestOptions(t))}async measureLengthFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new r(`imagery-layer:measure-length-from-image`,`this operation is not supported on the input image service`);if(e.geometry.type!==`polyline`)throw new r(`imagery-layer:measure-length-from-image`,`this input geometry must be a polyline`);return Ee(this.url,e,this._getRequestOptions(t))}async measureAreaFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new r(`imagery-layer:measure-area-from-image`,`this operation is not supported on the input image service`);if(e.geometry.type!==`polygon`)throw new r(`imagery-layer:measure-area-from-image`,`this input geometry must be a polygon`);return De(this.url,e,this._getRequestOptions(t))}getField(e){let{fieldsIndex:t}=this;return t?.get(e)}getFieldDomain(e,t){let n=this.getField(e);return n?n.domain:null}async internalFetchImage(e,t,n,r={}){await this._updateCurrentRasterInfo();let{exportImageServiceParameters:i}=this,a=!1;if(r.requestRawData&&(await this._initJobHandler(),!i.requestRawData&&this.format!==`lerc`)){a=!0,i.requestRawData=!0;let e=this.bandIds;if(!e?.length){let t=V(this.rasterInfo);Array.from({length:this.rasterInfo.bandCount},(e,t)=>t)?.join(`,`)!==t?.join(`,`)&&(e=t)}i.rawDataRequestBandIds=e}let o=this.getExportImageServiceParameters(e,t,n,r.timeExtent);if(a&&(i.requestRawData=!1,i.rawDataRequestBandIds=null),o==null){if(r.requestAsImageElement&&this._canRequestImageElement(this.format)){let e=document.createElement(`canvas`);if(e.width=t,e.height=n,r.returnImageBitmap){let{bitmap:t}=await M(e,`${$(this.parsedUrl)}/exportImage`,r);return{imageBitmap:t}}return{imageOrCanvasElement:e}}let{bandIds:i,rasterInfo:a}=this,o=(i?.length||a.bandCount)??0,s=t*n,c=a.pixelType,l=[];for(let e=0;e<o;e++)l.push(P.createEmptyBand(c,s));return{pixelData:{pixelBlock:new P({width:t,height:n,pixels:l,mask:new Uint8Array(s),pixelType:c}),extent:e}}}let s=!!r.requestAsImageElement&&!this.pixelFilter,c=s&&!!r.returnImageBitmap,l={imageServiceParameters:o,imageProps:{extent:e,width:t,height:n,format:this.format},requestAsImageElement:s,returnImageBitmap:c,signal:r.signal};return this._requestArrayBuffer(l)}async fetchPixels(e,t,n,i={}){await this._initJobHandler(),i.applyRendering&&await this._updateCurrentRasterInfo();let{imageMaxWidth:a,imageMaxHeight:o}=this;if(t<=a&&n<=o)return this._exportTileQueue.push({extent:e,width:t,height:n,options:i},{signal:i.signal});if(t>Ke||n>Ke||a<512||o<512)throw new r(`imagery-layer:fetch-pixels`,`The image service has a maximum export size of ${a}x${o}. The requested size of ${t}x${n} exceeds this limit.`);let{xmin:s,ymax:c,spatialReference:l}=this._projectedFullExtent??this.fullExtent;if(!l?.equals(e.spatialReference)){let{projectLoad:t,projectExecute:n}=await import(`../../geometry/operators/projectOperator.js`);await t();let r=n(this.fullExtent,e.spatialReference);s=r.xmin,c=r.ymax,this._projectedFullExtent=r}let u=e.width/t,d=e.height/n,f=Math.floor((e.xmin-s)/u),p=Math.floor((c-e.ymax)/d),h=f+t,g=p+n,_=Math.floor(f/512),v=Math.floor(p/512),y=Math.ceil(h/512)-1,b=Math.ceil(g/512)-1,x=512*u,S=512*d,C=[];for(let t=v;t<=b;t++){let n=c-t*S,r=n-S;for(let t=_;t<=y;t++){let a=s+t*x,o=new m({xmin:a,ymin:r,xmax:a+x,ymax:n,spatialReference:e.spatialReference});C.push(this._exportTileQueue.push({extent:o,width:512,height:512,options:i},{signal:i.signal}))}}let T=await Promise.all(C);return T.some(e=>e.pixelBlock==null)?{extent:e,pixelBlock:null}:{extent:e,pixelBlock:this._rasterJobHandler?await this._rasterJobHandler.mosaicPixelData({pixelBlocks:T,destExtent:e},{signal:i.signal,transferPixelsToWorker:!0}):w(T,e)?.pixelBlock}}async _fetchPixels(e,t,n,r={}){let i=r.applyRendering?void 0:new k({layer:this,requestRawData:!0,interpolation:r.interpolation??`nearest`,bandIds:r.bandIds??[]}),a=this.getExportImageServiceParameters(e,t,n,r.timeExtent,i);if(a==null)return{extent:e,pixelBlock:null};delete a.pixelType,r.bandIds||delete a.bandIds,delete a.compressionQuality;let o={imageServiceParameters:a,imageProps:{extent:e,width:t,height:n,format:this.format},requestAsImageElement:!1,returnImageBitmap:!1,signal:r.signal},{pixelData:s}=await this._requestArrayBuffer(o);return s??{extent:e,pixelBlock:null}}fetchKeyProperties(e){return n($(this.parsedUrl)+`/keyProperties`,{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>e.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new r(`#fetchRasterAttributeTable()`,`Failed to get rasterAttributeTable`)):n($(this.parsedUrl)+`/rasterAttributeTable`,{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>We.fromJSON(e.data))}getCatalogItemRasterInfo(e,t){let n=this._getQueryParams(),r={...t,query:n};return ze($(this.parsedUrl),e,r)}async getCatalogItemICSInfo(e,t){let{data:r}=await n($(this.parsedUrl)+`/`+e+`/info/ics`,{query:this._getQueryParams(),...t}),i=r?.ics;if(!i)return;let a=null;try{a=(await n($(this.parsedUrl)+`/`+e+`/info`,{query:this._getQueryParams(),...t})).data.extent}catch{}if(!a?.spatialReference)return{ics:i,icsToPixelTransform:null,icsExtent:null,northDirection:null};let o=this.version>=10.7?n($(this.parsedUrl)+`/`+e+`/info/icstopixel`,{query:this._getQueryParams(),...t}).then(e=>e.data).catch(()=>({})):{},s=a.spatialReference,c={geometries:JSON.stringify({geometryType:`esriGeometryEnvelope`,geometries:[a]}),inSR:_(s),outSR:`0:`+e},l=n($(this.parsedUrl)+`/project`,{query:this._getQueryParams(c),...t}).then(e=>e.data).catch(()=>({})),u=(a.xmin+a.xmax)/2,d=(a.ymax-a.ymin)/6,f=a.ymin+d,p=[];for(let e=0;e<5;e++)p.push({x:u,y:f+d*e});let h={geometries:JSON.stringify({geometryType:`esriGeometryPoint`,geometries:p}),inSR:_(s),outSR:`0:`+e},v=n($(this.parsedUrl)+`/project`,{query:this._getQueryParams(h),...t}).then(e=>e.data).catch(()=>({})),y=await Promise.all([o,l,v]),b=y[0].ipxf;if(b==null){let e=i.geodataXform?.xf_0;e?.name?.toLowerCase()===`topup`&&e?.coefficients?.length===6&&(b={affine:{name:`ics [sensor: Frame] to pixel (column, row) transformation`,coefficients:e.coefficients,cellsizeRatio:0,type:`GeometricXform`}})}let x=m.fromJSON(y[1]?.geometries?.[0]);x&&(x.spatialReference=new g({wkid:0,imageCoordinateSystem:i}));let S=y[2].geometries?y[2].geometries.filter(e=>e?.x!=null&&e.y!=null&&e.x!==`NaN`&&e.y!==`NaN`):[],C=S.length;if(C<3)return{ics:i,icsToPixelTransform:b,icsExtent:x,northDirection:null};let w=0,T=0,E=0,D=0;for(let e=0;e<C;e++)w+=S[e].x,T+=S[e].y,E+=S[e].x*S[e].x,D+=S[e].x*S[e].y;let O=(C*D-w*T)/(C*E-w*w),k=0,A=S[4].x>S[0].x,j=S[4].y>S[0].y;return O===1/0?k=j?90:270:O===0?k=A?0:180:O>0?k=A?Math.atan(O)*180/Math.PI:Math.atan(O)*180/Math.PI+180:O<0&&(k=j?180+Math.atan(O)*180/Math.PI:360+Math.atan(O)*180/Math.PI),{ics:i,icsToPixelTransform:b,icsExtent:x,northDirection:k}}async generateRasterInfo(e,t){let n=f(z,e),i={...t,query:this._getQueryParams()};if(!n||n.functionName?.toLowerCase()===`none`||this._isVectorFieldResampleFunction(n))return this.serviceRasterInfo??q($(this.parsedUrl),this.sourceJSON,i);let a=Je(n);if(!a)throw new r(`imagery-layer:generate-raster-info`,`the rendering rule is not supported`);if(this._functionRasterInfos[a])return this._functionRasterInfos[a];let o=Le($(this.parsedUrl),n,i);this._functionRasterInfos[a]=o;try{let t=await o,{rasterFunction:n}=this;return(n===e||JSON.stringify(n)===JSON.stringify(e))&&JSON.stringify(this.rasterInfo)!==JSON.stringify(t)&&(this.rasterInfo=t),t}catch(e){throw this._functionRasterInfos[a]=null,e}}getExportImageServiceParameters(e,t,n,r,i){e=e.clone().shiftCentralMeridian();let a=Oe(e.spatialReference,$(this.parsedUrl));i??=this.exportImageServiceParameters;let o=i.toJSON(),{bandIds:s,noData:c}=o,{renderingRule:l}=o,u=this.rasterFunction?.rasterFunctionDefinition,d=this.renderer?.type,f=!d||d===`raster-stretch`||d===`raster-colormap`||d===`unique-value`||d===`class-breaks`||d===`raster-shaded-relief`;if(s?.length&&this._hasRasterFunction(this.rasterFunction)&&!u&&f){let e={rasterFunction:`ExtractBand`,rasterFunctionArguments:{BandIds:s}};if(l.rasterFunction===`Stretch`)e.rasterFunctionArguments.Raster=l.rasterFunctionArguments.Raster,l.rasterFunctionArguments.Raster=e;else if(l.rasterFunction===`Colormap`){let t=l.rasterFunctionArguments.Raster;t?.rasterFunction===`Stretch`?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,l.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=l,l=e;o.bandIds=void 0}else o.bandIds=s?.join(`,`);Array.isArray(c)&&c.length>0&&(o.noData=c.join(`,`));let p=this._processMultidimensionalIntersection(null,r,i.mosaicRule);if(p.isOutSide)return null;o.mosaicRule=p.mosaicRule==null?null:JSON.stringify(p.mosaicRule),r=p.timeExtent,o.renderingRule=this._getRenderingRuleString(z.fromJSON(l));let m={};if(r!=null){let{start:e,end:t}=r.toJSON();e&&t&&e===t?m.time=``+e:(e!=null||t!=null)&&(m.time=`${e??`null`},${t??`null`}`)}return{bbox:e.xmin+`,`+e.ymin+`,`+e.xmax+`,`+e.ymax,bboxSR:a,imageSR:a,size:t+`,`+n,...o,...m}}async getSamples(e,t){if(!(await this._fetchCapabilities(t?.signal))?.operations.supportsGetSamples)throw new r(`imagery-layer:get-samples`,`getSamples operation is not supported on the input image service`);e=i(e);let{raster:n}=this;return n&&e.raster==null&&(e.raster=n),ke(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsIdentify)throw new r(`imagery-layer:identify`,`identify operation is not supported on the input image service`);e=i(e),this.version<10.91&&e.geometry?.type===`extent`&&(e.geometry=h.fromExtent(e.geometry));let n=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(n.isOutSide)throw new r(`imagery-layer:identify`,`the request cannot be fulfilled when falling outside of the multidimensional subset`);e.timeExtent=n.timeExtent,e.mosaicRule=n.mosaicRule;let{raster:a,rasterFunction:o}=this;return o&&e.rasterFunction==null&&(e.rasterFunction=o),a&&e.raster==null&&(e.raster=a),K(this.url,e,this._getRequestOptions(t))}async imageToMap(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMap)throw new r(`imagery-layer:image-to-map`,`imageToMap operation is not supported on the input image service`);return Ae($(this.parsedUrl),e,this._getRequestOptions(t))}async imageToMapMultiray(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMapMultiray)throw new r(`imagery-layer:image-to-map-multiray`,`imageToMapMultiray operation is not supported on the input image service`);return je($(this.parsedUrl),e,this._getRequestOptions(t))}async mapToImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMapToImage)throw new r(`imagery-layer:map-to-image`,`mapToImage operation is not supported on the input image service`);return Me($(this.parsedUrl),e,this._getRequestOptions(t))}async findImages(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsFindImages)throw new r(`imagery-layer:find-images`,`findImages operation is not supported on the input image service`);return Ne($(this.parsedUrl),e,this._getRequestOptions(t))}async getImageUrl(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsGetImageUrl)throw new r(`imagery-layer:get-image-url`,`getImageUrl operation is not supported on the input image service`);return Pe($(this.parsedUrl),e,this._getRequestOptions(t))}createQuery(){return new J({outFields:[`*`],returnGeometry:!0,where:this.definitionExpression||`1=1`})}async queryBoundary(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryBoundary)throw new r(`imagery-layer:query-boundary`,`queryBoundary operation is not supported on the input image service`);return e??={outSpatialReference:this.spatialReference},Fe($(this.parsedUrl),e,this._getRequestOptions(t))}async queryExtent(e,t){({query:e,requestOptions:t}=await this._prepareForQuery(e,t));let{where:n,objectIds:r,geometry:i,timeExtent:a,start:o,num:s,pixelSize:c}=e,l=n!=null&&n!==`1=1`,u=r!=null&&r.length>0,d=i!=null&&(i.type!==`extent`||!i.equals(this.fullExtent)),f=c!=null,p=o!=null||s!=null,{timeInfo:m}=this,h=a!=null&&m!=null&&!a.equals(m.fullTimeExtent);if(!(l||u||d||f||h||p)){let n=await Be(this.url,e,t),{outSpatialReference:r}=e;if(!r||r.equals(this.spatialReference))return{count:n,extent:this.fullExtent.clone()};let{projectLoad:i,projectExecute:a}=await import(`../../geometry/operators/projectOperator.js`);return await i(),{count:n,extent:a(this.fullExtent,r)}}return Ve(this.url,e,t)}async queryRasters(e,t){({query:e,requestOptions:t}=await this._prepareForQuery(e,t));let n=await Ue(this.url,e,t),r=this.graphicOrigin;return n.features.forEach(e=>{e.layer=this,e.origin=r}),n}async queryObjectIds(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),He(this.url,e,t)}async queryGPSInfo(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryGPSInfo)throw new r(`imagery-layer:query-gps-info`,`queryGPSInfo operation is not supported on the input image service`);return e??={where:`1=1`},Ie($(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasterCount(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),Be(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new r(`imagery-layer: query-visible-rasters`,`missing query parameter`);await this.load();let{pixelSize:n,returnDomainValues:i,returnTopmostRaster:a,showNoDataRecords:o}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1},s=!1,c=null,l=null,u=R.servicePixelValue.toLowerCase(),d=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(s=e.outFields.some(e=>!e.toLowerCase().startsWith(u)),this.version>=10.4)){let t=e.outFields.filter(e=>e.toLowerCase().startsWith(u)&&e.length>u.length).map(e=>{let t=e.slice(u.length+1);return[this._updateRenderingRulesFunctionName(t,d),t]});c=t.map(e=>new z({functionName:e[0]})),l=t.map(e=>e[1]);let{rasterFunction:n}=this;c.length===0?n?.functionName?(c.push(n),l.push(n.functionName)):c=null:n?.functionName&&!c.some(e=>e.functionName===n.functionName)&&(c.push(n),l.push(n.functionName))}let f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:p}=this,m=e.timeExtent||this.timeExtent;if(p){let{isOutside:t,intersection:n}=v(p,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(t)throw new r(`imagery-layer:query-visible-rasters`,`the request cannot be fulfilled when falling outside of the multidimensional subset`);n?.timeExtent!=null&&(m=n.timeExtent)}let g=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,m),_=e.geometry;this.version<10.91&&_?.type===`extent`&&(_=h.fromExtent(_));let b=this._getQueryParams({geometry:_,timeExtent:m,mosaicRule:g,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:n,returnCatalogItems:s,returnGeometry:f,raster:this.raster,maxItemCount:a?1:null});delete b.f;let x=new Ge(b);try{await this._generateRasterInfo(this.rasterFunction);let n=await K(this.url,x,{signal:t?.signal,query:{...this.customParameters}}),r=e.outFields,a=n.value!=null&&n.value.toLowerCase().includes(`nodata`),c=s&&!f&&n?.catalogItems?.features.length&&(o||!a),u=this.multidimensionalInfo&&this.sourceType===`raster-dataset`?y({rasterInfo:this.rasterInfo,multidimensionalDefinition:g?.multidimensionalDefinition,timeExtent:m,multidimensionalSubset:this.multidimensionalSubset}):null;if(!c)return this._processVisibleRastersResponse(n,{returnDomainValues:i,templateRRFunctionNames:l,showNoDataRecords:o,templateFields:r,effectiveMultidimensionalDefinition:u});let d=this.objectIdField||`ObjectId`,p=n.catalogItems?.features??[],h=p.map(e=>e.attributes?.[d]),_=new J({objectIds:h,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[d]}),v=await this.queryRasters(_);return v?.features?.length&&v.features.forEach(t=>{p.forEach(n=>{n.attributes[d]===t.attributes[d]&&t.geometry&&(n.geometry=t.geometry.clone(),e.outSpatialReference!=null&&(n.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(n,{returnDomainValues:i,templateRRFunctionNames:l,showNoDataRecords:o,templateFields:r,effectiveMultidimensionalDefinition:u})}catch{throw new r(`imagery-layer:query-visible-rasters`,`encountered error when querying visible rasters`)}}async fetchVariableStatisticsHistograms(e,t){let r=n($(this.parsedUrl)+`/statistics`,{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.statistics),i=n($(this.parsedUrl)+`/histograms`,{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.histograms),a=await Promise.all([r,i]);return a[0]&&a[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),{statistics:a[0]||null,histograms:a[1]||null}}getMultidimensionalSubsetVariables(e){let t=e??this.serviceRasterInfo.multidimensionalInfo;return b(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e);let t=this.sourceJSON,n=this.serviceRasterInfo==null?q($(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(e=>(this._set(`serviceRasterInfo`,e),this._set(`multidimensionalInfo`,e.multidimensionalInfo),Re(e,t),e)):Promise.resolve(this.serviceRasterInfo),r=!this.rasterInfo&&this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):Promise.resolve(this.rasterInfo),i=this.rasterFunctionInfos?.every(e=>e.functionType!=null)?null:this._getRasterFunctionInfos();return Promise.all([n,r,i]).then(e=>{e[1]?this._set(`rasterInfo`,e[1]):this._set(`rasterInfo`,e[0]),e[2]&&(t.rasterFunctionInfos=e[2],this.setAtOrigin(`rasterFunctionInfos`,e[2],`service`)),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set(`internalRenderer`,null),a.getLogger(this).warn(`ArcGISImageService`,`Switching to the default renderer. Renderer applied is not valid for this Imagery Layer`)),this._set(`internalRenderer`,this._configRenderer(this.renderer)),this.addHandles([s(()=>this.rasterFunction,e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(e).then(e=>{e&&(this.rasterInfo=e)})})]);let{serviceRasterInfo:n}=this;n.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(n)})}_combineMosaicRuleWithTimeExtent(e,t){let n=this.timeInfo,{multidimensionalInfo:r}=this.serviceRasterInfo;if(e==null||r==null||t==null||n?.startField==null)return e;let{startField:i}=n,a=r.variables.some(e=>e.dimensions.some(e=>e.name===i))?i:`StdTime`;if(e=e.clone(),this.sourceType===`mosaic-dataset`)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(e=>e.dimensionName!==a),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];let o=e.multidimensionalDefinition.filter(e=>e.dimensionName===a),s=t.start==null?null:t.start.getTime(),c=t.end==null?null:t.end.getTime(),l=s==null||c==null||s===c,u=l?[s||c]:[[s,c]],d=this.version>=10.8;if(o.length)o.forEach(e=>{e.dimensionName===a&&(d?(e.dimensionName=null,e.isSlice=!1,e.values=[]):(e.isSlice=l,e.values=u))});else if(!d){let t=e.multidimensionalDefinition.filter(e=>e.variableName!=null&&e.dimensionName==null);t.length?t.forEach(e=>{e.dimensionName=a,e.isSlice=l,e.values=u}):e.multidimensionalDefinition.push(new O({variableName:``,dimensionName:a,isSlice:l,values:u}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(e=>!!(e.variableName||e.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!==`mosaic-dataset`&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQuery)throw new r(`imagery-layer:query-rasters`,`query operation is not supported on the input image service`);let n=e==null?this.createQuery():f(J,e);return t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:n,requestOptions:t}}_isSupportedRenderer(e){let{rasterInfo:t,rasterFunction:n}=this;return e.type===`unique-value`&&this._hasRasterFunction(n)&&t?.bandCount===1&&[`u8`,`s8`].includes(t.pixelType)||t!=null&&e!=null&&H(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){let{data:r,ssl:i}=await n($(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=r,this.sourceJSON=t,i&&(this.url=this.url.replace(/^http:/i,`https:`))}if(t.capabilities?.toLowerCase().split(`,`).map(e=>e.trim()).indexOf(`tilesonly`)>-1)throw new r(`imagery-layer:fetch-service-info`,`use ImageryTileLayer to open tiles-only image services`);this.read(t,{origin:`service`,url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?e.serviceSourceType===`esriImageServiceSourceTypeMosaicDataset`:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;let t=this._isMosaicDataset(e),n=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return t||n}_isVectorFieldResampleFunction(e){if(e==null)return!1;let{functionName:t,functionArguments:n}=e,r=t?.toLowerCase()===`resample`,i=n?.ResampleType||n?.resampleType;return r&&(i===7||i===10)}_configRenderer(e){let{rasterInfo:t}=this,n=t.attributeTable,r=U(n,`red`)!=null&&U(n,`green`)!=null&&U(n,`blue`)!=null,i=!e&&t.colormap==null&&!r&&H(t).includes(`unique-value`);if(!(this.isRenderedFormat||this.pixelFilter)||this._isVectorDataSet()||i){let n=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,r=pe({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>=3){let e=r?.bandIds??V(t);e&&(t.bandCount!==3||e[0]!==0||e[1]!==1||e[2]!==2)&&(this.bandIds=e)}e||=r?.renderer??B(t,{bandIds:this.bandIds,variableName:this.rasterFunction?null:n});let i=me(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=i,this.symbolizer.rasterInfo=t):this.symbolizer=new W({rendererJSON:i,rasterInfo:t}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock==null?null:e.pixelBlock.clone()}}_getQueryParams(e){e?.renderingRule!=null&&typeof e.renderingRule!=`string`&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));let{raster:t,viewId:n}=this;return{raster:t,viewId:n,f:`json`,...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,n){return this._rasterJobHandler?this._rasterJobHandler.decode({data:e,options:t}):S(e,t,n)}async _getRasterFunctionInfos(e){let t=this.sourceJSON.rasterFunctionInfos;return this.loaded||!t?.length?t:t&&this.version>=10.3?t.length===1&&t[0].name.toLowerCase()===`none`?[{thumbnail:``,functionType:0,...t[0]}]:(await n($(this.parsedUrl)+`/rasterFunctionInfos`,{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes(`png`))}async _requestArrayBuffer(e){let{imageProps:t,requestAsImageElement:i,returnImageBitmap:a,signal:o}=e;if(i&&this._canRequestImageElement(t.format)){let r=`${$(this.parsedUrl)}/exportImage`,{data:i}=await n(r,{responseType:a?`blob`:`image`,query:this._getQueryParams({f:`image`,...this.refreshParameters,...e.imageServiceParameters}),signal:o});if(i instanceof Blob){let{bitmap:e}=await M(i,r,{signal:o});return{imageBitmap:e,params:t}}return{imageOrCanvasElement:i,params:t}}let s=this._initJobHandler(),c=n($(this.parsedUrl)+`/exportImage`,{responseType:`array-buffer`,query:this._getQueryParams({f:`image`,...e.imageServiceParameters}),signal:o}),l=(await Promise.all([c,s]))[0].data,u=t.format||`jpgpng`,d=u;if(d!==`bsq`&&d!==`bip`&&(d=C(l)),!d)throw new r(`imagery-layer:fetch-image`,`unsupported format signature `+String.fromCharCode.apply(null,new Uint8Array(l)));let f={signal:o};return{pixelData:{pixelBlock:await this._decodePixelBlock(l,{width:t.width,height:t.height,format:u,applyJpegMask:!0},f),extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=x(e,{multidimensionalSubset:this.multidimensionalSubset});if(t!=null&&t.length>0){this.mosaicRule=this.mosaicRule||new N;let e=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&this.rasterFunction.functionName?.toLowerCase()!==`none`&&t.forEach(e=>e.variableName=``),t=t.filter(({variableName:e,dimensionName:t})=>e&&e!==`*`||t),!e?.length&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,n){n||={};let r=e.value,{templateRRFunctionNames:i,showNoDataRecords:a,returnDomainValues:o,templateFields:s}=n,c=e.processedValues,l=e.catalogItems?.features,u=e.properties?.Values?.map(e=>e.replaceAll(/ /gi,`, `))||[],d=this.objectIdField||`ObjectId`,f=typeof r==`string`&&r.toLowerCase().includes(`nodata`),p=[];if(r&&!l&&(!f||a)){let e={};e[d]=0;let i=new t({geometry:this.fullExtent,attributes:e});u=[r],l=[i],this.multidimensionalInfo&&this.sourceType===`raster-dataset`&&ue(this.rasterFields,e,n.effectiveMultidimensionalDefinition)}if(!l)return[];this._updateResponseFieldNames(l,s),f&&!a&&(l=[]);let{itemPixelValue:m,servicePixelValue:h}=R,g=this.rasterFields.some(e=>e.name===m),_=this.graphicOrigin;for(let e=0;e<l.length;e++){let t=l[e];if(r!=null){let n=u[e],o=this.rasterFunction&&c&&c.length>0&&i&&i.length>0&&i.includes(this.rasterFunction.functionName)?c[i.indexOf(this.rasterFunction.functionName)]:r;if(n.toLowerCase()===`nodata`&&!a)continue;g&&(t.attributes[m]=n),t.attributes[h]=o,this._updateFeatureWithMagDirValues(t,n);let s=this.fields&&this.fields.length>0,l=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?s?n:r:o;this.rasterFunction||(l=s?n:r),this._updateFeatureWithRasterAttributeTableValues(t,l)}if(t.sourceLayer=t.layer=this,t.origin=_,o&&this._updateFeatureWithDomainValues(t),i&&c&&i.length===c.length)for(let e=0;e<i.length;e++){let n=`${R.servicePixelValue}.${i[e]}`;t.attributes[n]=c[e]}p.push(l[e])}return p}_processMultidimensionalIntersection(e,t,n){let{multidimensionalSubset:r}=this;if(!r)return n=this._combineMosaicRuleWithTimeExtent(n,t),{isOutSide:!1,timeExtent:t,mosaicRule:n};if(r){let{isOutside:n,intersection:i}=v(r,{geometry:e,timeExtent:t});if(n)return{isOutSide:!0,timeExtent:null,mosaicRule:null};i?.timeExtent!=null&&(t=i.timeExtent)}if(n=this._combineMosaicRuleWithTimeExtent(n,t),n?.multidimensionalDefinition){let{isOutside:e}=v(r,{multidimensionalDefinition:n.multidimensionalDefinition});if(e)return{isOutSide:!0,timeExtent:null,mosaicRule:null}}return{isOutSide:!1,timeExtent:t,mosaicRule:n}}_updateFeatureWithRasterAttributeTableValues(e,t){let n=this.rasterInfo.attributeTable||this.serviceRasterInfo.attributeTable;if(n==null)return;let{features:r,fields:i}=n,a=i.map(e=>e.name).find(e=>e.toLowerCase()===`value`);if(!a)return;let o=r.filter(e=>e.attributes[a]===(t==null?null:parseInt(t,10)));o&&o[0]&&i.forEach(t=>{let n=de+t.name;e.attributes[n]=o[0].attributes[t.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;let n=t.split(/,\s*/).map(e=>parseFloat(e)),r=n.map(e=>[e]),i=n.map(e=>({minValue:e,maxValue:e,noDataValue:null})),a=new P({height:1,width:1,pixelType:`f32`,pixels:r,statistics:i});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:a,extent:new m(0,0,0,0,this.spatialReference)});let o=this.serviceDataType===`esriImageServiceDataTypeVector-MagDir`?[a.pixels[0][0],a.pixels[1][0]]:T([a.pixels[0][0],a.pixels[1][0]]);e.attributes[R.magnitude]=o[0],e.attributes[R.direction]=o[1]}_updateFeatureWithDomainValues(e){(this.fields&&this.fields.filter(e=>e.domain?.type===`coded-value`))?.forEach(t=>{let n=e.attributes[t.name];if(n!=null){let r=t.domain.codedValues.find(e=>e.code===n);r&&(e.attributes[t.name]=r.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;let n=this.fieldsIndex;n!=null&&e.forEach(e=>{if(e?.attributes)for(let r of t){let t=n.get(r)?.name;t&&t!==r&&(e.attributes[r]=e.attributes[t],delete e.attributes[t])}})}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return e?.functionName!=null&&e.functionName.toLowerCase()!==`none`}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if(e===`Raw`)return e.replace(`Raw`,`None`);let n=e.toLowerCase().replaceAll(/ /gi,`_`);return t.has(n)?t.get(n):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty(`functionType`)}_isVectorDataSet(){return this.serviceDataType===`esriImageServiceDataTypeVector-UV`||this.serviceDataType===`esriImageServiceDataTypeVector-MagDir`}_applyMosaicAndRenderingRules(e){let{raster:t,mosaicRule:n,rasterFunction:r}=this;r&&e.rasterFunction==null&&(e.rasterFunction=r),n&&e.mosaicRule==null&&(e.mosaicRule=n),t&&e.raster==null&&(e.raster=t)}async _updateCurrentRasterInfo(e){if(this.renderer||this.symbolizer){let t=await this._generateRasterInfo(this.rasterFunction,{signal:e});t&&(this.rasterInfo=t)}}_applyMosaicRule(e){let{raster:t,mosaicRule:n}=this;n&&e.mosaicRule==null&&(e.mosaicRule=n),t&&e.raster==null&&(e.raster=t)}_readCapabilities(e){let t=e.capabilities?e.capabilities.toLowerCase().split(`,`).map(e=>e.trim()):[`image`,`catalog`],{currentVersion:n,maxRecordCount:r}=e,i=t.includes(`image`),a=e.serviceDataType===`esriImageServiceDataTypeElevation`,o=!!(e.spatialReference||e.extent?.spatialReference),s=t.includes(`edit`),c=t.includes(`mensuration`)&&o,l=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(`,`).map(e=>e.trim()),u=c&&l.includes(`basic`),d=this._isMosaicDataset(e)&&t.includes(`catalog`),f=t.includes(`download`),p=n>=10.7&&a||n>=11.4&&(a||c&&l.includes(`3d`)),m=d&&e.fields&&e.fields.length>0,h=m&&e.supportsAdvancedQueries?e.advancedQueryCapabilities:void 0;return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:i,supportsExportImage:i,supportsIdentify:i,supportsImageToMap:n>=11.2&&d,supportsImageToMapMultiray:n>=11.2&&d,supportsMapToImage:n>=11.2&&d,supportsFindImages:n>=11.2&&d,supportsGetImageUrl:n>=11.3&&f,supportsMeasure:c,supportsMeasureFromImage:n>=11.2,supportsDownload:f,supportsQuery:m,supportsGetSamples:n>=10.2&&i,supportsProject:n>=10.3&&i,supportsComputeStatisticsHistograms:n>=10.4&&i,supportsQueryBoundary:n>=10.6&&i,supportsCalculateVolume:p,supportsComputePixelLocation:n>=10.7&&d,supportsComputeAngles:n>=10.91,supportsQueryGPSInfo:n>=11.2&&d,supportsAdd:s,supportsDelete:s,supportsEditing:s,supportsUpdate:s,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:r,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:void 0,supportsStatisticsAggregatedIds:!!h?.supportsAggregateIds,supportsStatistics:!!h?.supportsStatistics,supportsOrderBy:!!h?.supportsOrderBy,supportsDistinct:!!h?.supportsDistinct,supportsPagination:!!h?.supportsPagination,supportsPaginationOnAggregatedQueries:!!h?.supportsPaginationOnAggregatedQueries,supportsStandardizedQueriesOnly:!!h?.useStandardizedQueries,supportsPercentileStatistics:!!h?.supportsPercentileStatistics,supportsCentroid:!!h?.supportsReturningGeometryCentroid,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!!h?.supportsQueryWithDistance,supportsOutDistance:!!h?.supportsOutDistance,supportsExtent:!!h?.supportsReturningQueryExtent,supportsGeometryProperties:!!h?.supportsReturningGeometryProperties,supportsHavingClause:!!h?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:h?.supportsSqlExpression??!!h,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!h?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},mensuration:{supportsDistanceAndAngle:u,supportsAreaAndPerimeter:u,supportsPointOrCentroid:u,supportsHeightFromBaseAndTop:c&&l.includes(`base-top height`),supportsHeightFromBaseAndTopShadow:c&&l.includes(`base-top shadow height`),supportsHeightFromTopAndTopShadow:c&&l.includes(`top-top shadow height`),supports3D:c&&l.includes(`3d`)}}}};e([l({clonable:!1})],Q.prototype,`_functionRasterInfos`,void 0),e([l({readOnly:!0})],Q.prototype,`_serviceSupportsMosaicRule`,void 0),e([Y(`_serviceSupportsMosaicRule`,[`currentVersion`,`fields`])],Q.prototype,`readServiceSupportsMosaicRule`,null),e([l({readOnly:!0})],Q.prototype,`_rasterFunctionNamesIndex`,null),e([l()],Q.prototype,`_projectedFullExtent`,void 0),e([l({clonable:!1})],Q.prototype,`_exportTileQueue`,void 0),e([l()],Q.prototype,`adjustAspectRatio`,void 0),e([l({type:[d],json:{write:!0}})],Q.prototype,`bandIds`,void 0),e([Y(`bandIds`)],Q.prototype,`readBandIds`,null),e([l({readOnly:!0,json:{read:!1}})],Q.prototype,`capabilities`,void 0),e([Y(`service`,`capabilities`,[`capabilities`,`currentVersion`,`serviceDataType`])],Q.prototype,`readCapabilities`,null),e([l({type:Number})],Q.prototype,`compressionQuality`,void 0),e([X(`compressionQuality`)],Q.prototype,`writeCompressionQuality`,null),e([l({type:Number})],Q.prototype,`compressionTolerance`,void 0),e([X(`compressionTolerance`)],Q.prototype,`writeCompressionTolerance`,null),e([l({json:{read:{source:`copyrightText`}}})],Q.prototype,`copyright`,void 0),e([l({readOnly:!0})],Q.prototype,`defaultMosaicRule`,void 0),e([Y(`defaultMosaicRule`,[`defaultMosaicMethod`])],Q.prototype,`readDefaultMosaicRule`,null),e([l({type:String,json:{name:`layerDefinition.definitionExpression`,write:{enabled:!0,allowNull:!0}}})],Q.prototype,`definitionExpression`,void 0),e([l({readOnly:!0,constructOnly:!0})],Q.prototype,`exportImageServiceParameters`,void 0),e([l()],Q.prototype,`rasterInfo`,void 0),e([l({readOnly:!0,type:[A]})],Q.prototype,`fields`,void 0),e([l({readOnly:!0})],Q.prototype,`fieldsIndex`,null),e([l({type:[`png`,`png8`,`png24`,`png32`,`jpg`,`bmp`,`gif`,`jpgpng`,`lerc`,`tiff`,`bip`,`bsq`],json:{write:!0}})],Q.prototype,`format`,null),e([Y(`service`,`format`,[`serviceDataType`,`allowRasterFunction`])],Q.prototype,`readFormat`,null),e([l({type:m})],Q.prototype,`fullExtent`,void 0),e([l({readOnly:!0})],Q.prototype,`hasMultidimensions`,void 0),e([l({json:{read:{source:`maxImageHeight`}}})],Q.prototype,`imageMaxHeight`,void 0),e([l({json:{read:{source:`maxImageWidth`}}})],Q.prototype,`imageMaxWidth`,void 0),e([l({type:String,json:{type:F.jsonValues,read:F.read,write:F.write}})],Q.prototype,`interpolation`,void 0),e([l()],Q.prototype,`minScale`,void 0),e([Y(`service`,`minScale`)],Q.prototype,`readMinScale`,null),e([l()],Q.prototype,`maxScale`,void 0),e([Y(`service`,`maxScale`)],Q.prototype,`readMaxScale`,null),e([l({type:N})],Q.prototype,`mosaicRule`,null),e([Y(`mosaicRule`,[`mosaicRule`,`defaultMosaicMethod`])],Q.prototype,`readMosaicRule`,null),e([X(`mosaicRule`)],Q.prototype,`writeMosaicRule`,null),e([l()],Q.prototype,`multidimensionalInfo`,void 0),e([l({type:te,json:{write:!0}})],Q.prototype,`multidimensionalSubset`,void 0),e([l({json:{type:[Number,[Number]],write:!0}})],Q.prototype,`noData`,void 0),e([l({type:String,json:{type:I.jsonValues,read:I.read,write:I.write}})],Q.prototype,`noDataInterpretation`,void 0),e([l({type:String,readOnly:!0,json:{read:{source:[`fields`]}}})],Q.prototype,`objectIdField`,void 0),e([Y(`objectIdField`)],Q.prototype,`readObjectIdField`,null),e([l({readOnly:!0})],Q.prototype,`geometryType`,void 0),e([l({})],Q.prototype,`typeIdField`,void 0),e([l({})],Q.prototype,`types`,void 0),e([l({readOnly:!0})],Q.prototype,`parsedUrl`,null),e([l({type:Function})],Q.prototype,`pixelFilter`,void 0),e([l()],Q.prototype,`raster`,void 0),e([l({readOnly:!0})],Q.prototype,`sourceType`,void 0),e([Y(`sourceType`,[`serviceSourceType`,`fields`])],Q.prototype,`readSourceType`,null),e([l()],Q.prototype,`viewId`,void 0),e([l({types:G})],Q.prototype,`renderer`,null),e([l({types:G,json:{name:`layerDefinition.drawingInfo.renderer`,origins:{"web-scene":{types:he,name:`layerDefinition.drawingInfo.renderer`,write:{overridePolicy(e){return{enabled:e&&e.type!==`vector-field`}}}}}}})],Q.prototype,`internalRenderer`,null),e([Y(`internalRenderer`)],Q.prototype,`readRenderer`,null),e([X(`internalRenderer`)],Q.prototype,`writeRenderer`,null),e([l({clonable:!1})],Q.prototype,`symbolizer`,void 0),e([l(E)],Q.prototype,`opacity`,void 0),e([l({readOnly:!0})],Q.prototype,`rasterFields`,null),e([l({constructOnly:!0})],Q.prototype,`rasterFunctionInfos`,void 0),e([l({type:z,json:{name:`renderingRule`}})],Q.prototype,`rasterFunction`,null),e([Y(`rasterFunction`,[`renderingRule`,`rasterFunctionInfos`])],Q.prototype,`readRasterFunction`,null),e([l({readOnly:!0})],Q.prototype,`serviceDataType`,void 0),e([l({readOnly:!0,type:g})],Q.prototype,`spatialReference`,void 0),e([Y(`spatialReference`,[`spatialReference`,`extent`])],Q.prototype,`readSpatialReference`,null),e([l({type:L.apiValues,json:{read:L.read,type:L.jsonValues}})],Q.prototype,`pixelType`,void 0),e([X(`pixelType`)],Q.prototype,`writePixelType`,null),e([l({constructOnly:!0,type:fe})],Q.prototype,`serviceRasterInfo`,void 0),e([l()],Q.prototype,`sourceJSON`,void 0),e([l(D)],Q.prototype,`url`,void 0),e([l({readOnly:!0})],Q.prototype,`version`,void 0),e([Y(`version`,[`currentVersion`,`fields`,`timeInfo`])],Q.prototype,`readVersion`,null),Q=e([u(`esri.layers.mixins.ArcGISImageService`)],Q);function $(e){return e?.path??``}return Q};export{Z as ArcGISImageService};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../Graphic.js";import n from"../../request.js";import r from"../../core/Error.js";import{clone as i}from"../../core/lang.js";import a from"../../core/Logger.js";import{QueueProcessor as o}from"../../core/QueueProcessor.js";import{watch as s}from"../../core/reactiveUtils.js";import{urlToObject as c}from"../../core/urlUtils.js";import{property as l,subclass as u}from"../../core/accessorSupport/decorators.js";import{Integer as d,ensureClass as f}from"../../core/accessorSupport/ensureType.js";import{runUntracked as p}from"../../core/accessorSupport/tracking.js";import m from"../../geometry/Extent.js";import h from"../../geometry/Point.js";import g from"../../geometry/Polygon.js";import _ from"../../geometry/SpatialReference.js";import{srToRESTValue as v}from"../../geometry/support/spatialReferenceUtils.js";import{intersectMultimensionalSubset as y,getEffectiveMultidimensionalDefinition as b,getSubsetVariablesFromMdInfo as x,getDefaultMultidimensionalDefinition as S}from"../raster/datasets/multidimensionalUtils.js";import{decode as C,getFormat as w}from"../raster/formats/RasterCodec.js";import{convertPixelSize as T}from"../raster/functions/clipUtils.js";import{mosaicPixelData as E}from"../raster/functions/pixelUtils.js";import{uvComponentToVector as D}from"../raster/functions/vectorFieldUtils.js";import{opacity as O,url as k}from"../support/commonProperties.js";import A from"../support/DimensionalDefinition.js";import{ExportImageServiceParameters as j}from"../support/ExportImageServiceParameters.js";import ee from"../support/Field.js";import te from"../support/FieldsIndex.js";import{createBitmap as M}from"../support/imageBitmapUtils.js";import{isSupportedRendererType as ne}from"../support/imageryRendererUtils.js";import N from"../support/MosaicRule.js";import re from"../support/MultidimensionalSubset.js";import P from"../support/PixelBlock.js";import{interpolationKebab as F,noDataInterpretationKebab as I,pixelTypeKebabDict as L}from"../support/rasterEnums.js";import{getServicePixelValueField as ie,getItemPixelValueField as ae,getRawServicePixelValueField as oe,getProcessedServicePixelValueField as se,getMagnitudeField as ce,getDirectionField as le,getMultidimensionalFields as ue,getRasterAttributeTableFields as de,addMultidimensionalFieldValues as fe,commonRasterFieldNames as R,rasterFieldPrefix as pe}from"../support/rasterFieldUtils.js";import z from"../support/RasterFunction.js";import me from"../support/RasterInfo.js";import{createDefaultRenderer as B,getDefaultBandCombination as V,getSupportedRendererTypes as H,getField as U,matchPresetRenderer as he,normalizeRendererJSON as ge}from"../../renderers/support/rasterRendererHelper.js";import W from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as G,websceneRasterRendererTypes as _e,read as ve}from"../../renderers/support/rasterTypeUtils.js";import{calculateVolume as ye,computeAngles as be,computePixelSpaceLocations as xe,computeHistograms as Se,computeStatisticsHistograms as Ce,measureHeight as we,measureAreaAndPerimeter as Te,measureDistanceAndAngle as Ee,measurePointOrCentroid as De,measureLengthFromImage as Oe,measureAreaFromImage as ke,getImageSpatialReferenceQueryParameter as Ae,getSamples as je,identify as K,imageToMap as Me,imageToMapMultiray as Ne,mapToImage as Pe,findImages as Fe,getImageUrl as Ie,queryBoundary as Le,queryGPSInfo as Re}from"../../rest/imageService.js";import{fetchServiceRasterInfo as q,generateRasterInfo as ze,patchServiceInfo as Be}from"../../rest/imageService/fetchRasterInfo.js";import{getCatalogItemRasterInfo as Ve}from"../../rest/imageService/getCatalogItemRasterInfo.js";import{executeForCount as J}from"../../rest/query/executeForCount.js";import{executeForExtent as He}from"../../rest/query/executeForExtent.js";import{executeForIds as Ue}from"../../rest/query/executeForIds.js";import{executeQueryJSON as We}from"../../rest/query/executeQueryJSON.js";import Ge from"../../rest/support/FeatureSet.js";import Ke from"../../rest/support/ImageIdentifyParameters.js";import Y from"../../rest/support/Query.js";import qe from"../../rest/support/StatisticDefinition.js";import{reader as X}from"../../core/accessorSupport/decorators/reader.js";import{writer as Z}from"../../core/accessorSupport/decorators/writer.js";const Je=4096,Ye=new Set([`png`,`png8`,`png24`,`png32`,`jpg`,`bmp`,`gif`,`jpgpng`,`lerc`,`tiff`]);function Xe(e){let t=JSON.stringify(e),n=t.includes(`"rasterFunctionDefinition":{`),r=(n?t.match(/"type":"(.*?FunctionArguments")/gi):t.match(/"rasterFunction":"(.*?")/gi))?.map(e=>n?e.slice(8,-18):e.slice(18,-1));return r?r.join(`/`):null}const Ze=Ze=>{let Qe=Ze,Q=class extends Qe{constructor(){super(...arguments),this._functionRasterInfos={},this._serviceSupportsMosaicRule=null,this._exportTileQueue=new o({concurrency:4,process:(e,t)=>this._fetchPixels(e.extent,e.width,e.height,{...e.options,signal:t})}),this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalInfo=null,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType=`polygon`,this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set(`exportImageServiceParameters`,new j({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){let e=new Map;return!this.rasterFunctionInfos||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.length<1||this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replaceAll(/ /gi,`_`),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(e=>typeof e==`number`))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,n){e!=null&&this.format!==`lerc`&&(t[n]=e)}writeCompressionTolerance(e,t,n){this.format===`lerc`&&e!=null&&(t[n]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?p(()=>N.fromJSON(t)):null}get fieldsIndex(){return this.fields?new te(this.fields):null}set format(e){e&&Ye.has(e.toLowerCase())&&this._set(`format`,e.toLowerCase())}readFormat(e,t){return t.serviceDataType===`esriImageServiceDataTypeVector-UV`||t.serviceDataType===`esriImageServiceDataTypeVector-MagDir`||this.pixelFilter!=null||t.allowRasterFunction===!1?`lerc`:`jpgpng`}get isRenderedFormat(){return!this.format||this.format.includes(`jpg`)||this.format.includes(`png`)}readMinScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}readMaxScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}set mosaicRule(e){let t=e;t?.mosaicMethod&&(t=N.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set(`mosaicRule`,t)}readMosaicRule(e,t){let n=e||t.mosaicRule;return n?N.fromJSON(n):this._isMosaicRuleSupported(t)?N.fromJSON(t):null}writeMosaicRule(e,t,n){let{mosaicRule:r}=this;this._isValidCustomizedMosaicRule(r)&&(t[n]=r.toJSON())}readObjectIdField(e,t){return e||=t.fields.find(e=>e.type===`esriFieldTypeOID`||e.type===`oid`)?.name,e}get parsedUrl(){return c(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?`mosaic-dataset`:`raster-dataset`}get renderer(){let{activePresetRendererName:e,presetRenderers:t}=this;return e?(t?.find(({name:t})=>t===e))?.renderer.clone():this.internalRenderer}set renderer(e){this.activePresetRendererName=null,this.internalRenderer=e}set internalRenderer(e){this.loaded&&(e=this._configRenderer(e)),this._set(`internalRenderer`,e)}readRenderer(e,t,n){let r=t?.layerDefinition?.drawingInfo?.renderer,i=ve(r,n);return i==null?null:(i.type===`vector-field`&&t.symbolTileSize&&!r.symbolTileSize&&(i.symbolTileSize=t.symbolTileSize),ne(i)||a.getLogger(this).warn(`ArcGISImageService`,`Imagery layer doesn't support given renderer type.`),i)}writeRenderer(e,t,n){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON()}get rasterFields(){let e=this.fields?.map(e=>e.clone())??[];e.push(ie()),this.sourceType===`mosaic-dataset`&&this.fields?.length&&e.push(ae()),this.version>=10.4&&this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.some(({name:e})=>e.toLowerCase()===`none`)&&e.push(oe()),this.rasterFunctionInfos!=null&&this.rasterFunctionInfos.filter(({name:e})=>e.toLowerCase()!==`none`).forEach(({name:t})=>e.push(se(t)));let{rasterInfo:t}=this;if(this._isVectorDataSet()){let n=t?.multidimensionalInfo?.variables[0].unit?.trim(),r=ce(n),i=le();e.push(r,i)}if(t?.multidimensionalInfo&&this.sourceType===`raster-dataset`){let n=ue(t.multidimensionalInfo);e.push(...n)}let n=t?.attributeTable;if(n!=null){let t=de(n);e.push(...t)}return e}set rasterFunction(e){let t=e;t?.rasterFunction&&(t=z.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set(`rasterFunction`,t)}readRasterFunction(e,t){let n=t.rasterFunctionInfos,r=t.renderingRule,i=r!=null&&Object.keys(r).length>0;return!i&&(!n?.length||n[0].name===`None`)?null:this._isRFTJson(r)?z.fromJSON({rasterFunctionDefinition:r}):z.fromJSON(i?r:{rasterFunctionInfos:n})}readSpatialReference(e,t){let n=e||t.extent.spatialReference;return n?_.fromJSON(n):null}writePixelType(e,t,n){(this.serviceRasterInfo==null||this.pixelType!==this.serviceRasterInfo.pixelType)&&(t[n]=L.toJSON(e))}readVersion(e,t){let n=t.currentVersion;return n||=t.hasOwnProperty(`fields`)||t.hasOwnProperty(`timeInfo`)?10:9.3,n}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let n=e,{renderer:r,symbolizer:i,pixelFilter:a}=this,{isRawData:o}=e;if(o&&this.format!==`lerc`&&(r??=B(this.rasterInfo,{bandIds:this.bandIds,variableName:this.rasterFunction?null:this.mosaicRule?.multidimensionalDefinition?.[0].variableName}),i||=(this.symbolizer=new W({rendererJSON:r.toJSON(),rasterInfo:this.rasterInfo}),this.symbolizer)),(o||!this.isRenderedFormat)&&r&&i&&!a){await this._updateSymbolizer(i,r);let a=this.bandIds?.length?this.bandIds:V(this.rasterInfo);n=await this._symbolize({pixelData:e,bandIds:a,symbolizer:i},t)}return n}destroy(){this._shutdownJobHandler()}async calculateVolume(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsCalculateVolume)throw new r(`imagery-layer:compute-pixel-space-locations`,`this operation is not supported on the input image service`);return e=i(e),this.mosaicRule&&e.mosaicRule==null&&(e.mosaicRule=this.mosaicRule),ye(this.url,e,this._getRequestOptions(t))}async computeAngles(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeAngles)throw new r(`imagery-layer:compute-angles`,`this operation is not supported on the input image service`);return be(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputePixelLocation)throw new r(`imagery-layer:compute-pixel-space-locations`,`this operation is not supported on the input image service`);return xe(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeHistograms)throw new r(`imagery-layer:compute-histograms`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicAndRenderingRules(e),Se(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsComputeStatisticsHistograms)throw new r(`imagery-layer:compute-statistics-histograms`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicAndRenderingRules(e),Ce(this.url,e,this._getRequestOptions(t))}async measureHeight(e,t){let n=await this._fetchCapabilities(t?.signal);if(!(e.operationType===`base-and-top`?n.mensuration.supportsHeightFromBaseAndTop:e.operationType===`base-and-top-shadow`?n.mensuration.supportsHeightFromBaseAndTopShadow:n.mensuration.supportsHeightFromTopAndTopShadow))throw new r(`imagery-layer:measure-height`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicRule(e),we(this.url,e,this._getRequestOptions(t))}async measureAreaAndPerimeter(e,t){let n=await this._fetchCapabilities(t?.signal);if(!n.mensuration.supportsAreaAndPerimeter||e.is3D&&!n.mensuration.supports3D)throw new r(`imagery-layer:measure-area-and-perimeter`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicRule(e),Te(this.url,e,this._getRequestOptions(t))}async measureDistanceAndAngle(e,t){let n=await this._fetchCapabilities(t?.signal);if(!n.mensuration.supportsDistanceAndAngle||e.is3D&&!n.mensuration.supports3D)throw new r(`imagery-layer:measure-distance-and-angle`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicRule(e),Ee(this.url,e,this._getRequestOptions(t))}async measurePointOrCentroid(e,t){let n=await this._fetchCapabilities(t?.signal);if(!n.mensuration.supportsPointOrCentroid||e.is3D&&!n.mensuration.supports3D)throw new r(`imagery-layer:measure-point-or-centroid`,`this operation is not supported on the input image service`);return e=i(e),this._applyMosaicRule(e),De(this.url,e,this._getRequestOptions(t))}async measureLengthFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new r(`imagery-layer:measure-length-from-image`,`this operation is not supported on the input image service`);if(e.geometry.type!==`polyline`)throw new r(`imagery-layer:measure-length-from-image`,`this input geometry must be a polyline`);return Oe(this.url,e,this._getRequestOptions(t))}async measureAreaFromImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMeasureFromImage)throw new r(`imagery-layer:measure-area-from-image`,`this operation is not supported on the input image service`);if(e.geometry.type!==`polygon`)throw new r(`imagery-layer:measure-area-from-image`,`this input geometry must be a polygon`);return ke(this.url,e,this._getRequestOptions(t))}getField(e){let{fieldsIndex:t}=this;return t?.get(e)}getFieldDomain(e,t){let n=this.getField(e);return n?n.domain:null}async internalFetchImage(e,t,n,r={}){await this._updateCurrentRasterInfo();let{exportImageServiceParameters:i}=this,a=!1;if(r.requestRawData&&(await this._initJobHandler(),!i.requestRawData&&this.format!==`lerc`)){a=!0,i.requestRawData=!0;let e=this.bandIds;if(!e?.length){let t=V(this.rasterInfo);Array.from({length:this.rasterInfo.bandCount},(e,t)=>t)?.join(`,`)!==t?.join(`,`)&&(e=t)}i.rawDataRequestBandIds=e}let o=this.getExportImageServiceParameters(e,t,n,r.timeExtent);if(a&&(i.requestRawData=!1,i.rawDataRequestBandIds=null),o==null){if(r.requestAsImageElement&&this._canRequestImageElement(this.format)){let e=document.createElement(`canvas`);if(e.width=t,e.height=n,r.returnImageBitmap){let{bitmap:t}=await M(e,`${$(this.parsedUrl)}/exportImage`,r);return{imageBitmap:t}}return{imageOrCanvasElement:e}}let{bandIds:i,rasterInfo:a}=this,o=(i?.length||a.bandCount)??0,s=t*n,c=a.pixelType,l=[];for(let e=0;e<o;e++)l.push(P.createEmptyBand(c,s));return{pixelData:{pixelBlock:new P({width:t,height:n,pixels:l,mask:new Uint8Array(s),pixelType:c}),extent:e}}}let s=!!r.requestAsImageElement&&!this.pixelFilter,c=s&&!!r.returnImageBitmap,l={imageServiceParameters:o,imageProps:{extent:e,width:t,height:n,format:this.format},requestAsImageElement:s,returnImageBitmap:c,signal:r.signal};return this._requestArrayBuffer(l)}async fetchPixels(e,t,n,i={}){await this._initJobHandler(),i.applyRendering&&await this._updateCurrentRasterInfo();let{imageMaxWidth:a,imageMaxHeight:o}=this;if(t<=a&&n<=o)return this._exportTileQueue.push({extent:e,width:t,height:n,options:i},{signal:i.signal});if(t>Je||n>Je||a<512||o<512)throw new r(`imagery-layer:fetch-pixels`,`The image service has a maximum export size of ${a}x${o}. The requested size of ${t}x${n} exceeds this limit.`);let{xmin:s,ymax:c,spatialReference:l}=this._projectedFullExtent??this.fullExtent;if(!l?.equals(e.spatialReference)){let{projectLoad:t,projectExecute:n}=await import(`../../geometry/operators/projectOperator.js`);await t();let r=n(this.fullExtent,e.spatialReference);s=r.xmin,c=r.ymax,this._projectedFullExtent=r}let u=e.width/t,d=e.height/n,f=Math.floor((e.xmin-s)/u),p=Math.floor((c-e.ymax)/d),h=f+t,g=p+n,_=Math.floor(f/512),v=Math.floor(p/512),y=Math.ceil(h/512)-1,b=Math.ceil(g/512)-1,x=512*u,S=512*d,C=[];for(let t=v;t<=b;t++){let n=c-t*S,r=n-S;for(let t=_;t<=y;t++){let a=s+t*x,o=new m({xmin:a,ymin:r,xmax:a+x,ymax:n,spatialReference:e.spatialReference});C.push(this._exportTileQueue.push({extent:o,width:512,height:512,options:i},{signal:i.signal}))}}let w=await Promise.all(C);return w.some(e=>e.pixelBlock==null)?{extent:e,pixelBlock:null}:{extent:e,pixelBlock:this._rasterJobHandler?await this._rasterJobHandler.mosaicPixelData({pixelBlocks:w,destExtent:e},{signal:i.signal,transferPixelsToWorker:!0}):E(w,e)?.pixelBlock}}async _fetchPixels(e,t,n,r={}){let i=r.applyRendering?void 0:new j({layer:this,requestRawData:!0,interpolation:r.interpolation??`nearest`,bandIds:r.bandIds??[]}),a=this.getExportImageServiceParameters(e,t,n,r.timeExtent,i);if(a==null)return{extent:e,pixelBlock:null};delete a.pixelType,r.bandIds||delete a.bandIds,delete a.compressionQuality;let o={imageServiceParameters:a,imageProps:{extent:e,width:t,height:n,format:this.format},requestAsImageElement:!1,returnImageBitmap:!1,signal:r.signal},{pixelData:s}=await this._requestArrayBuffer(o);return s??{extent:e,pixelBlock:null}}fetchKeyProperties(e){return n($(this.parsedUrl)+`/keyProperties`,{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>e.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new r(`#fetchRasterAttributeTable()`,`Failed to get rasterAttributeTable`)):n($(this.parsedUrl)+`/rasterAttributeTable`,{query:this._getQueryParams({renderingRule:this.version>=10.3?e?.rasterFunction:null})}).then(e=>Ge.fromJSON(e.data))}getCatalogItemRasterInfo(e,t){let n=this._getQueryParams(),r={...t,query:n};return Ve($(this.parsedUrl),e,r)}async getCatalogItemICSInfo(e,t){let{data:r}=await n($(this.parsedUrl)+`/`+e+`/info/ics`,{query:this._getQueryParams(),...t}),i=r?.ics;if(!i)return;let a=null;try{a=(await n($(this.parsedUrl)+`/`+e+`/info`,{query:this._getQueryParams(),...t})).data.extent}catch{}if(!a?.spatialReference)return{ics:i,icsToPixelTransform:null,icsExtent:null,northDirection:null};let o=this.version>=10.7?n($(this.parsedUrl)+`/`+e+`/info/icstopixel`,{query:this._getQueryParams(),...t}).then(e=>e.data).catch(()=>({})):{},s=a.spatialReference,c={geometries:JSON.stringify({geometryType:`esriGeometryEnvelope`,geometries:[a]}),inSR:v(s),outSR:`0:`+e},l=n($(this.parsedUrl)+`/project`,{query:this._getQueryParams(c),...t}).then(e=>e.data).catch(()=>({})),u=(a.xmin+a.xmax)/2,d=(a.ymax-a.ymin)/6,f=a.ymin+d,p=[];for(let e=0;e<5;e++)p.push({x:u,y:f+d*e});let h={geometries:JSON.stringify({geometryType:`esriGeometryPoint`,geometries:p}),inSR:v(s),outSR:`0:`+e},g=n($(this.parsedUrl)+`/project`,{query:this._getQueryParams(h),...t}).then(e=>e.data).catch(()=>({})),y=await Promise.all([o,l,g]),b=y[0].ipxf;if(b==null){let e=i.geodataXform?.xf_0;e?.name?.toLowerCase()===`topup`&&e?.coefficients?.length===6&&(b={affine:{name:`ics [sensor: Frame] to pixel (column, row) transformation`,coefficients:e.coefficients,cellsizeRatio:0,type:`GeometricXform`}})}let x=m.fromJSON(y[1]?.geometries?.[0]);x&&(x.spatialReference=new _({wkid:0,imageCoordinateSystem:i}));let S=y[2].geometries?y[2].geometries.filter(e=>e?.x!=null&&e.y!=null&&e.x!==`NaN`&&e.y!==`NaN`):[],C=S.length;if(C<3)return{ics:i,icsToPixelTransform:b,icsExtent:x,northDirection:null};let w=0,T=0,E=0,D=0;for(let e=0;e<C;e++)w+=S[e].x,T+=S[e].y,E+=S[e].x*S[e].x,D+=S[e].x*S[e].y;let O=(C*D-w*T)/(C*E-w*w),k=0,A=S[4].x>S[0].x,j=S[4].y>S[0].y;return O===1/0?k=j?90:270:O===0?k=A?0:180:O>0?k=A?Math.atan(O)*180/Math.PI:Math.atan(O)*180/Math.PI+180:O<0&&(k=j?180+Math.atan(O)*180/Math.PI:360+Math.atan(O)*180/Math.PI),{ics:i,icsToPixelTransform:b,icsExtent:x,northDirection:k}}async generateRasterInfo(e,t){let n=f(z,e),i={...t,query:this._getQueryParams()};if(!n||n.functionName?.toLowerCase()===`none`||this._isVectorFieldResampleFunction(n))return this.serviceRasterInfo??q($(this.parsedUrl),this.sourceJSON,i);let a=Xe(n);if(!a)throw new r(`imagery-layer:generate-raster-info`,`the rendering rule is not supported`);if(this._functionRasterInfos[a])return this._functionRasterInfos[a];let o=ze($(this.parsedUrl),n,i);this._functionRasterInfos[a]=o;try{let t=await o,{rasterFunction:n}=this;return(n===e||JSON.stringify(n)===JSON.stringify(e))&&JSON.stringify(this.rasterInfo)!==JSON.stringify(t)&&(this.rasterInfo=t),t}catch(e){throw this._functionRasterInfos[a]=null,e}}getExportImageServiceParameters(e,t,n,r,i){e=e.clone().shiftCentralMeridian();let a=Ae(e.spatialReference,$(this.parsedUrl));i??=this.exportImageServiceParameters;let o=i.toJSON(),{bandIds:s,noData:c}=o,{renderingRule:l}=o,u=this.rasterFunction?.rasterFunctionDefinition,d=this.renderer?.type,f=!d||d===`raster-stretch`||d===`raster-colormap`||d===`unique-value`||d===`class-breaks`||d===`raster-shaded-relief`;if(s?.length&&this._hasRasterFunction(this.rasterFunction)&&!u&&f){let e={rasterFunction:`ExtractBand`,rasterFunctionArguments:{BandIds:s}};if(l.rasterFunction===`Stretch`)e.rasterFunctionArguments.Raster=l.rasterFunctionArguments.Raster,l.rasterFunctionArguments.Raster=e;else if(l.rasterFunction===`Colormap`){let t=l.rasterFunctionArguments.Raster;t?.rasterFunction===`Stretch`?(e.rasterFunctionArguments.Raster=t.rasterFunctionArguments.Raster,t.rasterFunctionArguments.Raster=e):(e.rasterFunctionArguments.Raster=t,l.rasterFunctionArguments.Raster=e)}else e.rasterFunctionArguments.Raster=l,l=e;o.bandIds=void 0}else o.bandIds=s?.join(`,`);Array.isArray(c)&&c.length>0&&(o.noData=c.join(`,`));let p=this._processMultidimensionalIntersection(null,r,i.mosaicRule);if(p.isOutSide)return null;o.mosaicRule=p.mosaicRule==null?null:JSON.stringify(p.mosaicRule),r=p.timeExtent,o.renderingRule=this._getRenderingRuleString(z.fromJSON(l));let m={};if(r!=null){let{start:e,end:t}=r.toJSON();e&&t&&e===t?m.time=``+e:(e!=null||t!=null)&&(m.time=`${e??`null`},${t??`null`}`)}return{bbox:e.xmin+`,`+e.ymin+`,`+e.xmax+`,`+e.ymax,bboxSR:a,imageSR:a,size:t+`,`+n,...o,...m}}async getSamples(e,t){if(!(await this._fetchCapabilities(t?.signal))?.operations.supportsGetSamples)throw new r(`imagery-layer:get-samples`,`getSamples operation is not supported on the input image service`);e=i(e);let{raster:n}=this;return n&&e.raster==null&&(e.raster=n),je(this.url,e,this._getRequestOptions(t))}async identify(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsIdentify)throw new r(`imagery-layer:identify`,`identify operation is not supported on the input image service`);e=i(e),this.version<10.91&&e.geometry?.type===`extent`&&(e.geometry=g.fromExtent(e.geometry));let n=this._processMultidimensionalIntersection(e.geometry,e.timeExtent,e.mosaicRule||this.mosaicRule);if(n.isOutSide)throw new r(`imagery-layer:identify`,`the request cannot be fulfilled when falling outside of the multidimensional subset`);e.timeExtent=n.timeExtent,e.mosaicRule=n.mosaicRule;let{raster:a,rasterFunction:o}=this;return o&&e.rasterFunction==null&&(e.rasterFunction=o),a&&e.raster==null&&(e.raster=a),K(this.url,e,this._getRequestOptions(t))}async imageToMap(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMap)throw new r(`imagery-layer:image-to-map`,`imageToMap operation is not supported on the input image service`);return Me($(this.parsedUrl),e,this._getRequestOptions(t))}async imageToMapMultiray(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsImageToMapMultiray)throw new r(`imagery-layer:image-to-map-multiray`,`imageToMapMultiray operation is not supported on the input image service`);return Ne($(this.parsedUrl),e,this._getRequestOptions(t))}async mapToImage(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsMapToImage)throw new r(`imagery-layer:map-to-image`,`mapToImage operation is not supported on the input image service`);return Pe($(this.parsedUrl),e,this._getRequestOptions(t))}async findImages(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsFindImages)throw new r(`imagery-layer:find-images`,`findImages operation is not supported on the input image service`);return Fe($(this.parsedUrl),e,this._getRequestOptions(t))}async getImageUrl(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsGetImageUrl)throw new r(`imagery-layer:get-image-url`,`getImageUrl operation is not supported on the input image service`);return Ie($(this.parsedUrl),e,this._getRequestOptions(t))}createQuery(){return new Y({outFields:[`*`],returnGeometry:!0,where:this.definitionExpression||`1=1`})}async queryBoundary(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryBoundary)throw new r(`imagery-layer:query-boundary`,`queryBoundary operation is not supported on the input image service`);return e??={outSpatialReference:this.spatialReference},Le($(this.parsedUrl),e,this._getRequestOptions(t))}async queryExtent(e,t){({query:e,requestOptions:t}=await this._prepareForQuery(e,t));let{where:n,objectIds:r,geometry:i,timeExtent:a,start:o,num:s,pixelSize:c}=e,l=n!=null&&n!==`1=1`,u=r!=null&&r.length>0,d=i!=null&&(i.type!==`extent`||!i.equals(this.fullExtent)),f=c!=null,p=o!=null||s!=null,{timeInfo:m}=this,h=a!=null&&m!=null&&!a.equals(m.fullTimeExtent);if(!(l||u||d||f||h||p)){let n=await J(this.url,e,t),{outSpatialReference:r}=e;if(!r||r.equals(this.spatialReference))return{count:n,extent:this.fullExtent.clone()};let{projectLoad:i,projectExecute:a}=await import(`../../geometry/operators/projectOperator.js`);return await i(),{count:n,extent:a(this.fullExtent,r)}}return He(this.url,e,t)}async queryRasters(e,t){({query:e,requestOptions:t}=await this._prepareForQuery(e,t));let n=await We(this.url,e,t),r=this.graphicOrigin;return n.features.forEach(e=>{e.layer=this,e.origin=r}),n}async fetchMaxPixelSize(e,t){let n=await this._fetchCapabilities(t?.signal),r=this.fields?.find(({name:e})=>e.toLowerCase()===`maxps`);if(!n.query.supportsStatistics||!r)return null;let i=`maxPixelSize`,a=(await this.queryRasters({where:`1=1`,outStatistics:[new qe({statisticType:`max`,onStatisticField:r.name,outStatisticFieldName:i})],returnGeometry:!1},t)).features[0]?.attributes?.[i];if(!a)return null;let o=new h({x:a,y:a,spatialReference:this.spatialReference});return T(o,e)}async queryObjectIds(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),Ue(this.url,e,t)}async queryGPSInfo(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQueryGPSInfo)throw new r(`imagery-layer:query-gps-info`,`queryGPSInfo operation is not supported on the input image service`);return e??={where:`1=1`},Re($(this.parsedUrl),e,this._getRequestOptions(t))}async queryRasterCount(e,t){return{query:e,requestOptions:t}=await this._prepareForQuery(e,t),J(this.url,e,t)}async queryVisibleRasters(e,t){if(!e)throw new r(`imagery-layer: query-visible-rasters`,`missing query parameter`);await this.load();let{pixelSize:n,returnDomainValues:i,returnTopmostRaster:a,showNoDataRecords:o}=t||{pixelSize:null,returnDomainValues:!1,returnTopmostRaster:!1,showNoDataRecords:!1},s=!1,c=null,l=null,u=R.servicePixelValue.toLowerCase(),d=this._rasterFunctionNamesIndex;if(e.outFields!=null&&(s=e.outFields.some(e=>!e.toLowerCase().startsWith(u)),this.version>=10.4)){let t=e.outFields.filter(e=>e.toLowerCase().startsWith(u)&&e.length>u.length).map(e=>{let t=e.slice(u.length+1);return[this._updateRenderingRulesFunctionName(t,d),t]});c=t.map(e=>new z({functionName:e[0]})),l=t.map(e=>e[1]);let{rasterFunction:n}=this;c.length===0?n?.functionName?(c.push(n),l.push(n.functionName)):c=null:n?.functionName&&!c.some(e=>e.functionName===n.functionName)&&(c.push(n),l.push(n.functionName))}let f=e.outSpatialReference==null||e.outSpatialReference.equals(this.spatialReference),{multidimensionalSubset:p}=this,m=e.timeExtent||this.timeExtent;if(p){let{isOutside:t,intersection:n}=y(p,{geometry:e.geometry,timeExtent:e.timeExtent,multidimensionalDefinition:this.exportImageServiceParameters.mosaicRule?.multidimensionalDefinition});if(t)throw new r(`imagery-layer:query-visible-rasters`,`the request cannot be fulfilled when falling outside of the multidimensional subset`);n?.timeExtent!=null&&(m=n.timeExtent)}let h=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,m),_=e.geometry;this.version<10.91&&_?.type===`extent`&&(_=g.fromExtent(_));let v=this._getQueryParams({geometry:_,timeExtent:m,mosaicRule:h,rasterFunction:this.version<10.4?this.rasterFunction:null,rasterFunctions:c,pixelSize:n,returnCatalogItems:s,returnGeometry:f,raster:this.raster,maxItemCount:a?1:null});delete v.f;let x=new Ke(v);try{await this._generateRasterInfo(this.rasterFunction);let n=await K(this.url,x,{signal:t?.signal,query:{...this.customParameters}}),r=e.outFields,a=n.value!=null&&n.value.toLowerCase().includes(`nodata`),c=s&&!f&&n?.catalogItems?.features.length&&(o||!a),u=this.multidimensionalInfo&&this.sourceType===`raster-dataset`?b({rasterInfo:this.rasterInfo,multidimensionalDefinition:h?.multidimensionalDefinition,timeExtent:m,multidimensionalSubset:this.multidimensionalSubset}):null;if(!c)return this._processVisibleRastersResponse(n,{returnDomainValues:i,templateRRFunctionNames:l,showNoDataRecords:o,templateFields:r,effectiveMultidimensionalDefinition:u});let d=this.objectIdField||`ObjectId`,p=n.catalogItems?.features??[],g=p.map(e=>e.attributes?.[d]),_=new Y({objectIds:g,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[d]}),v=await this.queryRasters(_);return v?.features?.length&&v.features.forEach(t=>{p.forEach(n=>{n.attributes[d]===t.attributes[d]&&t.geometry&&(n.geometry=t.geometry.clone(),e.outSpatialReference!=null&&(n.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(n,{returnDomainValues:i,templateRRFunctionNames:l,showNoDataRecords:o,templateFields:r,effectiveMultidimensionalDefinition:u})}catch{throw new r(`imagery-layer:query-visible-rasters`,`encountered error when querying visible rasters`)}}async fetchVariableStatisticsHistograms(e,t){let r=n($(this.parsedUrl)+`/statistics`,{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.statistics),i=n($(this.parsedUrl)+`/histograms`,{query:this._getQueryParams({variable:e}),signal:t}).then(e=>e.data?.histograms),a=await Promise.all([r,i]);return a[0]&&a[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),{statistics:a[0]||null,histograms:a[1]||null}}getMultidimensionalSubsetVariables(e){let t=e??this.serviceRasterInfo.multidimensionalInfo;return x(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e);let t=this.sourceJSON,n=this.serviceRasterInfo==null?q($(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(e=>(this._set(`serviceRasterInfo`,e),this._set(`multidimensionalInfo`,e.multidimensionalInfo),Be(e,t),e)):Promise.resolve(this.serviceRasterInfo),r=!this.rasterInfo&&this._hasRasterFunction(this.rasterFunction)?this._generateRasterInfo(this.rasterFunction,{signal:e}):Promise.resolve(this.rasterInfo),i=this.rasterFunctionInfos?.every(e=>e.functionType!=null)?null:this._getRasterFunctionInfos();return Promise.all([n,r,i]).then(e=>{e[1]?this._set(`rasterInfo`,e[1]):this._set(`rasterInfo`,e[0]),e[2]&&(t.rasterFunctionInfos=e[2],this.setAtOrigin(`rasterFunctionInfos`,e[2],`service`)),this.internalRenderer&&!this._isSupportedRenderer(this.internalRenderer)&&(this._set(`internalRenderer`,null),a.getLogger(this).warn(`ArcGISImageService`,`Switching to the default renderer. Renderer applied is not valid for this Imagery Layer`)),this._set(`internalRenderer`,this._configRenderer(this.renderer)),this.addHandles([s(()=>this.rasterFunction,e=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this._generateRasterInfo(e).then(e=>{e&&(this.rasterInfo=e)})})]);let{serviceRasterInfo:n}=this;n.multidimensionalInfo!=null&&this._updateMultidimensionalDefinition(n)})}_combineMosaicRuleWithTimeExtent(e,t){let n=this.timeInfo,{multidimensionalInfo:r}=this.serviceRasterInfo;if(e==null||r==null||t==null||n?.startField==null)return e;let{startField:i}=n,a=r.variables.some(e=>e.dimensions.some(e=>e.name===i))?i:`StdTime`;if(e=e.clone(),this.sourceType===`mosaic-dataset`)return e.multidimensionalDefinition=e.multidimensionalDefinition?.filter(e=>e.dimensionName!==a),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];let o=e.multidimensionalDefinition.filter(e=>e.dimensionName===a),s=t.start==null?null:t.start.getTime(),c=t.end==null?null:t.end.getTime(),l=s==null||c==null||s===c,u=l?[s||c]:[[s,c]],d=this.version>=10.8;if(o.length)o.forEach(e=>{e.dimensionName===a&&(d?(e.dimensionName=null,e.isSlice=!1,e.values=[]):(e.isSlice=l,e.values=u))});else if(!d){let t=e.multidimensionalDefinition.filter(e=>e.variableName!=null&&e.dimensionName==null);t.length?t.forEach(e=>{e.dimensionName=a,e.isSlice=l,e.values=u}):e.multidimensionalDefinition.push(new A({variableName:``,dimensionName:a,isSlice:l,values:u}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return e==null?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(e=>!!(e.variableName||e.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!==`mosaic-dataset`&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t?.signal)).operations.supportsQuery)throw new r(`imagery-layer:query-rasters`,`query operation is not supported on the input image service`);let n=e==null?this.createQuery():f(Y,e);return t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:n,requestOptions:t}}_isSupportedRenderer(e){let{rasterInfo:t,rasterFunction:n}=this;return e.type===`unique-value`&&this._hasRasterFunction(n)&&t?.bandCount===1&&[`u8`,`s8`].includes(t.pixelType)||t!=null&&e!=null&&H(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){let t=this.sourceJSON;if(!t){let{data:r,ssl:i}=await n($(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=r,this.sourceJSON=t,i&&(this.url=this.url.replace(/^http:/i,`https:`))}if(t.capabilities?.toLowerCase().split(`,`).map(e=>e.trim()).indexOf(`tilesonly`)>-1)throw new r(`imagery-layer:fetch-service-info`,`use ImageryTileLayer to open tiles-only image services`);this.read(t,{origin:`service`,url:this.parsedUrl})}_isMosaicDataset(e){return e.serviceSourceType?e.serviceSourceType===`esriImageServiceSourceTypeMosaicDataset`:e.fields?.length>0}_isMosaicRuleSupported(e){if(!e)return!1;let t=this._isMosaicDataset(e),n=e.currentVersion>=10.71&&e.hasMultidimensions&&!(e.fields?.length>1);return t||n}_isVectorFieldResampleFunction(e){if(e==null)return!1;let{functionName:t,functionArguments:n}=e,r=t?.toLowerCase()===`resample`,i=n?.ResampleType||n?.resampleType;return r&&(i===7||i===10)}_configRenderer(e){let{rasterInfo:t}=this,n=t.attributeTable,r=U(n,`red`)!=null&&U(n,`green`)!=null&&U(n,`blue`)!=null,i=!e&&t.colormap==null&&!r&&H(t).includes(`unique-value`);if(!(this.isRenderedFormat||this.pixelFilter)||this._isVectorDataSet()||i){let n=this.mosaicRule?.multidimensionalDefinition?.[0].variableName,r=he({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>=3){let e=r?.bandIds??V(t);e&&(t.bandCount!==3||e[0]!==0||e[1]!==1||e[2]!==2)&&(this.bandIds=e)}e||=r?.renderer??B(t,{bandIds:this.bandIds,variableName:this.rasterFunction?null:n});let i=ge(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=i,this.symbolizer.rasterInfo=t):this.symbolizer=new W({rendererJSON:i,rasterInfo:t}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:e.pixelBlock==null?null:e.pixelBlock.clone()}}_getQueryParams(e){e?.renderingRule!=null&&typeof e.renderingRule!=`string`&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));let{raster:t,viewId:n}=this;return{raster:t,viewId:n,f:`json`,...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e?.query,...this.customParameters}}}_decodePixelBlock(e,t,n){return this._rasterJobHandler?this._rasterJobHandler.decode({data:e,options:t}):C(e,t,n)}async _getRasterFunctionInfos(e){let t=this.sourceJSON.rasterFunctionInfos;return this.loaded||!t?.length?t:t&&this.version>=10.3?t.length===1&&t[0].name.toLowerCase()===`none`?[{thumbnail:``,functionType:0,...t[0]}]:(await n($(this.parsedUrl)+`/rasterFunctionInfos`,{query:this._getQueryParams(),signal:e})).data?.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes(`png`))}async _requestArrayBuffer(e){let{imageProps:t,requestAsImageElement:i,returnImageBitmap:a,signal:o}=e;if(i&&this._canRequestImageElement(t.format)){let r=`${$(this.parsedUrl)}/exportImage`,{data:i}=await n(r,{responseType:a?`blob`:`image`,query:this._getQueryParams({f:`image`,...this.refreshParameters,...e.imageServiceParameters}),signal:o});if(i instanceof Blob){let{bitmap:e}=await M(i,r,{signal:o});return{imageBitmap:e,params:t}}return{imageOrCanvasElement:i,params:t}}let s=this._initJobHandler(),c=n($(this.parsedUrl)+`/exportImage`,{responseType:`array-buffer`,query:this._getQueryParams({f:`image`,...e.imageServiceParameters}),signal:o}),l=(await Promise.all([c,s]))[0].data,u=t.format||`jpgpng`,d=u;if(d!==`bsq`&&d!==`bip`&&(d=w(l)),!d)throw new r(`imagery-layer:fetch-image`,`unsupported format signature `+String.fromCharCode.apply(null,new Uint8Array(l)));let f={signal:o};return{pixelData:{pixelBlock:await this._decodePixelBlock(l,{width:t.width,height:t.height,format:u,applyJpegMask:!0},f),extent:t.extent},params:t}}_generateRasterInfo(e,t){return this.generateRasterInfo(e,t).catch(()=>null)}_isValidCustomizedMosaicRule(e){return e&&JSON.stringify(e.toJSON())!==JSON.stringify(this.defaultMosaicRule?.toJSON())}_updateMultidimensionalDefinition(e){if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;let t=S(e,{multidimensionalSubset:this.multidimensionalSubset});if(t!=null&&t.length>0){this.mosaicRule=this.mosaicRule||new N;let e=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.rasterFunction&&this.rasterFunction.functionName?.toLowerCase()!==`none`&&t.forEach(e=>e.variableName=``),t=t.filter(({variableName:e,dimensionName:t})=>e&&e!==`*`||t),!e?.length&&t.length&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,n){n||={};let r=e.value,{templateRRFunctionNames:i,showNoDataRecords:a,returnDomainValues:o,templateFields:s}=n,c=e.processedValues,l=e.catalogItems?.features,u=e.properties?.Values?.map(e=>e.replaceAll(/ /gi,`, `))||[],d=this.objectIdField||`ObjectId`,f=typeof r==`string`&&r.toLowerCase().includes(`nodata`),p=[];if(r&&!l&&(!f||a)){let e={};e[d]=0;let i=new t({geometry:this.fullExtent,attributes:e});u=[r],l=[i],this.multidimensionalInfo&&this.sourceType===`raster-dataset`&&fe(this.rasterFields,e,n.effectiveMultidimensionalDefinition)}if(!l)return[];this._updateResponseFieldNames(l,s),f&&!a&&(l=[]);let{itemPixelValue:m,servicePixelValue:h}=R,g=this.rasterFields.some(e=>e.name===m),_=this.graphicOrigin;for(let e=0;e<l.length;e++){let t=l[e];if(r!=null){let n=u[e],o=this.rasterFunction&&c&&c.length>0&&i&&i.length>0&&i.includes(this.rasterFunction.functionName)?c[i.indexOf(this.rasterFunction.functionName)]:r;if(n.toLowerCase()===`nodata`&&!a)continue;g&&(t.attributes[m]=n),t.attributes[h]=o,this._updateFeatureWithMagDirValues(t,n);let s=this.fields&&this.fields.length>0,l=this.rasterFunction&&this.serviceRasterInfo.attributeTable!=null?s?n:r:o;this.rasterFunction||(l=s?n:r),this._updateFeatureWithRasterAttributeTableValues(t,l)}if(t.sourceLayer=t.layer=this,t.origin=_,o&&this._updateFeatureWithDomainValues(t),i&&c&&i.length===c.length)for(let e=0;e<i.length;e++){let n=`${R.servicePixelValue}.${i[e]}`;t.attributes[n]=c[e]}p.push(l[e])}return p}_processMultidimensionalIntersection(e,t,n){let{multidimensionalSubset:r}=this;if(!r)return n=this._combineMosaicRuleWithTimeExtent(n,t),{isOutSide:!1,timeExtent:t,mosaicRule:n};if(r){let{isOutside:n,intersection:i}=y(r,{geometry:e,timeExtent:t});if(n)return{isOutSide:!0,timeExtent:null,mosaicRule:null};i?.timeExtent!=null&&(t=i.timeExtent)}if(n=this._combineMosaicRuleWithTimeExtent(n,t),n?.multidimensionalDefinition){let{isOutside:e}=y(r,{multidimensionalDefinition:n.multidimensionalDefinition});if(e)return{isOutSide:!0,timeExtent:null,mosaicRule:null}}return{isOutSide:!1,timeExtent:t,mosaicRule:n}}_updateFeatureWithRasterAttributeTableValues(e,t){let n=this.rasterInfo.attributeTable||this.serviceRasterInfo.attributeTable;if(n==null)return;let{features:r,fields:i}=n,a=i.map(e=>e.name).find(e=>e.toLowerCase()===`value`);if(!a)return;let o=r.filter(e=>e.attributes[a]===(t==null?null:parseInt(t,10)));o&&o[0]&&i.forEach(t=>{let n=pe+t.name;e.attributes[n]=o[0].attributes[t.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;let n=t.split(/,\s*/).map(e=>parseFloat(e)),r=n.map(e=>[e]),i=n.map(e=>({minValue:e,maxValue:e,noDataValue:null})),a=new P({height:1,width:1,pixelType:`f32`,pixels:r,statistics:i});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:a,extent:new m(0,0,0,0,this.spatialReference)});let o=this.serviceDataType===`esriImageServiceDataTypeVector-MagDir`?[a.pixels[0][0],a.pixels[1][0]]:D([a.pixels[0][0],a.pixels[1][0]]);e.attributes[R.magnitude]=o[0],e.attributes[R.direction]=o[1]}_updateFeatureWithDomainValues(e){(this.fields&&this.fields.filter(e=>e.domain?.type===`coded-value`))?.forEach(t=>{let n=e.attributes[t.name];if(n!=null){let r=t.domain.codedValues.find(e=>e.code===n);r&&(e.attributes[t.name]=r.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;let n=this.fieldsIndex;n!=null&&e.forEach(e=>{if(e?.attributes)for(let r of t){let t=n.get(r)?.name;t&&t!==r&&(e.attributes[r]=e.attributes[t],delete e.attributes[t])}})}_getRenderingRuleString(e){if(e){let t=e.toJSON();return t=t.rasterFunctionDefinition??t,(t.thumbnail||t.thumbnailEx)&&(t.thumbnail=t.thumbnailEx=null),JSON.stringify(t)}return null}_hasRasterFunction(e){return e?.functionName!=null&&e.functionName.toLowerCase()!==`none`}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if(e===`Raw`)return e.replace(`Raw`,`None`);let n=e.toLowerCase().replaceAll(/ /gi,`_`);return t.has(n)?t.get(n):e}_isRFTJson(e){return e?.name&&e.arguments&&e.function&&e.hasOwnProperty(`functionType`)}_isVectorDataSet(){return this.serviceDataType===`esriImageServiceDataTypeVector-UV`||this.serviceDataType===`esriImageServiceDataTypeVector-MagDir`}_applyMosaicAndRenderingRules(e){let{raster:t,mosaicRule:n,rasterFunction:r}=this;r&&e.rasterFunction==null&&(e.rasterFunction=r),n&&e.mosaicRule==null&&(e.mosaicRule=n),t&&e.raster==null&&(e.raster=t)}async _updateCurrentRasterInfo(e){if(this.renderer||this.symbolizer){let t=await this._generateRasterInfo(this.rasterFunction,{signal:e});t&&(this.rasterInfo=t)}}_applyMosaicRule(e){let{raster:t,mosaicRule:n}=this;n&&e.mosaicRule==null&&(e.mosaicRule=n),t&&e.raster==null&&(e.raster=t)}_readCapabilities(e){let t=e.capabilities?e.capabilities.toLowerCase().split(`,`).map(e=>e.trim()):[`image`,`catalog`],{currentVersion:n,maxRecordCount:r}=e,i=t.includes(`image`),a=e.serviceDataType===`esriImageServiceDataTypeElevation`,o=!!(e.spatialReference||e.extent?.spatialReference),s=t.includes(`edit`),c=t.includes(`mensuration`)&&o,l=e.mensurationCapabilities==null?[]:e.mensurationCapabilities.toLowerCase().split(`,`).map(e=>e.trim()),u=c&&l.includes(`basic`),d=this._isMosaicDataset(e)&&t.includes(`catalog`),f=t.includes(`download`),p=n>=10.7&&a||n>=11.4&&(a||c&&l.includes(`3d`)),m=d&&e.fields&&e.fields.length>0,h=m&&e.supportsAdvancedQueries?e.advancedQueryCapabilities:void 0;return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:i,supportsExportImage:i,supportsIdentify:i,supportsImageToMap:n>=11.2&&d,supportsImageToMapMultiray:n>=11.2&&d,supportsMapToImage:n>=11.2&&d,supportsFindImages:n>=11.2&&d,supportsGetImageUrl:n>=11.3&&f,supportsMeasure:c,supportsMeasureFromImage:n>=11.2,supportsDownload:f,supportsQuery:m,supportsGetSamples:n>=10.2&&i,supportsProject:n>=10.3&&i,supportsComputeStatisticsHistograms:n>=10.4&&i,supportsQueryBoundary:n>=10.6&&i,supportsCalculateVolume:p,supportsComputePixelLocation:n>=10.7&&d,supportsComputeAngles:n>=10.91,supportsQueryGPSInfo:n>=11.2&&d,supportsAdd:s,supportsDelete:s,supportsEditing:s,supportsUpdate:s,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryTopFeatures:!1,supportsAsyncConvert3D:!1},query:{maxRecordCount:r,maxRecordCountFactor:void 0,maxUniqueIDCount:void 0,relativeTimeBinWindow:void 0,supportsStatisticsAggregatedIds:!!h?.supportsAggregateIds,supportsStatistics:!!h?.supportsStatistics,supportsOrderBy:!!h?.supportsOrderBy,supportsDistinct:!!h?.supportsDistinct,supportsPagination:!!h?.supportsPagination,supportsPaginationOnAggregatedQueries:!!h?.supportsPaginationOnAggregatedQueries,supportsStandardizedQueriesOnly:!!h?.useStandardizedQueries,supportsPercentileStatistics:!!h?.supportsPercentileStatistics,supportsCentroid:!!h?.supportsReturningGeometryCentroid,supportsCentroidOnDegeneratedQuantizedGeometry:!1,supportsCurrentUser:!1,supportsDegeneratedQuantizedGeometry:!1,supportsDistance:!!h?.supportsQueryWithDistance,supportsOutDistance:!!h?.supportsOutDistance,supportsExtent:!!h?.supportsReturningQueryExtent,supportsGeometryProperties:!!h?.supportsReturningGeometryProperties,supportsHavingClause:!!h?.supportsHavingClause,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsReturnExceededLimitGeometries:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:h?.supportsSqlExpression??!!h,supportsTopFeaturesQuery:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsFormatPBFWithCurves:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!h?.supportsDefaultSR,supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,standardMaxRecordCountNoGeometry:void 0,tileMaxRecordCount:void 0,supportsTrueCurve:!1},mensuration:{supportsDistanceAndAngle:u,supportsAreaAndPerimeter:u,supportsPointOrCentroid:u,supportsHeightFromBaseAndTop:c&&l.includes(`base-top height`),supportsHeightFromBaseAndTopShadow:c&&l.includes(`base-top shadow height`),supportsHeightFromTopAndTopShadow:c&&l.includes(`top-top shadow height`),supports3D:c&&l.includes(`3d`)}}}};e([l({clonable:!1})],Q.prototype,`_functionRasterInfos`,void 0),e([l({readOnly:!0})],Q.prototype,`_serviceSupportsMosaicRule`,void 0),e([X(`_serviceSupportsMosaicRule`,[`currentVersion`,`fields`])],Q.prototype,`readServiceSupportsMosaicRule`,null),e([l({readOnly:!0})],Q.prototype,`_rasterFunctionNamesIndex`,null),e([l()],Q.prototype,`_projectedFullExtent`,void 0),e([l({clonable:!1})],Q.prototype,`_exportTileQueue`,void 0),e([l()],Q.prototype,`adjustAspectRatio`,void 0),e([l({type:[d],json:{write:!0}})],Q.prototype,`bandIds`,void 0),e([X(`bandIds`)],Q.prototype,`readBandIds`,null),e([l({readOnly:!0,json:{read:!1}})],Q.prototype,`capabilities`,void 0),e([X(`service`,`capabilities`,[`capabilities`,`currentVersion`,`serviceDataType`])],Q.prototype,`readCapabilities`,null),e([l({type:Number})],Q.prototype,`compressionQuality`,void 0),e([Z(`compressionQuality`)],Q.prototype,`writeCompressionQuality`,null),e([l({type:Number})],Q.prototype,`compressionTolerance`,void 0),e([Z(`compressionTolerance`)],Q.prototype,`writeCompressionTolerance`,null),e([l({json:{read:{source:`copyrightText`}}})],Q.prototype,`copyright`,void 0),e([l({readOnly:!0})],Q.prototype,`defaultMosaicRule`,void 0),e([X(`defaultMosaicRule`,[`defaultMosaicMethod`])],Q.prototype,`readDefaultMosaicRule`,null),e([l({type:String,json:{name:`layerDefinition.definitionExpression`,write:{enabled:!0,allowNull:!0}}})],Q.prototype,`definitionExpression`,void 0),e([l({readOnly:!0,constructOnly:!0})],Q.prototype,`exportImageServiceParameters`,void 0),e([l()],Q.prototype,`rasterInfo`,void 0),e([l({readOnly:!0,type:[ee]})],Q.prototype,`fields`,void 0),e([l({readOnly:!0})],Q.prototype,`fieldsIndex`,null),e([l({type:[`png`,`png8`,`png24`,`png32`,`jpg`,`bmp`,`gif`,`jpgpng`,`lerc`,`tiff`,`bip`,`bsq`],json:{write:!0}})],Q.prototype,`format`,null),e([X(`service`,`format`,[`serviceDataType`,`allowRasterFunction`])],Q.prototype,`readFormat`,null),e([l({type:m})],Q.prototype,`fullExtent`,void 0),e([l({readOnly:!0})],Q.prototype,`hasMultidimensions`,void 0),e([l({json:{read:{source:`maxImageHeight`}}})],Q.prototype,`imageMaxHeight`,void 0),e([l({json:{read:{source:`maxImageWidth`}}})],Q.prototype,`imageMaxWidth`,void 0),e([l({type:String,json:{type:F.jsonValues,read:F.read,write:F.write}})],Q.prototype,`interpolation`,void 0),e([l()],Q.prototype,`minScale`,void 0),e([X(`service`,`minScale`)],Q.prototype,`readMinScale`,null),e([l()],Q.prototype,`maxScale`,void 0),e([X(`service`,`maxScale`)],Q.prototype,`readMaxScale`,null),e([l({type:N})],Q.prototype,`mosaicRule`,null),e([X(`mosaicRule`,[`mosaicRule`,`defaultMosaicMethod`])],Q.prototype,`readMosaicRule`,null),e([Z(`mosaicRule`)],Q.prototype,`writeMosaicRule`,null),e([l()],Q.prototype,`multidimensionalInfo`,void 0),e([l({type:re,json:{write:!0}})],Q.prototype,`multidimensionalSubset`,void 0),e([l({json:{type:[Number,[Number]],write:!0}})],Q.prototype,`noData`,void 0),e([l({type:String,json:{type:I.jsonValues,read:I.read,write:I.write}})],Q.prototype,`noDataInterpretation`,void 0),e([l({type:String,readOnly:!0,json:{read:{source:[`fields`]}}})],Q.prototype,`objectIdField`,void 0),e([X(`objectIdField`)],Q.prototype,`readObjectIdField`,null),e([l({readOnly:!0})],Q.prototype,`geometryType`,void 0),e([l({})],Q.prototype,`typeIdField`,void 0),e([l({})],Q.prototype,`types`,void 0),e([l({readOnly:!0})],Q.prototype,`parsedUrl`,null),e([l({type:Function})],Q.prototype,`pixelFilter`,void 0),e([l()],Q.prototype,`raster`,void 0),e([l({readOnly:!0})],Q.prototype,`sourceType`,void 0),e([X(`sourceType`,[`serviceSourceType`,`fields`])],Q.prototype,`readSourceType`,null),e([l()],Q.prototype,`viewId`,void 0),e([l({types:G})],Q.prototype,`renderer`,null),e([l({types:G,json:{name:`layerDefinition.drawingInfo.renderer`,origins:{"web-scene":{types:_e,name:`layerDefinition.drawingInfo.renderer`,write:{overridePolicy(e){return{enabled:e&&e.type!==`vector-field`}}}}}}})],Q.prototype,`internalRenderer`,null),e([X(`internalRenderer`)],Q.prototype,`readRenderer`,null),e([Z(`internalRenderer`)],Q.prototype,`writeRenderer`,null),e([l({clonable:!1})],Q.prototype,`symbolizer`,void 0),e([l(O)],Q.prototype,`opacity`,void 0),e([l({readOnly:!0})],Q.prototype,`rasterFields`,null),e([l({constructOnly:!0})],Q.prototype,`rasterFunctionInfos`,void 0),e([l({type:z,json:{name:`renderingRule`}})],Q.prototype,`rasterFunction`,null),e([X(`rasterFunction`,[`renderingRule`,`rasterFunctionInfos`])],Q.prototype,`readRasterFunction`,null),e([l({readOnly:!0})],Q.prototype,`serviceDataType`,void 0),e([l({readOnly:!0,type:_})],Q.prototype,`spatialReference`,void 0),e([X(`spatialReference`,[`spatialReference`,`extent`])],Q.prototype,`readSpatialReference`,null),e([l({type:L.apiValues,json:{read:L.read,type:L.jsonValues}})],Q.prototype,`pixelType`,void 0),e([Z(`pixelType`)],Q.prototype,`writePixelType`,null),e([l({constructOnly:!0,type:me})],Q.prototype,`serviceRasterInfo`,void 0),e([l()],Q.prototype,`sourceJSON`,void 0),e([l(k)],Q.prototype,`url`,void 0),e([l({readOnly:!0})],Q.prototype,`version`,void 0),e([X(`version`,[`currentVersion`,`fields`,`timeInfo`])],Q.prototype,`readVersion`,null),Q=e([u(`esri.layers.mixins.ArcGISImageService`)],Q);function $(e){return e?.path??``}return Q};export{Ze as ArcGISImageService};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{getMetersPerUnitForSR as n}from"../../../core/units.js";import r from"../../../geometry/Extent.js";import{P as i,a,b as o,c as s,d as c}from"../../../chunks/pe.js";import l from"../../../geometry/Point.js";import u from"../../../geometry/Polygon.js";import{projectWithoutEngine as d}from"../../../geometry/projectionUtils.js";import f from"../../../geometry/SpatialReference.js";import{getInfo as p}from"../../../geometry/support/spatialReferenceUtils.js";function m(){if(!S)throw new t(`rasterprojectionhelper-project`,`projection operator is not loaded`)}const h=(e,t,n,r=0)=>{if(n[0]===1)return[0,0];let i=1,a=-1,o=1,s=-1;for(let t=0;t<e.length;t+=2)isNaN(e[t])||(i=i>e[t]?e[t]:i,a=a>e[t]?a:e[t],o=o>e[t+1]?e[t+1]:o,s=s>e[t+1]?s:e[t+1]);let{cols:c,rows:l}=t,u=(a-i)/c/n[0],d=(s-o)/l/n[1],f=r*2,p=0,m=!1,h=[0,0];for(let t=0;t<c-3;t++){for(let n=0;n<l-3;n++){let r=t*l*2+n*2,i=(e[r]+e[r+4]+e[r+l*4]+e[r+l*4+4])/4,a=(e[r+1]+e[r+5]+e[r+l*4+1]+e[r+l*4+5])/4,o=Math.abs((i-e[r+l*2+2])/u),s=Math.abs((a-e[r+l*2+3])/d);if(o+s>p&&(p=o+s,h=[o,s]),f&&p>f){m=!0;break}}if(m)break}return h},g={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},_=32,v=4,y=4,b=new Map,x=new Map;let S=!1,C,w,T;async function E(){return C||(C=Promise.withResolvers(),w=await import(`../../../geometry/operators/projectOperator.js`),T=await import(`../../../geometry/operators/support/geographicTransformationUtils.js`),w.projectIsLoaded()||await w.projectLoad(),T.isLoaded()||await T.load(),S=!0,C.resolve()),C.promise}function D(e,t,n){if(m(),n){let n=w.projectExecute(e,t);return T.getTransformation(t,e.spatialReference,n)}return T.getTransformation(e.spatialReference,t,e)}function O(e,t,n,i){let a=e.spatialReference;if(!a||!t||a.equals(t))return e;m();let o=n.center,s=new r({xmin:o.x-e.x/2,xmax:o.x+e.x/2,ymin:o.y-e.y/2,ymax:o.y+e.y/2,spatialReference:a}),c=w.projectExecute(s,t,{geographicTransformation:i}),l=W(t);return c==null||l!=null&&c.width>=l?k(e,a,t):{x:c.width,y:c.height}}function k(e,t,r){let i=n(t)/n(r);return{x:e.x*i,y:e.y*i}}function A(e,r,i){let{spatialReference:a}=i;if(!a||!r||a.equals(r))return e;if(a.isGeographic&&r.isGeographic)return k(e,a,r);if(m(),!S)throw new t(`raster-projection-helper:project-dataset-resolution`,`geometry engine is not loaded`);let{x:o,y:s}=e,c=n(a),l=(o+s)/2*c,d=1;l>30&&(d=30/l,o*=d,s*=d);let f=o*256/2,p=s*256/2,{x:h,y:g}=i.center,_=[];for(let e=0;e<=256;e++)_.push([h-f,g-p+e*s]);for(let e=1;e<=256;e++)_.push([h-f+e*o,g+p]);for(let e=1;e<=256;e++)_.push([h+f,g+p-e*s]);for(let e=1;e<256;e++)_.push([h+f-e*o,g-p]);_.push(_[0]);let v=new u({rings:[_],spatialReference:a}),y=w.projectExecute(v,r);if(!y)return k(e,a,r);let b=y.extent,x=W(r);if(b==null||x!=null&&b.width>=x)return k(e,a,r);let C=$(y.rings),T=o*s*256*256,E=Math.sqrt(C/T)/d,D={x:b.width/d/256,y:b.height/d/256},O={x:o*E,y:s*E},A=D.x*D.y;return Math.abs(A-O.x*O.y)/A<.1?D:O}function j(e,t){return(typeof e==`number`?e:(e.x+e.y)/2)*n(t)*96*39.37}function M(e,t){let{pixelSize:n,extent:r}=e;return j(A(n,t,r),t)}function N(e,t=.01){return n(e)?t/n(e):0}function P(e,t,n,r=!0){let i=e.spatialReference;if(i.equals(t))return e;m();let a=w.projectExecute(e,t,{geographicTransformation:n});return!r||!a||F([e],[a],i,t),a}function F(e,t,n,r){let i=G(n,!0),a=G(r,!0),o=N(n,500),s=N(r,500);if(o&&i!=null&&a!=null)for(let n=0;n<e.length;n++){let r=t[n];if(!r)continue;let{x:c}=e[n],{x:l}=r;l>=a[1]-s&&Math.abs(c-i[0])<o?r.x-=a[1]-a[0]:l<=a[0]+s&&Math.abs(c-i[1])<o&&(r.x+=a[1]-a[0])}}function I(e){let{inSR:t,outSR:n,preferPE:r}=e;if(t.equals(n)){let{points:t}=B(e,null);return t}return t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator?te(e):r&&(t.isGeographic||R(t)!=null)?ee(e):L(e)}function L(e){let{points:t}=B(e,null),{inSR:n,outSR:r,datumTransformation:i}=e,a=t.map(e=>new l(e[0],e[1],n)),o=w.projectExecuteMany(a,r,{geographicTransformation:i});return i&&F(a,o,n,r),o.map(e=>e?[e.x,e.y]:[NaN,NaN])}function ee(e){let{inSR:t,outSR:n,datumTransformation:r}=e,{points:o,mask:l}=B(e,R(t));if(!t.isGeographic){let e=t.wkid?i.coordsys(t.wkid):i.fromString(t.isGeographic?a.PE_TYPE_GEOGCS:a.PE_TYPE_PROJCS,t.wkt2||t.wkt);s.projToGeog(e,o.length,o)}if(r!=null&&r.steps.length){let e,t=179.9955;if(n.isGeographic&&(e=o.map(([e])=>e>t?1:e<-179.9955?-1:0)),r.steps.forEach(e=>{let t=e.wkid?i.geogtran(e.wkid):i.fromString(a.PE_TYPE_GEOGTRAN,e.wkt);c.geogToGeog(t,o.length,o,null,e.isInverse?a.PE_TRANSFORM_2_TO_1:a.PE_TRANSFORM_1_TO_2)}),e)for(let n=0;n<o.length;n++){let r=e[n],i=o[n][0],a=i>t?1:i<-179.9955?-1:0;r&&a&&r!==a&&(o[n][0]=r>0?i+360:i-360)}}if(!n.isGeographic){let e=R(n,!0);ne(o,e!=null&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90]);let t=n.wkid?i.coordsys(n.wkid):i.fromString(n.isGeographic?a.PE_TYPE_GEOGCS:a.PE_TYPE_PROJCS,n.wkt2||n.wkt);s.geogToProj(t,o.length,o)}let u=o;if(l&&o.length!==l.length){u=[];for(let e=0,t=0;e<l.length;e++)l[e]?u.push(o[t++]):u.push([NaN,NaN])}return u}function te(e){let{cols:t,rows:n,xres:r,yres:i,usePixelCenter:a,inSR:o,outSR:s}=e,{xmin:c,ymax:u}=e;a&&(c+=r/2,u-=i/2);let f=[],p=[],m=Math.max(t,n);for(let e=0;e<m;e++){let a=c+r*Math.min(t,e),m=u-i*Math.min(n,e),h=d(new l({x:a,y:m,spatialReference:o}),o,s);e<=t&&f.push(h.x),e<=n&&p.push(h.y)}let h=[];for(let e=0;e<t;e++)for(let t=0;t<n;t++)h.push([f[e],p[t]]);return h}function R(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),b.has(n)){let e=b.get(n);return t?e?.gcs:e?.pcs}let r=e.wkid?i.coordsys(e.wkid):i.fromString(e.isGeographic?a.PE_TYPE_GEOGCS:a.PE_TYPE_PROJCS,e.wkt2||e.wkt),o=z(r,N(e,1e-4)),s=z(r,0,!0);return b.set(n,{pcs:o,gcs:s}),t?s:o}function z(e,t=0,n=!1){let r=o.generate(e),i=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!r||!i?.length)return null;let a=!1,s=i.find(e=>e.getInclusive()===1&&e.getKind()===1);if(!s){if(s=i.find(e=>e.getInclusive()===1&&e.getKind()===0),!s)return null;a=!0}let c=n?0:+(r.getNorthPoleLocation()===2)|(r.getSouthPoleLocation()===2?2:0),l=r.isPannableRectangle(),u=s.getCoord();if(a)return{isEnvelope:a,isPannable:l,vertices:u,coef:null,bbox:[u[0][0]-t,u[0][1]-t,u[1][0]+t,u[1][1]+t],poleLocation:c};let d=0,f=[],[p,m]=u[0],[h,g]=u[0];for(let e=0,t=u.length;e<t;e++){d++,d===t&&(d=0);let[n,r]=u[e],[i,a]=u[d];if(a===r)f.push([n,i,r,a,2]);else{let e=(i-n)/(a-r||1e-4),t=n-e*r;r<a?f.push([e,t,r,a,0]):f.push([e,t,a,r,1])}p=p<n?p:n,m=m<r?m:r,h=h>n?h:n,g=g>r?g:r}return{isEnvelope:!1,isPannable:l,vertices:u,coef:f,bbox:[p,m,h,g],poleLocation:c}}function B(e,t){let n=[],{cols:r,rows:i,xres:a,yres:o,usePixelCenter:s}=e,{xmin:c,ymax:l}=e;if(s&&(c+=a/2,l-=o/2),t==null){for(let e=0;e<r;e++)for(let t=0;t<i;t++)n.push([c+a*e,l-o*t]);return{points:n}}let u=new Uint8Array(r*i);if(t.isEnvelope){let{isPannable:e,bbox:[s,d,f,p]}=t;for(let t=0,m=0;t<r;t++){let r=c+a*t,h=e||r>=s&&r<=f;for(let e=0;e<i;e++,m++){let t=l-o*e;h&&t>=d&&t<=p&&(n.push([r,t]),u[m]=1)}}return{points:n,mask:u}}let d=t.coef,f=[];for(let e=0;e<i;e++){let t=l-o*e,n=[],r=[];for(let e=0;e<d.length;e++){let[i,a,o,s,c]=d[e];if(t===o&&o===s)n.push(i),n.push(a),r.push(2),r.push(2);else if(t>=o&&t<=s){let e=i*t+a;n.push(e),r.push(c)}}let i=n;if(n.length>2){let e=r[0]===2?0:r[0],t=n[0];i=[];for(let a=1;a<r.length;a++)(r[a]!==2||a===r.length-1)&&(r[a]!==e&&(i.push(e===0?Math.min(t,n[a-1]):Math.max(t,n[a-1])),e=r[a],t=n[a]),a===r.length-1&&i.push(r[a]===0?Math.min(t,n[a]):Math.max(t,n[a])));i.sort((e,t)=>e-t)}else n[0]>n[1]&&(i=[n[1],n[0]]);f.push(i)}for(let e=0,t=0;e<r;e++){let r=c+a*e;for(let e=0;e<i;e++,t++){let i=l-o*e,a=f[e];if(a.length===2)r>=a[0]&&r<=a[1]&&(n.push([r,i]),u[t]=1);else if(a.length>2){let e=!1;for(let t=0;t<a.length;t+=2)if(r>=a[t]&&r<=a[t+1]){e=!0;break}e&&(n.push([r,i]),u[t]=1)}}}return{points:n,mask:u}}function ne(e,t){let[n,r]=t;for(let t=0;t<e.length;t++){let i=e[t][1];(i<n||i>r)&&(e[t]=[NaN,NaN])}}function V(e,t){let n=W(e[0].spatialReference);if(e.length<2||n==null||(t??=N(e[0].spatialReference),e=e.filter(e=>e.width>t),e.length===1))return e[0];let{xmin:i,xmax:a,ymin:o,ymax:s}=e[0];for(let t=1;t<e.length;t++){let r=e[t];a=r.xmax+n*t,o=Math.min(o,r.ymin),s=Math.max(s,r.ymax)}return new r({xmin:i,xmax:a,ymin:o,ymax:s,spatialReference:e[0].spatialReference})}function H(t,n,i=null,a=!0){let o=t.spatialReference;if(o.equals(n)||!n)return t;let s=q(t),c=W(o,!0),l=W(n);if(s===0||c==null||l==null){let e=U(t,n,i,a);if(e&&c==null&&l!=null&&Math.abs(e.width-l)<N(n)&&w.projectIsLoaded()){let r=R(o);if(r!=null&&r.poleLocation===0&&t.width<(r.bbox[2]-r.bbox[0])/2)return ie(t,n)||e}return e}let u=t.clone().normalize();if(u.length===1&&t.xmax<c&&t.xmax-c/2>N(o)){let{xmin:e,xmax:n}=t;for(let i=0;i<=s;i++){let a=i===0?e:-c/2,l=i===s?n-c*i:c/2;u[i]=new r({xmin:a,xmax:l,ymin:t.ymin,ymax:t.ymax,spatialReference:o})}}let d=u.map(e=>U(e,n,i,a)).filter(e);return d.length===0?null:V(d)}function re(e,t,n){if(e.type===`extent`){let{xmin:t,ymin:n,xmax:r,ymax:i,spatialReference:a}=e;e=new u({rings:[[[t,i],[r,i],[r,n],[t,n],[t,i]]],spatialReference:a})}return e.spatialReference.equals(t)?e:(m(),w.projectExecute(e,t,{geographicTransformation:n}))}function ie(e,t){let n=W(t);if(n==null)return null;let{xmin:i,ymin:a,xmax:o,ymax:s}=e,c=e.spatialReference,l=new u({spatialReference:c,rings:[[[i,a],[o,a],[o,s],[i,s],[i,a]]]}),d=w.projectExecute(l,t);if(d.rings.length!==2||!d.rings[0].length||!d.rings[1].length)return null;let{rings:f}=d,p=N(c),m=new r({spatialReference:t});for(let e=0;e<2;e++){i=o=f[e][0][0],a=s=f[e][0][1];for(let t=0;t<f[e].length;t++)i=i>f[e][t][0]?f[e][t][0]:i,o=o<f[e][t][0]?f[e][t][0]:o,a=a>f[e][t][1]?f[e][t][1]:a,s=s<f[e][t][1]?f[e][t][1]:s;if(e===0)m.ymin=a,m.ymax=s,m.xmin=i,m.xmax=o;else if(m.ymin=Math.min(m.ymin,a),m.ymax=Math.max(m.ymax,s),Math.abs(o-n/2)<p)m.xmin=i,m.xmax+=n;else if(Math.abs(i+n/2)<p)m.xmax=o+n;else return null}return m}function U(e,t,n,r=!0,i=!0){let a=e.spatialReference;if(a.equals(t)||!t)return e;m();let o=w.projectExecute(e,t,{geographicTransformation:n});if(i&&t.isWebMercator&&o&&(o.ymax=Math.min(20037508.342787,o.ymax),o.ymin=Math.max(-20037508.342787,o.ymin),o.ymin>=o.ymax))return null;if(!r||!o)return o;let s=G(a,!0),c=G(t,!0);if(s==null||c==null)return o;let u=N(a,.001),d=N(a,500),f=N(t,.001);if(Math.abs(o.xmin-c[0])<f&&Math.abs(o.xmax-c[1])<f){let r=Math.abs(e.xmin-s[0]),i=Math.abs(s[1]-e.xmax);if(r<u&&i>d){o.xmin=c[0];let r=[];r.push(new l(e.xmax,e.ymin,a)),r.push(new l(e.xmax,(e.ymin+e.ymax)/2,a)),r.push(new l(e.xmax,e.ymax,a));let i=r.map(e=>P(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);o.xmax=Math.max.apply(null,i)}if(i<u&&r>d){o.xmax=c[1];let r=[];r.push(new l(e.xmin,e.ymin,a)),r.push(new l(e.xmin,(e.ymin+e.ymax)/2,a)),r.push(new l(e.xmin,e.ymax,a));let i=r.map(e=>P(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);o.xmin=Math.min.apply(null,i)}}else{let e=N(t,.001);Math.abs(o.xmin-c[0])<e&&(o.xmin=c[0]),Math.abs(o.xmax-c[1])<e&&(o.xmax=c[1])}return o}function W(e,t=!1){if(!e)return null;let n=t?20037508.342787:20037508.342788905;return e.isWebMercator?n*2:e.wkid&&e.isGeographic?360:g[e.wkid]*2||null}function G(e,t=!1){if(e.isGeographic)return[-180,180];let n=W(e,t);return n?[-n/2,n/2]:null}function K(e,t,n,r){let i=(e-t)/n;return i-Math.floor(i)===0?r&&--i:i=Math.floor(i),i}function q(e,t=!1){let n=W(e.spatialReference);if(n==null)return 0;let r=n/2,i=t?0:-r,a=N(e.spatialReference),o=!t&&Math.abs(e.xmax-n/2)<a?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<a?-n/2:e.xmin;return K(o,i,n,!0)-K(s,i,n,!1)}function ae(e){let t=e.storageInfo.origin.x,n=W(e.spatialReference,!0);if(n==null)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};let r=n/2,{nativePixelSize:i,storageInfo:a,extent:o}=e,{maximumPyramidLevel:s,blockWidth:c,pyramidScalingFactor:l}=a,u=i.x,d=[],f=e.transform!=null&&e.transform.type===`gcs-shift`,p=t+(f?0:r),m=f?n-t:r-t;for(let e=0;e<=s;e++){let e=(o.xmax-t)/u/c,n=e-Math.floor(e)===0?e:Math.ceil(e),r=m/u/c,i=r-Math.floor(r)===0?r:Math.ceil(r),a=Math.floor(p/u/c),s=Math.round(p/u)%c,f=(c-Math.round(m/u)%c)%c;d.push({resolutionX:u,blockWidth:c,datasetColumnCount:n,worldColumnCountFromOrigin:i,leftMargin:s,rightPadding:f,originColumnOffset:a}),u*=l}return{originX:t,halfWorldWidth:r,pyramidsInfo:d,hasGCSSShiftTransform:f}}function oe(e){if(!e||e.isGeographic)return e;let t=String(e.wkid||e.wkt2||e.wkt),n;return x.has(t)?n=x.get(t):(n=(e.wkid?i.coordsys(e.wkid):i.fromString(a.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),x.set(t,n)),new f({wkid:n})}function se(e){let t=e.isAdaptive&&e.spacing==null,n=e.spacing||[32,32],r=J(e),i={cols:r.size[0]+1,rows:r.size[1]+1},a=r.outofBoundPointCount>0&&r.outofBoundPointCount<r.offsets.length/2,o=r.outofBoundPointCount===r.offsets.length/2||t&&a?[0,0]:h(r.offsets,i,n,4),s=(o[0]+o[1])/2,c=e.projectedExtent.spatialReference,l=e.srcBufferExtent.spatialReference;if(t&&(a||s>4)&&(c.isGeographic||R(c),n=[4,4],r=J({...e,spacing:n}),i={cols:r.size[0]+1,rows:r.size[1]+1},o=h(r.offsets,i,n,4)),r.error=o,n[0]>1&&(r.coefficients=Y(r.offsets,i,a)),e.includeGCSGrid&&!c.isGeographic&&!c.isWebMercator){if(l.isGeographic)r.gcsGrid={offsets:r.offsets,coefficients:r.coefficients,spacing:n};else{let t=R(c);if(t!=null&&!t.isEnvelope){let t=oe(c),o=H(e.projectedExtent,t),{offsets:s}=J({...e,srcBufferExtent:o,spacing:n}),l=Y(s,i,a);r.gcsGrid={offsets:s,coefficients:l,spacing:n}}}}return r}function J(e){let{projectedExtent:t,srcBufferExtent:n,pixelSize:r,datumTransformation:i,rasterTransform:a}=e,o=t.spatialReference,s=n.spatialReference;m();let{xmin:c,ymin:u,xmax:d,ymax:f}=t,p=W(s),h=p!=null&&(e.hasWrapAround||a?.type===`gcs-shift`),g=e.spacing||[32,32],_=g[0]*r.x,v=g[1]*r.y,y=g[0]===1,b=Math.ceil((d-c)/_-.1/g[0])+ +!y,x=Math.ceil((f-u)/v-.1/g[1])+ +!y,S=I({cols:b,rows:x,xmin:c,ymax:f,xres:_,yres:v,inSR:o,outSR:s,datumTransformation:i,preferPE:g[0]<=4,usePixelCenter:y}),C=[],w,T=0,E=y?-1:NaN,{xmin:D,xmax:O,ymax:k,width:A,height:j}=n,M=N(s,500),P=p!=null&&D>0&&O>p/2,F=R(o),L=F!=null&&F.poleLocation>0;for(let e=0;e<b;e++){let t=[];for(let n=0;n<x;n++){let r=S[e*x+n];if(h&&r[0]>O&&r[0]>p/2-M?r[0]-=p:h&&e===0&&r[0]<0&&P&&!a&&(r[0]+=p),!r||isNaN(r[0])||isNaN(r[1])){C.push(E),C.push(E),t.push(null),T++;continue}if(a){let e=a.inverseTransform(new l({x:r[0],y:r[1],spatialReference:s}));r=[e.x,e.y]}t.push(r),e>0&&h&&w[n]&&r[0]<w[n][0]&&(r[0]+=p,L&&r[0]>O&&r[0]>p&&(r[0]-=p)),C.push((r[0]-D)/A),C.push((k-r[1])/j)}w=t}return{offsets:C,error:null,coefficients:null,outofBoundPointCount:T,spacing:g,size:y?[b,x]:[b-1,x-1]}}function Y(e,t,n){let{cols:r,rows:i}=t,a=new Float32Array((r-1)*(i-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),s=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let t=0;t<r-1;t++){for(let n=0;n<i-1;n++){let c=t*i*2+n*2,l=e[c],u=e[c+1],d=e[c+2],f=e[c+3];c+=i*2;let p=e[c],m=e[c+1],h=e[c+2],g=e[c+3],_=0,v=(n*(r-1)+t)*12;for(let e=0;e<3;e++)a[v++]=o[_++]*l+o[_++]*d+o[_++]*h;_=0;for(let e=0;e<3;e++)a[v++]=o[_++]*u+o[_++]*f+o[_++]*g;_=0;for(let e=0;e<3;e++)a[v++]=s[_++]*l+s[_++]*p+s[_++]*h;_=0;for(let e=0;e<3;e++)a[v++]=s[_++]*u+s[_++]*m+s[_++]*g}if(n)for(let e=0;e<a.length;e++)isNaN(a[e])&&(a[e]=-1)}return a}function X(e,t){let n=e.clone().normalize();return n.length===1?n[0]:V(n,t)}function ce(e){let{spatialReference:t}=e,n=p(t);if(!n)return e;let[i,a]=n.valid,o=a-i,s=0;if(e.xmin<i){let t=i-e.xmin;s=Math.ceil(t/o)}else if(e.xmin>a){let t=e.xmin-a;s=-Math.ceil(t/o)}return new r({spatialReference:e.spatialReference,xmin:e.xmin+s*o,ymin:e.ymin,xmax:e.xmax+s*o,ymax:e.ymax})}function le(e,t,r){let{storageInfo:i,pixelSize:a}=t,o=0,s=!1,{pyramidResolutions:c}=i,u=i.tileInfo.format?.toLowerCase()===`mixed`?Math.max(1,Math.min(3,i.tileInfo.dpi/96)):1,d=(e.x+e.y)/2/u;if(c!=null&&c.length){let e=c[c.length-1],i=(e.x+e.y)/2,u=(a.x+a.y)/2;if(d<=u)o=0;else if(d>=i)o=c.length,s=d/i>8;else{let e=u,t;for(let n=1;n<=c.length;n++){if(t=(c[n-1].x+c[n-1].y)/2,d<=t){d===t?o=n:r===`down`?(o=n-1,s=d/e>8):o=r===`up`||d-e>t-d||d/e>2?n:n-1;break}e=t}}let f=o===0?a:c[o-1];return s&&Math.min(f.x,f.y)*n(t.spatialReference)>19567&&(s=!1),{pyramidLevel:o,pyramidResolution:new l({x:f.x,y:f.y,spatialReference:t.spatialReference}),excessiveReading:s}}let f=Math.log(e.x/a.x)/Math.LN2,p=Math.log(e.y/a.y)/Math.LN2,m=t.storageInfo.maximumPyramidLevel||0;o=r===`down`?Math.floor(Math.min(f,p)):r===`up`?Math.ceil(Math.max(f,p)):Math.round((f+p)/2),o<0?o=0:o>m&&(s=o>m+3,o=m);let h=2**o,g=new l({x:h*t.nativePixelSize.x,y:h*t.nativePixelSize.y,spatialReference:t.spatialReference});return{pyramidLevel:o,pyramidResolution:g,excessiveReading:s}}function Z(e,t,n=!1){let{pixelSize:r,extent:i}=e,a=D(i,t,!1),o=H(X(i,(r.x+r.y)/16),t,a);return!o||n||q(o)===0?o:U(i,t,a)}function ue(e,t,n){let r=n?.tileSize??512,i=n?.alignGlobalDatasetWithAGOL??!0,a=!!n?.limitToSrcResolution,{extent:o,pixelSize:s}=e,c=A(s,t,o);if(c==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};let l=(c.x+c.y)/2,u=j(l,t),d=256/r,f=t.isGeographic?295828763.7958547*d:591657527.591555*d,p=(t.isGeographic?.703125:156543.03392800014)*d,m=e.dataType===`vector-magdir`||e.dataType===`vector-uv`,h=Z(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(f/2/u)/Math.LN2));if(!m&&h&&i&&(t.isGeographic||t.isWebMercator)){let n=W(t);if(m=q(h)>0||n!=null&&h.width>n/4,!m&&n!=null){let t=-1;if(g<3)t=2**g*l*r;else if(e.storageInfo){let{maximumPyramidLevel:n=0,pyramidScalingFactor:i=2}=e.storageInfo;t=i**n*l*r}let i=Math.ceil(n/t);m=i===1||i===2&&n/2-h.xmax<t}}let _=u,v,y=1.001,b=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(m){_=f;let n=Q(e,t);v={x:n.x*p,y:n.y*p}}else{v={x:s.x,y:s.y};let e=0;for(;_<y/2*f&&e<g;)e++,_*=b,v.x*=b,v.y*=b;Math.max(_,f)/Math.min(_,f)<=y&&(_=f)}let x=[_],S=[{x:v.x,y:v.y}],C=Math.min(70.5310735,u)/y;for(;_>=C;)_/=b,v.x/=b,v.y/=b,x.push(_),S.push({x:v.x,y:v.y});if(a){let e=s.x*.001,t=S.findIndex(t=>t.x>=s.x-e&&t.x<=s.x+e);t>-1?(S.length=t+1,x.length=t+1):(t=S.findIndex(t=>t.x<=s.x+e),t>0&&(S.length=t,x.length=t))}return{projectedPixelSize:c,scales:x,srcResolutions:S,isCustomTilingScheme:!m}}function Q(e,t){if(t.isWGS84||t.isWebMercator){let n=t.isGeographic?1341104507446289e-21:.29858214164761665,r=t.isGeographic?4326:3857,i=Z(e,new f({wkid:r}),!0),a=A({x:n,y:n},e.spatialReference,i);return{x:a.x/n,y:a.y/n}}let n=A(e.pixelSize,t,e.extent),r=(n.x+n.y)/2;return{x:e.pixelSize.x/r,y:e.pixelSize.y/r}}function de(e,t){let{spatialReference:n,lods:r}=t,{x:i,y:a}=Q(e,n);return r.map(({resolution:e})=>({x:e*i,y:e*a}))}function $(e){let t=0;for(let n of e){let e=n.length,r=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)r+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=r/2}return Math.abs(t)}export{$ as calculateArea2D,ue as computeProjectedScales,Q as computeSrcResolutionRatio,de as computeSrcResolutions,_ as defaultGridSpacing,y as defaultProjectionToleranceInPixels,D as getDefaultDatumTransformationForDataset,I as getProjectedGridPoints,se as getProjectionOffsetGrid,ae as getRasterDatasetAlignmentInfo,M as getSourceScale,W as getWorldWidth,q as getWorldWrapCount,E as load,v as minimumGridSpacing,Z as projectDatasetExtent,A as projectDatasetResolution,H as projectExtent,P as projectPoint,re as projectPolygon,O as projectResolution,ce as shiftExtent,X as snapExtent,le as snapPyramid};
|
|
2
|
+
import{isSome as e}from"../../../core/arrayUtils.js";import t from"../../../core/Error.js";import{getMetersPerUnitForSR as n}from"../../../core/units.js";import r from"../../../geometry/Extent.js";import{P as i,a,b as o,c as s,d as c}from"../../../chunks/pe.js";import l from"../../../geometry/Point.js";import u from"../../../geometry/Polygon.js";import{projectWithoutEngine as d}from"../../../geometry/projectionUtils.js";import f from"../../../geometry/SpatialReference.js";import{getInfo as p}from"../../../geometry/support/spatialReferenceUtils.js";function m(){if(!S)throw new t(`rasterprojectionhelper-project`,`projection operator is not loaded`)}const h=(e,t,n,r=0)=>{if(n[0]===1)return[0,0];let i=1,a=-1,o=1,s=-1;for(let t=0;t<e.length;t+=2)isNaN(e[t])||(i=i>e[t]?e[t]:i,a=a>e[t]?a:e[t],o=o>e[t+1]?e[t+1]:o,s=s>e[t+1]?s:e[t+1]);let{cols:c,rows:l}=t,u=(a-i)/c/n[0],d=(s-o)/l/n[1],f=r*2,p=0,m=!1,h=[0,0];for(let t=0;t<c-3;t++){for(let n=0;n<l-3;n++){let r=t*l*2+n*2,i=(e[r]+e[r+4]+e[r+l*4]+e[r+l*4+4])/4,a=(e[r+1]+e[r+5]+e[r+l*4+1]+e[r+l*4+5])/4,o=Math.abs((i-e[r+l*2+2])/u),s=Math.abs((a-e[r+l*2+3])/d);if(o+s>p&&(p=o+s,h=[o,s]),f&&p>f){m=!0;break}}if(m)break}return h},g={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},_=32,v=4,y=4,b=new Map,x=new Map;let S=!1,C,w,T;async function E(){return C||(C=Promise.withResolvers(),w=await import(`../../../geometry/operators/projectOperator.js`),T=await import(`../../../geometry/operators/support/geographicTransformationUtils.js`),w.projectIsLoaded()||await w.projectLoad(),T.isLoaded()||await T.load(),S=!0,C.resolve()),C.promise}function D(e,t,n){if(m(),n){let n=w.projectExecute(e,t);return T.getTransformation(t,e.spatialReference,n)}return T.getTransformation(e.spatialReference,t,e)}function O(e,t,n,i){let a=e.spatialReference;if(!a||!t||a.equals(t))return e;m();let o=n.center,s=new r({xmin:o.x-e.x/2,xmax:o.x+e.x/2,ymin:o.y-e.y/2,ymax:o.y+e.y/2,spatialReference:a}),c=w.projectExecute(s,t,{geographicTransformation:i}),l=W(t);return c==null||l!=null&&c.width>=l?k(e,a,t):{x:c.width,y:c.height}}function k(e,t,r){let i=n(t)/n(r);return{x:e.x*i,y:e.y*i}}function A(e,r,i){let{spatialReference:a}=i;if(!a||!r||a.equals(r))return e;if(a.isGeographic&&r.isGeographic)return k(e,a,r);if(m(),!S)throw new t(`raster-projection-helper:project-dataset-resolution`,`geometry engine is not loaded`);let{x:o,y:s}=e,c=n(a),l=(o+s)/2*c,d=1;l>30&&(d=30/l,o*=d,s*=d);let f=o*256/2,p=s*256/2,{x:h,y:g}=i.center,_=[];for(let e=0;e<=256;e++)_.push([h-f,g-p+e*s]);for(let e=1;e<=256;e++)_.push([h-f+e*o,g+p]);for(let e=1;e<=256;e++)_.push([h+f,g+p-e*s]);for(let e=1;e<256;e++)_.push([h+f-e*o,g-p]);_.push(_[0]);let v=new u({rings:[_],spatialReference:a}),y=w.projectExecute(v,r);if(!y)return k(e,a,r);let b=y.extent,x=W(r);if(b==null||x!=null&&b.width>=x)return k(e,a,r);let C=$(y.rings),T=o*s*256*256,E=Math.sqrt(C/T)/d,D={x:b.width/d/256,y:b.height/d/256},O={x:o*E,y:s*E},A=D.x*D.y;return Math.abs(A-O.x*O.y)/A<.1?D:O}function j(e,t){return(typeof e==`number`?e:(e.x+e.y)/2)*n(t)*96*39.37}function M(e,t){let{pixelSize:n,extent:r}=e;return j(A(n,t,r),t)}function N(e,t=.01){return n(e)?t/n(e):0}function P(e,t,n,r=!0){let i=e.spatialReference;if(i.equals(t))return e;m();let a=w.projectExecute(e,t,{geographicTransformation:n});return!r||!a||F([e],[a],i,t),a}function F(e,t,n,r){let i=G(n,!0),a=G(r,!0),o=N(n,500),s=N(r,500);if(o&&i!=null&&a!=null)for(let n=0;n<e.length;n++){let r=t[n];if(!r)continue;let{x:c}=e[n],{x:l}=r;l>=a[1]-s&&Math.abs(c-i[0])<o?r.x-=a[1]-a[0]:l<=a[0]+s&&Math.abs(c-i[1])<o&&(r.x+=a[1]-a[0])}}function I(e){let{inSR:t,outSR:n,preferPE:r}=e;if(t.equals(n)){let{points:t}=B(e,null);return t}return t.isWebMercator&&n.isWGS84||t.isWGS84&&n.isWebMercator?te(e):r&&(t.isGeographic||R(t)!=null)?ee(e):L(e)}function L(e){let{points:t}=B(e,null),{inSR:n,outSR:r,datumTransformation:i}=e,a=t.map(e=>new l(e[0],e[1],n)),o=w.projectExecuteMany(a,r,{geographicTransformation:i});return i&&F(a,o,n,r),o.map(e=>e?[e.x,e.y]:[NaN,NaN])}function ee(e){let{inSR:t,outSR:n,datumTransformation:r}=e,{points:o,mask:l}=B(e,R(t));if(!t.isGeographic){let e=t.wkid?i.coordsys(t.wkid):i.fromString(t.isGeographic?a.PE_TYPE_GEOGCS:a.PE_TYPE_PROJCS,t.wkt2||t.wkt);s.projToGeog(e,o.length,o)}if(r!=null&&r.steps.length){let e,t=179.9955;if(n.isGeographic&&(e=o.map(([e])=>e>t?1:e<-179.9955?-1:0)),r.steps.forEach(e=>{let t=e.wkid?i.geogtran(e.wkid):i.fromString(a.PE_TYPE_GEOGTRAN,e.wkt);c.geogToGeog(t,o.length,o,null,e.isInverse?a.PE_TRANSFORM_2_TO_1:a.PE_TRANSFORM_1_TO_2)}),e)for(let n=0;n<o.length;n++){let r=e[n],i=o[n][0],a=i>t?1:i<-179.9955?-1:0;r&&a&&r!==a&&(o[n][0]=r>0?i+360:i-360)}}if(!n.isGeographic){let e=R(n,!0);ne(o,e!=null&&e.isEnvelope?[e.bbox[1],e.bbox[3]]:[-90,90]);let t=n.wkid?i.coordsys(n.wkid):i.fromString(n.isGeographic?a.PE_TYPE_GEOGCS:a.PE_TYPE_PROJCS,n.wkt2||n.wkt);s.geogToProj(t,o.length,o)}let u=o;if(l&&o.length!==l.length){u=[];for(let e=0,t=0;e<l.length;e++)l[e]?u.push(o[t++]):u.push([NaN,NaN])}return u}function te(e){let{cols:t,rows:n,xres:r,yres:i,usePixelCenter:a,inSR:o,outSR:s}=e,{xmin:c,ymax:u}=e;a&&(c+=r/2,u-=i/2);let f=[],p=[],m=Math.max(t,n);for(let e=0;e<m;e++){let a=c+r*Math.min(t,e),m=u-i*Math.min(n,e),h=d(new l({x:a,y:m,spatialReference:o}),o,s);e<=t&&f.push(h.x),e<=n&&p.push(h.y)}let h=[];for(let e=0;e<t;e++)for(let t=0;t<n;t++)h.push([f[e],p[t]]);return h}function R(e,t=!1){let n=e.wkid||e.wkt2||e.wkt;if(!n||e.isGeographic)return null;if(n=String(n),b.has(n)){let e=b.get(n);return t?e?.gcs:e?.pcs}let r=e.wkid?i.coordsys(e.wkid):i.fromString(e.isGeographic?a.PE_TYPE_GEOGCS:a.PE_TYPE_PROJCS,e.wkt2||e.wkt),o=z(r,N(e,1e-4)),s=z(r,0,!0);return b.set(n,{pcs:o,gcs:s}),t?s:o}function z(e,t=0,n=!1){let r=o.generate(e),i=n?e.horizonGcsGenerate():e.horizonPcsGenerate();if(!r||!i?.length)return null;let a=!1,s=i.find(e=>e.getInclusive()===1&&e.getKind()===1);if(!s){if(s=i.find(e=>e.getInclusive()===1&&e.getKind()===0),!s)return null;a=!0}let c=n?0:+(r.getNorthPoleLocation()===2)|(r.getSouthPoleLocation()===2?2:0),l=r.isPannableRectangle(),u=s.getCoord();if(a)return{isEnvelope:a,isPannable:l,vertices:u,coef:null,bbox:[u[0][0]-t,u[0][1]-t,u[1][0]+t,u[1][1]+t],poleLocation:c};let d=0,f=[],[p,m]=u[0],[h,g]=u[0];for(let e=0,t=u.length;e<t;e++){d++,d===t&&(d=0);let[n,r]=u[e],[i,a]=u[d];if(a===r)f.push([n,i,r,a,2]);else{let e=(i-n)/(a-r||1e-4),t=n-e*r;r<a?f.push([e,t,r,a,0]):f.push([e,t,a,r,1])}p=p<n?p:n,m=m<r?m:r,h=h>n?h:n,g=g>r?g:r}return{isEnvelope:!1,isPannable:l,vertices:u,coef:f,bbox:[p,m,h,g],poleLocation:c}}function B(e,t){let n=[],{cols:r,rows:i,xres:a,yres:o,usePixelCenter:s}=e,{xmin:c,ymax:l}=e;if(s&&(c+=a/2,l-=o/2),t==null){for(let e=0;e<r;e++)for(let t=0;t<i;t++)n.push([c+a*e,l-o*t]);return{points:n}}let u=new Uint8Array(r*i);if(t.isEnvelope){let{isPannable:e,bbox:[s,d,f,p]}=t;for(let t=0,m=0;t<r;t++){let r=c+a*t,h=e||r>=s&&r<=f;for(let e=0;e<i;e++,m++){let t=l-o*e;h&&t>=d&&t<=p&&(n.push([r,t]),u[m]=1)}}return{points:n,mask:u}}let d=t.coef,f=[];for(let e=0;e<i;e++){let t=l-o*e,n=[],r=[];for(let e=0;e<d.length;e++){let[i,a,o,s,c]=d[e];if(t===o&&o===s)n.push(i),n.push(a),r.push(2),r.push(2);else if(t>=o&&t<=s){let e=i*t+a;n.push(e),r.push(c)}}let i=n;if(n.length>2){let e=r[0]===2?0:r[0],t=n[0];i=[];for(let a=1;a<r.length;a++)(r[a]!==2||a===r.length-1)&&(r[a]!==e&&(i.push(e===0?Math.min(t,n[a-1]):Math.max(t,n[a-1])),e=r[a],t=n[a]),a===r.length-1&&i.push(r[a]===0?Math.min(t,n[a]):Math.max(t,n[a])));i.sort((e,t)=>e-t)}else n[0]>n[1]&&(i=[n[1],n[0]]);f.push(i)}for(let e=0,t=0;e<r;e++){let r=c+a*e;for(let e=0;e<i;e++,t++){let i=l-o*e,a=f[e];if(a.length===2)r>=a[0]&&r<=a[1]&&(n.push([r,i]),u[t]=1);else if(a.length>2){let e=!1;for(let t=0;t<a.length;t+=2)if(r>=a[t]&&r<=a[t+1]){e=!0;break}e&&(n.push([r,i]),u[t]=1)}}}return{points:n,mask:u}}function ne(e,t){let[n,r]=t;for(let t=0;t<e.length;t++){let i=e[t][1];(i<n||i>r)&&(e[t]=[NaN,NaN])}}function V(e,t){let n=W(e[0].spatialReference);if(e.length<2||n==null||(t??=N(e[0].spatialReference),e=e.filter(e=>e.width>t),e.length===1))return e[0];let{xmin:i,xmax:a,ymin:o,ymax:s}=e[0];for(let t=1;t<e.length;t++){let r=e[t];a=r.xmax+n*t,o=Math.min(o,r.ymin),s=Math.max(s,r.ymax)}return new r({xmin:i,xmax:a,ymin:o,ymax:s,spatialReference:e[0].spatialReference})}function H(t,n,i=null,a=!0){let o=t.spatialReference;if(o.equals(n)||!n)return t;let s=q(t),c=W(o,!0),l=W(n);if(s===0||c==null||l==null){let e=U(t,n,i,a);if(e&&c==null&&l!=null&&Math.abs(e.width-l)<N(n)&&w.projectIsLoaded()){let r=R(o);if(r!=null&&r.poleLocation===0&&t.width<(r.bbox[2]-r.bbox[0])/2)return ie(t,n)||e}return e}let u=t.clone().normalize();if(u.length===1&&t.xmax<c&&t.xmax-c/2>N(o)){let{xmin:e,xmax:n}=t;for(let i=0;i<=s;i++){let a=i===0?e:-c/2,l=i===s?n-c*i:c/2;u[i]=new r({xmin:a,xmax:l,ymin:t.ymin,ymax:t.ymax,spatialReference:o})}}let d=u.map(e=>U(e,n,i,a)).filter(e);return d.length===0?null:V(d)}function re(e,t,n){if(e.type===`extent`){let{xmin:t,ymin:n,xmax:r,ymax:i,spatialReference:a}=e;e=new u({rings:[[[t,i],[r,i],[r,n],[t,n],[t,i]]],spatialReference:a})}return e.spatialReference.equals(t)?e:(m(),w.projectExecute(e,t,{geographicTransformation:n}))}function ie(e,t){let n=W(t);if(n==null)return null;let{xmin:i,ymin:a,xmax:o,ymax:s}=e,c=e.spatialReference,l=new u({spatialReference:c,rings:[[[i,a],[o,a],[o,s],[i,s],[i,a]]]}),d=w.projectExecute(l,t);if(d.rings.length!==2||!d.rings[0].length||!d.rings[1].length)return null;let{rings:f}=d,p=N(c),m=new r({spatialReference:t});for(let e=0;e<2;e++){i=o=f[e][0][0],a=s=f[e][0][1];for(let t=0;t<f[e].length;t++)i=i>f[e][t][0]?f[e][t][0]:i,o=o<f[e][t][0]?f[e][t][0]:o,a=a>f[e][t][1]?f[e][t][1]:a,s=s<f[e][t][1]?f[e][t][1]:s;if(e===0)m.ymin=a,m.ymax=s,m.xmin=i,m.xmax=o;else if(m.ymin=Math.min(m.ymin,a),m.ymax=Math.max(m.ymax,s),Math.abs(o-n/2)<p)m.xmin=i,m.xmax+=n;else if(Math.abs(i+n/2)<p)m.xmax=o+n;else return null}return m}function U(e,t,n,r=!0,i=!0){let a=e.spatialReference;if(a.equals(t)||!t)return e;m();let o=w.projectExecute(e,t,{geographicTransformation:n});if(i&&t.isWebMercator&&o&&(o.ymax=Math.min(20037508.342787,o.ymax),o.ymin=Math.max(-20037508.342787,o.ymin),o.ymin>=o.ymax))return null;if(!r||!o)return o;let s=G(a,!0),c=G(t,!0);if(s==null||c==null)return o;let u=N(a,.001),d=N(a,500),f=N(t,.001);if(Math.abs(o.xmin-c[0])<f&&Math.abs(o.xmax-c[1])<f){let r=Math.abs(e.xmin-s[0]),i=Math.abs(s[1]-e.xmax);if(r<u&&i>d){o.xmin=c[0];let r=[];r.push(new l(e.xmax,e.ymin,a)),r.push(new l(e.xmax,(e.ymin+e.ymax)/2,a)),r.push(new l(e.xmax,e.ymax,a));let i=r.map(e=>P(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);o.xmax=Math.max.apply(null,i)}if(i<u&&r>d){o.xmax=c[1];let r=[];r.push(new l(e.xmin,e.ymin,a)),r.push(new l(e.xmin,(e.ymin+e.ymax)/2,a)),r.push(new l(e.xmin,e.ymax,a));let i=r.map(e=>P(e,t,n)).filter(e=>!isNaN(e?.x)).map(e=>e.x);o.xmin=Math.min.apply(null,i)}}else{let e=N(t,.001);Math.abs(o.xmin-c[0])<e&&(o.xmin=c[0]),Math.abs(o.xmax-c[1])<e&&(o.xmax=c[1])}return o}function W(e,t=!1){if(!e)return null;let n=t?20037508.342787:20037508.342788905;return e.isWebMercator?n*2:e.wkid&&e.isGeographic?360:g[e.wkid]*2||null}function G(e,t=!1){if(e.isGeographic)return[-180,180];let n=W(e,t);return n?[-n/2,n/2]:null}function K(e,t,n,r){let i=(e-t)/n;return i-Math.floor(i)===0?r&&--i:i=Math.floor(i),i}function q(e,t=!1){let n=W(e.spatialReference);if(n==null)return 0;let r=n/2,i=t?0:-r,a=N(e.spatialReference),o=!t&&Math.abs(e.xmax-n/2)<a?n/2:e.xmax,s=!t&&Math.abs(e.xmin+n/2)<a?-n/2:e.xmin;return K(o,i,n,!0)-K(s,i,n,!1)}function ae(e){let t=e.storageInfo.origin.x,n=W(e.spatialReference,!0);if(n==null)return{originX:t,halfWorldWidth:null,pyramidsInfo:null};let r=n/2,{nativePixelSize:i,storageInfo:a,extent:o}=e,{maximumPyramidLevel:s,blockWidth:c,pyramidScalingFactor:l}=a,u=i.x,d=[],f=e.transform!=null&&e.transform.type===`gcs-shift`,p=Math.max(0,t+(f?0:r));for(let e=0;e<=s;e++){let e=(o.xmax-t)/u/c,r=e-Math.floor(e)===0?e:Math.ceil(e),i=Math.round(p/u),a=Math.round(n/u)-i,s=Math.ceil(a/c),f=Math.floor(i/c),m=i%c,h=(c-a%c)%c;d.push({resolutionX:u,blockWidth:c,datasetColumnCount:r,worldColumnCountFromOrigin:s,leftMargin:m,rightPadding:h,originColumnOffset:f}),u*=l}return{originX:t,halfWorldWidth:r,pyramidsInfo:d,hasGCSSShiftTransform:f}}function oe(e){if(!e||e.isGeographic)return e;let t=String(e.wkid||e.wkt2||e.wkt),n;return x.has(t)?n=x.get(t):(n=(e.wkid?i.coordsys(e.wkid):i.fromString(a.PE_TYPE_PROJCS,e.wkt2||e.wkt)).getGeogcs().getCode(),x.set(t,n)),new f({wkid:n})}function se(e){let t=e.isAdaptive&&e.spacing==null,n=e.spacing||[32,32],r=J(e),i={cols:r.size[0]+1,rows:r.size[1]+1},a=r.outofBoundPointCount>0&&r.outofBoundPointCount<r.offsets.length/2,o=r.outofBoundPointCount===r.offsets.length/2||t&&a?[0,0]:h(r.offsets,i,n,4),s=(o[0]+o[1])/2,c=e.projectedExtent.spatialReference,l=e.srcBufferExtent.spatialReference;if(t&&(a||s>4)&&(c.isGeographic||R(c),n=[4,4],r=J({...e,spacing:n}),i={cols:r.size[0]+1,rows:r.size[1]+1},o=h(r.offsets,i,n,4)),r.error=o,n[0]>1&&(r.coefficients=Y(r.offsets,i,a)),e.includeGCSGrid&&!c.isGeographic&&!c.isWebMercator){if(l.isGeographic)r.gcsGrid={offsets:r.offsets,coefficients:r.coefficients,spacing:n};else{let t=R(c);if(t!=null&&!t.isEnvelope){let t=oe(c),o=H(e.projectedExtent,t),{offsets:s}=J({...e,srcBufferExtent:o,spacing:n}),l=Y(s,i,a);r.gcsGrid={offsets:s,coefficients:l,spacing:n}}}}return r}function J(e){let{projectedExtent:t,srcBufferExtent:n,pixelSize:r,datumTransformation:i,rasterTransform:a}=e,o=t.spatialReference,s=n.spatialReference;m();let{xmin:c,ymin:u,xmax:d,ymax:f}=t,p=W(s),h=p!=null&&(e.hasWrapAround||a?.type===`gcs-shift`),g=e.spacing||[32,32],_=g[0]*r.x,v=g[1]*r.y,y=g[0]===1,b=Math.ceil((d-c)/_-.1/g[0])+ +!y,x=Math.ceil((f-u)/v-.1/g[1])+ +!y,S=I({cols:b,rows:x,xmin:c,ymax:f,xres:_,yres:v,inSR:o,outSR:s,datumTransformation:i,preferPE:g[0]<=4,usePixelCenter:y}),C=[],w,T=0,E=y?-1:NaN,{xmin:D,xmax:O,ymax:k,width:A,height:j}=n,M=N(s,500),P=p!=null&&D>0&&O>p/2,F=R(o),L=F!=null&&F.poleLocation>0;for(let e=0;e<b;e++){let t=[];for(let n=0;n<x;n++){let r=S[e*x+n];if(h&&r[0]>O&&r[0]>p/2-M?r[0]-=p:h&&e===0&&r[0]<0&&P&&!a&&(r[0]+=p),!r||isNaN(r[0])||isNaN(r[1])){C.push(E),C.push(E),t.push(null),T++;continue}if(a){let e=a.inverseTransform(new l({x:r[0],y:r[1],spatialReference:s}));r=[e.x,e.y]}t.push(r),e>0&&h&&w[n]&&r[0]<w[n][0]&&(r[0]+=p,L&&r[0]>O&&r[0]>p&&(r[0]-=p)),C.push((r[0]-D)/A),C.push((k-r[1])/j)}w=t}return{offsets:C,error:null,coefficients:null,outofBoundPointCount:T,spacing:g,size:y?[b,x]:[b-1,x-1]}}function Y(e,t,n){let{cols:r,rows:i}=t,a=new Float32Array((r-1)*(i-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),s=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let t=0;t<r-1;t++){for(let n=0;n<i-1;n++){let c=t*i*2+n*2,l=e[c],u=e[c+1],d=e[c+2],f=e[c+3];c+=i*2;let p=e[c],m=e[c+1],h=e[c+2],g=e[c+3],_=0,v=(n*(r-1)+t)*12;for(let e=0;e<3;e++)a[v++]=o[_++]*l+o[_++]*d+o[_++]*h;_=0;for(let e=0;e<3;e++)a[v++]=o[_++]*u+o[_++]*f+o[_++]*g;_=0;for(let e=0;e<3;e++)a[v++]=s[_++]*l+s[_++]*p+s[_++]*h;_=0;for(let e=0;e<3;e++)a[v++]=s[_++]*u+s[_++]*m+s[_++]*g}if(n)for(let e=0;e<a.length;e++)isNaN(a[e])&&(a[e]=-1)}return a}function X(e,t){let n=e.clone().normalize();return n.length===1?n[0]:V(n,t)}function ce(e){let{spatialReference:t}=e,n=p(t);if(!n)return e;let[i,a]=n.valid,o=a-i,s=0;if(e.xmin<i){let t=i-e.xmin;s=Math.ceil(t/o)}else if(e.xmin>a){let t=e.xmin-a;s=-Math.ceil(t/o)}return new r({spatialReference:e.spatialReference,xmin:e.xmin+s*o,ymin:e.ymin,xmax:e.xmax+s*o,ymax:e.ymax})}function le(e,t,r){let{storageInfo:i,pixelSize:a}=t,o=0,s=!1,{pyramidResolutions:c}=i,u=i.tileInfo.format?.toLowerCase()===`mixed`?Math.max(1,Math.min(3,i.tileInfo.dpi/96)):1,d=(e.x+e.y)/2/u;if(c!=null&&c.length){let e=c[c.length-1],i=(e.x+e.y)/2,u=(a.x+a.y)/2;if(d<=u)o=0;else if(d>=i)o=c.length,s=d/i>8;else{let e=u,t;for(let n=1;n<=c.length;n++){if(t=(c[n-1].x+c[n-1].y)/2,d<=t){d===t?o=n:r===`down`?(o=n-1,s=d/e>8):o=r===`up`||d-e>t-d||d/e>2?n:n-1;break}e=t}}let f=o===0?a:c[o-1];return s&&Math.min(f.x,f.y)*n(t.spatialReference)>19567&&(s=!1),{pyramidLevel:o,pyramidResolution:new l({x:f.x,y:f.y,spatialReference:t.spatialReference}),excessiveReading:s}}let f=Math.log(e.x/a.x)/Math.LN2,p=Math.log(e.y/a.y)/Math.LN2,m=t.storageInfo.maximumPyramidLevel||0;o=r===`down`?Math.floor(Math.min(f,p)):r===`up`?Math.ceil(Math.max(f,p)):Math.round((f+p)/2),o<0?o=0:o>m&&(s=o>m+3,o=m);let h=2**o,g=new l({x:h*t.nativePixelSize.x,y:h*t.nativePixelSize.y,spatialReference:t.spatialReference});return{pyramidLevel:o,pyramidResolution:g,excessiveReading:s}}function Z(e,t,n=!1){let{pixelSize:r,extent:i}=e,a=D(i,t,!1),o=H(X(i,(r.x+r.y)/16),t,a);return!o||n||q(o)===0?o:U(i,t,a)}function ue(e,t,n){let r=n?.tileSize??512,i=n?.alignGlobalDatasetWithAGOL??!0,a=!!n?.limitToSrcResolution,{extent:o,pixelSize:s}=e,c=A(s,t,o);if(c==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};let l=(c.x+c.y)/2,u=j(l,t),d=256/r,f=t.isGeographic?295828763.7958547*d:591657527.591555*d,p=(t.isGeographic?.703125:156543.03392800014)*d,m=e.dataType===`vector-magdir`||e.dataType===`vector-uv`,h=Z(e,t,!0),g=Math.min(Math.ceil(Math.log(Math.min(e.width,e.height)/32)/Math.LN2),Math.ceil(Math.log(f/2/u)/Math.LN2));if(!m&&h&&i&&(t.isGeographic||t.isWebMercator)){let n=W(t);if(m=q(h)>0||n!=null&&h.width>n/4,!m&&n!=null){let t=-1;if(g<3)t=2**g*l*r;else if(e.storageInfo){let{maximumPyramidLevel:n=0,pyramidScalingFactor:i=2}=e.storageInfo;t=i**n*l*r}let i=Math.ceil(n/t);m=i===1||i===2&&n/2-h.xmax<t}}let _=u,v,y=1.001,b=Math.min(2,Math.max(1.414,e.storageInfo?.pyramidScalingFactor||2));if(m){_=f;let n=Q(e,t);v={x:n.x*p,y:n.y*p}}else{v={x:s.x,y:s.y};let e=0;for(;_<y/2*f&&e<g;)e++,_*=b,v.x*=b,v.y*=b;Math.max(_,f)/Math.min(_,f)<=y&&(_=f)}let x=[_],S=[{x:v.x,y:v.y}],C=Math.min(70.5310735,u)/y;for(;_>=C;)_/=b,v.x/=b,v.y/=b,x.push(_),S.push({x:v.x,y:v.y});if(a){let e=s.x*.001,t=S.findIndex(t=>t.x>=s.x-e&&t.x<=s.x+e);t>-1?(S.length=t+1,x.length=t+1):(t=S.findIndex(t=>t.x<=s.x+e),t>0&&(S.length=t,x.length=t))}return{projectedPixelSize:c,scales:x,srcResolutions:S,isCustomTilingScheme:!m}}function Q(e,t){if(t.isWGS84||t.isWebMercator){let n=t.isGeographic?1341104507446289e-21:.29858214164761665,r=t.isGeographic?4326:3857,i=Z(e,new f({wkid:r}),!0),a=A({x:n,y:n},e.spatialReference,i);return{x:a.x/n,y:a.y/n}}let n=A(e.pixelSize,t,e.extent),r=(n.x+n.y)/2;return{x:e.pixelSize.x/r,y:e.pixelSize.y/r}}function de(e,t){let{spatialReference:n,lods:r}=t,{x:i,y:a}=Q(e,n);return r.map(({resolution:e})=>({x:e*i,y:e*a}))}function $(e){let t=0;for(let n of e){let e=n.length,r=n[0][0]*(n[1][1]-n[e-2][1]);for(let t=1;t<e-1;t++)r+=n[t][0]*(n[t+1][1]-n[t-1][1]);t+=r/2}return Math.abs(t)}export{$ as calculateArea2D,ue as computeProjectedScales,Q as computeSrcResolutionRatio,de as computeSrcResolutions,_ as defaultGridSpacing,y as defaultProjectionToleranceInPixels,D as getDefaultDatumTransformationForDataset,I as getProjectedGridPoints,se as getProjectionOffsetGrid,ae as getRasterDatasetAlignmentInfo,M as getSourceScale,W as getWorldWidth,q as getWorldWrapCount,E as load,v as minimumGridSpacing,Z as projectDatasetExtent,A as projectDatasetResolution,H as projectExtent,P as projectPoint,re as projectPolygon,O as projectResolution,ce as shiftExtent,X as snapExtent,le as snapPyramid};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{isMultiOriginJSONMixin as n}from"../../core/multiOriginJSONSupportUtils.js";import{
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{isMultiOriginJSONMixin as n}from"../../core/multiOriginJSONSupportUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import{subclass as i}from"../../core/accessorSupport/decorators/subclass.js";import{hasSameTimeFields as a}from"./timeInfoUtils.js";import{timeExtentToSQL as o,timeExtentToQueryParameter as s}from"../../rest/support/timeUtils.js";let c=class extends t{constructor(e){super(e),this.fieldsIndex=null,this.layer=null}getExpression(e){let{layer:t}=this;if(!t)return;let r=t.timeInfo;if(!n(t))return{type:`where`,value:o(e,r,this.fieldsIndex)};let i=t.getAtOrigin(`timeInfo`,`service`);if(i)return r?r===i||a(r,i)?{type:`time`,value:s(e)}:{type:`where`,value:o(e,r,this.fieldsIndex)}:void 0;if(r)return{type:`where`,value:o(e,r,this.fieldsIndex)}}};e([r({constructOnly:!0})],c.prototype,`fieldsIndex`,void 0),e([r({constructOnly:!0})],c.prototype,`layer`,void 0),c=e([i(`esri.layers.support.TimeInformation`)],c);export{c as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.
|
|
3
|
+
"version": "5.2.2",
|
|
4
4
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@amcharts/amcharts5": "~5.20.8",
|
|
23
|
-
"@arcgis/toolkit": "5.2.
|
|
24
|
-
"@esri/arcgis-html-sanitizer": "~4.2.0
|
|
25
|
-
"@esri/calcite-components": "^5.2.
|
|
23
|
+
"@arcgis/toolkit": "5.2.2",
|
|
24
|
+
"@esri/arcgis-html-sanitizer": "~4.2.0",
|
|
25
|
+
"@esri/calcite-components": "^5.2.1",
|
|
26
26
|
"@vaadin/grid": "~25.3.2",
|
|
27
27
|
"@zip.js/zip.js": "~2.23.0",
|
|
28
28
|
"luxon": "~3.7.2",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{parseUrl as e}from"../utils.js";import{executeAttributeBinsQuery as t}from"./operations/queryAttributeBins.js";import n from"../support/AttributeBinsFeatureSet.js";import r from"../support/AttributeBinsQuery.js";async function i(i,a,o){let{data:
|
|
2
|
+
import{parseUrl as e}from"../utils.js";import{executeAttributeBinsQuery as t}from"./operations/queryAttributeBins.js";import n from"../support/AttributeBinsFeatureSet.js";import r from"../support/AttributeBinsQuery.js";async function i(i,a,o,s){let{data:c}=await t(e(i),r.from(a),o,s);return n.fromJSON(c)}export{i as executeAttributeBinsQuery};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../geometry/Extent.js";import{parseUrl as t}from"../utils.js";import{executeQueryForExtent as n}from"./operations/query.js";import r from"../support/Query.js";async function i(i,a,o){let
|
|
2
|
+
import e from"../../geometry/Extent.js";import{parseUrl as t}from"../utils.js";import{executeQueryForExtent as n}from"./operations/query.js";import r from"../support/Query.js";async function i(i,a,o,s){let c=t(i),l=await n(c,r.from(a),{...o},s),u=l.extent;return!u||isNaN(u.xmin)||isNaN(u.ymin)||isNaN(u.xmax)||isNaN(u.ymax)?{count:l.count,extent:null}:{count:l.count,extent:e.fromJSON(u)}}export{i as executeForExtent};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{parseUrl as e}from"../utils.js";import{executeQueryForTopCount as t}from"./operations/queryTopFeatures.js";import n from"../support/TopFeaturesQuery.js";async function r(r,i,a){let
|
|
2
|
+
import{parseUrl as e}from"../utils.js";import{executeQueryForTopCount as t}from"./operations/queryTopFeatures.js";import n from"../support/TopFeaturesQuery.js";async function r(r,i,a,o){let s=e(r);return(await t(s,n.from(i),{...a},o)).data.count}export{r as executeForTopCount};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../geometry/Extent.js";import{parseUrl as t}from"../utils.js";import{executeQueryForTopExtents as n}from"./operations/queryTopFeatures.js";import r from"../support/TopFeaturesQuery.js";async function i(i,a,o){let
|
|
2
|
+
import e from"../../geometry/Extent.js";import{parseUrl as t}from"../utils.js";import{executeQueryForTopExtents as n}from"./operations/queryTopFeatures.js";import r from"../support/TopFeaturesQuery.js";async function i(i,a,o,s){let c=t(i),l=await n(c,r.from(a),{...o},s),u=l.data.extent;return!u||isNaN(u.xmin)||isNaN(u.ymin)||isNaN(u.xmax)||isNaN(u.ymax)?{count:l.data.count,extent:null}:{count:l.data.count,extent:e.fromJSON(u)}}export{i as executeForTopExtents};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{parseUrl as e}from"../utils.js";import{executeQueryForTopIds as t}from"./operations/queryTopFeatures.js";import n from"../support/TopFeaturesQuery.js";async function r(r,i,a){let
|
|
2
|
+
import{parseUrl as e}from"../utils.js";import{executeQueryForTopIds as t}from"./operations/queryTopFeatures.js";import n from"../support/TopFeaturesQuery.js";async function r(r,i,a,o){let s=e(r);return(await t(s,n.from(i),{...a},o)).data.objectIds}export{r as executeForTopIds};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{parseUrl as e}from"../utils.js";import{executeTopFeaturesQuery as t}from"./operations/queryTopFeatures.js";import n from"../support/FeatureSet.js";import r from"../support/TopFeaturesQuery.js";async function i(i,a,o,s){let
|
|
2
|
+
import{parseUrl as e}from"../utils.js";import{executeTopFeaturesQuery as t}from"./operations/queryTopFeatures.js";import n from"../support/FeatureSet.js";import r from"../support/TopFeaturesQuery.js";async function i(i,a,o,s,c){let l=e(i),u={...s},{data:d}=await t(l,r.from(a),o,u,c);return n.fromJSON(d)}export{i as executeTopFeaturesQuery};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../request.js";import{urlToObject as t,join as n}from"../../../core/urlUtils.js";import{normalizeCentralMeridian as r}from"../../../geometry/support/normalizeUtils.js";import{mapParameters as i}from"../../operations/urlUtils.js";import{parsePBFFeatureQuery as a}from"./pbfQueryUtils.js";import{safeExtentResultFormat as o,queryLikeToQueryStringParameters as s}from"./queryUtils.js";import{applyFeatureSetZUnitScaling as c}from"./queryZScale.js";function l(e,t,n){return s(e,t,n)}async function u(e,t,n,r,i){let a=t.timeExtent?.isEmpty?{features:[]}:await _(e,t,`json`,r,void 0,i);return a.features??=[],c(t,n,a),a}async function d(e,t,n,r,i){if(t.timeExtent?.isEmpty)return n.featureSet;let o=await f(e,t,r,i);return a(o,n)}function f(e,t,n,r){return _(e,t,`pbf`,n,void 0,r)}function p(e,t,n,r){return t.timeExtent?.isEmpty?Promise.resolve({objectIds:[]}):_(e,t,`json`,n,{returnIdsOnly:!0},r)}async function m(e,t,n,r){return t.timeExtent?.isEmpty?0:(await _(e,t,`json`,n,{returnCountOnly:!0},r)).count}async function h(e,t,n){if(t.timeExtent?.isEmpty)return{count:0,extent:null};let
|
|
2
|
+
import e from"../../../request.js";import{urlToObject as t,join as n}from"../../../core/urlUtils.js";import{normalizeCentralMeridian as r}from"../../../geometry/support/normalizeUtils.js";import{mapParameters as i}from"../../operations/urlUtils.js";import{parsePBFFeatureQuery as a}from"./pbfQueryUtils.js";import{safeExtentResultFormat as o,queryLikeToQueryStringParameters as s}from"./queryUtils.js";import{applyFeatureSetZUnitScaling as c}from"./queryZScale.js";function l(e,t,n){return s(e,t,n)}async function u(e,t,n,r,i){let a=t.timeExtent?.isEmpty?{features:[]}:await _(e,t,`json`,r,void 0,i);return a.features??=[],c(t,n,a),a}async function d(e,t,n,r,i){if(t.timeExtent?.isEmpty)return n.featureSet;let o=await f(e,t,r,i);return a(o,n)}function f(e,t,n,r){return _(e,t,`pbf`,n,void 0,r)}function p(e,t,n,r){return t.timeExtent?.isEmpty?Promise.resolve({objectIds:[]}):_(e,t,`json`,n,{returnIdsOnly:!0},r)}async function m(e,t,n,r){return t.timeExtent?.isEmpty?0:(await _(e,t,`json`,n,{returnCountOnly:!0},r)).count}async function h(e,t,n,r){if(t.timeExtent?.isEmpty)return{count:0,extent:null};let i=await _(e,t,o,n,{returnExtentOnly:!0,returnCountOnly:!0},r);if(i.hasOwnProperty(`extent`))return i;let a=typeof e==`string`?e:e.path;if(/\/imageserver\/?$/i.test(a)&&i.hasOwnProperty(`count`)){let a=await _(e,t,o,n,{returnExtentOnly:!0},r);return{count:i.count,extent:a.extent}}if(i.features||i.hasOwnProperty(`count`))throw Error(`Layer does not support extent calculation.`);return i}function g(e,t){if(!e.returnIdsOnly||!t.uniqueIdFields)return e;let n={...e,returnUniqueIdsOnly:!0};return delete n.returnIdsOnly,n}async function _(t,n,r,i={},a={},o={}){let s=await v(t,n,r,i,a,o),c=r===`json`?`json`:`array-buffer`;return e(s.url,{responseType:c,...s.options}).then(({data:e})=>e)}async function v(e,a,o,s,c={},u={}){let d=typeof e==`string`?t(e):e,[f]=await r([a.geometry],s);if(f!=null){let e=a.clone();e.geometry=f.clone(),a=e}let p=i({...d.query,f:o,...g(c,u),...l(a,c,u)});return s={...s,query:{...p,...s.query}},new y(n(d.path,b(a,c)?`query3d`:`query`),s)}class y{constructor(e,t){this.url=e,this.options=t}}function b(e,t){return e.formatOf3DObjects!=null&&!(t.returnCountOnly||t.returnExtentOnly||t.returnIdsOnly)}export{y as RunQueryParameters,u as executeQuery,m as executeQueryForCount,h as executeQueryForExtent,p as executeQueryForIds,d as executeQueryPBF,f as executeQueryPBFBuffer,v as getQueryParameters,l as queryToQueryStringParameters,_ as runQuery};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../request.js";import{urlToObject as
|
|
2
|
+
import e from"../../../request.js";import{sqlAnd as t}from"../../../core/sql.js";import{urlToObject as n,join as r}from"../../../core/urlUtils.js";import{getJsonType as i}from"../../../geometry/support/jsonTypeUtils.js";import{normalizeCentralMeridian as a}from"../../../geometry/support/normalizeUtils.js";import{srToRESTValue as o,equals as s}from"../../../geometry/support/spatialReferenceUtils.js";import{mapParameters as c}from"../../operations/urlUtils.js";import{timeExtentToQueryParameter as l}from"../../support/timeUtils.js";function u(e,n){let r=e.geometry,a=e.toJSON(),c=a,u,d,f;if(r!=null&&(d=r.spatialReference,f=o(d),c.geometryType=i(r),c.geometry=JSON.stringify(r),c.inSR=f),a.outSR?(c.outSR=o(a.outSR),u=e.outSpatialReference):r&&(c.outSR=c.inSR,u=d),c.bin&&=JSON.stringify(c.bin),c.quantizationParameters&&=JSON.stringify(c.quantizationParameters),c.outStatistics&&=JSON.stringify(c.outStatistics),c.outTimeReference&&=JSON.stringify(c.outTimeReference),e.timeExtent){let r=n?.timeInformation;if(r){let n=r.getExpression(e.timeExtent);switch(n?.type){case`time`:c.time=n.value;break;case`where`:n.value&&(c.where=t(c.where,n.value))}}else c.time=l(e.timeExtent);delete a.timeExtent}return e.defaultSpatialReference&&s(d,u)&&(c.defaultSR=c.inSR,delete c.inSR,delete c.outSR),c}async function d(e,t,n,r){return t.timeExtent!=null&&t.timeExtent.isEmpty?{data:{features:[]}}:await f(e,t,n,r)}async function f(t,i,o={},s={}){let l=typeof t==`string`?n(t):t,[d]=await a([i.geometry],o);d!=null&&(i=i.clone(),i.geometry=d);let f=c({...l.query,f:`json`,...u(i,s)});return e(r(l.path,`queryBins`),{...o,query:{...f,...o.query}})}export{d as executeAttributeBinsQuery,u as queryToQueryStringParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../../request.js";import{urlToObject as
|
|
2
|
+
import e from"../../../request.js";import{sqlAnd as t}from"../../../core/sql.js";import{urlToObject as n,join as r}from"../../../core/urlUtils.js";import{getJsonType as i}from"../../../geometry/support/jsonTypeUtils.js";import{normalizeCentralMeridian as a}from"../../../geometry/support/normalizeUtils.js";import{srToRESTValue as o}from"../../../geometry/support/spatialReferenceUtils.js";import{mapParameters as s}from"../../operations/urlUtils.js";import{safeExtentResultFormat as c}from"./queryUtils.js";import{applyFeatureSetZUnitScaling as l}from"./queryZScale.js";import{timeExtentToQueryParameter as u}from"../../support/timeUtils.js";function d(e,n,r){let a=e.geometry,s=e.toJSON(),c=s;if(a!=null&&(c.geometry=JSON.stringify(a),c.geometryType=i(a),c.inSR=o(a.spatialReference)),s.topFilter?.groupByFields&&(c.topFilter.groupByFields=s.topFilter.groupByFields.join(`,`)),s.topFilter?.orderByFields&&(c.topFilter.orderByFields=s.topFilter.orderByFields.join(`,`)),s.topFilter&&(c.topFilter=JSON.stringify(c.topFilter)),s.objectIds)switch(r?.uniqueIdFields?.length){case void 0:c.objectIds=s.objectIds.join(`,`);break;case 1:c.uniqueIds=JSON.stringify(s.objectIds),delete c.objectIds;break;default:c.uniqueIds=JSON.stringify(s.objectIds.map(e=>JSON.parse(e))),delete c.objectIds}if(s.orderByFields&&(c.orderByFields=s.orderByFields.join(`,`)),s.outFields&&!(n?.returnCountOnly||n?.returnExtentOnly||n?.returnIdsOnly)?c.outFields=s.outFields.includes(`*`)?`*`:s.outFields.join(`,`):delete c.outFields,s.outSR?c.outSR=o(s.outSR):a&&s.returnGeometry&&(c.outSR=c.inSR),s.returnGeometry&&delete s.returnGeometry,e.timeExtent){let n=r?.timeInformation;if(n){let r=n.getExpression(e.timeExtent);switch(r?.type){case`time`:c.time=r.value;break;case`where`:r.value&&(c.where=t(c.where,r.value))}}else c.time=u(e.timeExtent);delete s.timeExtent}return c}async function f(e,t,n,r,i){let a=await _(e,t,`json`,r,void 0,i);return l(t,n,a.data),a}async function p(e,t,n,r){return t.timeExtent!=null&&t.timeExtent.isEmpty?{data:{objectIds:[]}}:_(e,t,`json`,n,{returnIdsOnly:!0},r)}async function m(e,t,n,r){return t.timeExtent!=null&&t.timeExtent.isEmpty?{data:{count:0,extent:null}}:_(e,t,c,n,{returnExtentOnly:!0,returnCountOnly:!0},r).then(e=>{let t=e.data;if(t.hasOwnProperty(`extent`))return e;if(t.features||t.hasOwnProperty(`count`))throw Error(`Layer does not support extent calculation.`);return e})}function h(e,t,n,r){return t.timeExtent!=null&&t.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):_(e,t,`json`,n,{returnIdsOnly:!0,returnCountOnly:!0},r)}function g(e,t){if(!e.returnIdsOnly||!t.uniqueIdFields)return e;let n={...e,returnUniqueIdsOnly:!0};return delete n.returnIdsOnly,n}async function _(t,i,o,c={},l={},u={}){let f=typeof t==`string`?n(t):t,p=i.geometry?[i.geometry]:[];c.responseType=`json`;let[m]=await a(p,c);m!=null&&(i=i.clone(),i.geometry=m);let h=s({...f.query,f:o,...g(l,u),...d(i,l,u)});return e(r(f.path,`queryTopFeatures`),{...c,query:{...h,...c.query}})}export{h as executeQueryForTopCount,m as executeQueryForTopExtents,p as executeQueryForTopIds,f as executeTopFeaturesQuery,d as queryToQueryStringParameters};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function e(e){let{start:t,end:n}=e;if(t||n){if(!t&&n)return`null,${n.getTime()}`;if(!n&&t)return`${t.getTime()},null`;if(n&&t)return t.getTime()===n.getTime()?`${t.getTime()}`:`${t.getTime()},${n.getTime()}`}}export{
|
|
2
|
+
import{sqlAnd as e,sqlName as t,sqlLiteral as n}from"../../core/sql.js";const r={equals:`=`,greaterThanOrEqual:`>=`,lessThanOrEqual:`<=`};function i(e,r,i,a){let o=a.get(e)?.type,s=a.getTimeZone(e);return`${t(e)} ${r} ${n(i,{type:`date`},{type:o,timeZone:s})}`}function a(t,n,a,o){if(!n||!a)return;let{startField:s,endField:c}=n,{start:l,end:u}=t;if(!l&&!u||!s&&!c)return;let d=s??c,f=c??s;if(d&&f){if(l&&u){if(l.getTime()===u.getTime())return e(o,i(d,r.equals,l,a));if(!s||!c){let t=i(d,r.greaterThanOrEqual,l,a),n=i(d,r.lessThanOrEqual,u,a);return e(o,e(t,n))}let t=i(s,r.greaterThanOrEqual,l,a),n=i(c,r.lessThanOrEqual,u,a);return e(o,e(t,n))}if(l)return e(o,i(d,r.greaterThanOrEqual,l,a));if(u)return e(o,i(f,r.lessThanOrEqual,u,a))}}function o(e){let{start:t,end:n}=e;if(t||n){if(!t&&n)return`null,${n.getTime()}`;if(!n&&t)return`${t.getTime()},null`;if(n&&t)return t.getTime()===n.getTime()?`${t.getTime()}`:`${t.getTime()},${n.getTime()}`}}export{i as constructSQLExpression,o as timeExtentToQueryParameter,a as timeExtentToSQL};
|
package/symbols/TextSymbol.d.ts
CHANGED
|
@@ -218,7 +218,6 @@ export interface TextSymbolProperties extends SymbolProperties, Partial<Pick<Tex
|
|
|
218
218
|
* @since 4.0
|
|
219
219
|
* @see [Symbol Builder](https://developers.arcgis.com/javascript/latest/symbol-builder/)
|
|
220
220
|
* @see [Sample: Add labels to a FeatureLayer](https://developers.arcgis.com/javascript/latest/sample-code/labels-basic/)
|
|
221
|
-
* @see [Using icon fonts with map graphics](https://developers.arcgis.com/javascript/latest/sample-code/styling-icon-fonts/)
|
|
222
221
|
* @see [TextSymbol3DLayer](https://developers.arcgis.com/javascript/latest/references/core/symbols/TextSymbol3DLayer/)
|
|
223
222
|
* @see [Labeling Guide](https://developers.arcgis.com/javascript/latest/labeling/)
|
|
224
223
|
* @example
|