@arcgis/core 5.0.0-next.84 → 5.0.0-next.85

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.
Files changed (100) hide show
  1. package/applications/Components/applySetUtils.d.ts +237 -0
  2. package/applications/Components/applySetUtils.js +5 -0
  3. package/applications/Components/editUtils.d.ts +92 -0
  4. package/applications/Components/editUtils.js +5 -0
  5. package/applications/Components/symbolUtils.d.ts +37 -0
  6. package/applications/Components/symbolUtils.js +5 -0
  7. package/applications/Components/templateUtils.d.ts +106 -0
  8. package/applications/Components/templateUtils.js +5 -0
  9. package/assets/esri/core/workers/RemoteClient.js +1 -1
  10. package/assets/esri/core/workers/chunks/001fd3d30e5bb0d180c6.js +1 -0
  11. package/assets/esri/core/workers/chunks/008a555ce169640e2a35.js.LICENSE.txt +1 -1
  12. package/assets/esri/core/workers/chunks/0402b7996940ba0f8cc8.js +2 -0
  13. package/assets/esri/core/workers/chunks/{534ed6574e4a1613ba05.js.LICENSE.txt → 0402b7996940ba0f8cc8.js.LICENSE.txt} +1 -1
  14. package/assets/esri/core/workers/chunks/{5b0ca8d2154ef59da600.js → 055aead7135a2f8bca29.js} +1 -1
  15. package/assets/esri/core/workers/chunks/0889e3d1a034be031c9e.js +2 -0
  16. package/assets/esri/core/workers/chunks/{e3d3fc87789fd711f161.js.LICENSE.txt → 0889e3d1a034be031c9e.js.LICENSE.txt} +1 -1
  17. package/assets/esri/core/workers/chunks/21739c37160061f229ef.js +1 -0
  18. package/assets/esri/core/workers/chunks/{76d6843d56bff0d4c45e.js → 301fa6276f4098521106.js} +1 -1
  19. package/assets/esri/core/workers/chunks/4c07b2d1a14906371fc5.js +2 -0
  20. package/assets/esri/core/workers/chunks/{21ac84b5c7dedcfd747d.js.LICENSE.txt → 4c07b2d1a14906371fc5.js.LICENSE.txt} +1 -1
  21. package/assets/esri/core/workers/chunks/{e881629bf230a148963d.js → 52ae2073604deef63ea2.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{3909217130048b5feeae.js → 5543de9a0435c319f4f9.js} +1 -1
  23. package/assets/esri/core/workers/chunks/5eee48b02e1683f022df.js +2 -0
  24. package/assets/esri/core/workers/chunks/{ef519984fa691aad8d87.js.LICENSE.txt → 5eee48b02e1683f022df.js.LICENSE.txt} +1 -1
  25. package/assets/esri/core/workers/chunks/{911912b0ef7ffed875be.js → 7a1ec6ac88d974cc5074.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{5e3dd05f1ecfdb21350e.js → 7f7c4ffbdf7b20dc7a54.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{dc57400b835724204909.js → 8b1fa59d436e2815b2f1.js} +2 -2
  28. package/assets/esri/core/workers/chunks/{dc57400b835724204909.js.LICENSE.txt → 8b1fa59d436e2815b2f1.js.LICENSE.txt} +1 -1
  29. package/assets/esri/core/workers/chunks/9264cce4699284eae97c.js +2 -0
  30. package/assets/esri/core/workers/chunks/{5aee84e827e6fcc9c4c4.js.LICENSE.txt → 9264cce4699284eae97c.js.LICENSE.txt} +1 -1
  31. package/assets/esri/core/workers/chunks/95e93884b39ca4b312d1.js +2 -0
  32. package/assets/esri/core/workers/chunks/{90a53bfe95ed687c28c1.js.LICENSE.txt → 95e93884b39ca4b312d1.js.LICENSE.txt} +1 -1
  33. package/assets/esri/core/workers/chunks/{2a1898c5b8d7757e39e3.js → a09099697955eb44bfac.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{6610d23d8539f06e64ca.js → adecd31fd64d6753682d.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{df40be5a050b8d20617a.js → b190a776de4859ac00f8.js} +1 -1
  36. package/assets/esri/core/workers/chunks/c18a2948ae3cb527d8bb.js +1 -0
  37. package/assets/esri/core/workers/chunks/{d8c8f54532714d4db2cd.js → c791e8ebf3ee0805c479.js} +1 -1
  38. package/assets/esri/core/workers/chunks/f5ed6953a9255f0bed6a.js.LICENSE.txt +1 -1
  39. package/assets/esri/themes/dark/main.css +1 -1
  40. package/assets/esri/themes/light/main.css +1 -1
  41. package/assets/esri/themes/light/view.css +1 -1
  42. package/chunks/HUDMaterial.glsl.js +1 -1
  43. package/config.js +1 -1
  44. package/copyright.txt +2 -2
  45. package/editing/sharedTemplates/templateLoader.js +5 -0
  46. package/editing/templateUtils.js +1 -1
  47. package/interfaces.d.ts +6 -0
  48. package/kernel.js +1 -1
  49. package/layers/mixins/ImageryTileMixin.js +1 -1
  50. package/layers/raster/datasets/FunctionRaster.js +1 -1
  51. package/layers/raster/functions/BaseRasterFunction.js +1 -1
  52. package/layers/raster/functions/StretchFunction.js +1 -1
  53. package/layers/support/RasterJobHandler.js +1 -1
  54. package/layers/support/RasterWorker.js +1 -1
  55. package/networks/CircuitManager.d.ts +1 -1
  56. package/networks/support/jsonTypes.d.ts +65 -0
  57. package/package.json +1 -1
  58. package/rest/featureService/types.d.ts +42 -5
  59. package/rest/networks/circuits/exportCircuits.js +1 -1
  60. package/rest/networks/circuits/support/ExportCircuitsParameters.d.ts +10 -2
  61. package/rest/networks/circuits/support/ExportCircuitsParameters.js +1 -1
  62. package/rest/support/Query.d.ts +12 -1
  63. package/support/revision.js +1 -1
  64. package/symbols/support/symbolUtils.js +1 -1
  65. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  66. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  67. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  68. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementShiftTool.js +1 -1
  69. package/views/3d/camera/intersectionUtils.js +1 -1
  70. package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
  71. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  72. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  73. package/views/interactive/snapping/SelfSnappingEngine.js +1 -1
  74. package/views/interactive/snapping/SnappingContext.js +1 -1
  75. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +18 -0
  76. package/widgets/BatchAttributeForm.d.ts +2 -0
  77. package/widgets/BatchAttributeForm.js +1 -1
  78. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  79. package/widgets/Editor/workflowUtils.js +1 -1
  80. package/widgets/Feature/support/featureUtils.js +1 -1
  81. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +43 -4
  82. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  83. package/widgets/FeatureTable/Grid/types.d.ts +7 -1
  84. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  85. package/widgets/FeatureTable.d.ts +43 -4
  86. package/widgets/FeatureTable.js +1 -1
  87. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  88. package/widgets/Search/SearchViewModel.d.ts +5 -0
  89. package/widgets/Search/SearchViewModel.js +1 -1
  90. package/widgets/Search/support/layerSearchUtils.js +1 -1
  91. package/widgets/Search.js +1 -1
  92. package/assets/esri/core/workers/chunks/21ac84b5c7dedcfd747d.js +0 -2
  93. package/assets/esri/core/workers/chunks/22503abc06354741d28a.js +0 -1
  94. package/assets/esri/core/workers/chunks/534ed6574e4a1613ba05.js +0 -2
  95. package/assets/esri/core/workers/chunks/5aee84e827e6fcc9c4c4.js +0 -2
  96. package/assets/esri/core/workers/chunks/7b2f848947b296c7c785.js +0 -1
  97. package/assets/esri/core/workers/chunks/90a53bfe95ed687c28c1.js +0 -2
  98. package/assets/esri/core/workers/chunks/c16115cfbca879dd6717.js +0 -1
  99. package/assets/esri/core/workers/chunks/e3d3fc87789fd711f161.js +0 -2
  100. package/assets/esri/core/workers/chunks/ef519984fa691aad8d87.js +0 -2
@@ -69,7 +69,7 @@ posProj = alignToPixelOrigin(posProj, viewport.zw);
69
69
 
70
70
  vtc = uv;
71
71
 
72
- ${P(H,S`debugBorderCoords = vec4(uv01, 1.5 / combinedSize);`)}
72
+ ${P(H,S`debugBorderCoords = vec4(uv0, 1.5 / combinedSize);`)}
73
73
  vsize = inputSize;
74
74
  `),K.uniforms.add(new y("tex",e=>e.texture)),I&&!N&&K.uniforms.add(new j("depthMap",e=>e.mainDepth),new C("occludedOpacity",e=>e.hudOccludedFragmentOpacity));const Y=H?S`(isBorder > 0.0 ? 0.0 : ${S.float($)})`:S.float($),Z=S`
75
75
  ${P(H,S`float isBorder = float(any(lessThan(debugBorderCoords.xy, debugBorderCoords.zw)) || any(greaterThan(debugBorderCoords.xy, 1.0 - debugBorderCoords.zw)));`)}
package/config.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.84";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
5
+ import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="5.0.0-next.85";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
package/copyright.txt CHANGED
@@ -656,9 +656,9 @@ DEALINGS IN THE SOFTWARE.
656
656
 
657
657
  -------------------------------------------------------------------------------
658
658
 
659
- woff2-rs/
659
+ woff2-patched/
660
660
 
661
- https://github.com/Cimpress-MCP/woff2-rs
661
+ https://github.com/zimond/woff2-rs
662
662
 
663
663
  Copyright 2022 Cimpress
664
664
 
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import e from"../../core/Error.js";import{isSharedTemplate as t,isSharedTemplateOrMetadata as r}from"../templateUtils.js";import{getSharedTemplateProvider as a}from"./SharedTemplateProvider.js";async function o(o,l){if(null==l)return null;if(t(l))return l.load();if(r(l)){const t=(await import("./SharedTemplate.js")).default,r=a(o,{makeSharedTemplateFromJSON:e=>t.fromJSON(e)}),m=await r.getTemplates({templateIds:[l.templateId],featureService:l.featureService});if(0===m.length)throw new e("editor:failed-to-load-template","Unable to load the provided template");return m[0].load()}return l}export{o as getFullTemplate};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../core/Logger.js";import{getOrCreateMapValue as t}from"../core/MapUtils.js";import{throwIfAborted as r}from"../core/promiseUtils.js";import{addMaybe as n}from"../core/SetUtils.js";import{isGroupTemplateDefinition as i,isPresetTemplateDefinition as o,isFeatureTemplateDefinition as s}from"./sharedTemplates/templateDefinitions/templateDefinitionUtils.js";import{isSubtypeGroupLayer as a,isSubtypeSublayer as l,isFeatureLayer as p}from"../layers/support/layerUtils.js";import{querySharedTemplates as u}from"../rest/sharedTemplates/querySharedTemplates.js";import{getServices as f}from"../undoredo/support/Services.js";const c=()=>e.getLogger("esri.editing.templateUtils");function y(e){return null!=e&&"prototype"in e}function m(e){return g(e)&&!("definition"in e)}function d(e){return g(e)&&"definition"in e}function g(e){return null!=e&&"templateId"in e}function w(e){return d(e)&&"feature"===e?.type&&(null==e.definition||s(e.definition))}function A(e){return d(e)&&"group"===e?.type&&(null==e.definition||i(e.definition))}function h(e){return d(e)&&"preset"===e?.type&&(null==e.definition||o(e.definition))}function j(e){return d(e)&&null!=e?.definition}const v=e=>{if(null==e||"object"!=typeof e)return[];return[..."templates"in e&&Array.isArray(e.templates)?e.templates:[],..."types"in e&&Array.isArray(e.types)?e.types.flatMap(e=>e.templates):[]]};async function S({layers:e,view:t,signal:n,queryOptions:i}){if(null==t)return e.map(e=>({layer:e,templates:v(e)}));const o=await M(e,t);r(n);const s=new Map,a=Array.from(o).map(async e=>(await e.load(),await b({serviceInfo:e,out:s,signal:n,queryOptions:i}))),l=await Promise.allSettled(a);for(const r of l.filter(e=>"rejected"===e.status))c().warn("Failed to fetch shared templates for service. Will use standard templates if available.",r.reason);return e.map(e=>({layer:e,templates:s.get(e)??v(e)}))}async function b({serviceInfo:e,out:t,signal:n,queryOptions:i}){const{featureService:o,layersAndTables:s}=e,l=await q({featureService:o,layers:s.toArray(),signal:n,queryOptions:i});r(n);for(const[r,p]of l.entries())if(0!==p.length)if(a(r)){const e=O(p),n=[],i=e.get(1/0)??n;for(const o of r.sublayers){const r=e.get(o.subtypeCode)??n;t.set(o,[...r,...i])}}else t.set(r,p)}async function q({featureService:e,layers:r,signal:n,queryOptions:i}){if(!e.capabilities?.editing.supportsSharedTemplates)return new Map;const o=new Map(r.map(e=>[e.layerId,e])),s=await u({featureService:e,query:{layers:Array.from(o.keys()),...i},requestOptions:{signal:n}}),a=new Map;for(const l of s)for(const e of l.layerIds)o.has(e)&&t(a,o.get(e),()=>[]).push(l);return a}async function M(e,t){const r=f(t),i=new Set;for(const o of e)n(i,L(r,o));return await Promise.all(Array.from(i).map(e=>e.load())),i}function L(e,t){return l(t)&&t.parent?e.tablesAndLayersLookup.get(t.parent):p(t)?e.tablesAndLayersLookup.get(t):null}function O(e){const r=new Map;for(const n of e)t(r,n.subtypeCode??1/0,()=>[]).push(n);return r}export{v as getAllStandardFeatureTemplatesForLayer,L as getServiceInfoForLayer,S as getTemplatesForLayers,j as isLoadedSharedTemplate,w as isSharedFeatureTemplate,A as isSharedGroupTemplate,h as isSharedPresetTemplate,d as isSharedTemplate,m as isSharedTemplateMetadata,g as isSharedTemplateOrMetadata,y as isStandardFeatureTemplate};
5
+ import e from"../core/Logger.js";import{getOrCreateMapValue as t}from"../core/MapUtils.js";import{throwIfAborted as r}from"../core/promiseUtils.js";import{addMaybe as n}from"../core/SetUtils.js";import{isGroupTemplateDefinition as i,isPresetTemplateDefinition as o,isFeatureTemplateDefinition as s}from"./sharedTemplates/templateDefinitions/templateDefinitionUtils.js";import{isSubtypeGroupLayer as a,isSubtypeSublayer as l,isFeatureLayer as u}from"../layers/support/layerUtils.js";import{querySharedTemplates as p}from"../rest/sharedTemplates/querySharedTemplates.js";import{getServices as f}from"../undoredo/support/Services.js";const c=()=>e.getLogger("esri.editing.templateUtils");function y(e){return null!=e&&"prototype"in e}function m(e){return g(e)&&!("definition"in e)}function d(e){return g(e)&&"definition"in e}function g(e){return null!=e&&"templateId"in e}function w(e){return d(e)&&"feature"===e?.type&&(null==e.definition||s(e.definition))}function A(e){return d(e)&&"group"===e?.type&&(null==e.definition||i(e.definition))}function b(e){return d(e)&&"preset"===e?.type&&(null==e.definition||o(e.definition))}function h(e){return d(e)&&null!=e?.definition}const j=e=>{if(null==e||"object"!=typeof e)return[];return[..."templates"in e&&Array.isArray(e.templates)?e.templates:[],..."types"in e&&Array.isArray(e.types)?e.types.flatMap(e=>e.templates):[]]};async function v({layers:e,view:t,signal:n,queryOptions:i}){if(null==t)return e.map(e=>({layer:e,templates:j(e)}));const o=await M(e,t);r(n);const s=new Map,a=Array.from(o).map(async e=>(await e.load(),await S({serviceInfo:e,out:s,signal:n,queryOptions:i}))),l=await Promise.allSettled(a);for(const r of l.filter(e=>"rejected"===e.status))c().warn("Failed to fetch shared templates for service. Will use standard templates if available.",r.reason);return e.map(e=>({layer:e,templates:s.get(e)??j(e)}))}async function S({serviceInfo:e,out:t,signal:n,queryOptions:i}){const{featureService:o,layersAndTables:s}=e,l=await q({featureService:o,layers:s.toArray(),signal:n,queryOptions:i});r(n);for(const[r,u]of l.entries())if(0!==u.length)if(a(r)){const e=O(u),n=[],i=e.get(1/0)??n;for(const o of r.sublayers){const r=e.get(o.subtypeCode)??n;t.set(o,[...r,...i])}}else t.set(r,u)}async function q({featureService:e,layers:r,signal:n,queryOptions:i}){if(!e.capabilities?.editing.supportsSharedTemplates)return new Map;const o=new Map(r.map(e=>[e.layerId,e])),s=await p({featureService:e,query:{layers:Array.from(o.keys()),...i},requestOptions:{signal:n}}),a=new Map;for(const l of s)for(const e of l.layerIds)o.has(e)&&t(a,o.get(e),()=>[]).push(l);return a}async function M(e,t){const r=f(t),i=new Set;for(const o of e)n(i,L(r,o));return await Promise.all(Array.from(i).map(e=>e.load())),i}function L(e,t){return l(t)&&t.parent?e.tablesAndLayersLookup.get(t.parent):u(t)?e.tablesAndLayersLookup.get(t):null}function O(e){const r=new Map;for(const n of e)t(r,n.subtypeCode??1/0,()=>[]).push(n);return r}function U(e,t={}){return A(e)||b(e)?{}:y(e)?{...e.prototype.attributes,...t}:w(e)?{...e.definition?.defaultValues,...t}:{...t}}export{j as getAllStandardFeatureTemplatesForLayer,U as getCreationAttributes,L as getServiceInfoForLayer,v as getTemplatesForLayers,h as isLoadedSharedTemplate,w as isSharedFeatureTemplate,A as isSharedGroupTemplate,b as isSharedPresetTemplate,d as isSharedTemplate,m as isSharedTemplateMetadata,g as isSharedTemplateOrMetadata,y as isStandardFeatureTemplate};
package/interfaces.d.ts CHANGED
@@ -5463,6 +5463,12 @@ declare namespace __esri {
5463
5463
 
5464
5464
  export type DeleteAssociationEdit = import("./rest/featureService/types.js").DeleteAssociationEdit;
5465
5465
 
5466
+ export type DeleteAssociationEditAllFields = import("./rest/featureService/types.js").DeleteAssociationEditAllFields;
5467
+
5468
+ export type DeleteAssociationEditOnlyGlobalId = import("./rest/featureService/types.js").DeleteAssociationEditOnlyGlobalId;
5469
+
5470
+ export type DeleteAssociationEditOmitGlobalId = import("./rest/featureService/types.js").DeleteAssociationEditOmitGlobalId;
5471
+
5466
5472
  export type CombineGroupedObjectsEdit = import("./rest/featureService/types.js").CombineGroupedObjectsEdit;
5467
5473
 
5468
5474
  export type DivideGroupedObjectsEdit = import("./rest/featureService/types.js").DivideGroupedObjectsEdit;
package/kernel.js CHANGED
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.84",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
5
+ import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="5.0";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="5.0.0-next.85",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../request.js";import i from"../../core/Error.js";import r from"../../core/Logger.js";import{property as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{Integer as o,ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import m from"../../geometry/SpatialReference.js";import{getInfo as u}from"../../geometry/support/spatialReferenceUtils.js";import{isFunctionRaster as c}from"../raster/datasets/datasetUtils.js";import d from"../raster/datasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as p,getDefaultVariableInfo as h,isMultiSliceOrRangeDefinition as f,convertOleDateTimeToEpoch as y,getSubsetVariablesFromMdInfo as g,getDefaultMultidimensionalDefinition as b}from"../raster/datasets/multidimensionalUtils.js";import{snapToRaster as R,clip as I}from"../raster/functions/clipUtils.js";import{create as x}from"../raster/functions/rasterFunctionHelper.js";import{load as w,projectExtent as S,projectPolygon as v}from"../raster/functions/rasterProjectionHelper.js";import{computeStatisticsHistograms as F}from"../raster/functions/stretchUtils.js";import{sanitizeUrl as _}from"../support/arcgisLayerUrl.js";import{url as j}from"../support/commonProperties.js";import D from"../support/DimensionalDefinition.js";import J from"../support/MultidimensionalSubset.js";import{interpolationKebab as T}from"../support/rasterEnums.js";import N from"../support/RasterFunction.js";import O from"../support/TileInfo.js";import{getVariableRasterInfo as z,getDefaultInterpolation as H,matchPresetRenderer as P,getDefaultBandCombination as E,getFunctionColorRamp as C,createDefaultRenderer as B,normalizeRendererJSON as M}from"../../renderers/support/rasterRendererHelper.js";import U from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as q,websceneRasterRendererTypes as k,read as L}from"../../renderers/support/rasterTypeUtils.js";import A from"../../rest/support/ImageHistogramParameters.js";import V from"../../rest/support/ImageSample.js";import $ from"../../rest/support/ImageSampleParameters.js";import G from"../../rest/support/ImageSampleResult.js";import{enumeration as W}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as K}from"../../core/accessorSupport/decorators/reader.js";const Q=1e3,X=X=>{const Y=X;let Z=class extends Y{constructor(...e){super(...e),this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=c(e[0]?.raster)}destroy(){this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",_(e,r.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const i=t?.find(({name:t})=>t===e);return i?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,i){const r=t?.layerDefinition?.drawingInfo?.renderer;return L(r,i)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=a(A,e).clone();const{serviceRasterInfo:r}=this;if(null==r)throw new i("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:s}=e;if(null==s)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let n=s;const{spatialReference:o}=r;if(!s.spatialReference.equals(o)){await w();const e="extent"===s.type?S(s,o):v(s,o);if(null==e)throw new i("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");n=e}const m=e.pixelSize??new l({x:r.pixelSize.x,y:r.pixelSize.y,spatialReference:o}),{extent:u,width:c,height:d}=R(r,n,m),p=await this.fetchPixels(u,c,d,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new i("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await I(p.pixelBlock,u,n),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):F(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const i=p({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:i,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:i}=this;if(!e||!t||!i)return;const{rasterInfo:r}=this.raster,s=h(r,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=s?.name,o=z(r,n);return this._updateSymbolizer(t,i,n,o)}async applyRenderer(e,t,i){const r=e?.pixelBlock;if(!(null!=r&&r.pixels&&r.pixels.length>0))return null;await this.updateRenderer();const s=this.bandIds??[],{pixelBlock:n}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:s,symbolizer:this.symbolizer},i);return n}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&c(t)){const i=t.rasterFunction.rawInputBandIds;e=e?.length&&i?.length&&1!==t.rasterInfo.bandCount?e.map(e=>i[Math.min(e,i.length-1)]):i}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}getTileUrl(e,t,i){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${i}`:""}getCompatibleTileInfo(e,t,i=!1){if(!this.loaded||null==t)return null;if(i&&e.equals(this.spatialReference))return this.tileInfo;const r=u(e);return O.create({size:256,spatialReference:e,origin:r?{x:r.origin[0],y:r.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,i,r,s={}){if(ee(this),s.requestAsImageElement){const n=this.getTileUrl(e,i,r);return t(n,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:s.signal}).then(e=>e.data)}const{serviceRasterInfo:n}=this;if(null!=n.multidimensionalInfo&&null==(s=this.normalizeRasterFetchOptions(s)).multidimensionalDefinition){const t=s.tileInfo||n.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,i,r,t);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(s={...s,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,i,r,s)}async fetchPixels(e,t,i,r={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(r=this.normalizeRasterFetchOptions(r)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),i=Math.round(i);const s=await this.raster.fetchPixels(e,t,i,r);return r.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(s.pixelBlock=s.pixelBlock?.extractBands(r.bandIds)),s}async getSamples(e,t){if(await this.load(),(e=a($,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new i("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const r=e.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:r},n=(await this._getSampleLocations(e)).map(e=>this.identify(e,s).then(t=>(t.location=e,t))),o=(await Promise.all(n)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new G({samples:o})}async identify(e,t={}){await this.load(),e=a(l,e).clone().normalize();const{raster:r,serviceRasterInfo:s}=this;if(null!=s?.multidimensionalInfo){if(!(s.hasMultidimensionalTranspose&&!(!f(t.multidimensionalDefinition)&&!t.transposedVariableName))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const n=this.multidimensionalSubset?.areaOfInterest;if(n&&!n.contains(e))throw new i("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let o;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=c(r)?this.getRawDisplayBandIds():this.bandIds;o=e?.length?e:void 0}return r.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,i=t?.[0]?.variableName;return e.variables.some(e=>e.name===i&&(!t?.[0].dimensionName||e.dimensions.some(e=>"StdTime"===e.name)))}getStandardTimeValue(e){return new Date(y(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return g(this.multidimensionalSubset,t)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=b(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&c(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;ee(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,c(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:i,type:r}=t;if("multipoint"===r)return t.points.map(e=>new l({x:e[0],y:e[1],spatialReference:i}));if("polyline"===r){let r=t;if(e.sampleCount||e.sampleDistance){const i=await import("../../geometry/operators/densifyOperator.js"),s=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),n=Math.min(e.sampleCount||100,Q);let o=e.sampleDistance;if(!o){o=s/(n+(2===r.paths[0].length?1:0))}r=i.execute(t,o,{unit:"meters"})}return r.paths.flatMap(e=>e.map(e=>new l({x:e[0],y:e[1],spatialReference:i})))}const s=Math.min(e.sampleCount||100,Q),n="extent"===t.type,o=n?t:t.extent,a=Math.sqrt(o.width*o.height/s),m=o.height/a,u=o.width/a,{xmin:c,ymax:d}=o,p=[];for(let h=0;h<m;h++)for(let e=0;e<u;e++){const r=new l({x:c+(e+.5)*a,y:d-(h+.5)*a,spatialReference:i});(n||t.contains(r))&&p.push(r)}return p}_configDefaultInterpolation(){if(null==this.interpolation){ee(this);const{raster:e}=this,t=H(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){ee(this);const{rasterInfo:t}=this.raster,i=h(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=i?.name,n=P({variableName:s,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=n?.bandIds??E(t)),!this.renderer||"override"===e){const e=C(this.raster),i=n?.renderer??B(t,{bandIds:this.bandIds,variableName:s,rasterFunctionColorRamp:e}),r=t.statistics,o=r&&r.length>0?r[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===i.type&&(a>1e24||l<-1e24)&&(i.dynamicRangeAdjustment=!0,i.customStatistics=null,"none"===i.stretchType&&(i.stretchType="min-max")),this.renderer=i}const o=M({...this.renderer.toJSON(),variableName:s}),a=z(t,s);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new U({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=B(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,i=t.customStatistics?.length;!t.dynamicRangeAdjustment&&i&&e&&i!==e&&this._configDefaultRenderer("override")}}}else r.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&c(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",N.fromJSON(e)))}let e,t=this.raster,i=!1;c(t)?(e=t.primaryRasters.rasters,t=e[0],i=!0):e=[t];const{rasterFunction:r}=this;if(r){const i={raster:t};e.length>1&&e.forEach(e=>i[e.url]=e);const s=x(r.functionDefinition?.toJSON()??r.toJSON(),i),n=new d({rasterFunction:s});n.rasterJobHandler=this._rasterJobHandler,await n.open(),this.raster=n}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!i&&!r)return;const{bandIds:s}=this,{bandCount:n}=this.raster.rasterInfo,o=s?.length?s.some(e=>e>=n):n>=3;s&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:i}=this.raster,r=i.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),s=(i.pixelSize.x+i.pixelSize.y)/2*r;if(!e.dataSeries?.length)return[new V({location:e.location,pixelValue:e.value,locationId:t,resolution:s})];const n=[];return e.dataSeries.forEach(({value:i,multidimensionalDefinition:r},o)=>{const a={Variables:r[0].variableName,Dimensions:r.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of r){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const i=t[t.length-1];a[`${e}_Max`]=Array.isArray(i)?i[i.length-1]:i}const l=new V({location:e.location,pixelValue:i,rasterId:o,locationId:t,resolution:s,attributes:a});n.push(l)}),n}};function ee(e){if(!e.raster||!e.serviceRasterInfo)throw new i("imagery-tile","no raster")}return e([s({clonable:!1})],Z.prototype,"_cachedRasterFunctionJson",void 0),e([s({clonable:!1})],Z.prototype,"_compatibleFullExtent",void 0),e([s({clonable:!1})],Z.prototype,"_isConstructedFromFunctionRaster",void 0),e([s({clonable:!1})],Z.prototype,"_rasterFunctionUpdatePromise",void 0),e([s({type:[o],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],Z.prototype,"bandIds",void 0),e([s({json:{origins:{service:{read:{source:"copyrightText"}}}}})],Z.prototype,"copyright",void 0),e([s({json:{read:!1}})],Z.prototype,"fullExtent",null),e([s({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),W(T)],Z.prototype,"interpolation",void 0),e([s()],Z.prototype,"ioConfig",void 0),e([s({type:[D],json:{write:!0}})],Z.prototype,"multidimensionalDefinition",null),e([s({type:J,json:{write:!0}})],Z.prototype,"multidimensionalSubset",void 0),e([s()],Z.prototype,"raster",void 0),e([s({type:N})],Z.prototype,"rasterFunction",null),e([s()],Z.prototype,"serviceRasterInfo",void 0),e([s()],Z.prototype,"sourceJSON",void 0),e([s({readOnly:!0,type:m,json:{read:!1}})],Z.prototype,"spatialReference",void 0),e([s({type:O})],Z.prototype,"tileInfo",void 0),e([s(j)],Z.prototype,"url",null),e([s({types:q})],Z.prototype,"renderer",null),e([s({types:q,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:k,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],Z.prototype,"internalRenderer",null),e([K("internalRenderer")],Z.prototype,"readRenderer",null),e([s({clonable:!1})],Z.prototype,"symbolizer",void 0),Z=e([n("esri.layers.mixins.ImageryTileMixin")],Z),Z};export{X as ImageryTileMixin};
5
+ import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import i from"../../core/Logger.js";import{property as n,subclass as s}from"../../core/accessorSupport/decorators.js";import{Integer as o,ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import u from"../../geometry/SpatialReference.js";import{getInfo as c}from"../../geometry/support/spatialReferenceUtils.js";import{isFunctionRaster as m}from"../raster/datasets/datasetUtils.js";import d from"../raster/datasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as p,getDefaultVariableInfo as h,isMultiSliceOrRangeDefinition as f,convertOleDateTimeToEpoch as y,getSubsetVariablesFromMdInfo as g,getDefaultMultidimensionalDefinition as R}from"../raster/datasets/multidimensionalUtils.js";import{snapToRaster as b,clip as I}from"../raster/functions/clipUtils.js";import{create as x}from"../raster/functions/rasterFunctionHelper.js";import{load as w,projectExtent as S,projectPolygon as _}from"../raster/functions/rasterProjectionHelper.js";import{computeStatisticsHistograms as F}from"../raster/functions/stretchUtils.js";import{sanitizeUrl as v}from"../support/arcgisLayerUrl.js";import{url as J}from"../support/commonProperties.js";import j from"../support/DimensionalDefinition.js";import D from"../support/MultidimensionalSubset.js";import{interpolationKebab as N}from"../support/rasterEnums.js";import T from"../support/RasterFunction.js";import H from"../support/RasterJobHandler.js";import C from"../support/TileInfo.js";import{getVariableRasterInfo as O,getDefaultInterpolation as z,matchPresetRenderer as P,getDefaultBandCombination as E,getFunctionColorRamp as B,createDefaultRenderer as M,normalizeRendererJSON as A}from"../../renderers/support/rasterRendererHelper.js";import U from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as q,websceneRasterRendererTypes as k,read as L}from"../../renderers/support/rasterTypeUtils.js";import V from"../../rest/support/ImageHistogramParameters.js";import $ from"../../rest/support/ImageSample.js";import G from"../../rest/support/ImageSampleParameters.js";import W from"../../rest/support/ImageSampleResult.js";import{enumeration as K}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as Q}from"../../core/accessorSupport/decorators/reader.js";const X=1e3,Y=Y=>{const Z=Y;let ee=class extends Z{constructor(...e){super(...e),this._draRasterConfig=null,this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=m(e[0]?.raster)}destroy(){this._draRasterConfig?.rasterJobHandler?.destroy(),this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",v(e,i.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const r=t?.find(({name:t})=>t===e);return r?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer;return L(i,r)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=a(V,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new r("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:n}=e;if(null==n)throw new r("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let s=n;const{spatialReference:o}=i;if(!n.spatialReference.equals(o)){await w();const e="extent"===n.type?S(n,o):_(n,o);if(null==e)throw new r("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");s=e}const u=e.pixelSize??new l({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:m,height:d}=b(i,s,u),p=await this.fetchPixels(c,m,d,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new r("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await I(p.pixelBlock,c,s),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):F(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const r=p({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:r,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:r}=this;if(!e||!t||!r)return;const{rasterInfo:i}=this.raster,n=h(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=n?.name,o=O(i,s);return this._updateSymbolizer(t,r,s,o)}async applyRenderer(e,t,r){const i=e?.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;await this.updateRenderer();const n=this.bandIds??[],{pixelBlock:s}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:n,symbolizer:this.symbolizer},r);return s}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&m(t)){const r=t.rasterFunction.rawInputBandIds;e=e?.length&&r?.length&&1!==t.rasterInfo.bandCount?e.map(e=>r[Math.min(e,r.length-1)]):r}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}getTileUrl(e,t,r){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${r}`:""}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||null==t)return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const i=c(e);return C.create({size:256,spatialReference:e,origin:i?{x:i.origin[0],y:i.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,r,i,n={}){if(te(this),n.requestAsImageElement){const s=this.getTileUrl(e,r,i);return t(s,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then(e=>e.data)}const{serviceRasterInfo:s}=this;if(null!=s.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition){const t=n.tileInfo||s.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,r,i,t);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,r,i,n)}async fetchPixels(e,t,r,i={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(i=this.normalizeRasterFetchOptions(i)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),r=Math.round(r);const n=await this.raster.fetchPixels(e,t,r,i);return i.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(n.pixelBlock=n.pixelBlock?.extractBands(i.bandIds)),n}async getSamples(e,t){if(await this.load(),(e=a(G,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new r("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,n={...t,multidimensionalDefinition:i},s=(await this._getSampleLocations(e)).map(e=>this.identify(e,n).then(t=>(t.location=e,t))),o=(await Promise.all(s)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new W({samples:o})}async identify(e,t={}){await this.load(),e=a(l,e).clone().normalize();const{raster:i,serviceRasterInfo:n}=this;if(null!=n?.multidimensionalInfo){if(!(n.hasMultidimensionalTranspose&&!(!f(t.multidimensionalDefinition)&&!t.transposedVariableName))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const s=this.multidimensionalSubset?.areaOfInterest;if(s&&!s.contains(e))throw new r("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let o;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=m(i)?this.getRawDisplayBandIds():this.bandIds;o=e?.length?e:void 0}return i.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,r=t?.[0]?.variableName;return e.variables.some(e=>e.name===r&&(!t?.[0].dimensionName||e.dimensions.some(e=>"StdTime"===e.name)))}getStandardTimeValue(e){return new Date(y(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return g(this.multidimensionalSubset,t)}async getDynamicRangeInputRaster(){if(!this.rasterFunction||!m(this.raster)||!this._cachedRasterFunctionJson)return null;const e=JSON.stringify(this._cachedRasterFunctionJson);if(this._draRasterConfig?.functionJson===e)return this._draRasterConfig;const t=this.raster.rasterFunction.queryRasterFunction(e=>"Stretch"===e.functionName&&e.functionArguments.dynamicRangeAdjustment);if(!t)return null;const r=t.toJSON(),i=this.raster.primaryRasters.rasters,n=t.functionArguments.raster,s=r.rasterFunctionArguments;if(!n||"object"!=typeof n||!("functionName"in n))return this._draRasterConfig={functionJson:e,raster:i[0],functionArguments:s,rasterJobHandler:this._draRasterConfig?.rasterJobHandler},this._draRasterConfig;const o={raster:i[0]};i.length>1&&i.forEach(e=>o[e.url]=e);const a=x(n.toJSON(),o),l=new d({rasterFunction:a});await l.open();let u=this._draRasterConfig?.rasterJobHandler;try{u||(u=new H,await u.initialize()),l.rasterJobHandler=u,await l.syncJobHandler()}catch{}return this._draRasterConfig={functionJson:e,raster:l,functionArguments:s,rasterJobHandler:u},this._draRasterConfig}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=R(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&m(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;te(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,m(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:r,type:i}=t;if("multipoint"===i)return t.points.map(e=>new l({x:e[0],y:e[1],spatialReference:r}));if("polyline"===i){let i=t;if(e.sampleCount||e.sampleDistance){const r=await import("../../geometry/operators/densifyOperator.js"),n=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),s=Math.min(e.sampleCount||100,X);let o=e.sampleDistance;if(!o){o=n/(s+(2===i.paths[0].length?1:0))}i=r.execute(t,o,{unit:"meters"})}return i.paths.flatMap(e=>e.map(e=>new l({x:e[0],y:e[1],spatialReference:r})))}const n=Math.min(e.sampleCount||100,X),s="extent"===t.type,o=s?t:t.extent,a=Math.sqrt(o.width*o.height/n),u=o.height/a,c=o.width/a,{xmin:m,ymax:d}=o,p=[];for(let h=0;h<u;h++)for(let e=0;e<c;e++){const i=new l({x:m+(e+.5)*a,y:d-(h+.5)*a,spatialReference:r});(s||t.contains(i))&&p.push(i)}return p}_configDefaultInterpolation(){if(null==this.interpolation){te(this);const{raster:e}=this,t=z(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){te(this);const{rasterInfo:t}=this.raster,r=h(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=r?.name,s=P({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=s?.bandIds??E(t)),!this.renderer||"override"===e){const e=B(this.raster),r=s?.renderer??M(t,{bandIds:this.bandIds,variableName:n,rasterFunctionColorRamp:e}),i=t.statistics,o=i&&i.length>0?i[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===r.type&&(a>1e24||l<-1e24)&&(r.dynamicRangeAdjustment=!0,r.customStatistics=null,"none"===r.stretchType&&(r.stretchType="min-max")),this.renderer=r}const o=A({...this.renderer.toJSON(),variableName:n}),a=O(t,n);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new U({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=M(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,r=t.customStatistics?.length;!t.dynamicRangeAdjustment&&r&&e&&r!==e&&this._configDefaultRenderer("override")}}}else i.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&m(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",T.fromJSON(e)))}let e,t=this.raster,r=!1;m(t)?(e=t.primaryRasters.rasters,t=e[0],r=!0):e=[t];const{rasterFunction:i}=this;if(i){const r={raster:t};e.length>1&&e.forEach(e=>r[e.url]=e);const n=x(i.functionDefinition?.toJSON()??i.toJSON(),r),s=new d({rasterFunction:n});s.rasterJobHandler=this._rasterJobHandler,await s.open(),this.raster=s}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!r&&!i)return;const{bandIds:n}=this,{bandCount:s}=this.raster.rasterInfo,o=n?.length?n.some(e=>e>=s):s>=3;n&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:r}=this.raster,i=r.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),n=(r.pixelSize.x+r.pixelSize.y)/2*i;if(!e.dataSeries?.length)return[new $({location:e.location,pixelValue:e.value,locationId:t,resolution:n})];const s=[];return e.dataSeries.forEach(({value:r,multidimensionalDefinition:i},o)=>{const a={Variables:i[0].variableName,Dimensions:i.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of i){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const r=t[t.length-1];a[`${e}_Max`]=Array.isArray(r)?r[r.length-1]:r}const l=new $({location:e.location,pixelValue:r,rasterId:o,locationId:t,resolution:n,attributes:a});s.push(l)}),s}};function te(e){if(!e.raster||!e.serviceRasterInfo)throw new r("imagery-tile","no raster")}return e([n({clonable:!1})],ee.prototype,"_cachedRasterFunctionJson",void 0),e([n({clonable:!1})],ee.prototype,"_compatibleFullExtent",void 0),e([n({clonable:!1})],ee.prototype,"_draRasterConfig",void 0),e([n({clonable:!1})],ee.prototype,"_isConstructedFromFunctionRaster",void 0),e([n({clonable:!1})],ee.prototype,"_rasterFunctionUpdatePromise",void 0),e([n({type:[o],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],ee.prototype,"bandIds",void 0),e([n({json:{origins:{service:{read:{source:"copyrightText"}}}}})],ee.prototype,"copyright",void 0),e([n({json:{read:!1}})],ee.prototype,"fullExtent",null),e([n({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),K(N)],ee.prototype,"interpolation",void 0),e([n()],ee.prototype,"ioConfig",void 0),e([n({type:[j],json:{write:!0}})],ee.prototype,"multidimensionalDefinition",null),e([n({type:D,json:{write:!0}})],ee.prototype,"multidimensionalSubset",void 0),e([n()],ee.prototype,"raster",void 0),e([n({type:T})],ee.prototype,"rasterFunction",null),e([n()],ee.prototype,"serviceRasterInfo",void 0),e([n()],ee.prototype,"sourceJSON",void 0),e([n({readOnly:!0,type:u,json:{read:!1}})],ee.prototype,"spatialReference",void 0),e([n({type:C})],ee.prototype,"tileInfo",void 0),e([n(J)],ee.prototype,"url",null),e([n({types:q})],ee.prototype,"renderer",null),e([n({types:q,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:k,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],ee.prototype,"internalRenderer",null),e([Q("internalRenderer")],ee.prototype,"readRenderer",null),e([n({clonable:!1})],ee.prototype,"symbolizer",void 0),ee=e([s("esri.layers.mixins.ImageryTileMixin")],ee),ee};export{Y as ImageryTileMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import s from"../../../geometry/Polygon.js";import a from"./BaseRaster.js";import{clip as o}from"../functions/clipUtils.js";import{approximateTransform as n}from"../functions/pixelUtils.js";import{projectPolygon as l}from"../functions/rasterProjectionHelper.js";import c from"../../../rest/support/FeatureSet.js";const p=40;let m=class extends a{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(t,e,r,i={}){const{rasters:s,rasterIds:a}=this.primaryRasters;let l=!1;const{interpolation:c}=i,p=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!i.requestRawData&&p&&(l=1===s.length&&!i.skipRasterFunction,i={...i,interpolation:"bilinear",requestRawData:l}),i.requestRawData&&s.length>1&&!this.hasUniqueSourceStorageInfo&&(l=!1,i={...i,requestRawData:!1});const m=s.map(s=>s.fetchPixels(t,e,r,i)),u=await Promise.all(m),h=u.map(t=>t.pixelBlock),f=l||i.requestRawData?u.map(t=>t.srcTilePixelSize):null;if(i.skipRasterFunction||h.every(t=>null==t))return u[0];const d=u.find(t=>null!=t.pixelBlock)?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:a}):this.rasterFunction.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:a});const{transformGrid:g}=u[0];if(!l||null==y||null==g){const t=i.noClip?null:this.getClippingGeometry(d.spatialReference);return!i.noClip&&null!=y&&t&&(y=await o(y,d,t)),{...u[0],pixelBlock:y}}const x={rows:g.spacing[0],cols:g.spacing[1]};let R;if(this.rasterJobHandler){R=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:c,alignmentInfo:void 0,blockWidths:null},i)).pixelBlock}else R=n(y,{width:e,height:r},g.coefficients,x,c);const w=i.noClip?null:this.getClippingGeometry(t.spatialReference);return i.noClip||null==R||null==w||(R=await o(R,t,w)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:R}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=h(t);let i=this._clippingGeometry.get(r);return null!=i||(i=t.equals(e.spatialReference)?e:l(e,t),this._clippingGeometry.set(r,i)),i}async _open(t){const{rasterFunction:r}=this;r.isRoot=!0,this.primaryRasters?.rasters?.length?r.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=r.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(t=>t.rasterJobHandler=this.rasterJobHandler));const{rasters:i,rasterIds:s}=this.primaryRasters,a=i.map(e=>e.rasterInfo?void 0:e.open(t));await Promise.all(a);const o=i.map(({rasterInfo:t})=>t),n=r.bind({rasterInfos:o,rasterIds:s});if(r.rawSourceRasterInfos=o,!n.success||0===o.length)throw new e("raster-function:open",`cannot bind the function: ${n.error??""}`);const l="Table"===r.functionName?r:r.functionArguments?.raster;"Table"===l?.functionName&&(r.rasterInfo.attributeTable=c.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const p=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every(t=>u(t,p)),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",r.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&"inside"===t.clippingType){const{extent:t}=this.rasterInfo,r=await import("../../../geometry/operators/densifyOperator.js"),i=await import("../../../geometry/operators/differenceOperator.js");let a=r.execute(s.fromExtent(t),2*(t.width+t.height)/p);a=l(a,e.spatialReference),e=i.execute(a,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};function u(t,e){const{storageInfo:r,pixelSize:i,spatialReference:s,extent:a}=t,{storageInfo:o,pixelSize:n,spatialReference:l,extent:c}=e;return i.x===n.x&&i.y===n.y&&s.equals(l)&&a.equals(c)&&r.blockHeight===o.blockHeight&&r.blockWidth===o.blockWidth&&r.maximumPyramidLevel===o.maximumPyramidLevel&&r.firstPyramidLevel===o.firstPyramidLevel&&r.pyramidBlockWidth===o.pyramidBlockWidth&&r.pyramidBlockHeight===o.pyramidBlockHeight&&r.pyramidScalingFactor===o.pyramidScalingFactor}function h(t){return String(t.wkid??t.wkt??t.wkt2)}t([r({type:String,json:{write:!0}})],m.prototype,"datasetFormat",void 0),t([r()],m.prototype,"tileType",void 0),t([r()],m.prototype,"rasterFunction",void 0),t([r()],m.prototype,"primaryRasters",void 0),m=t([i("esri.layers.raster.datasets.FunctionRaster")],m);export{m as default};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Error.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import s from"../../../geometry/Polygon.js";import a from"./BaseRaster.js";import{clip as o}from"../functions/clipUtils.js";import{approximateTransform as n}from"../functions/pixelUtils.js";import{projectPolygon as l}from"../functions/rasterProjectionHelper.js";import c from"../../../rest/support/FeatureSet.js";const p=40;let m=class extends a{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(t,e,r,i={}){const{rasters:s,rasterIds:a}=this.primaryRasters;let l=!1;const{interpolation:c}=i,p=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!i.requestRawData&&p&&(l=1===s.length&&!i.skipRasterFunction,i={...i,interpolation:"bilinear",requestRawData:l}),i.requestRawData&&s.length>1&&!this.hasUniqueSourceStorageInfo&&(l=!1,i={...i,requestRawData:!1});const m=s.map(s=>s.fetchPixels(t,e,r,i)),u=await Promise.all(m),h=u.map(t=>t.pixelBlock),f=l||i.requestRawData?u.map(t=>t.srcTilePixelSize):null;if(i.skipRasterFunction||h.every(t=>null==t))return u[0];const d=u.find(t=>null!=t.pixelBlock)?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:a,parameters:this.processParameters}):this.rasterFunction.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:a},this.processParameters);const{transformGrid:g}=u[0];if(!l||null==y||null==g){const t=i.noClip?null:this.getClippingGeometry(d.spatialReference);return!i.noClip&&null!=y&&t&&(y=await o(y,d,t)),{...u[0],pixelBlock:y}}const x={rows:g.spacing[0],cols:g.spacing[1]};let R;if(this.rasterJobHandler){R=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:c,alignmentInfo:void 0,blockWidths:null},i)).pixelBlock}else R=n(y,{width:e,height:r},g.coefficients,x,c);const w=i.noClip?null:this.getClippingGeometry(t.spatialReference);return i.noClip||null==R||null==w||(R=await o(R,t,w)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:R}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=h(t);let i=this._clippingGeometry.get(r);return null!=i||(i=t.equals(e.spatialReference)?e:l(e,t),this._clippingGeometry.set(r,i)),i}async _open(t){const{rasterFunction:r}=this;r.isRoot=!0,this.primaryRasters?.rasters?.length?r.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=r.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(t=>t.rasterJobHandler=this.rasterJobHandler));const{rasters:i,rasterIds:s}=this.primaryRasters,a=i.map(e=>e.rasterInfo?void 0:e.open(t));await Promise.all(a);const o=i.map(({rasterInfo:t})=>t),n=r.bind({rasterInfos:o,rasterIds:s});if(r.rawSourceRasterInfos=o,!n.success||0===o.length)throw new e("raster-function:open",`cannot bind the function: ${n.error??""}`);const l="Table"===r.functionName?r:r.functionArguments?.raster;"Table"===l?.functionName&&(r.rasterInfo.attributeTable=c.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const p=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every(t=>u(t,p)),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",r.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&"inside"===t.clippingType){const{extent:t}=this.rasterInfo,r=await import("../../../geometry/operators/densifyOperator.js"),i=await import("../../../geometry/operators/differenceOperator.js");let a=r.execute(s.fromExtent(t),2*(t.width+t.height)/p);a=l(a,e.spatialReference),e=i.execute(a,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};function u(t,e){const{storageInfo:r,pixelSize:i,spatialReference:s,extent:a}=t,{storageInfo:o,pixelSize:n,spatialReference:l,extent:c}=e;return i.x===n.x&&i.y===n.y&&s.equals(l)&&a.equals(c)&&r.blockHeight===o.blockHeight&&r.blockWidth===o.blockWidth&&r.maximumPyramidLevel===o.maximumPyramidLevel&&r.firstPyramidLevel===o.firstPyramidLevel&&r.pyramidBlockWidth===o.pyramidBlockWidth&&r.pyramidBlockHeight===o.pyramidBlockHeight&&r.pyramidScalingFactor===o.pyramidScalingFactor}function h(t){return String(t.wkid??t.wkt??t.wkt2)}t([r({type:String,json:{write:!0}})],m.prototype,"datasetFormat",void 0),t([r()],m.prototype,"tileType",void 0),t([r()],m.prototype,"rasterFunction",void 0),t([r()],m.prototype,"processParameters",void 0),t([r()],m.prototype,"primaryRasters",void 0),m=t([i("esri.layers.raster.datasets.FunctionRaster")],m);export{m as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{JSONSupport as s}from"../../../core/JSONSupport.js";import{property as e,cast as r,subclass as n}from"../../../core/accessorSupport/decorators.js";import i from"../../support/PixelBlock.js";import o from"../../support/RasterInfo.js";const a=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let u=class extends s{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this.isRoot=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const s=[t],{parameters:e}=t;let r=e.rasters||e.raster&&[e.raster];for(;r?.length;){s.unshift(...r);const t=[];for(let s=0;s<r.length;s++){const{parameters:e}=r[s],n=e.rasters||e.raster&&[e.raster];n?.length&&t.push(...n)}r=t}for(let a=s.length-1;a>=0;a--)s[a].isNoopProcess&&s.splice(a,1);let n=!1;for(let a=0;a<s.length;a++){const t=s[a];t.id=s.length-a-1;const{rasters:e}=t.parameters;n=n||null!=e&&e.length>1}const i=s.some(({name:t})=>a.has(t.toLowerCase())),{rawSourceRasterInfos:o}=this;return{functions:s,hasBranches:n,hasFocalFunction:i,isSourceSingleBand:1===o?.[0]?.bandCount}}bind(t,s=!1,e=-1){this.id=e+1;const r=this._getRasterValues();let n=!0;for(let i=0;i<r.length;i++){const e=r[i];if(null!=e&&this._isRasterFunctionValue(e)){const r=e.bind(t,s,this.id+i);if(!r.success)return this._bindingResult=r,r;n=n&&r.supportsGPU}}if(!this.rasterInfo||s){if(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),n&&=this._bindingResult.supportsGPU,this._bindingResult.success&&(this._patchRasterInfo(),n&&this.isRoot)){this.processInputBandIds();this.swizzleInputBandIds(this.rawInputBandIds)||(n=this.rawInputBandIds.length<=3)}return this._bindingResult.supportsGPU=n,this._bindingResult}return this._bindingResult={success:!0,supportsGPU:!0},this._bindingResult}process(t){const s=this._getRasterValues(),e=0===s.length?t.pixelBlocks??t.primaryPixelBlocks:s.map(s=>this._readRasterValue(s,t));return this._processPixels({...t,pixelBlocks:e})}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);if(t.length>1){const s=t.map(t=>t.processInputBandIds());return this.rawInputBandIds=[...new Set(s.flat())],this.rawInputBandIds}const s=t[0];if(s)return this.rawInputBandIds=s.processInputBandIds(),this.rawInputBandIds;const{bandCount:e}=this.sourceRasterInfos[0],r=Array.from({length:e},(t,s)=>s);return this.rawInputBandIds=this._getInputBandIds(r),this.rawInputBandIds}swizzleInputBandIds(t){const s=this._getRasterValues().filter(this._isRasterFunctionValue);let e=!0;for(const r of s)e=r.swizzleInputBandIds(t)&&e;return!!e&&this._swizzleBandIds(t)}getPrimaryRasters(){const t=[],s=[];return this._getPrimaryRasters(this,t,s),{rasters:t,rasterIds:s}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:s,rasters:e}=this.functionArguments;return e&&Array.isArray(e)&&e.length?(t.rasters=e.map(t=>this._isRasterFunctionValue(t)?t.getWebGLProcessorDefinition():"number"==typeof t?{name:"Constant",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(t=>null!=t)||(t.rasters=null)):this._isRasterFunctionValue(s)&&(t.raster=s.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];"Clip"===this.functionName&&t.push(this.functionArguments);const{raster:s,rasters:e}=this.functionArguments;if(e&&Array.isArray(e)&&e.length)e.forEach(s=>{if(this._isRasterFunctionValue(s)){const e=s.getClippingGeometries();t.push(...e)}});else if(this._isRasterFunctionValue(s)){const e=s.getClippingGeometries();t.push(...e)}return t}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_swizzleBandIds(t){return!0}_isInputRasterPrimaryOrConstant(){return!this._getRasterValues().some(t=>t&&"object"==typeof t&&"rasterFunction"in t&&t.rasterFunction)}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach(t=>{t.statistics=void 0,t.histograms=void 0})}_getRasterValues(){const{rasterArgumentNames:t}=this;return"rasters"===t[0]?this.functionArguments.rasters??[]:t.flatMap(t=>this.functionArguments[t])}_getSourceRasterInfos(t){const s=this._getRasterValues(),{rasterInfos:e,rasterIds:r}=t;if(0===s.length)return e;const n=s.map(t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&r.includes(t)?e[r.indexOf(t)]:"number"!=typeof t?e[0]:void 0),i=n.find(t=>t)??e[0];return n.forEach((t,s)=>{void 0===t&&(n[s]=i)}),n}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,s=[],e=[]){for(let r=0;r<t.sourceRasters.length;r++){const n=t.sourceRasters[r];if("number"!=typeof n)if("bind"in n)this._getPrimaryRasters(n,s,e);else{const t=n,r=this._getPrimaryRasterId(t);if(null==r)continue;e.includes(r)||(this.mainPrimaryRasterId===r?(s.unshift(t),e.unshift(r)):(s.push(t),e.push(r)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,s){const{primaryPixelBlocks:e}=s;if(null==t||"$$"===t){const t=e[0];return null==t?null:t.clone()}if("string"==typeof t){const r=s.primaryRasterIds.indexOf(t);return-1===r?null:e[r]}if("number"==typeof t){const s=e[0];if(null==s)return null;const{width:r,height:n,pixelType:o}=s,a=new Float32Array(r*n);a.fill(t);const u=this.sourceRasterInfos[0].bandCount,l=new Array(u).fill(a);return new i({width:r,height:n,pixelType:o,pixels:l})}return t.process(s)}_patchRasterInfo(){const{rasterInfo:t}=this;if(!t?.keyProperties)return;const{bandCount:s,keyProperties:e,statistics:r,histograms:n}=t,i=e.BandProperties;i&&i.length!==s&&(t.keyProperties={...e,BandProperties:void 0}),r&&r.length!==s&&(t.statistics=r.length>s?r.slice(0,s):null),n&&n.length!==s&&(t.histograms=n.length>s?n.slice(0,s):null),e.BAND_COUNT&&Number(e.BAND_COUNT)!==s&&(t.keyProperties={...e,BAND_COUNT:"string"==typeof e.BAND_COUNT?String(s):s})}};t([e({json:{write:!0}})],u.prototype,"functionName",void 0),t([e({json:{write:!0}})],u.prototype,"functionArguments",void 0),t([e()],u.prototype,"rasterArgumentNames",void 0),t([e({json:{write:!0}}),r(t=>t?.toLowerCase())],u.prototype,"outputPixelType",void 0),t([e({json:{write:!0}})],u.prototype,"mainPrimaryRasterId",void 0),t([e()],u.prototype,"sourceRasters",void 0),t([e({type:[o],json:{write:!0}})],u.prototype,"sourceRasterInfos",void 0),t([e({json:{write:!0}})],u.prototype,"rasterInfo",void 0),t([e({json:{write:!0}})],u.prototype,"readingBufferSize",void 0),t([e({json:{write:!0}})],u.prototype,"id",void 0),t([e()],u.prototype,"isNoopProcess",void 0),t([e()],u.prototype,"supportsGPU",null),t([e({json:{write:!0}})],u.prototype,"rawInputBandIds",void 0),t([e()],u.prototype,"rawSourceRasterInfos",void 0),t([e({json:{write:!0}})],u.prototype,"isInputBandIdsSwizzled",void 0),t([e({json:{write:!0}})],u.prototype,"swizzledBandSelection",void 0),t([e()],u.prototype,"isBranch",void 0),t([e()],u.prototype,"isRoot",void 0),t([e({readOnly:!0})],u.prototype,"flatWebGLFunctionChain",null),t([e()],u.prototype,"_bindingResult",void 0),u=t([n("esri.layers.raster.functions.BaseRasterFunction")],u);const l=u;export{l as default};
5
+ import{__decorate as t}from"tslib";import{JSONSupport as s}from"../../../core/JSONSupport.js";import{property as e,cast as r,subclass as n}from"../../../core/accessorSupport/decorators.js";import i from"../../support/PixelBlock.js";import o from"../../support/RasterInfo.js";const a=new Set(["slope","aspect","curvature","hillshade","shadedrelief","statistics"]);let u=class extends s{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0,this.id=-1,this.isNoopProcess=!1,this.rawInputBandIds=[],this.rawSourceRasterInfos=null,this.isInputBandIdsSwizzled=!1,this.swizzledBandSelection=[],this.isBranch=!1,this.isRoot=!1,this._bindingResult=null}get supportsGPU(){return this._bindingResult.supportsGPU}get flatWebGLFunctionChain(){const t=this.getWebGLProcessorDefinition();if(!t)return null;const s=[t],{parameters:e}=t;let r=e.rasters||e.raster&&[e.raster];for(;r?.length;){s.unshift(...r);const t=[];for(let s=0;s<r.length;s++){const{parameters:e}=r[s],n=e.rasters||e.raster&&[e.raster];n?.length&&t.push(...n)}r=t}for(let a=s.length-1;a>=0;a--)s[a].isNoopProcess&&s.splice(a,1);let n=!1;for(let a=0;a<s.length;a++){const t=s[a];t.id=s.length-a-1;const{rasters:e}=t.parameters;n=n||null!=e&&e.length>1}const i=s.some(({name:t})=>a.has(t.toLowerCase())),{rawSourceRasterInfos:o}=this;return{functions:s,hasBranches:n,hasFocalFunction:i,isSourceSingleBand:1===o?.[0]?.bandCount}}bind(t,s=!1,e=-1){this.id=e+1;const r=this._getRasterValues();let n=!0;for(let i=0;i<r.length;i++){const e=r[i];if(null!=e&&this._isRasterFunctionValue(e)){const r=e.bind(t,s,this.id+i);if(!r.success)return this._bindingResult=r,r;n=n&&r.supportsGPU}}if(!this.rasterInfo||s){if(this.sourceRasterInfos=this._getSourceRasterInfos(t),this._bindingResult=this._bindSourceRasters(),n&&=this._bindingResult.supportsGPU,this._bindingResult.success&&(this._patchRasterInfo(),n&&this.isRoot)){this.processInputBandIds();this.swizzleInputBandIds(this.rawInputBandIds)||(n=this.rawInputBandIds.length<=3)}return this._bindingResult.supportsGPU=n,this._bindingResult}return this._bindingResult={success:!0,supportsGPU:!0},this._bindingResult}queryRasterFunction(t){const s=[this];for(;s.length;){const e=s.pop();if(t(e))return e;const r=e.getImmediateChildFunctions();s.push(...r)}}getImmediateChildFunctions(){return this._getRasterValues().filter(t=>t&&"object"==typeof t&&"bind"in t)}process(t,s){const e=this._getRasterValues(),r=0===e.length?t.pixelBlocks??t.primaryPixelBlocks:e.map(s=>this._readRasterValue(s,t));return this._processPixels({...t,pixelBlocks:r},s)}processInputBandIds(){const t=this._getRasterValues().filter(this._isRasterFunctionValue);if(t.length>1){const s=t.map(t=>t.processInputBandIds());return this.rawInputBandIds=[...new Set(s.flat())],this.rawInputBandIds}const s=t[0];if(s)return this.rawInputBandIds=s.processInputBandIds(),this.rawInputBandIds;const{bandCount:e}=this.sourceRasterInfos[0],r=Array.from({length:e},(t,s)=>s);return this.rawInputBandIds=this._getInputBandIds(r),this.rawInputBandIds}swizzleInputBandIds(t){const s=this._getRasterValues().filter(this._isRasterFunctionValue);let e=!0;for(const r of s)e=r.swizzleInputBandIds(t)&&e;return!!e&&this._swizzleBandIds(t)}getPrimaryRasters(){const t=[],s=[];return this._getPrimaryRasters(this,t,s),{rasters:t,rasterIds:s}}getWebGLProcessorDefinition(){const t=this._getWebGLParameters(),{raster:s,rasters:e}=this.functionArguments;return e&&Array.isArray(e)&&e.length?(t.rasters=e.map(t=>this._isRasterFunctionValue(t)?t.getWebGLProcessorDefinition():"number"==typeof t?{name:"Constant",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}:{name:"Identity",parameters:{value:t},pixelType:"f32",id:-1,isNoopProcess:!1}),t.rasters.some(t=>null!=t)||(t.rasters=null)):this._isRasterFunctionValue(s)&&(t.raster=s.getWebGLProcessorDefinition()),{name:this.functionName,parameters:t,pixelType:this.outputPixelType,id:this.id,isNoopProcess:this.isNoopProcess}}getClippingGeometries(){const t=[];"Clip"===this.functionName&&t.push(this.functionArguments);const{raster:s,rasters:e}=this.functionArguments;if(e&&Array.isArray(e)&&e.length)e.forEach(s=>{if(this._isRasterFunctionValue(s)){const e=s.getClippingGeometries();t.push(...e)}});else if(this._isRasterFunctionValue(s)){const e=s.getClippingGeometries();t.push(...e)}return t}_getOutputPixelType(t){return"unknown"===this.outputPixelType?t:this.outputPixelType??t}_getWebGLParameters(){return{}}_getInputBandIds(t){return t}_swizzleBandIds(t){return!0}_isInputRasterPrimaryOrConstant(){return!this._getRasterValues().some(t=>t&&"object"==typeof t&&"rasterFunction"in t&&t.rasterFunction)}_removeStatsHistColormapVAT(t){t.statistics=null,t.histograms=null,t.colormap=null,t.attributeTable=null,t.multidimensionalInfo?.variables.forEach(t=>{t.statistics=void 0,t.histograms=void 0})}_getRasterValues(){const{rasterArgumentNames:t}=this;return"rasters"===t[0]?this.functionArguments.rasters??[]:t.flatMap(t=>this.functionArguments[t])}_getSourceRasterInfos(t){const s=this._getRasterValues(),{rasterInfos:e,rasterIds:r}=t;if(0===s.length)return e;const n=s.map(t=>t&&"object"==typeof t&&"bind"in t&&t.rasterInfo?t.rasterInfo:"string"==typeof t&&r.includes(t)?e[r.indexOf(t)]:"number"!=typeof t?e[0]:void 0),i=n.find(t=>t)??e[0];return n.forEach((t,s)=>{void 0===t&&(n[s]=i)}),n}_getPrimaryRasterId(t){return t?.rasterId}_getPrimaryRasters(t,s=[],e=[]){for(let r=0;r<t.sourceRasters.length;r++){const n=t.sourceRasters[r];if("number"!=typeof n)if("bind"in n)this._getPrimaryRasters(n,s,e);else{const t=n,r=this._getPrimaryRasterId(t);if(null==r)continue;e.includes(r)||(this.mainPrimaryRasterId===r?(s.unshift(t),e.unshift(r)):(s.push(t),e.push(r)))}}}_isRasterFunctionValue(t){return null!=t&&"object"==typeof t&&"getWebGLProcessorDefinition"in t}_readRasterValue(t,s){const{primaryPixelBlocks:e}=s;if(null==t||"$$"===t){const t=e[0];return null==t?null:t.clone()}if("string"==typeof t){const r=s.primaryRasterIds.indexOf(t);return-1===r?null:e[r]}if("number"==typeof t){const s=e[0];if(null==s)return null;const{width:r,height:n,pixelType:o}=s,a=new Float32Array(r*n);a.fill(t);const u=this.sourceRasterInfos[0].bandCount,l=new Array(u).fill(a);return new i({width:r,height:n,pixelType:o,pixels:l})}return t.process(s)}_patchRasterInfo(){const{rasterInfo:t}=this;if(!t?.keyProperties)return;const{bandCount:s,keyProperties:e,statistics:r,histograms:n}=t,i=e.BandProperties;i&&i.length!==s&&(t.keyProperties={...e,BandProperties:void 0}),r&&r.length!==s&&(t.statistics=r.length>s?r.slice(0,s):null),n&&n.length!==s&&(t.histograms=n.length>s?n.slice(0,s):null),e.BAND_COUNT&&Number(e.BAND_COUNT)!==s&&(t.keyProperties={...e,BAND_COUNT:"string"==typeof e.BAND_COUNT?String(s):s})}};t([e({json:{write:!0}})],u.prototype,"functionName",void 0),t([e({json:{write:!0}})],u.prototype,"functionArguments",void 0),t([e()],u.prototype,"rasterArgumentNames",void 0),t([e({json:{write:!0}}),r(t=>t?.toLowerCase())],u.prototype,"outputPixelType",void 0),t([e({json:{write:!0}})],u.prototype,"mainPrimaryRasterId",void 0),t([e()],u.prototype,"sourceRasters",void 0),t([e({type:[o],json:{write:!0}})],u.prototype,"sourceRasterInfos",void 0),t([e({json:{write:!0}})],u.prototype,"rasterInfo",void 0),t([e({json:{write:!0}})],u.prototype,"readingBufferSize",void 0),t([e({json:{write:!0}})],u.prototype,"id",void 0),t([e()],u.prototype,"isNoopProcess",void 0),t([e()],u.prototype,"supportsGPU",null),t([e({json:{write:!0}})],u.prototype,"rawInputBandIds",void 0),t([e()],u.prototype,"rawSourceRasterInfos",void 0),t([e({json:{write:!0}})],u.prototype,"isInputBandIdsSwizzled",void 0),t([e({json:{write:!0}})],u.prototype,"swizzledBandSelection",void 0),t([e()],u.prototype,"isBranch",void 0),t([e()],u.prototype,"isRoot",void 0),t([e({readOnly:!0})],u.prototype,"flatWebGLFunctionChain",null),t([e()],u.prototype,"_bindingResult",void 0),u=t([n("esri.layers.raster.functions.BaseRasterFunction")],u);const l=u;export{l as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as s,subclass as e}from"../../../core/accessorSupport/decorators.js";import{isIntegerPixelType as o}from"../formats/pixelRangeUtils.js";import u from"./BaseRasterFunction.js";import{lookupPixels as r}from"./pixelUtils.js";import i from"./StretchFunctionArguments.js";import{getStretchCutoff as n,createStretchLUT as a,stretch as p,computeGammaCorrection as m}from"./stretchUtils.js";let c=class extends u{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:s}=t,{functionArguments:e}=this,{dynamicRangeAdjustment:u,gamma:r,useGamma:i}=e;if(!u&&["u8","u16","s8","s16"].includes(s)){const u=n(e.toJSON(),{rasterInfo:t}),p=o(this.outputPixelType)?"round":"float";this.lookup=a({pixelType:s,...u,gamma:i?r:null,rounding:p}),this.cutOffs=u}else u||(this.cutOffs=n(e.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(s);const p=t.clone();p.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(p),"u8"===this.outputPixelType&&(p.keyProperties.DataType="processed");const{outputMin:m=0,outputMax:c=255}=this.functionArguments;p.statistics=[];for(let o=0;o<p.bandCount;o++)p.statistics[o]={min:m,max:c};this.rasterInfo=p;return{success:!0,supportsGPU:!u}}_processPixels(t){const s=t.pixelBlocks?.[0];if(null==s)return s;const{lookup:e}=this;if(e)return r(s,{...e,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:o}=this,u=this.cutOffs||n(o.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:s}),i=o.useGamma?o.gamma:null;return p(s,{...u,gamma:i,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:s=255,gamma:e,useGamma:u}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,i=u&&e?.length?m(r,e):[1,1,1],{minCutOff:n,maxCutOff:a}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===n.length&&(n[1]=n[2]=n[0],a[1]=a[2]=a[0]);const p=a.map((e,o)=>(s-t)/(a[o]-n[o])),c=o(this.outputPixelType),f=u&&e?[e[0],e[1]??e[0],e[2]??e[0]]:[1,1,1],l=u?[i[0],i[1]??i[0],i[2]??i[0]]:[1,1,1];return{bandCount:r,minOutput:t,maxOutput:s,minCutOff:n,maxCutOff:a,factor:p,useGamma:u,gamma:f,gammaCorrection:l,stretchType:this.functionArguments.stretchType,isOutputRounded:c,type:"stretch"}}};t([s({json:{write:!0,name:"rasterFunction"}})],c.prototype,"functionName",void 0),t([s({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],c.prototype,"functionArguments",void 0),t([s()],c.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],c.prototype,"lookup",void 0),t([s({json:{write:!0}})],c.prototype,"cutOffs",void 0),c=t([e("esri.layers.raster.functions.StretchFunction")],c);const f=c;export{f as default};
5
+ import{__decorate as t}from"tslib";import{property as s,subclass as e}from"../../../core/accessorSupport/decorators.js";import{isIntegerPixelType as o}from"../formats/pixelRangeUtils.js";import u from"./BaseRasterFunction.js";import{lookupPixels as r}from"./pixelUtils.js";import i from"./StretchFunctionArguments.js";import{getStretchCutoff as n,createStretchLUT as a,stretch as p,computeGammaCorrection as m}from"./stretchUtils.js";let c=class extends u{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:s}=t,{functionArguments:e}=this,{dynamicRangeAdjustment:u,gamma:r,useGamma:i}=e;if(!u&&["u8","u16","s8","s16"].includes(s)){const u=n(e.toJSON(),{rasterInfo:t}),p=o(this.outputPixelType)?"round":"float";this.lookup=a({pixelType:s,...u,gamma:i?r:null,rounding:p}),this.cutOffs=u}else u||(this.cutOffs=n(e.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(s);const p=t.clone();p.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(p),"u8"===this.outputPixelType&&(p.keyProperties.DataType="processed");const{outputMin:m=0,outputMax:c=255}=this.functionArguments;p.statistics=[];for(let o=0;o<p.bandCount;o++)p.statistics[o]={min:m,max:c};this.rasterInfo=p;return{success:!0,supportsGPU:!u}}_processPixels(t,s){const e=t.pixelBlocks?.[0];if(null==e)return e;const{lookup:o}=this;if(o)return r(e,{...o,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:u}=this,i=s?.stretchCutoff??this.cutOffs??n(u.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:e}),a=u.useGamma?u.gamma:null;return p(e,{...i,gamma:a,outputPixelType:this.outputPixelType})}_getWebGLParameters(){const{outputMin:t=0,outputMax:s=255,gamma:e,useGamma:u}=this.functionArguments,r=this.rasterInfo.bandCount>=2?3:1,i=u&&e?.length?m(r,e):[1,1,1],{minCutOff:n,maxCutOff:a}=this.cutOffs??{minCutOff:[0,0,0],maxCutOff:[255,255,255]};1===n.length&&(n[1]=n[2]=n[0],a[1]=a[2]=a[0]);const p=a.map((e,o)=>(s-t)/(a[o]-n[o])),c=o(this.outputPixelType),f=u&&e?[e[0],e[1]??e[0],e[2]??e[0]]:[1,1,1],l=u?[i[0],i[1]??i[0],i[2]??i[0]]:[1,1,1];return{bandCount:r,minOutput:t,maxOutput:s,minCutOff:n,maxCutOff:a,factor:p,useGamma:u,gamma:f,gammaCorrection:l,stretchType:this.functionArguments.stretchType,isOutputRounded:c,type:"stretch"}}};t([s({json:{write:!0,name:"rasterFunction"}})],c.prototype,"functionName",void 0),t([s({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],c.prototype,"functionArguments",void 0),t([s()],c.prototype,"rasterArgumentNames",void 0),t([s({json:{write:!0}})],c.prototype,"lookup",void 0),t([s({json:{write:!0}})],c.prototype,"cutOffs",void 0),c=t([e("esri.layers.raster.functions.StretchFunction")],c);const f=c;export{f as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Error.js";import{open as r}from"../../core/workers.js";import t from"./PixelBlock.js";class i{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const e=await r("RasterWorker");this._destroyed?e.close():this._workerThread=e}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(e,r){a(this._workerThread);const i=e.pixelBlock.getTransferableObject().pixelBlock,s=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:i,type:e.dataType},r);return s?new t(s):null}async convertPixelBlockToFeatures(e,r){a(this._workerThread);const t=await this._workerThread.invoke("convertPixelBlockToFeatures",{pixelBlock:e.pixelBlock.toJSON(),extent:e.extent.toJSON(),fieldNames:e.fieldNames,skipFactor:e.skipFactor,pixelIdOffset:e.pixelIdOffset,imageRowSize:e.imageRowSize},r),i=e.extent.spatialReference?.toJSON();return t.forEach(e=>e.geometry.spatialReference=i),t}computeStatisticsHistograms(e,r){a(this._workerThread);const{transferList:t,pixelBlock:i}=e.pixelBlock.getTransferableObject();return r?.transferPixelsToWorker&&(r={...r,transferList:t}),this._workerThread.invoke("computeStatisticsHistograms",{...e,pixelBlock:i},r)}async transformPixels(e,r){a(this._workerThread);const{transferList:i,pixelBlock:s}=e.pixelBlock.getTransferableObject();r?.transferPixelsToWorker&&(r={...r,transferList:i});const o=await this._workerThread.invoke("transformPixels",{...e,pixelBlock:s},r);return t.fromJSON(o)}async compositeBands(e,r){a(this._workerThread);const i=e.pixelBlocks.map(e=>e?.getTransferableObject()),s={pixelBlocks:i.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=i.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const o=await this._workerThread.invoke("compositeBands",s,r);return o?t.fromJSON(o):null}async decode(e,r){a(this._workerThread);const i=await this._workerThread.invoke("decode",e,{...r,transferList:[e.data]});return i?new t(i):null}async symbolize(e,r){a(this._workerThread);const i=e.pixelBlock?.getTransferableObject().pixelBlock,s={extent:e.extent?.toJSON(),pixelBlock:i,simpleStretchParams:e.simpleStretchParams,bandIds:e.bandIds},o=await this._workerThread.invoke("symbolize",s,r);return o?new t(o):null}async highlightPixels(e,r){a(this._workerThread);const t={pixelBlock:e.pixelBlock?.toJSON(),renderedPixelBlock:e.renderedPixelBlock?.toJSON(),highlightOptions:e.highlightOptions},i=await this._workerThread.invoke("highlightPixels",t,r);e.renderedPixelBlock.pixels=i.pixels,e.renderedPixelBlock.mask=i.mask,e.renderedPixelBlock.maskIsAlpha=i.maskIsAlpha}async updateSymbolizer(e,r){a(this._workerThread);const t=e?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:e.toJSON(),histograms:t},r))}async updateRasterFunction(e,r){a(this._workerThread),await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:e.toJSON()},r))}async process(e,r){a(this._workerThread);const i=await this._workerThread.invoke("process",{extent:e.extent?.toJSON(),primaryPixelSizes:e.primaryPixelSizes?.map(e=>null!=e?e.toJSON():null),primaryPixelBlocks:e.primaryPixelBlocks.map(e=>e?.getTransferableObject().pixelBlock),primaryRasterIds:e.primaryRasterIds},r);return i?new t(i):null}async stretch(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const i={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,stretchParams:e.stretchParams},s=await this._workerThread.invoke("stretch",i,r);return s?new t(s):null}async split(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const i={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,tileSize:e.tileSize,maximumPyramidLevel:e.maximumPyramidLevel,useBilinear:e.useBilinear},s=await this._workerThread.invoke("split",i,r);return s&&s.forEach((e,r)=>{s.set(r,e?t.fromJSON(e):null)}),s}async clipTile(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const i=e.pixelBlock.getTransferableObject().pixelBlock,s={...e,pixelBlock:i},o=await this._workerThread.invoke("clipTile",s,r);return o?t.fromJSON(o):null}async estimateStatisticsHistograms(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock};return await this._workerThread.invoke("estimateStatisticsHistograms",t,r)}async mosaicAndTransform(e,r){if(a(this._workerThread),!e?.srcPixelBlocks?.length)return{pixelBlock:null};const i=e.srcPixelBlocks.map(e=>e?.getTransferableObject()),s={...e,srcPixelBlocks:i.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=i.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const o=await this._workerThread.invoke("mosaicAndTransform",s,r);return{pixelBlock:o.pixelBlock?new t(o.pixelBlock):null,localNorthDirections:o.localNorthDirections}}async createFlowMesh(e,r){a(this._workerThread);const t={buffer:e.flowData.data.buffer,maskBuffer:e.flowData.mask.buffer,width:e.flowData.width,height:e.flowData.height},{meshType:i,simulationSettings:s,startInfo:o}=e,l=await this._workerThread.invoke("createFlowMesh",{meshType:i,flowData:t,simulationSettings:s,startInfo:o},{...r,transferList:[t.buffer,t.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer),pathData:new Float32Array(l.pathBuffer)}}getProjectionOffsetGrid(e,r){a(this._workerThread);const t=null!=e.datumTransformation?e.datumTransformation.steps.map(e=>({wkid:e.wkid,wkt:e.wkt,isInverse:e.isInverse})):null,i=null!=e.rasterTransform?e.rasterTransform.toJSON():null,s={projectedExtent:e.projectedExtent.toJSON(),srcBufferExtent:e.srcBufferExtent.toJSON(),pixelSize:e.pixelSize,hasWrapAround:e.hasWrapAround,spacing:e.spacing,datumTransformationSteps:t,rasterTransform:i,isAdaptive:e.isAdaptive,includeGCSGrid:e.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,r)}}function a(r){if(null==r)throw new e("raster-jobhandler:no-connection","no available worker connection")}export{i as default};
5
+ import e from"../../core/Error.js";import{open as r}from"../../core/workers.js";import t from"./PixelBlock.js";class i{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const e=await r("RasterWorker");this._destroyed?e.close():this._workerThread=e}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(e,r){a(this._workerThread);const i=e.pixelBlock.getTransferableObject().pixelBlock,s=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:i,type:e.dataType},r);return s?new t(s):null}async convertPixelBlockToFeatures(e,r){a(this._workerThread);const t=await this._workerThread.invoke("convertPixelBlockToFeatures",{pixelBlock:e.pixelBlock.toJSON(),extent:e.extent.toJSON(),fieldNames:e.fieldNames,skipFactor:e.skipFactor,pixelIdOffset:e.pixelIdOffset,imageRowSize:e.imageRowSize},r),i=e.extent.spatialReference?.toJSON();return t.forEach(e=>e.geometry.spatialReference=i),t}computeStatisticsHistograms(e,r){a(this._workerThread);const{transferList:t,pixelBlock:i}=e.pixelBlock.getTransferableObject();return r?.transferPixelsToWorker&&(r={...r,transferList:t}),this._workerThread.invoke("computeStatisticsHistograms",{...e,pixelBlock:i},r)}async transformPixels(e,r){a(this._workerThread);const{transferList:i,pixelBlock:s}=e.pixelBlock.getTransferableObject();r?.transferPixelsToWorker&&(r={...r,transferList:i});const o=await this._workerThread.invoke("transformPixels",{...e,pixelBlock:s},r);return t.fromJSON(o)}async compositeBands(e,r){a(this._workerThread);const i=e.pixelBlocks.map(e=>e?.getTransferableObject()),s={pixelBlocks:i.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=i.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const o=await this._workerThread.invoke("compositeBands",s,r);return o?t.fromJSON(o):null}async decode(e,r){a(this._workerThread);const i=await this._workerThread.invoke("decode",e,{...r,transferList:[e.data]});return i?new t(i):null}async symbolize(e,r){a(this._workerThread);const i=e.pixelBlock?.getTransferableObject().pixelBlock,s={extent:e.extent?.toJSON(),pixelBlock:i,simpleStretchParams:e.simpleStretchParams,bandIds:e.bandIds},o=await this._workerThread.invoke("symbolize",s,r);return o?new t(o):null}async highlightPixels(e,r){a(this._workerThread);const t={pixelBlock:e.pixelBlock?.toJSON(),renderedPixelBlock:e.renderedPixelBlock?.toJSON(),highlightOptions:e.highlightOptions},i=await this._workerThread.invoke("highlightPixels",t,r);e.renderedPixelBlock.pixels=i.pixels,e.renderedPixelBlock.mask=i.mask,e.renderedPixelBlock.maskIsAlpha=i.maskIsAlpha}async updateSymbolizer(e,r){a(this._workerThread);const t=e?.rendererJSON?.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:e.toJSON(),histograms:t},r))}async updateRasterFunction(e,r){a(this._workerThread),await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:e.toJSON()},r))}async process(e,r){a(this._workerThread);const i=await this._workerThread.invoke("process",{extent:e.extent?.toJSON(),primaryPixelSizes:e.primaryPixelSizes?.map(e=>null!=e?e.toJSON():null),primaryPixelBlocks:e.primaryPixelBlocks.map(e=>e?.getTransferableObject().pixelBlock),primaryRasterIds:e.primaryRasterIds,parameters:e.parameters},r);return i?new t(i):null}async stretch(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const i={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,stretchParams:e.stretchParams},s=await this._workerThread.invoke("stretch",i,r);return s?new t(s):null}async split(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const i={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock,tileSize:e.tileSize,maximumPyramidLevel:e.maximumPyramidLevel,useBilinear:e.useBilinear},s=await this._workerThread.invoke("split",i,r);return s&&s.forEach((e,r)=>{s.set(r,e?t.fromJSON(e):null)}),s}async clipTile(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const i=e.pixelBlock.getTransferableObject().pixelBlock,s={...e,pixelBlock:i},o=await this._workerThread.invoke("clipTile",s,r);return o?t.fromJSON(o):null}async estimateStatisticsHistograms(e,r){if(a(this._workerThread),!e?.pixelBlock)return null;const t={srcPixelBlock:e.pixelBlock.getTransferableObject().pixelBlock};return await this._workerThread.invoke("estimateStatisticsHistograms",t,r)}async mosaicAndTransform(e,r){if(a(this._workerThread),!e?.srcPixelBlocks?.length)return{pixelBlock:null};const i=e.srcPixelBlocks.map(e=>e?.getTransferableObject()),s={...e,srcPixelBlocks:i.map(e=>e?.pixelBlock)};if(r?.transferPixelsToWorker){const e=i.flatMap(e=>e?.transferList).filter(e=>null!=e);r={...r,transferList:e}}const o=await this._workerThread.invoke("mosaicAndTransform",s,r);return{pixelBlock:o.pixelBlock?new t(o.pixelBlock):null,localNorthDirections:o.localNorthDirections}}async createFlowMesh(e,r){a(this._workerThread);const t={buffer:e.flowData.data.buffer,maskBuffer:e.flowData.mask.buffer,width:e.flowData.width,height:e.flowData.height},{meshType:i,simulationSettings:s,startInfo:o}=e,l=await this._workerThread.invoke("createFlowMesh",{meshType:i,flowData:t,simulationSettings:s,startInfo:o},{...r,transferList:[t.buffer,t.maskBuffer]});return{vertexData:new Float32Array(l.vertexBuffer),indexData:new Uint32Array(l.indexBuffer),pathData:new Float32Array(l.pathBuffer)}}getProjectionOffsetGrid(e,r){a(this._workerThread);const t=null!=e.datumTransformation?e.datumTransformation.steps.map(e=>({wkid:e.wkid,wkt:e.wkt,isInverse:e.isInverse})):null,i=null!=e.rasterTransform?e.rasterTransform.toJSON():null,s={projectedExtent:e.projectedExtent.toJSON(),srcBufferExtent:e.srcBufferExtent.toJSON(),pixelSize:e.pixelSize,hasWrapAround:e.hasWrapAround,spacing:e.spacing,datumTransformationSteps:t,rasterTransform:i,isAdaptive:e.isAdaptive,includeGCSGrid:e.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",s,r)}}function a(r){if(null==r)throw new e("raster-jobhandler:no-connection","no available worker connection")}export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../geometry/Extent.js";import r from"../../geometry/Point.js";import t from"../../geometry/operators/support/GeographicTransformation.js";import{decode as s}from"../raster/formats/RasterCodec.js";import{transformPixels as o}from"../raster/functions/pixelTransformUtils.js";import{convertPixelBlockToFeatures as i,compositeBands as n,highlightPixels as l,split as a,clipTile as m,mosaic as c,approximateTransform as f,getLocalArithmeticNorthRotations as p}from"../raster/functions/pixelUtils.js";import{create as u}from"../raster/functions/rasterFunctionHelper.js";import{load as x,getProjectionOffsetGrid as d}from"../raster/functions/rasterProjectionHelper.js";import{computeStatisticsHistograms as S,estimateStatisticsHistograms as h}from"../raster/functions/stretchUtils.js";import{convertVectorFieldData as k,convertToLocalDirections as g}from"../raster/functions/vectorFieldUtils.js";import{readTransform as B}from"../raster/transforms/utils.js";import O from"./PixelBlock.js";import y from"../../renderers/support/RasterSymbolizer.js";import{createFlowMesh as P}from"../../views/2d/engine/flow/dataUtils.js";function N(e){if(!e)return{result:null,transferList:[]};const{pixelBlock:r,transferList:t}=e.getTransferableObject();return{result:r,transferList:t}}class J{convertVectorFieldData(e){const r=O.fromJSON(e.pixelBlock),t=N(k(r,e.type));return Promise.resolve(t)}convertPixelBlockToFeatures(r){const t=i({pixelBlock:O.fromJSON(r.pixelBlock),extent:e.fromJSON(r.extent),fieldNames:r.fieldNames,skipFactor:r.skipFactor,skipSpatialReference:!0,pixelIdOffset:r.pixelIdOffset,imageRowSize:r.imageRowSize});return Promise.resolve(t)}transformPixels(e){const r=O.fromJSON(e.pixelBlock),t=o(r,e.transformType,e.transformParameters);return Promise.resolve(N(t))}computeStatisticsHistograms(e){const r=O.fromJSON(e.pixelBlock),t=S(r,{histogramSize:e.histogramSize,includeSkewnessKurtosis:e.includeSkewnessKurtosis});return Promise.resolve(t)}compositeBands(e){const r=e.pixelBlocks.map(e=>e&&O.fromJSON(e)),t=N(n(r));return Promise.resolve(t)}async decode(e){return N(await s(e.data,e.options))}symbolize(r){const t=r.pixelBlock?O.fromJSON(r.pixelBlock):null,s=r.extent?e.fromJSON(r.extent):null,o=N(this.symbolizer.symbolize({...r,pixelBlock:t,extent:s}));return Promise.resolve(o)}highlightPixels(e){const r=O.fromJSON(e.pixelBlock),t=O.fromJSON(e.renderedPixelBlock);return l({pixelBlock:r,renderedPixelBlock:t,highlightOptions:e.highlightOptions}),Promise.resolve(t.toJSON())}async updateSymbolizer(e){this.symbolizer=y.fromJSON(e.symbolizerJSON),e.histograms&&"rasterStretch"===this.symbolizer?.rendererJSON.type&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=u(e.rasterFunctionJSON)}async process(t){return N(this.rasterFunction.process({extent:e.fromJSON(t.extent),primaryPixelBlocks:t.primaryPixelBlocks.map(e=>null!=e?O.fromJSON(e):null),primaryPixelSizes:t.primaryPixelSizes?.map(e=>null!=e?r.fromJSON(e):null),primaryRasterIds:t.primaryRasterIds}))}stretch(e){const r=N(this.symbolizer.simpleStretch(O.fromJSON(e.srcPixelBlock),e.stretchParams));return Promise.resolve(r)}estimateStatisticsHistograms(e){const r=h(O.fromJSON(e.srcPixelBlock));return Promise.resolve(r)}split(e){const r=a(O.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel??0,!1===e.useBilinear),t=[];let s;return r&&(s=new Map,r.forEach((e,r)=>{if(e){const{pixelBlock:o,transferList:i}=e.getTransferableObject();s.set(r,o),i.forEach(e=>{t.includes(e)||t.push(e)})}})),Promise.resolve({result:s,transferList:t})}clipTile(e){const r=O.fromJSON(e.pixelBlock),t=N(m({...e,pixelBlock:r}));return Promise.resolve(t)}async mosaicAndTransform(e){const r=e.srcPixelBlocks.map(e=>e?new O(e):null),t=c(r,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let s,o=t;e.coefs&&(o=f(t,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(s=p(e.destDimension,e.gcsGrid),o=g(o,e.isUV?"vector-uv":"vector-magdir",s));const{result:i,transferList:n}=N(o);return{result:{pixelBlock:i,localNorthDirections:s},transferList:n}}async createFlowMesh(e,r){const t={data:new Float32Array(e.flowData.buffer),mask:new Uint8Array(e.flowData.maskBuffer),width:e.flowData.width,height:e.flowData.height},{vertexData:s,indexData:o,pathData:i}=await P(e.meshType,e.simulationSettings,t,e.startInfo,r.signal);return{result:{vertexBuffer:s.buffer,indexBuffer:o.buffer,pathBuffer:i.buffer},transferList:[s.buffer,o.buffer]}}async getProjectionOffsetGrid(r){const s=e.fromJSON(r.projectedExtent),o=e.fromJSON(r.srcBufferExtent);let i=null;r.datumTransformationSteps?.length&&(i=new t({steps:r.datumTransformationSteps})),await x();const n=r.rasterTransform?B(r.rasterTransform):null;return d({...r,projectedExtent:s,srcBufferExtent:o,datumTransformation:i,rasterTransform:n})}}export{J as default};
5
+ import e from"../../geometry/Extent.js";import r from"../../geometry/Point.js";import t from"../../geometry/operators/support/GeographicTransformation.js";import{decode as s}from"../raster/formats/RasterCodec.js";import{transformPixels as o}from"../raster/functions/pixelTransformUtils.js";import{convertPixelBlockToFeatures as i,compositeBands as n,highlightPixels as l,split as a,clipTile as m,mosaic as c,approximateTransform as f,getLocalArithmeticNorthRotations as p}from"../raster/functions/pixelUtils.js";import{create as u}from"../raster/functions/rasterFunctionHelper.js";import{load as x,getProjectionOffsetGrid as d}from"../raster/functions/rasterProjectionHelper.js";import{computeStatisticsHistograms as S,estimateStatisticsHistograms as h}from"../raster/functions/stretchUtils.js";import{convertVectorFieldData as k,convertToLocalDirections as g}from"../raster/functions/vectorFieldUtils.js";import{readTransform as B}from"../raster/transforms/utils.js";import O from"./PixelBlock.js";import y from"../../renderers/support/RasterSymbolizer.js";import{createFlowMesh as P}from"../../views/2d/engine/flow/dataUtils.js";function N(e){if(!e)return{result:null,transferList:[]};const{pixelBlock:r,transferList:t}=e.getTransferableObject();return{result:r,transferList:t}}class J{convertVectorFieldData(e){const r=O.fromJSON(e.pixelBlock),t=N(k(r,e.type));return Promise.resolve(t)}convertPixelBlockToFeatures(r){const t=i({pixelBlock:O.fromJSON(r.pixelBlock),extent:e.fromJSON(r.extent),fieldNames:r.fieldNames,skipFactor:r.skipFactor,skipSpatialReference:!0,pixelIdOffset:r.pixelIdOffset,imageRowSize:r.imageRowSize});return Promise.resolve(t)}transformPixels(e){const r=O.fromJSON(e.pixelBlock),t=o(r,e.transformType,e.transformParameters);return Promise.resolve(N(t))}computeStatisticsHistograms(e){const r=O.fromJSON(e.pixelBlock),t=S(r,{histogramSize:e.histogramSize,includeSkewnessKurtosis:e.includeSkewnessKurtosis});return Promise.resolve(t)}compositeBands(e){const r=e.pixelBlocks.map(e=>e&&O.fromJSON(e)),t=N(n(r));return Promise.resolve(t)}async decode(e){return N(await s(e.data,e.options))}symbolize(r){const t=r.pixelBlock?O.fromJSON(r.pixelBlock):null,s=r.extent?e.fromJSON(r.extent):null,o=N(this.symbolizer.symbolize({...r,pixelBlock:t,extent:s}));return Promise.resolve(o)}highlightPixels(e){const r=O.fromJSON(e.pixelBlock),t=O.fromJSON(e.renderedPixelBlock);return l({pixelBlock:r,renderedPixelBlock:t,highlightOptions:e.highlightOptions}),Promise.resolve(t.toJSON())}async updateSymbolizer(e){this.symbolizer=y.fromJSON(e.symbolizerJSON),e.histograms&&"rasterStretch"===this.symbolizer?.rendererJSON.type&&(this.symbolizer.rendererJSON.histograms=e.histograms)}async updateRasterFunction(e){this.rasterFunction=u(e.rasterFunctionJSON)}async process(t){return N(this.rasterFunction.process({extent:e.fromJSON(t.extent),primaryPixelBlocks:t.primaryPixelBlocks.map(e=>null!=e?O.fromJSON(e):null),primaryPixelSizes:t.primaryPixelSizes?.map(e=>null!=e?r.fromJSON(e):null),primaryRasterIds:t.primaryRasterIds},t.parameters))}stretch(e){const r=N(this.symbolizer.simpleStretch(O.fromJSON(e.srcPixelBlock),e.stretchParams));return Promise.resolve(r)}estimateStatisticsHistograms(e){const r=h(O.fromJSON(e.srcPixelBlock));return Promise.resolve(r)}split(e){const r=a(O.fromJSON(e.srcPixelBlock),e.tileSize,e.maximumPyramidLevel??0,!1===e.useBilinear),t=[];let s;return r&&(s=new Map,r.forEach((e,r)=>{if(e){const{pixelBlock:o,transferList:i}=e.getTransferableObject();s.set(r,o),i.forEach(e=>{t.includes(e)||t.push(e)})}})),Promise.resolve({result:s,transferList:t})}clipTile(e){const r=O.fromJSON(e.pixelBlock),t=N(m({...e,pixelBlock:r}));return Promise.resolve(t)}async mosaicAndTransform(e){const r=e.srcPixelBlocks.map(e=>e?new O(e):null),t=c(r,e.srcMosaicSize,{blockWidths:e.blockWidths,alignmentInfo:e.alignmentInfo,clipOffset:e.clipOffset,clipSize:e.clipSize});let s,o=t;e.coefs&&(o=f(t,e.destDimension,e.coefs,e.sampleSpacing,e.interpolation)),e.projectDirections&&e.gcsGrid&&(s=p(e.destDimension,e.gcsGrid),o=g(o,e.isUV?"vector-uv":"vector-magdir",s));const{result:i,transferList:n}=N(o);return{result:{pixelBlock:i,localNorthDirections:s},transferList:n}}async createFlowMesh(e,r){const t={data:new Float32Array(e.flowData.buffer),mask:new Uint8Array(e.flowData.maskBuffer),width:e.flowData.width,height:e.flowData.height},{vertexData:s,indexData:o,pathData:i}=await P(e.meshType,e.simulationSettings,t,e.startInfo,r.signal);return{result:{vertexBuffer:s.buffer,indexBuffer:o.buffer,pathBuffer:i.buffer},transferList:[s.buffer,o.buffer]}}async getProjectionOffsetGrid(r){const s=e.fromJSON(r.projectedExtent),o=e.fromJSON(r.srcBufferExtent);let i=null;r.datumTransformationSteps?.length&&(i=new t({steps:r.datumTransformationSteps})),await x();const n=r.rasterTransform?B(r.rasterTransform):null;return d({...r,projectedExtent:s,srcBufferExtent:o,datumTransformation:i,rasterTransform:n})}}export{J as default};
@@ -25,7 +25,7 @@ export interface CircuitManagerProperties extends JSONSupportMixinProperties {
25
25
  */
26
26
  export type QueryCircuitProperties = Pick<QueryCircuitsParametersProperties, "location" | "locationType" | "returnConsumerCircuits">;
27
27
 
28
- export type ExportCircuitsProperties = Pick<ExportCircuitsParametersProperties, "circuits" | "exportAcknowledgement">;
28
+ export type ExportCircuitsProperties = Pick<ExportCircuitsParametersProperties, "circuitNames" | "exportAcknowledgement" | "resultTypes">;
29
29
 
30
30
  /**
31
31
  * A CircuitManager provides access to circuit management capabilities for a telecom domain network
@@ -553,6 +553,71 @@ export interface ResultType {
553
553
  type: "elements" | "aggregatedGeometry" | "paths" | "circuits";
554
554
  }
555
555
 
556
+ /**
557
+ * Specifies the type of results to export for circuits.
558
+ *
559
+ * @since 5.0
560
+ * @example
561
+ * const exportCircuitProps = {
562
+ * circuitNames: ["TESTCIRCUIT"],
563
+ * exportAcknowledgement: false,
564
+ * resultTypes: [
565
+ * {
566
+ * type: "features",
567
+ * includeGeometry: true,
568
+ * includeDomainDescriptions: true,
569
+ * networkAttributeNames: ["Asset group", "Asset type"],
570
+ * diagramTemplateName: "",
571
+ * resultTypeFields: [
572
+ * { networkSourceId: 20, fieldName: "FIRSTUNIT" },
573
+ * { networkSourceId: 20, fieldName: "LASTUNIT" },
574
+ * ],
575
+ * },
576
+ * ],
577
+ * };
578
+ *
579
+ * const exportResult = await circuitManager.export(exportCircuitProps);
580
+ */
581
+ export interface ExportCircuitsResultType {
582
+ /**
583
+ * The name of a predefined diagram template.
584
+ *
585
+ * @since 5.0
586
+ */
587
+ diagramTemplateName: string;
588
+ /**
589
+ * Specifies whether domain descriptions will be included in the output file
590
+ * to communicate domain mapping for features and connectivity.
591
+ *
592
+ * @since 5.0
593
+ */
594
+ includeDomainDescriptions: boolean;
595
+ /**
596
+ * Whether to include geometry values in the export.
597
+ *
598
+ * @since 5.0
599
+ */
600
+ includeGeometry: boolean;
601
+ /**
602
+ * The network attributes that will be included in the result.
603
+ *
604
+ * @since 5.0
605
+ */
606
+ networkAttributeNames: string[];
607
+ /**
608
+ * The feature class and field name values to include in the export.
609
+ *
610
+ * @since 5.0
611
+ */
612
+ resultTypeFields: Record<string, any>[];
613
+ /**
614
+ * The return type for the export.
615
+ *
616
+ * @since 5.0
617
+ */
618
+ type: "features" | "connectivity" | "associations" | "circuits";
619
+ }
620
+
556
621
  /**
557
622
  * ValidationSetItemJSON represents the set of features and objects to validate.
558
623
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.0.0-next.84",
3
+ "version": "5.0.0-next.85",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -387,12 +387,29 @@ export interface ServiceContents {
387
387
 
388
388
  /**
389
389
  * Specifies a traditional or foreign-key association to delete.
390
- * To delete a foreign-key association, `globalId` must be the null GUID `{00000000-0000-0000-0000-000000000000}`.
390
+ *
391
+ * This object can be used in three ways:
392
+ *
393
+ * 1. Specify all fields: Can delete any association, `globalId` can optionally be specified
394
+ * for traditional associations for improved performance.
395
+ * 2. Only global ID: Can only delete traditional associations with non-null global IDs.
396
+ * 3. Omit global ID: Primarily used to delete foreign-key associations.
397
+ * Can also delete traditional associations, but with reduced performance.
391
398
  *
392
399
  * @beta
393
400
  * @since 4.34
394
401
  */
395
- export interface DeleteAssociationEdit {
402
+ export type DeleteAssociationEdit = DeleteAssociationEditAllFields | DeleteAssociationEditOnlyGlobalId | DeleteAssociationEditOmitGlobalId;
403
+
404
+ /**
405
+ * Specifies a traditional or foreign-key association to delete.
406
+ * To delete a foreign-key association, `globalId` must be the null GUID `{00000000-0000-0000-0000-000000000000}`.
407
+ * When deleting a traditional association, `globalId` is optional, but improves performance when specified.
408
+ *
409
+ * @beta
410
+ * @since 5.0
411
+ */
412
+ export interface DeleteAssociationEditAllFields {
396
413
  /**
397
414
  * The type of association.
398
415
  *
@@ -443,6 +460,24 @@ export interface DeleteAssociationEdit {
443
460
  toTerminalId: number;
444
461
  }
445
462
 
463
+ /**
464
+ * Specifies a traditional association to delete by the association's global ID.
465
+ *
466
+ * @beta
467
+ * @since 5.0
468
+ */
469
+ export type DeleteAssociationEditOnlyGlobalId = Pick<DeleteAssociationEditAllFields, "globalId">;
470
+
471
+ /**
472
+ * Specifies a foreign-key association to delete.
473
+ * Can also be used to delete a traditional association, but is less efficient than specifying
474
+ * the traditional association's global ID.
475
+ *
476
+ * @beta
477
+ * @since 5.0
478
+ */
479
+ export type DeleteAssociationEditOmitGlobalId = Omit<DeleteAssociationEditAllFields, "globalId">;
480
+
446
481
  /**
447
482
  * Specifies grouped objects to combine in a telecom domain network.
448
483
  *
@@ -499,9 +534,11 @@ export interface ServiceEdits extends Edits {
499
534
  */
500
535
  combineGroupedObjects?: CombineGroupedObjectsEdit[];
501
536
  /**
502
- * An array of objects specifying
503
- * traditional or foreign-key associations to delete. To delete associations with `deleteAssociations`, all "from" and "to" properties must
504
- * be specified in the [DeleteAssociationEdit](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-types.html#DeleteAssociationEdit) object.
537
+ * An array of objects specifying traditional or foreign-key associations to delete.
538
+ *
539
+ * Each object can be type [DeleteAssociationEditAllFields](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-types.html#DeleteAssociationEditAllFields),
540
+ * [DeleteAssociationEditOnlyGlobalId](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-types.html#DeleteAssociationEditOnlyGlobalId), or [DeleteAssociationEditOmitGlobalId](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-featureService-types.html#DeleteAssociationEditOmitGlobalId),
541
+ * depending on the association to delete.
505
542
  *
506
543
  * @since 5.0
507
544
  */
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../request.js";import{parseUrl as r,encode as o,asValidOptions as i}from"../../utils.js";import s from"./support/ExportCircuitsResult.js";async function c(c,u,p){const e=r(c),m=u.toJSON();u.circuits&&(m.circuits=JSON.stringify(u.circuits));const n={...m,f:"json"},a=o({...e.query,...n}),f=i(a,{...p,method:"post",authMode:"no-prompt"}),j=`${e.path}/circuits/export`,{data:d}=await t(j,f);return s.fromJSON(d)}export{c as exportCircuits};
5
+ import t from"../../../request.js";import{parseUrl as o,encode as r,asValidOptions as s}from"../../utils.js";import p from"./support/ExportCircuitsResult.js";async function i(i,u,e){const m=o(i),a={...u.toJSON(),f:"json"},n=r({...m.query,...a}),c=s(n,{...e,method:"post",authMode:"no-prompt"}),f=`${m.path}/circuits/export`,{data:j}=await t(f,c);return p.fromJSON(j)}export{i as exportCircuits};
@@ -1,7 +1,8 @@
1
1
  import type { JSONSupport, JSONSupportMixinProperties } from "../../../../core/JSONSupport.js";
2
+ import type { ExportCircuitsResultType } from "../../../../networks/support/jsonTypes.js";
2
3
 
3
4
  /** @since 5.0 */
4
- export interface ExportCircuitsParametersProperties extends JSONSupportMixinProperties, Partial<Pick<ExportCircuitsParameters, "circuits" | "exportAcknowledgement">> {}
5
+ export interface ExportCircuitsParametersProperties extends JSONSupportMixinProperties, Partial<Pick<ExportCircuitsParameters, "circuitNames" | "exportAcknowledgement" | "resultTypes">> {}
5
6
 
6
7
  /** @since 5.0 */
7
8
  export default abstract class ExportCircuitsParameters extends JSONSupport {
@@ -10,7 +11,7 @@ export default abstract class ExportCircuitsParameters extends JSONSupport {
10
11
  *
11
12
  * @since 5.0
12
13
  */
13
- accessor circuits: string[];
14
+ accessor circuitNames: string[];
14
15
  /**
15
16
  * Specifies whether the export is acknowledged.
16
17
  * If true, the default version is required for the utility network's `gdbVersion`.
@@ -19,4 +20,11 @@ export default abstract class ExportCircuitsParameters extends JSONSupport {
19
20
  * @since 5.0
20
21
  */
21
22
  accessor exportAcknowledgement: boolean;
23
+ /**
24
+ * The types of results to return.
25
+ * If unspecified, the default is `features`.
26
+ *
27
+ * @since 5.0
28
+ */
29
+ accessor resultTypes: ExportCircuitsResultType[] | null | undefined;
22
30
  }
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../../../core/JSONSupport.js";import{property as o,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{ensureClass as i}from"../../../../core/accessorSupport/ensureType.js";import s from"../../../../geometry/SpatialReference.js";import{writer as p}from"../../../../core/accessorSupport/decorators/writer.js";var n;let l=n=class extends e{static from(t){return i(n,t)}constructor(t){super(t),this.circuits=null,this.exportAcknowledgement=!1,this.moment=null,this.outSpatialReference=null,this.domainNetworkName=null,this.gdbVersion=null,this.sessionId=null}writeOutSR(t,e,o){if(null!=t){const{wkid:r,latestWkid:i,wkt:s,wkt2:p}=t;e[o]=JSON.stringify({wkid:r??void 0,latestWkid:i??void 0,wkt:s??void 0,wkt2:p??void 0})}}};t([o({json:{type:[String],write:!0}})],l.prototype,"circuits",void 0),t([o({json:{type:Boolean,write:!0}})],l.prototype,"exportAcknowledgement",void 0),t([o({type:Date,json:{type:Number,write:{writer:(t,e)=>{e.moment=t?t.getTime():null}}}})],l.prototype,"moment",void 0),t([o({type:s,json:{write:{allowNull:!0,target:"outSR"}}})],l.prototype,"outSpatialReference",void 0),t([p("outSpatialReference")],l.prototype,"writeOutSR",null),t([o({type:String,json:{write:!0}})],l.prototype,"domainNetworkName",void 0),t([o({type:String,json:{write:!0}})],l.prototype,"gdbVersion",void 0),t([o({type:String,json:{write:!0}})],l.prototype,"sessionId",void 0),l=n=t([r("esri.rest.networks.circuits.support.ExportCircuitsParameters")],l);const c=l;export{c as default};
5
+ import{__decorate as t}from"tslib";import{JSONSupport as e}from"../../../../core/JSONSupport.js";import{property as r,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{ensureClass as i}from"../../../../core/accessorSupport/ensureType.js";import s from"../../../../geometry/SpatialReference.js";import{writer as p}from"../../../../core/accessorSupport/decorators/writer.js";var n;let l=n=class extends e{static from(t){return i(n,t)}constructor(t){super(t),this.circuitNames=null,this.resultTypes=null,this.exportAcknowledgement=!1,this.moment=null,this.outSpatialReference=null,this.domainNetworkName=null,this.gdbVersion=null,this.sessionId=null}writeOutSR(t,e,r){if(null!=t){const{wkid:o,latestWkid:i,wkt:s,wkt2:p}=t;e[r]=JSON.stringify({wkid:o??void 0,latestWkid:i??void 0,wkt:s??void 0,wkt2:p??void 0})}}};t([r({json:{type:[String],write:{writer:(t,e)=>e.circuits=JSON.stringify(t??[])},read:{source:"circuits"}}})],l.prototype,"circuitNames",void 0),t([r({json:{type:[Object],write:{writer:(t,e)=>e.resultTypes=JSON.stringify(t??[])}}})],l.prototype,"resultTypes",void 0),t([r({json:{type:Boolean,write:!0}})],l.prototype,"exportAcknowledgement",void 0),t([r({type:Date,json:{type:Number,write:{writer:(t,e)=>{e.moment=t?t.getTime():null}}}})],l.prototype,"moment",void 0),t([r({type:s,json:{write:{allowNull:!0,target:"outSR"}}})],l.prototype,"outSpatialReference",void 0),t([p("outSpatialReference")],l.prototype,"writeOutSR",null),t([r({type:String,json:{write:!0}})],l.prototype,"domainNetworkName",void 0),t([r({type:String,json:{write:!0}})],l.prototype,"gdbVersion",void 0),t([r({type:String,json:{write:!0}})],l.prototype,"sessionId",void 0),l=n=t([o("esri.rest.networks.circuits.support.ExportCircuitsParameters")],l);const u=l;export{u as default};
@@ -9,7 +9,7 @@ import type { StatisticDefinitionProperties } from "./StatisticDefinition.js";
9
9
  import type { PointProperties } from "../../geometry/Point.js";
10
10
  import type { QuantizationParametersProperties } from "./QuantizationParameters.js";
11
11
 
12
- export interface QueryProperties extends JSONSupportMixinProperties, QueryMixinProperties, Partial<Pick<Query, "aggregateIds" | "datumTransformation" | "gdbVersion" | "geometryPrecision" | "groupByFieldsForStatistics" | "having" | "maxAllowableOffset" | "maxRecordCountFactor" | "multipatchOption" | "num" | "objectIds" | "orderByFields" | "outFields" | "parameterValues" | "rangeValues" | "relationParameter" | "returnCentroid" | "returnDistinctValues" | "returnExceededLimitFeatures" | "returnGeometry" | "returnM" | "returnQueryGeometry" | "returnZ" | "sqlFormat" | "start" | "text">> {
12
+ export interface QueryProperties extends JSONSupportMixinProperties, QueryMixinProperties, Partial<Pick<Query, "aggregateIds" | "datumTransformation" | "gdbVersion" | "geometryPrecision" | "groupByFieldsForStatistics" | "having" | "maxAllowableOffset" | "maxRecordCountFactor" | "multipatchOption" | "num" | "objectIds" | "orderByFields" | "outFields" | "parameterValues" | "rangeValues" | "relationParameter" | "returnCentroid" | "returnDistinctValues" | "returnExceededLimitFeatures" | "returnGeometry" | "returnM" | "returnQueryGeometry" | "returnTrueCurves" | "returnZ" | "sqlFormat" | "start" | "text">> {
13
13
  /**
14
14
  * The historic moment to query. This parameter applies only if the `supportsQueryWithHistoricMoment`
15
15
  * capability of the service being queried is `true`. This setting is provided in the layer resource.
@@ -701,6 +701,17 @@ export default class Query extends QuerySuperclass {
701
701
  * @default false
702
702
  */
703
703
  accessor returnQueryGeometry: boolean;
704
+ /**
705
+ * When `true` output geometry will include curves. If `false`, curves (if any) will be converted to
706
+ * densified polylines or polygons. The implied default is `false`.
707
+ *
708
+ * This option only applies when [returnGeometry](#returnGeometry) is set to `true` and the output geometry is
709
+ * non-quantized polylines or polygons.
710
+ *
711
+ * @since 5.0
712
+ * @see [ArcGIS REST API | Query Feature Service/Layer | returnTrueCurves](https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/#:~:text=returntruecurves)
713
+ */
714
+ accessor returnTrueCurves: boolean | null | undefined;
704
715
  /**
705
716
  * If `true`, and [returnGeometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-Query.html#returnGeometry) is `true`, then z-values are included in the geometry.
706
717
  *