@arcgis/core 4.24.0-next.20220430 → 4.24.0-next.20220503

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 (998) hide show
  1. package/Basemap.js +1 -1
  2. package/Color.js +1 -1
  3. package/Ground.js +1 -1
  4. package/Map.js +1 -1
  5. package/PopupTemplate.js +1 -1
  6. package/WebMap.js +1 -1
  7. package/WebScene.js +1 -1
  8. package/analysis/LinearDimension.js +1 -1
  9. package/analysis/SliceAnalysis.js +1 -1
  10. package/applications/SceneViewer/sceneViewerUtils.js +1 -1
  11. package/arcade/Dictionary.js +1 -1
  12. package/arcade/Feature.js +1 -1
  13. package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
  14. package/arcade/featureset/support/FeatureSet.js +1 -1
  15. package/assets/esri/core/workers/RemoteClient.js +1 -1
  16. package/assets/esri/core/workers/chunks/{e06461703e6f1acfcfdc.js → 076d1b1101b59af0d389.js} +1 -1
  17. package/assets/esri/core/workers/chunks/0b72d123386dc4ec7538.js +1 -0
  18. package/assets/esri/core/workers/chunks/0d53e575f11198867619.js +1 -0
  19. package/assets/esri/core/workers/chunks/0e6e3cf07c84d9f040c0.js +1 -0
  20. package/assets/esri/core/workers/chunks/105728404ddd9e73d5c9.js +1 -0
  21. package/assets/esri/core/workers/chunks/11106873b009b98e4286.js +1 -0
  22. package/assets/esri/core/workers/chunks/11a7b156591d1feca952.js +1 -0
  23. package/assets/esri/core/workers/chunks/{94325f920a125610e1f5.js → 12feeace7215248be23f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/17be5bd0d1c233d73d7a.js +1 -0
  25. package/assets/esri/core/workers/chunks/1b53bd65407ba5c479d7.js +1 -0
  26. package/assets/esri/core/workers/chunks/1d91aa745b49b2ab36cf.js +1 -0
  27. package/assets/esri/core/workers/chunks/{fd35b69872ac9393924f.js → 1db8bfb1731be3ae320c.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{3433361f09c84b31aec4.js → 2290bd6dc2e6bb136e14.js} +1 -1
  29. package/assets/esri/core/workers/chunks/24217129d492e170f0f0.js +1 -0
  30. package/assets/esri/core/workers/chunks/24e194107e0e5090125b.js +1 -0
  31. package/assets/esri/core/workers/chunks/2a1301a1d0cd4c0c17cf.js +1 -0
  32. package/assets/esri/core/workers/chunks/{178831b0d0bdabcc45e7.js → 2a676221ca1fc8e0cf34.js} +1 -1
  33. package/assets/esri/core/workers/chunks/2aede0d1dcac8592436b.js +1 -0
  34. package/assets/esri/core/workers/chunks/2b93ad626f5e75b97692.js +1 -0
  35. package/assets/esri/core/workers/chunks/2d03210fc6b5884c6bf9.js +1 -0
  36. package/assets/esri/core/workers/chunks/{b10c333abe4f4e52841c.js → 2dfd3def105005fc72c7.js} +1 -1
  37. package/assets/esri/core/workers/chunks/2f8ff35b8ab15c0e39c2.js +1 -0
  38. package/assets/esri/core/workers/chunks/36272141b3c33cb19026.js +1 -0
  39. package/assets/esri/core/workers/chunks/36c8e8de9c3f67d32572.js +1 -0
  40. package/assets/esri/core/workers/chunks/3ab8c6ae2f2713f637b0.js +1 -0
  41. package/assets/esri/core/workers/chunks/3c058381adcfdc407aa1.js +1 -0
  42. package/assets/esri/core/workers/chunks/3f39df1dfc0a685e5f9d.js +1 -0
  43. package/assets/esri/core/workers/chunks/3fd52a03b3126556aee6.js +1 -0
  44. package/assets/esri/core/workers/chunks/4082d8573f41f952c72e.js +1 -0
  45. package/assets/esri/core/workers/chunks/40b11eea270f6688ff9c.js +1 -0
  46. package/assets/esri/core/workers/chunks/4281b4b27f4767cdd3ae.js +1 -0
  47. package/assets/esri/core/workers/chunks/43fcaaeb6fd179e9199b.js +1 -0
  48. package/assets/esri/core/workers/chunks/4c65b27d80b23c0c3101.js +1 -0
  49. package/assets/esri/core/workers/chunks/{a6406a248b7b2ed65f35.js → 4ec7d59b0c814dbaa7a4.js} +1 -1
  50. package/assets/esri/core/workers/chunks/4f378ad6f4299183df85.js +1 -0
  51. package/assets/esri/core/workers/chunks/505b0aa5ee3e5a26c351.js +1 -0
  52. package/assets/esri/core/workers/chunks/509a9cdd0228a730bcea.js +1 -0
  53. package/assets/esri/core/workers/chunks/52255ad573cec0a34720.js +1 -0
  54. package/assets/esri/core/workers/chunks/52d4fdc451a58a858af1.js +1 -0
  55. package/assets/esri/core/workers/chunks/5405f478af3563580926.js +1 -0
  56. package/assets/esri/core/workers/chunks/54577c2522ca3ff08f7e.js +1 -0
  57. package/assets/esri/core/workers/chunks/54d67e450da6ce2641b4.js +1 -0
  58. package/assets/esri/core/workers/chunks/56d3cb0ae0069a8eadde.js +1 -0
  59. package/assets/esri/core/workers/chunks/5b4efe0014162f777534.js +1 -0
  60. package/assets/esri/core/workers/chunks/5baa162351551817838b.js +1 -0
  61. package/assets/esri/core/workers/chunks/5cf2064bfd9d0847d9ec.js +1 -0
  62. package/assets/esri/core/workers/chunks/620dc3c13c345d5aa9f6.js +1 -0
  63. package/assets/esri/core/workers/chunks/7c290763920f52a1f504.js +1 -0
  64. package/assets/esri/core/workers/chunks/7dc266be958e34e81007.js +972 -0
  65. package/assets/esri/core/workers/chunks/7dfd70f4fa1096e56641.js +1 -0
  66. package/assets/esri/core/workers/chunks/7f097de06972a68cd08a.js +1 -0
  67. package/assets/esri/core/workers/chunks/8033531b0cc706b40d86.js +1 -0
  68. package/assets/esri/core/workers/chunks/814234844a056d9f1ddc.js +1 -0
  69. package/assets/esri/core/workers/chunks/83700cdd60ceecc639cd.js +1 -0
  70. package/assets/esri/core/workers/chunks/857df84cea67079a91e5.js +1 -0
  71. package/assets/esri/core/workers/chunks/8793070d288878d6f49b.js +1 -0
  72. package/assets/esri/core/workers/chunks/8865c5cc28df60364e60.js +1 -0
  73. package/assets/esri/core/workers/chunks/{e9f786d4ba3143ed9644.js → 8cc85d1d46dda16ad041.js} +1 -1
  74. package/assets/esri/core/workers/chunks/958a7ef2cbf048819988.js +1 -0
  75. package/assets/esri/core/workers/chunks/967af0aa4dc4da032fdc.js +1 -0
  76. package/assets/esri/core/workers/chunks/9722880bd7f455b2bd07.js +1 -0
  77. package/assets/esri/core/workers/chunks/9d738aab0d907cd09a9d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{86b31ae136f931d7884a.js → 9e6df034d7949880471f.js} +1 -1
  79. package/assets/esri/core/workers/chunks/a056a79f31cddb066f15.js +1 -0
  80. package/assets/esri/core/workers/chunks/a2c9fd78d42df7314a3e.js +1 -0
  81. package/assets/esri/core/workers/chunks/a4dcb50f6622cb1444c8.js +1 -0
  82. package/assets/esri/core/workers/chunks/a6bfbe449b8c2fa5334c.js +1 -0
  83. package/assets/esri/core/workers/chunks/a8ed1a938dc164b401d9.js +1 -0
  84. package/assets/esri/core/workers/chunks/a9a73bc4875a5aeaf1b9.js +1 -0
  85. package/assets/esri/core/workers/chunks/ac0df52b2f2a4874e4ea.js +1 -0
  86. package/assets/esri/core/workers/chunks/{431efa172901ab8e4d53.js → acfa8eb19225f7862b1d.js} +1 -1
  87. package/assets/esri/core/workers/chunks/adae54f116f311d72d97.js +1 -0
  88. package/assets/esri/core/workers/chunks/{718073d13d3de67b629b.js → aeeb364b7c1876f6e7db.js} +1 -1
  89. package/assets/esri/core/workers/chunks/afddfe620e6539991e6b.js +1 -0
  90. package/assets/esri/core/workers/chunks/b02a83845d3da4caee9d.js +1 -0
  91. package/assets/esri/core/workers/chunks/{0d21506b7d4f9afdbb09.js → b3847a6bbd45d813f03c.js} +1 -1
  92. package/assets/esri/core/workers/chunks/b4c23630d6c85f7b59c0.js +1 -0
  93. package/assets/esri/core/workers/chunks/{c318b229911b60fc3cbf.js → b50ae3dc7e43ff452568.js} +1 -1
  94. package/assets/esri/core/workers/chunks/b5ede4df4620097c6528.js +1 -0
  95. package/assets/esri/core/workers/chunks/b7d7ad127f8939cbdec2.js +1 -0
  96. package/assets/esri/core/workers/chunks/bf1d1c02d12b526b0750.js +1 -0
  97. package/assets/esri/core/workers/chunks/c0e6dbecdbd30066a82c.js +1 -0
  98. package/assets/esri/core/workers/chunks/c2a36243eb105d570bff.js +1 -0
  99. package/assets/esri/core/workers/chunks/c8a3a28809542396c6fd.js +1 -0
  100. package/assets/esri/core/workers/chunks/cf1047ad176a25dcd2d6.js +1 -0
  101. package/assets/esri/core/workers/chunks/d03de043d43691665a93.js +1 -0
  102. package/assets/esri/core/workers/chunks/d3fecbaca51ef8844026.js +1 -0
  103. package/assets/esri/core/workers/chunks/dafe120243db6648a4ab.js +1 -0
  104. package/assets/esri/core/workers/chunks/dccc33d87cb7d902f5c7.js +1 -0
  105. package/assets/esri/core/workers/chunks/dd43f5647900ee27af22.js +1 -0
  106. package/assets/esri/core/workers/chunks/{52489e2f7748dc610263.js → dfdd853dd6c023089963.js} +1 -1
  107. package/assets/esri/core/workers/chunks/e6f76f62cf58fb1e67c6.js +1 -0
  108. package/assets/esri/core/workers/chunks/ea73a1d9cad5e1a5d861.js +1 -0
  109. package/assets/esri/core/workers/chunks/{4130ea1f5a9f197168d7.js → ed4519ac9533a4d340f1.js} +1 -1
  110. package/assets/esri/core/workers/chunks/f0e462f5a16852f33225.js +1 -0
  111. package/assets/esri/core/workers/chunks/f13c29bcc71aed8f3a2e.js +1 -0
  112. package/assets/esri/core/workers/chunks/f356e505c36397fda3cf.js +1 -0
  113. package/assets/esri/core/workers/chunks/f55cbaf5a1d6ee6ac171.js +1 -0
  114. package/assets/esri/core/workers/chunks/f6e613ae6812a347a26c.js +1 -0
  115. package/assets/esri/core/workers/chunks/fb3279408bd5323ec612.js +1 -0
  116. package/assets/esri/core/workers/chunks/fdf80a371b7b2a45f1ff.js +1 -0
  117. package/assets/esri/libs/vxl/vxlLayer.wasm +0 -0
  118. package/chunks/ChapmanAtmosphere.glsl.js +15 -15
  119. package/chunks/CheckerBoard.glsl.js +3 -3
  120. package/chunks/Clouds.glsl.js +2 -3
  121. package/chunks/CloudsComposition.glsl.js +3 -3
  122. package/chunks/ColorMaterial.glsl.js +11 -11
  123. package/chunks/DefaultMaterial.glsl.js +26 -26
  124. package/chunks/EdgeShader.glsl.js +3 -3
  125. package/chunks/Fog.glsl.js +6 -6
  126. package/chunks/HUDMaterial.glsl.js +48 -48
  127. package/chunks/HeatmapDensity.glsl.js +7 -7
  128. package/chunks/HighlightApply.glsl.js +3 -3
  129. package/chunks/LineCallout.glsl.js +3 -3
  130. package/chunks/LineMarker.glsl.js +22 -22
  131. package/chunks/MeasurementArrow.glsl.js +4 -4
  132. package/chunks/NativeLine.glsl.js +11 -11
  133. package/chunks/Path.glsl.js +16 -16
  134. package/chunks/Pattern.glsl.js +30 -30
  135. package/chunks/RasterColorizer.glsl.js +4 -4
  136. package/chunks/RealisticTree.glsl.js +20 -20
  137. package/chunks/RibbonLine.glsl.js +39 -39
  138. package/chunks/ShadedColorMaterial.glsl.js +10 -10
  139. package/chunks/ShadowCastVisualize.glsl.js +5 -5
  140. package/chunks/ShadowHighlight.glsl.js +2 -2
  141. package/chunks/SlicePlaneMaterial.glsl.js +3 -3
  142. package/chunks/Stars.glsl.js +2 -2
  143. package/chunks/WaterSurface.glsl.js +20 -20
  144. package/chunks/languageUtils.js +1 -1
  145. package/chunks/persistableUrlUtils.js +1 -1
  146. package/chunks/vec22.js +1 -1
  147. package/chunks/vec2f64.js +1 -1
  148. package/chunks/vec3.js +1 -1
  149. package/chunks/vec33.js +1 -1
  150. package/chunks/vec43.js +1 -1
  151. package/colorUtils.js +1 -1
  152. package/config.js +1 -1
  153. package/core/Accessor.js +1 -1
  154. package/core/AsyncUpdate.js +1 -1
  155. package/core/Clonable.js +1 -1
  156. package/core/Collection.js +1 -1
  157. package/core/HandleOwner.js +1 -1
  158. package/core/Loadable.js +1 -1
  159. package/core/NestedMap.js +1 -1
  160. package/core/accessorSupport/DefaultsStore.js +1 -1
  161. package/core/accessorSupport/Properties.js +1 -1
  162. package/core/accessorSupport/decorators/enumeration.js +1 -1
  163. package/core/accessorSupport/extensions/serializableProperty/reader.js +1 -1
  164. package/core/accessorSupport/extensions/serializableProperty/writePolicyUtils.js +1 -1
  165. package/core/accessorSupport/extensions/serializableProperty/writer.js +1 -1
  166. package/core/accessorSupport/read.js +1 -1
  167. package/core/accessorSupport/tracking.js +1 -1
  168. package/core/accessorSupport/write.js +1 -1
  169. package/core/devEnvironmentUtils.js +1 -1
  170. package/core/has.js +1 -1
  171. package/core/libs/gl-matrix-2/factories/vec2f64.js +1 -1
  172. package/core/libs/gl-matrix-2/math/vec3.js +1 -1
  173. package/core/libs/rbush/PooledRBush.js +1 -1
  174. package/core/promiseUtils.js +1 -1
  175. package/core/reactiveUtils.js +1 -1
  176. package/core/scheduling.js +1 -1
  177. package/core/throttle.js +1 -1
  178. package/core/urlUtils.js +1 -1
  179. package/core/watchUtils.js +1 -1
  180. package/core/workers/RemoteClient.js +1 -1
  181. package/core/workers/WorkerOwner.js +1 -1
  182. package/core/workers/loaderConfig.js +1 -1
  183. package/core/workers/workerFactory.js +1 -1
  184. package/geometry/Mesh.js +1 -1
  185. package/geometry/geometryEngine.js +1 -1
  186. package/geometry/geometryEngineAsync.js +1 -1
  187. package/geometry/projection.js +1 -1
  188. package/geometry/support/axisAngleDegrees.js +1 -1
  189. package/geometry/support/meshUtils/centerAt.js +1 -1
  190. package/geometry/support/meshUtils/deduplicate.js +1 -1
  191. package/geometry/support/meshUtils/elevation.js +1 -1
  192. package/geometry/support/meshUtils/geographicUtils.js +1 -1
  193. package/geometry/support/meshUtils/georeference.js +1 -1
  194. package/geometry/support/meshUtils/loadExternal.js +1 -1
  195. package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
  196. package/geometry/support/meshUtils/offset.js +1 -1
  197. package/geometry/support/meshUtils/rotate.js +1 -1
  198. package/geometry/support/meshUtils/scale.js +1 -1
  199. package/geometry/support/normalizeUtils.js +1 -1
  200. package/geometry/support/normalizeUtilsCommon.js +1 -1
  201. package/geometry/support/offset.js +1 -1
  202. package/geometry/support/rotate.js +1 -1
  203. package/identity/IdentityManagerBase.js +1 -1
  204. package/identity/IdentityModal.js +1 -1
  205. package/interfaces.d.ts +109 -2
  206. package/intl/locale.js +1 -1
  207. package/intl/messages.js +1 -1
  208. package/kernel.js +1 -1
  209. package/layers/AnalysisLayer.js +1 -1
  210. package/layers/CSVLayer.js +1 -1
  211. package/layers/FeatureLayer.js +1 -1
  212. package/layers/GeoJSONLayer.js +1 -1
  213. package/layers/GeoRSSLayer.js +1 -1
  214. package/layers/ImageryLayer.js +1 -1
  215. package/layers/ImageryTileLayer.js +1 -1
  216. package/layers/Layer.js +1 -1
  217. package/layers/MapImageLayer.js +1 -1
  218. package/layers/MapNotesLayer.js +1 -1
  219. package/layers/OGCFeatureLayer.js +1 -1
  220. package/layers/RouteLayer.js +1 -1
  221. package/layers/SceneLayer.js +1 -1
  222. package/layers/StreamLayer.js +1 -1
  223. package/layers/SubtypeGroupLayer.js +1 -1
  224. package/layers/TileLayer.js +1 -1
  225. package/layers/VectorTileLayer.js +1 -1
  226. package/layers/VoxelLayer.js +1 -1
  227. package/layers/VoxelWasmPerScene.js +1 -1
  228. package/layers/WCSLayer.js +1 -1
  229. package/layers/WFSLayer.js +1 -1
  230. package/layers/WMSLayer.js +1 -1
  231. package/layers/WMTSLayer.js +1 -1
  232. package/layers/buildingSublayers/BuildingComponentSublayer.js +1 -1
  233. package/layers/effects/EffectView.js +1 -1
  234. package/layers/effects/FeatureEffectView.js +1 -1
  235. package/layers/effects/jsonUtils.js +1 -1
  236. package/layers/graphics/OptimizedGeometry.js +1 -1
  237. package/layers/graphics/centroid.js +1 -1
  238. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  239. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  240. package/layers/graphics/data/QueryEngineResult.js +1 -1
  241. package/layers/graphics/data/StreamFeatureManager.js +1 -1
  242. package/layers/graphics/editingSupport.js +1 -1
  243. package/layers/graphics/objectIdUtils.js +1 -1
  244. package/layers/graphics/sources/CSVSource.js +1 -1
  245. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  246. package/layers/graphics/sources/GeoJSONSource.js +1 -1
  247. package/layers/graphics/sources/MemorySource.js +1 -1
  248. package/layers/graphics/sources/OGCFeatureSource.js +1 -1
  249. package/layers/graphics/sources/WFSSource.js +1 -1
  250. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  251. package/layers/graphics/sources/connections/WebSocketConnection.js +1 -1
  252. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  253. package/layers/graphics/sources/geojson/geojson.js +1 -1
  254. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  255. package/layers/graphics/sources/support/QueryTask.js +1 -1
  256. package/layers/mixins/APIKeyMixin.js +1 -1
  257. package/layers/mixins/ArcGISImageService.js +1 -1
  258. package/layers/mixins/ArcGISMapService.js +1 -1
  259. package/layers/mixins/ImageryTileMixin.js +1 -1
  260. package/layers/mixins/OperationalLayer.js +1 -1
  261. package/layers/mixins/PortalLayer.js +1 -1
  262. package/layers/mixins/SceneService.js +1 -1
  263. package/layers/mixins/refresh.js +1 -1
  264. package/layers/ogc/dateUtils.js +1 -1
  265. package/layers/ogc/ogcFeatureUtils.js +1 -1
  266. package/layers/ogc/wfsUtils.js +1 -1
  267. package/layers/save/featureLayerUtils.js +1 -1
  268. package/layers/support/ExportImageParameters.js +1 -1
  269. package/layers/support/ExportImageServiceParameters.js +1 -1
  270. package/layers/support/ExportWMSImageParameters.js +1 -1
  271. package/layers/support/FeatureEffect.js +1 -1
  272. package/layers/support/FeatureType.js +1 -1
  273. package/layers/support/FetchAssociatedFeatureLayer.js +1 -1
  274. package/layers/support/LabelClass.js +1 -1
  275. package/layers/support/LayerContingentValuesCache.js +1 -1
  276. package/layers/support/RasterFunction.js +1 -1
  277. package/layers/support/RasterInfo.js +1 -1
  278. package/layers/support/RasterJobHandler.js +1 -1
  279. package/layers/support/RasterWorker.js +1 -1
  280. package/layers/support/Sublayer.js +1 -1
  281. package/layers/support/SubtypeSublayer.js +1 -1
  282. package/layers/support/TilemapCache.js +1 -1
  283. package/layers/support/TimeReference.d.ts +4 -0
  284. package/layers/support/WMTSSublayer.js +1 -1
  285. package/layers/support/arcgisLayers.js +1 -1
  286. package/layers/support/commonProperties.js +1 -1
  287. package/layers/support/editableLayers.js +1 -1
  288. package/layers/support/fieldUtils.js +1 -1
  289. package/layers/support/floorFilterUtils.js +1 -1
  290. package/layers/support/imageryRendererUtils.js +1 -1
  291. package/layers/support/layerUtils.js +1 -1
  292. package/layers/support/layersCreator.js +1 -1
  293. package/layers/support/rasterDatasets/BaseRaster.js +1 -1
  294. package/layers/support/rasterDatasets/CloudRaster.js +1 -1
  295. package/layers/support/rasterDatasets/ImageAuxRaster.js +1 -1
  296. package/layers/support/rasterDatasets/ImageServerRaster.js +1 -1
  297. package/layers/support/rasterDatasets/InMemoryRaster.js +1 -1
  298. package/layers/support/rasterDatasets/MRFRaster.js +1 -1
  299. package/layers/support/rasterDatasets/TIFFRaster.js +1 -1
  300. package/layers/support/rasterDatasets/WCSRaster.js +1 -1
  301. package/layers/support/rasterDatasets/multipartParser.js +1 -1
  302. package/layers/support/rasterDatasets/pamParser.js +1 -1
  303. package/layers/support/rasterDatasets/wcsCapabilitiesParser.js +1 -1
  304. package/layers/support/rasterDatasets/wcsCoverageParser.js +1 -1
  305. package/layers/support/rasterDatasets/xmlUtilities.js +1 -1
  306. package/layers/support/rasterFormats/Lerc.js +1 -1
  307. package/layers/support/rasterFormats/RasterCodec.js +1 -1
  308. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  309. package/layers/support/rasterFunctions/pixelUtils.js +1 -1
  310. package/layers/support/rasterFunctions/rasterProjectionHelper.js +1 -1
  311. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  312. package/layers/support/rasterFunctions/vectorFieldUtils.js +1 -1
  313. package/layers/support/rasterTransforms/PolynomialTransform.js +1 -1
  314. package/layers/support/rasterTransforms/utils.js +1 -1
  315. package/layers/support/source/DataLayerSource.js +1 -1
  316. package/layers/support/source/QueryTableDataSource.js +1 -1
  317. package/layers/support/vectorTileLayerLoader.js +1 -1
  318. package/layers/support/wmsUtils.js +1 -1
  319. package/layers/support/wmtsUtils.js +1 -1
  320. package/libs/maquette-advanced-projector/projector.js +1 -1
  321. package/networks/Network.js +1 -1
  322. package/networks/UtilityNetwork.js +1 -1
  323. package/networks/support/utils.js +1 -1
  324. package/package.json +1 -1
  325. package/popup/content/ExpressionContent.js +1 -1
  326. package/portal/Portal.js +1 -1
  327. package/portal/PortalItem.js +1 -1
  328. package/portal/support/geometryServiceUtils.js +1 -1
  329. package/portal/support/layersLoader.js +1 -1
  330. package/portal/support/portalItemUtils.js +1 -1
  331. package/portal/support/portalLayers.js +1 -1
  332. package/renderers/DictionaryRenderer.js +1 -1
  333. package/renderers/FlowRenderer.js +1 -1
  334. package/renderers/RasterColormapRenderer.js +1 -1
  335. package/renderers/RasterStretchRenderer.js +1 -1
  336. package/renderers/VectorFieldRenderer.js +1 -1
  337. package/renderers/support/RasterSymbolizer.js +1 -1
  338. package/renderers/support/UniqueValueInfo.js +1 -1
  339. package/renderers/support/colorRampUtils.js +1 -1
  340. package/renderers/support/heatmapUtils.js +1 -1
  341. package/renderers/support/rasterRendererHelper.js +1 -1
  342. package/request.js +1 -1
  343. package/rest/identify.js +1 -1
  344. package/rest/imageService.js +1 -1
  345. package/rest/networkService.js +1 -1
  346. package/rest/networks/support/SynthesizeAssociationGeometriesParameters.js +1 -1
  347. package/rest/operations/identify.js +1 -1
  348. package/rest/print.js +1 -1
  349. package/rest/query/executeQuery.js +1 -1
  350. package/rest/query/operations/query.js +1 -1
  351. package/rest/query/operations/queryRelatedRecords.js +1 -1
  352. package/rest/query/operations/queryTopFeatures.js +1 -1
  353. package/rest/route.js +1 -1
  354. package/rest/support/DirectionLine.js +1 -1
  355. package/rest/support/DirectionPoint.js +1 -1
  356. package/rest/support/DirectionsFeatureSet.js +1 -1
  357. package/rest/support/FeatureSet.js +1 -1
  358. package/rest/support/ImageSampleParameters.js +1 -1
  359. package/rest/support/PointBarrier.js +1 -1
  360. package/rest/support/PolygonBarrier.js +1 -1
  361. package/rest/support/PolylineBarrier.js +1 -1
  362. package/rest/support/RouteInfo.js +1 -1
  363. package/rest/support/Stop.js +1 -1
  364. package/rest/support/meshFeatureSet.js +1 -1
  365. package/rest/support/printTaskUtils.js +1 -1
  366. package/smartMapping/labels/clusters.js +1 -1
  367. package/smartMapping/raster/renderers/rgb.js +1 -1
  368. package/smartMapping/raster/renderers/uniqueValue.js +1 -1
  369. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  370. package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
  371. package/smartMapping/raster/support/utils.js +1 -1
  372. package/smartMapping/renderers/color.js +1 -1
  373. package/smartMapping/renderers/size.js +1 -1
  374. package/smartMapping/renderers/support/utils.js +1 -1
  375. package/smartMapping/renderers/univariateColorSize.js +1 -1
  376. package/smartMapping/statistics/support/WorkerClient.js +1 -1
  377. package/smartMapping/support/adapters/CSVLayerAdapter.js +1 -1
  378. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  379. package/smartMapping/support/adapters/OGCFeatureLayerAdapter.js +1 -1
  380. package/smartMapping/support/adapters/SceneLayerAdapter.js +1 -1
  381. package/smartMapping/support/adapters/support/utils.js +1 -1
  382. package/statistics/utils.js +1 -1
  383. package/support/LayersMixin.js +1 -1
  384. package/support/TablesMixin.js +1 -1
  385. package/support/arcadeUtils.js +1 -1
  386. package/support/basemapUtils.js +1 -1
  387. package/support/popupUtils.js +1 -1
  388. package/support/revision.js +1 -1
  389. package/support/timeUtils.js +1 -1
  390. package/symbols/FillSymbol3DLayer.js +1 -1
  391. package/symbols/LineSymbol3DLayer.js +1 -1
  392. package/symbols/LineSymbolMarker.js +1 -1
  393. package/symbols/PictureFillSymbol.js +1 -1
  394. package/symbols/PointSymbol3D.js +1 -1
  395. package/symbols/SimpleLineSymbol.js +1 -1
  396. package/symbols/SimpleMarkerSymbol.js +1 -1
  397. package/symbols/cim/CIMResourceManager.js +1 -1
  398. package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
  399. package/symbols/cim/CIMSymbolHelper.js +1 -1
  400. package/symbols/cim/ExpandedCIM.js +1 -1
  401. package/symbols/cim/SDFHelper.js +1 -1
  402. package/symbols/cim/cimAnalyzer.js +1 -1
  403. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  404. package/symbols/cim/effects/EffectDashes.js +1 -1
  405. package/symbols/cim/effects/EffectOffset.js +1 -1
  406. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  407. package/symbols/cim/utils.js +1 -1
  408. package/symbols/support/cimSymbolUtils.js +1 -1
  409. package/symbols/support/jsonUtils.js +1 -1
  410. package/symbols/support/previewCIMSymbol.js +1 -1
  411. package/symbols/support/previewSymbol2D.js +1 -1
  412. package/symbols/support/previewSymbol3D.js +1 -1
  413. package/symbols/support/previewWebStyleSymbol.js +1 -1
  414. package/symbols/support/svgUtils.js +1 -1
  415. package/symbols/support/symbolConversion.js +1 -1
  416. package/symbols/support/symbolUtils.js +1 -1
  417. package/tasks/GenerateRendererTask.js +1 -1
  418. package/views/2d/MapViewConstraints.js +1 -1
  419. package/views/2d/constraints/GeometryConstraint.js +1 -1
  420. package/views/2d/engine/Bitmap.js +1 -1
  421. package/views/2d/engine/Container.js +1 -1
  422. package/views/2d/engine/DisplayObject.js +1 -1
  423. package/views/2d/engine/Stage.js +1 -1
  424. package/views/2d/engine/imagery/BrushRasterBitmap.js +1 -1
  425. package/views/2d/engine/imagery/RasterBitmap.js +1 -1
  426. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  427. package/views/2d/engine/vectorTiles/TilemapRequest.js +1 -1
  428. package/views/2d/engine/vectorTiles/WorkerTileHandler.js +1 -1
  429. package/views/2d/engine/vectorTiles/buckets/FillBucket.js +1 -1
  430. package/views/2d/engine/vectorTiles/buckets/LineBucket.js +1 -1
  431. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  432. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  433. package/views/2d/engine/vectorTiles/style/StyleLayer.js +1 -1
  434. package/views/2d/engine/vectorTiles/style/StyleRepository.js +1 -1
  435. package/views/2d/engine/vectorTiles/style/VectorTileSource.js +1 -1
  436. package/views/2d/engine/webgl/FeatureTile.js +1 -1
  437. package/views/2d/engine/webgl/GraphicTile.js +1 -1
  438. package/views/2d/engine/webgl/TextureManager.js +1 -1
  439. package/views/2d/engine/webgl/brushes/WGLBrushHeatmap.js +1 -1
  440. package/views/2d/engine/webgl/brushes/WGLBrushVTLCircle.js +1 -1
  441. package/views/2d/engine/webgl/brushes/WGLBrushVTLFill.js +1 -1
  442. package/views/2d/engine/webgl/brushes/WGLBrushVTLLine.js +1 -1
  443. package/views/2d/engine/webgl/collisions/CollisionEngine.js +1 -1
  444. package/views/2d/engine/webgl/collisions/MetricReader.js +1 -1
  445. package/views/2d/engine/webgl/cpuMapped/DisplayRecordReader.js +1 -1
  446. package/views/2d/engine/webgl/cpuMapped/FreeList.js +1 -1
  447. package/views/2d/engine/webgl/mesh/MeshData.js +1 -1
  448. package/views/2d/engine/webgl/mesh/templates/WGLBaseLineTemplate.js +1 -1
  449. package/views/2d/engine/webgl/mesh/templates/WGLBaseMarkerTemplate.js +1 -1
  450. package/views/2d/engine/webgl/mesh/templates/WGLBaseTextTemplate.js +1 -1
  451. package/views/2d/engine/webgl/mesh/templates/WGLDynamicFillTemplate.js +1 -1
  452. package/views/2d/engine/webgl/mesh/templates/WGLLabelTemplate.js +1 -1
  453. package/views/2d/engine/webgl/mesh/templates/WGLLineTemplate.js +1 -1
  454. package/views/2d/engine/webgl/mesh/templates/WGLMeshTemplate.js +1 -1
  455. package/views/2d/engine/webgl/painter/RenderPass.js +1 -1
  456. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  457. package/views/2d/engine/webgl/techniques/dotDensity/TechniqueDotDensity.js +1 -1
  458. package/views/2d/input/MapViewInputManager.js +1 -1
  459. package/views/2d/input/handlers/GamepadNavigation.js +1 -1
  460. package/views/2d/interactive/editingTools/draw/DrawGraphicTool2D.js +1 -1
  461. package/views/2d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles2D.js +1 -1
  462. package/views/2d/layers/BaseLayerView2D.js +1 -1
  463. package/views/2d/layers/BaseLayerViewGL2D.js +1 -1
  464. package/views/2d/layers/BitmapTileLayerView2D.js +1 -1
  465. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  466. package/views/2d/layers/GeoRSSLayerView2D.js +1 -1
  467. package/views/2d/layers/GraphicsLayerView2D.js +1 -1
  468. package/views/2d/layers/ImageryLayerView2D.js +1 -1
  469. package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
  470. package/views/2d/layers/KMLLayerView2D.js +1 -1
  471. package/views/2d/layers/LayerView2D.js +1 -1
  472. package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
  473. package/views/2d/layers/TileLayerView2D.js +1 -1
  474. package/views/2d/layers/VectorTileLayerView2D.js +1 -1
  475. package/views/2d/layers/WMTSLayerView2D.js +1 -1
  476. package/views/2d/layers/features/FeatureStore2D.js +1 -1
  477. package/views/2d/layers/features/Pipeline.js +1 -1
  478. package/views/2d/layers/features/batchUtils.js +1 -1
  479. package/views/2d/layers/features/controllers/FeatureController2D.js +1 -1
  480. package/views/2d/layers/features/controllers/support/sourceAdapters.js +1 -1
  481. package/views/2d/layers/features/createSymbolSchema.js +1 -1
  482. package/views/2d/layers/features/processors/SymbolProcessor.js +1 -1
  483. package/views/2d/layers/features/schemaUtils.js +1 -1
  484. package/views/2d/layers/features/sources/BaseFeatureSource.js +1 -1
  485. package/views/2d/layers/features/sources/DataTileSource.js +1 -1
  486. package/views/2d/layers/features/sources/DataTileSubscription.js +1 -1
  487. package/views/2d/layers/features/sources/SnapshotFeatureSource.js +1 -1
  488. package/views/2d/layers/features/support/ClusterStore.js +1 -1
  489. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  490. package/views/2d/layers/features/support/FeatureSetReaderJSON.js +1 -1
  491. package/views/2d/layers/features/support/FeatureSetReaderPBF.js +1 -1
  492. package/views/2d/layers/features/support/FeatureSetReaderPBFHeader.js +1 -1
  493. package/views/2d/layers/features/support/ResourceManagerProxy.js +1 -1
  494. package/views/2d/layers/features/tileRenderers/SymbolTileRenderer.js +1 -1
  495. package/views/2d/layers/features/tileRenderers/support/WGLFeatureView.js +1 -1
  496. package/views/2d/layers/graphics/graphicsUtils.js +1 -1
  497. package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
  498. package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
  499. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  500. package/views/2d/layers/support/ExportStrategy.js +1 -1
  501. package/views/2d/layers/support/FeatureCommandQueue.js +1 -1
  502. package/views/2d/magnifier/MagnifierView2D.js +1 -1
  503. package/views/2d/support/engineHelpers.js +1 -1
  504. package/views/2d/tiling/TileManager.js +1 -1
  505. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  506. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  507. package/views/3d/analysis/Dimensioning/DimensioningVisualization.js +5 -0
  508. package/views/3d/analysis/Dimensioning/LinearDimensionVisualization.js +5 -0
  509. package/views/3d/analysis/DimensioningAnalysisView3D.js +1 -1
  510. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementController.js +1 -1
  511. package/views/3d/analysis/DirectLineMeasurement/DirectLineMeasurementVisualization.js +1 -1
  512. package/views/3d/analysis/DirectLineMeasurementAnalysisView3D.js +1 -1
  513. package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
  514. package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
  515. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  516. package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
  517. package/views/3d/environment/ChapmanAtmosphere.glsl.js +1 -1
  518. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  519. package/views/3d/environment/Clouds.glsl.js +1 -1
  520. package/views/3d/environment/CloudsComposition.glsl.js +1 -1
  521. package/views/3d/environment/CloudsComposition.js +1 -1
  522. package/views/3d/environment/CloudsCompositionParameters.js +5 -0
  523. package/views/3d/environment/EnvironmentRenderer.js +1 -1
  524. package/views/3d/environment/Fog.glsl.js +1 -1
  525. package/views/3d/environment/Fog.js +1 -1
  526. package/views/3d/environment/Precipitation.js +1 -1
  527. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  528. package/views/3d/environment/SceneViewEnvironmentManager.js +1 -1
  529. package/views/3d/environment/SimpleAtmosphere.js +1 -1
  530. package/views/3d/environment/Stars.glsl.js +1 -1
  531. package/views/3d/environment/Stars.js +1 -1
  532. package/views/3d/externalRenderers/ExternalRendererStore.js +1 -1
  533. package/views/3d/glTF/internal/Resource.js +1 -1
  534. package/views/3d/glTF/loader.js +1 -1
  535. package/views/3d/input/SceneInputManager.js +1 -1
  536. package/views/3d/input/handlers/TwoFingerTilt.js +1 -1
  537. package/views/3d/interactive/Manipulator3D.js +1 -1
  538. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  539. package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
  540. package/views/3d/interactive/editingTools/moveGraphic/isSupportedGraphic.js +1 -1
  541. package/views/3d/interactive/editingTools/reshapeGraphic/GraphicReshapeTool.js +1 -1
  542. package/views/3d/interactive/editingTools/reshapeGraphic/ReshapeOperation.js +1 -1
  543. package/views/3d/interactive/editingTools/reshapeGraphic/isSupportedGraphic.js +1 -1
  544. package/views/3d/interactive/editingTools/transformGraphic/GraphicScaleRotateTransform.js +1 -1
  545. package/views/3d/interactive/editingTools/transformGraphic/isSupportedGraphic.js +1 -1
  546. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DView.js +1 -1
  547. package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DView.js +1 -1
  548. package/views/3d/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiles3D.js +1 -1
  549. package/views/3d/interactive/visualElements/DrapedVisualElementResources.js +1 -1
  550. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  551. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  552. package/views/3d/interactive/visualElements/VisualElementResources.js +1 -1
  553. package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
  554. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  555. package/views/3d/layers/FeatureLayerView3D.js +1 -1
  556. package/views/3d/layers/FeatureLayerViewBase3D.js +1 -1
  557. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  558. package/views/3d/layers/GraphicsLayerView3D.js +1 -1
  559. package/views/3d/layers/GraphicsView3D.js +1 -1
  560. package/views/3d/layers/I3SMeshView3D.js +1 -1
  561. package/views/3d/layers/ImageryLayerView3D.js +1 -1
  562. package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
  563. package/views/3d/layers/LayerView3D.js +1 -1
  564. package/views/3d/layers/RouteLayerView3D.js +1 -1
  565. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  566. package/views/3d/layers/SceneLayerView3D.js +1 -1
  567. package/views/3d/layers/SceneLayerWorker.js +1 -1
  568. package/views/3d/layers/StreamLayerView3D.js +1 -1
  569. package/views/3d/layers/TiledLayerView3D.js +1 -1
  570. package/views/3d/layers/VectorTileLayerView3D.js +1 -1
  571. package/views/3d/layers/VoxelLayerView3D.js +1 -1
  572. package/views/3d/layers/WMSLayerView3D.js +1 -1
  573. package/views/3d/layers/WMTSLayerView3D.js +1 -1
  574. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  575. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  576. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  577. package/views/3d/layers/graphics/Graphics3DFilterVisibility.js +1 -1
  578. package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
  579. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  580. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  581. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  582. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  583. package/views/3d/layers/graphics/Graphics3DPointSymbol.js +1 -1
  584. package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
  585. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  586. package/views/3d/layers/graphics/GraphicsDeconflictor.js +1 -1
  587. package/views/3d/layers/graphics/GraphicsProcessor.js +1 -1
  588. package/views/3d/layers/graphics/Labeler.js +1 -1
  589. package/views/3d/layers/i3s/I3SAttributeOverrides.js +1 -1
  590. package/views/3d/layers/i3s/I3SMeshViewFilter.js +1 -1
  591. package/views/3d/layers/i3s/I3SStreamDataController.js +1 -1
  592. package/views/3d/layers/i3s/I3SUtil.js +1 -1
  593. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  594. package/views/3d/layers/support/FeatureTileTree3DDebugger.js +1 -1
  595. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  596. package/views/3d/layers/support/StageLayerElevationProvider.js +1 -1
  597. package/views/3d/layers/support/featureTileQuery3D.js +1 -1
  598. package/views/3d/state/ConstraintsManager.js +1 -1
  599. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  600. package/views/3d/support/ResourceController.js +1 -1
  601. package/views/3d/support/SharedSymbolResources.js +1 -1
  602. package/views/3d/support/TextureCollection.js +1 -1
  603. package/views/3d/support/cameraUtils.js +1 -1
  604. package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
  605. package/views/3d/support/pointsOfInterest/Focus.js +1 -1
  606. package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
  607. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  608. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  609. package/views/3d/terrain/OverlayManager.js +1 -1
  610. package/views/3d/terrain/OverlayRenderer.js +1 -1
  611. package/views/3d/terrain/PatchGeometry.js +1 -1
  612. package/views/3d/terrain/PatchGeometryFactory.js +1 -1
  613. package/views/3d/terrain/PatchRenderData.js +1 -1
  614. package/views/3d/terrain/PlanarPatch.js +1 -1
  615. package/views/3d/terrain/RasterColorizerTechnique.js +1 -1
  616. package/views/3d/terrain/RasterTile.js +1 -1
  617. package/views/3d/terrain/SphericalPatch.js +1 -1
  618. package/views/3d/terrain/TerrainRenderer.js +1 -1
  619. package/views/3d/terrain/TerrainSurface.js +1 -1
  620. package/views/3d/terrain/Tile.js +1 -1
  621. package/views/3d/terrain/TileCompositor.js +1 -1
  622. package/views/3d/terrain/TileRenderer.js +1 -1
  623. package/views/3d/terrain/TilingSchemeLogic.js +1 -1
  624. package/views/3d/terrain/terrainUtils.js +1 -1
  625. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  626. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  627. package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
  628. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +2 -2
  629. package/views/3d/webgl-engine/core/material/MaterialBase.js +1 -1
  630. package/views/3d/webgl-engine/core/shaderLibrary/ScreenSizeScaling.glsl.js +1 -1
  631. package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +5 -5
  632. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +8 -8
  633. package/views/3d/webgl-engine/core/shaderLibrary/attributes/RibbonVertexPosition.glsl.js +6 -6
  634. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexNormal.glsl.js +4 -4
  635. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VertexPosition.glsl.js +2 -2
  636. package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +5 -5
  637. package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +13 -13
  638. package/views/3d/webgl-engine/core/shaderLibrary/raster/BasicGrid.glsl.js +2 -2
  639. package/views/3d/webgl-engine/core/shaderLibrary/raster/Colormap.glsl.js +1 -1
  640. package/views/3d/webgl-engine/core/shaderLibrary/raster/Common.glsl.js +2 -2
  641. package/views/3d/webgl-engine/core/shaderLibrary/raster/Projection.glsl.js +1 -1
  642. package/views/3d/webgl-engine/core/shaderLibrary/raster/RasterColorizer.glsl.js +1 -1
  643. package/views/3d/webgl-engine/core/shaderLibrary/shading/ComputeMaterialColor.glsl.js +1 -1
  644. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +5 -5
  645. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientOcclusion.glsl.js +3 -3
  646. package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +13 -13
  647. package/views/3d/webgl-engine/core/shaderLibrary/shading/LineStipple.glsl.js +17 -17
  648. package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadShadowMap.glsl.js +1 -1
  649. package/views/3d/webgl-engine/core/shaderLibrary/shading/VisualVariables.glsl.js +7 -7
  650. package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +2 -2
  651. package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +5 -5
  652. package/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js +2 -2
  653. package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +15 -15
  654. package/views/3d/webgl-engine/core/shaderLibrary/util/ScreenSizePerspective.glsl.js +2 -2
  655. package/views/3d/webgl-engine/core/shaderLibrary/util/View.glsl.js +1 -1
  656. package/views/3d/webgl-engine/core/shaderModules/BooleanPassUniform.js +5 -0
  657. package/views/3d/webgl-engine/core/shaderModules/Float4DrawUniform.js +5 -0
  658. package/views/3d/webgl-engine/core/shaderModules/{Matrix3Uniform.js → Float4PassUniform.js} +1 -1
  659. package/views/3d/webgl-engine/core/shaderModules/Float4Uniform.js +1 -1
  660. package/views/3d/webgl-engine/core/shaderModules/Matrix3DrawUniform.js +5 -0
  661. package/views/3d/webgl-engine/core/shaderModules/Matrix3PassUniform.js +5 -0
  662. package/views/3d/webgl-engine/core/shaderModules/{TextureCubeUniform.js → TextureCubePassUniform.js} +1 -1
  663. package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueConfiguration.js +1 -1
  664. package/views/3d/webgl-engine/lib/AutoDisposable.js +1 -1
  665. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  666. package/views/3d/webgl-engine/lib/GLTextureMaterial.js +1 -1
  667. package/views/3d/webgl-engine/lib/RenderPluginManager.js +1 -1
  668. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  669. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  670. package/views/3d/webgl-engine/lib/ShadowHighlight.js +1 -1
  671. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  672. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  673. package/views/3d/webgl-engine/lib/WebGLLayer.js +1 -1
  674. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  675. package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
  676. package/views/3d/webgl-engine/lib/pathGeometryUtils.js +1 -1
  677. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  678. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  679. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  680. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  681. package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
  682. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  683. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  684. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  685. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  686. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  687. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  688. package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
  689. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  690. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  691. package/views/3d/webgl-engine/materials/{VisualVariableMaterialParameters.js → VisualVariablePassParameters.js} +1 -1
  692. package/views/3d/webgl-engine/materials/WaterGLMaterial.js +1 -1
  693. package/views/3d/webgl-engine/materials/WaterTechnique.js +1 -1
  694. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  695. package/views/3d/webgl-engine/parts/requireUtils.js +1 -1
  696. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  697. package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
  698. package/views/3d/webgl-engine/shaders/ColorMaterial.glsl.js +1 -1
  699. package/views/3d/webgl-engine/shaders/DefaultMaterial.glsl.js +1 -1
  700. package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
  701. package/views/3d/webgl-engine/shaders/HUDMaterial.glsl.js +1 -1
  702. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  703. package/views/3d/webgl-engine/shaders/HeatmapDensity.glsl.js +1 -1
  704. package/views/3d/webgl-engine/shaders/HeatmapDensityTechnique.js +1 -1
  705. package/views/3d/webgl-engine/shaders/HeatmapTechnique.js +1 -1
  706. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  707. package/views/3d/webgl-engine/shaders/LineCallout.glsl.js +1 -1
  708. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  709. package/views/3d/webgl-engine/shaders/Magnifier.glsl.js +3 -3
  710. package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
  711. package/views/3d/webgl-engine/shaders/NativeLine.glsl.js +1 -1
  712. package/views/3d/webgl-engine/shaders/Path.glsl.js +1 -1
  713. package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
  714. package/views/3d/webgl-engine/shaders/RealisticTree.glsl.js +1 -1
  715. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  716. package/views/3d/webgl-engine/shaders/ShadedColorMaterial.glsl.js +1 -1
  717. package/views/3d/webgl-engine/shaders/ShadowCastVisualize.glsl.js +1 -1
  718. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  719. package/views/3d/webgl-engine/shaders/SlicePlaneMaterial.glsl.js +1 -1
  720. package/views/3d/webgl-engine/shaders/WaterSurface.glsl.js +1 -1
  721. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/AdjustProjectedPosition.glsl.js +3 -3
  722. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeShader.glsl.js +1 -1
  723. package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +5 -5
  724. package/views/BasemapView.js +1 -1
  725. package/views/GroundView.js +1 -1
  726. package/views/LayerViewManager.js +1 -1
  727. package/views/MapView.js +1 -1
  728. package/views/SceneView.js +1 -1
  729. package/views/ToolViewManager.js +1 -1
  730. package/views/View.js +1 -1
  731. package/views/draw/DrawAction.js +1 -1
  732. package/views/draw/DrawGraphicTool.js +1 -1
  733. package/views/draw/DrawOperation.js +1 -1
  734. package/views/draw/DrawTool.js +1 -1
  735. package/views/draw/support/Box.js +1 -1
  736. package/views/draw/support/GraphicMover.js +1 -1
  737. package/views/draw/support/Reshape.js +1 -1
  738. package/views/interactive/coordinateHelper.js +1 -1
  739. package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
  740. package/views/interactive/snapping/FeatureSnappingEngine.js +1 -1
  741. package/views/interactive/snapping/SnappingManager.js +1 -1
  742. package/views/interactive/snapping/featureSources/WorkerTileTreeDebugger.js +1 -1
  743. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorkerHandle.js +1 -1
  744. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTileStore.js +1 -1
  745. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceTiledFetcher.js +1 -1
  746. package/views/layers/FeatureLayerView.js +1 -1
  747. package/views/layers/GroupLayerView.js +1 -1
  748. package/views/layers/ImageryLayerView.js +1 -1
  749. package/views/layers/ImageryTileLayerView.js +1 -1
  750. package/views/layers/LayerView.js +1 -1
  751. package/views/layers/MapImageLayerView.js +1 -1
  752. package/views/layers/WMSLayerView.js +1 -1
  753. package/views/support/AllocationTracer.js +1 -1
  754. package/views/support/DefaultsFromMap.js +1 -1
  755. package/views/support/geometry2dUtils.js +1 -1
  756. package/views/support/layerViewUtils.js +1 -1
  757. package/views/support/waitForResources.js +1 -1
  758. package/views/ui/UI.js +1 -1
  759. package/views/webgl/BufferObject.js +1 -1
  760. package/views/webgl/FramebufferObject.js +1 -1
  761. package/views/webgl/RenderingContext.js +1 -1
  762. package/views/webgl/Texture.js +1 -1
  763. package/views/webgl/UniformBufferLayout.js +1 -1
  764. package/views/webgl/VertexArrayObject.js +1 -1
  765. package/views/webgl/capabilities.js +1 -1
  766. package/views/webgl/rasterUtils.js +1 -1
  767. package/views/webgl/testFloatBufferBlend.js +1 -1
  768. package/webdoc/widgets/TimeSlider.js +1 -1
  769. package/webmap/Bookmark.js +1 -1
  770. package/webscene/Slide.js +1 -1
  771. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  772. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  773. package/widgets/AreaMeasurement2D.js +1 -1
  774. package/widgets/AreaMeasurement3D.js +1 -1
  775. package/widgets/Attribution.js +1 -1
  776. package/widgets/BasemapGallery/BasemapGalleryViewModel.js +1 -1
  777. package/widgets/BasemapGallery/support/BasemapGalleryItem.js +1 -1
  778. package/widgets/BasemapGallery/support/basemapCompatibilityUtils.js +1 -1
  779. package/widgets/BasemapLayerList.js +1 -1
  780. package/widgets/BasemapToggle/BasemapToggleViewModel.js +1 -1
  781. package/widgets/Bookmarks/BookmarksViewModel.js +1 -1
  782. package/widgets/Bookmarks.js +1 -1
  783. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  784. package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
  785. package/widgets/BuildingExplorer/BuildingLevel.js +1 -1
  786. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  787. package/widgets/BuildingExplorer/BuildingNumericFilterViewModel.js +1 -1
  788. package/widgets/BuildingExplorer/BuildingPhase.js +1 -1
  789. package/widgets/BuildingExplorer/support/buildingLayerUtils.js +1 -1
  790. package/widgets/BuildingExplorer.js +1 -1
  791. package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
  792. package/widgets/CoordinateConversion/support/Format.js +1 -1
  793. package/widgets/Daylight/DaylightViewModel.js +1 -1
  794. package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
  795. package/widgets/Daylight.js +1 -1
  796. package/widgets/DirectLineMeasurement3D.js +1 -1
  797. package/widgets/Directions/DirectionsViewModel.js +1 -1
  798. package/widgets/Directions.js +1 -1
  799. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  800. package/widgets/DistanceMeasurement2D.js +1 -1
  801. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  802. package/widgets/Editor/CreateWorkflow.js +1 -1
  803. package/widgets/Editor/EditorViewModel.js +1 -1
  804. package/widgets/Editor/UpdateWorkflow.js +1 -1
  805. package/widgets/Editor/workflowUtils.js +1 -1
  806. package/widgets/Editor.js +1 -1
  807. package/widgets/ElevationProfile/ElevationProfileLineGround.js +1 -1
  808. package/widgets/ElevationProfile/ElevationProfileLineInput.js +1 -1
  809. package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
  810. package/widgets/ElevationProfile/ElevationProfileTool.js +1 -1
  811. package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
  812. package/widgets/ElevationProfile/components/Statistics.js +1 -1
  813. package/widgets/ElevationProfile/support/elevationQuerySourceUtils.js +1 -1
  814. package/widgets/ElevationProfile/support/profileUtils.js +1 -1
  815. package/widgets/ElevationProfile.js +1 -1
  816. package/widgets/Expand.js +1 -1
  817. package/widgets/Feature/FeatureAttachments.js +1 -1
  818. package/widgets/Feature/FeatureContent.js +1 -1
  819. package/widgets/Feature/FeatureExpression/FeatureExpressionViewModel.js +1 -1
  820. package/widgets/Feature/FeatureExpression.js +1 -1
  821. package/widgets/Feature/FeatureFields/FeatureFieldsViewModel.js +1 -1
  822. package/widgets/Feature/FeatureFields.js +1 -1
  823. package/widgets/Feature/FeatureMedia/FeatureMediaViewModel.js +1 -1
  824. package/widgets/Feature/FeatureMedia.js +1 -1
  825. package/widgets/Feature/FeatureViewModel.js +1 -1
  826. package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
  827. package/widgets/Feature/support/featureUtils.js +1 -1
  828. package/widgets/Feature/support/relatedFeatureUtils.js +1 -1
  829. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  830. package/widgets/FeatureForm/InputField.js +1 -1
  831. package/widgets/FeatureForm/support/formTemplateUtils.js +1 -1
  832. package/widgets/FeatureForm.js +1 -1
  833. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  834. package/widgets/FeatureTable/FieldColumn.js +1 -1
  835. package/widgets/FeatureTable/Grid/Column.js +1 -1
  836. package/widgets/FeatureTable/Grid/EditorColumn.js +1 -1
  837. package/widgets/FeatureTable/Grid/Grid.js +1 -1
  838. package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
  839. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  840. package/widgets/FeatureTable/Grid/support/LocalStore.js +1 -1
  841. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  842. package/widgets/FeatureTable.js +1 -1
  843. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.js +1 -1
  844. package/widgets/FeatureTemplates/ItemList.js +1 -1
  845. package/widgets/FeatureTemplates/TemplateItem.js +1 -1
  846. package/widgets/FeatureTemplates.js +1 -1
  847. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  848. package/widgets/FloorFilter.js +1 -1
  849. package/widgets/Fullscreen.js +1 -1
  850. package/widgets/Home.js +1 -1
  851. package/widgets/LayerList/LayerListViewModel.js +1 -1
  852. package/widgets/LayerList/support/layerListUtils.js +1 -1
  853. package/widgets/LayerList.js +1 -1
  854. package/widgets/Legend/LegendViewModel.js +1 -1
  855. package/widgets/Legend/styles/Card.js +1 -1
  856. package/widgets/Legend/styles/support/univariateUtils.js +1 -1
  857. package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
  858. package/widgets/Legend/support/clusterUtils.js +1 -1
  859. package/widgets/Legend/support/sizeRampUtils.js +1 -1
  860. package/widgets/Locate/LocateViewModel.js +1 -1
  861. package/widgets/Popup/PopupViewModel.js +1 -1
  862. package/widgets/Popup/actionUtils.js +1 -1
  863. package/widgets/Popup.js +1 -1
  864. package/widgets/Print/PrintViewModel.js +1 -1
  865. package/widgets/Print.js +1 -1
  866. package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
  867. package/widgets/Search/LayerSearchSource.js +1 -1
  868. package/widgets/Search/SearchResultRenderer.js +1 -1
  869. package/widgets/Search/SearchViewModel.js +1 -1
  870. package/widgets/Search/support/geometryUtils.js +1 -1
  871. package/widgets/Search/support/layerSearchUtils.js +1 -1
  872. package/widgets/Search/support/locatorUtils.js +1 -1
  873. package/widgets/Search.js +1 -1
  874. package/widgets/ShadowCast/components/DiscreteConfigurator.js +1 -1
  875. package/widgets/ShadowCast/components/Label.js +1 -1
  876. package/widgets/ShadowCast/components/TimezonePicker.js +1 -1
  877. package/widgets/ShadowCast.js +1 -1
  878. package/widgets/Sketch/SketchViewModel.js +1 -1
  879. package/widgets/Sketch.js +1 -1
  880. package/widgets/Slider.js +1 -1
  881. package/widgets/Swipe/SwipeViewModel.js +1 -1
  882. package/widgets/TableList/TableListViewModel.js +1 -1
  883. package/widgets/TableList/support/tableListUtils.js +1 -1
  884. package/widgets/TableList.js +1 -1
  885. package/widgets/TimeSlider/TimeSliderViewModel.js +1 -1
  886. package/widgets/TimeSlider/utils.js +1 -1
  887. package/widgets/TimeSlider.js +1 -1
  888. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
  889. package/widgets/Weather.js +1 -1
  890. package/widgets/Widget.js +1 -1
  891. package/widgets/smartMapping/BinaryColorSizeSlider/BinaryColorSizeSliderViewModel.js +1 -1
  892. package/widgets/smartMapping/BinaryColorSizeSlider.js +1 -1
  893. package/widgets/smartMapping/ClassedColorSlider.js +1 -1
  894. package/widgets/smartMapping/ClassedSizeSlider.js +1 -1
  895. package/widgets/smartMapping/ColorSizeSlider.js +1 -1
  896. package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
  897. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  898. package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
  899. package/widgets/support/AnalysisViewModel.js +1 -1
  900. package/widgets/support/ColorPicker.js +1 -1
  901. package/widgets/support/DatePicker.js +1 -1
  902. package/widgets/support/InteractiveAnalysisViewModel.js +1 -1
  903. package/widgets/support/Popover.js +1 -1
  904. package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.js +1 -1
  905. package/widgets/support/SelectionToolbar.js +1 -1
  906. package/widgets/support/Selector2D/SelectionOperation2D.js +1 -1
  907. package/widgets/support/Selector2D.js +1 -1
  908. package/widgets/support/SnappingControls/SnappingControlsViewModel.js +1 -1
  909. package/widgets/support/SnappingControls.js +1 -1
  910. package/widgets/support/jsxWidgetSupport.js +1 -1
  911. package/widgets/support/widgetUtils.js +1 -1
  912. package/assets/esri/core/workers/chunks/049c5c30bd37693dddb7.js +0 -1
  913. package/assets/esri/core/workers/chunks/055a0ebf22a82f859474.js +0 -1
  914. package/assets/esri/core/workers/chunks/0b12ff7b2ed2838afbb8.js +0 -1
  915. package/assets/esri/core/workers/chunks/0e25548573baf855e394.js +0 -1
  916. package/assets/esri/core/workers/chunks/0edd4c3ca6e7d749d0e5.js +0 -1
  917. package/assets/esri/core/workers/chunks/0fcbf7e2db58e38ee6d1.js +0 -1
  918. package/assets/esri/core/workers/chunks/133f971e72a1a6277ac4.js +0 -1
  919. package/assets/esri/core/workers/chunks/135a90ae61f3b3cae91b.js +0 -1
  920. package/assets/esri/core/workers/chunks/13fde7fd56c39fa3f2d5.js +0 -1
  921. package/assets/esri/core/workers/chunks/1c90855c3b0e5dcff908.js +0 -1
  922. package/assets/esri/core/workers/chunks/1dbef1919c7ac10a6bcc.js +0 -1
  923. package/assets/esri/core/workers/chunks/1facbda248863cf72cbd.js +0 -1
  924. package/assets/esri/core/workers/chunks/1fb2d7abe6c8efa84695.js +0 -1
  925. package/assets/esri/core/workers/chunks/2068377c2a796d5f2245.js +0 -1
  926. package/assets/esri/core/workers/chunks/28a5878cbe5880476855.js +0 -1
  927. package/assets/esri/core/workers/chunks/2cf3934b3ecabdf207c8.js +0 -1
  928. package/assets/esri/core/workers/chunks/2d42711a629384144625.js +0 -1
  929. package/assets/esri/core/workers/chunks/3021fda52083fc67d18c.js +0 -1
  930. package/assets/esri/core/workers/chunks/30333a95dc0a44e23fb5.js +0 -1
  931. package/assets/esri/core/workers/chunks/30837d93116f0337972f.js +0 -1
  932. package/assets/esri/core/workers/chunks/320543485c8e22485075.js +0 -1
  933. package/assets/esri/core/workers/chunks/3f0f7da92a6e4493686e.js +0 -1
  934. package/assets/esri/core/workers/chunks/42057f252ba4e82a8b45.js +0 -1
  935. package/assets/esri/core/workers/chunks/45a3f6033cdf4bc74a4c.js +0 -1
  936. package/assets/esri/core/workers/chunks/492b65fe99641f5740f0.js +0 -1
  937. package/assets/esri/core/workers/chunks/4d1cd7df617273c489f4.js +0 -1
  938. package/assets/esri/core/workers/chunks/4df9dfa80dbbae9b743d.js +0 -1
  939. package/assets/esri/core/workers/chunks/515c1c055666ff4740f3.js +0 -1
  940. package/assets/esri/core/workers/chunks/541e644fc77dbe527124.js +0 -1
  941. package/assets/esri/core/workers/chunks/59e341b2db44351bf557.js +0 -1
  942. package/assets/esri/core/workers/chunks/5a10b58533b4116115ac.js +0 -1
  943. package/assets/esri/core/workers/chunks/5f940853341d7e2bc852.js +0 -1
  944. package/assets/esri/core/workers/chunks/5ff2cdecf95e0136dd52.js +0 -1
  945. package/assets/esri/core/workers/chunks/6147bfbe2bd7292d6ad0.js +0 -1
  946. package/assets/esri/core/workers/chunks/6467f996fe9f136c370b.js +0 -1
  947. package/assets/esri/core/workers/chunks/682a8f15f352de76df69.js +0 -1
  948. package/assets/esri/core/workers/chunks/6a06635089761ee3e6d4.js +0 -972
  949. package/assets/esri/core/workers/chunks/725828a41917d3d56f2d.js +0 -1
  950. package/assets/esri/core/workers/chunks/794b47764ebb0257ed41.js +0 -1
  951. package/assets/esri/core/workers/chunks/7fd03a75eb07a09cda35.js +0 -1
  952. package/assets/esri/core/workers/chunks/86ad6b020c01850d9095.js +0 -1
  953. package/assets/esri/core/workers/chunks/86f9d1ce36661781d962.js +0 -1
  954. package/assets/esri/core/workers/chunks/8dcf6c836b53b40dfbf1.js +0 -1
  955. package/assets/esri/core/workers/chunks/8e98ff9404a802352037.js +0 -1
  956. package/assets/esri/core/workers/chunks/94e51fe1c539df6257c2.js +0 -1
  957. package/assets/esri/core/workers/chunks/9519a02b9b8db88a3150.js +0 -1
  958. package/assets/esri/core/workers/chunks/9a8b50ed75219b4a42e1.js +0 -1
  959. package/assets/esri/core/workers/chunks/9f3a094aa4b47e4eb046.js +0 -1
  960. package/assets/esri/core/workers/chunks/a0ebf25c9c9a7f839b93.js +0 -1
  961. package/assets/esri/core/workers/chunks/a25f0a195f9217665530.js +0 -1
  962. package/assets/esri/core/workers/chunks/a2be1e0b632cef87f6a4.js +0 -1
  963. package/assets/esri/core/workers/chunks/a4d8cf9829da9cfc5f36.js +0 -1
  964. package/assets/esri/core/workers/chunks/a562059dbdd1bf1fab66.js +0 -1
  965. package/assets/esri/core/workers/chunks/a59ee7d2b98c85f27dd2.js +0 -1
  966. package/assets/esri/core/workers/chunks/a5dbab94697757c87c49.js +0 -1
  967. package/assets/esri/core/workers/chunks/a5e65d5a7a536759d1cc.js +0 -1
  968. package/assets/esri/core/workers/chunks/a8ac0b6a3eba35e3a5b6.js +0 -1
  969. package/assets/esri/core/workers/chunks/acbd0f4d72d1f5d8e4e8.js +0 -1
  970. package/assets/esri/core/workers/chunks/acc97a210f36bff2d1b0.js +0 -1
  971. package/assets/esri/core/workers/chunks/ad68fe924456d6d7d4f0.js +0 -1
  972. package/assets/esri/core/workers/chunks/b06c949fc7d08e376a5f.js +0 -1
  973. package/assets/esri/core/workers/chunks/b26bd8fde2fc65bb67fb.js +0 -1
  974. package/assets/esri/core/workers/chunks/b4405e9fe6c0cf7250d3.js +0 -1
  975. package/assets/esri/core/workers/chunks/bc08fe3b03767bd694c5.js +0 -1
  976. package/assets/esri/core/workers/chunks/c11501e96ffd81bf39a0.js +0 -1
  977. package/assets/esri/core/workers/chunks/c44116378cc1bc627044.js +0 -1
  978. package/assets/esri/core/workers/chunks/c9b09099488d0e719dfb.js +0 -1
  979. package/assets/esri/core/workers/chunks/cbea4f1eb814115748db.js +0 -1
  980. package/assets/esri/core/workers/chunks/ce262a2accd982988ef1.js +0 -1
  981. package/assets/esri/core/workers/chunks/d15e6662d90718411d62.js +0 -1
  982. package/assets/esri/core/workers/chunks/d16aac3461af9cee0c29.js +0 -1
  983. package/assets/esri/core/workers/chunks/d60dd3e1028f714f2258.js +0 -1
  984. package/assets/esri/core/workers/chunks/d6c150c243ca1f6108f9.js +0 -1
  985. package/assets/esri/core/workers/chunks/d85748b57a71999caf3a.js +0 -1
  986. package/assets/esri/core/workers/chunks/d8c59b1d73650c060dfb.js +0 -1
  987. package/assets/esri/core/workers/chunks/dcb6e1b33402d7fa455b.js +0 -1
  988. package/assets/esri/core/workers/chunks/df653bca2b14dffc82d1.js +0 -1
  989. package/assets/esri/core/workers/chunks/e2a12142439d3037a3a7.js +0 -1
  990. package/assets/esri/core/workers/chunks/e3e1d87b8532bf84a18d.js +0 -1
  991. package/assets/esri/core/workers/chunks/e7744b7e0c16bba93151.js +0 -1
  992. package/assets/esri/core/workers/chunks/ea50effc5c39870dc871.js +0 -1
  993. package/assets/esri/core/workers/chunks/f1665a64564593f2a438.js +0 -1
  994. package/assets/esri/core/workers/chunks/f4c12f3a5e7f89106ae0.js +0 -1
  995. package/assets/esri/core/workers/chunks/fbefdc74b3aab716187f.js +0 -1
  996. package/assets/esri/core/workers/chunks/fc4fd9db056579e09bfe.js +0 -1
  997. package/assets/esri/core/workers/chunks/fd4907fa96f55128764d.js +0 -1
  998. package/views/3d/webgl-engine/core/shaderModules/BooleanUniform.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- function e(e){const t=null==e?void 0:e.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function t(e){const t=null==e?void 0:e.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function n(e){return"voxel"===(null==e?void 0:e.type)}function r(e){return"imagery-tile"===(null==e?void 0:e.type)}function i(e){var t;return"esri.Basemap"===(null==(t=e.parent)?void 0:t.declaredClass)&&e.parent.baseLayers.includes(e)}function l(e){var t;return"feature"===(null==e?void 0:e.type)&&!e.url&&"memory"===(null==(t=e.source)?void 0:t.type)}function o(e){var t;return"feature"===(null==e?void 0:e.type)&&"feature-layer"===(null==(t=e.source)?void 0:t.type)}function u(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach(((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)})),n.length>0)){let e;if(r){const t={};n.forEach((e=>{t[e[0]]=e[1]})),e=JSON.stringify(t)}else{const t=[];n.forEach((e=>{t.push(e[0]+":"+e[1])})),e=t.join(";")}return e}return null}function a(e){if(!e)return;const t=[];return e.forEach(((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))})),t.length?"{"+t.join(",")+"}":void 0}function c(e,t){const n=[];if(e>0&&t)for(let r=0;r<t.length;r++)if(!(t[r].parentLayerId>=0&&!n.includes(t[r].parentLayerId)&&t.some((e=>e.id===t[r].parentLayerId)))&&t[r].id>=0){let i=!0;const l=t[r].maxScale,o=t[r].minScale;(l>0||o>0)&&(l>0&&o>0?i=l<=e&&e<=o:l>0?i=l<=e:o>0&&(i=e<=o)),i&&n.push(t[r].id)}return n}function s(e){return!0===e.labelsVisible&&null!=e.labelingInfo&&e.labelingInfo.length>0}function f(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}export{s as areLabelsVisible,c as getLayersForScale,f as getTileMaxtrixSetFromActiveLayer,i as isBaseLayer,e as isBasemapSupportedLayer,l as isFeatureCollectionLayer,o as isFeatureServiceLayer,r as isImageryTileLayer,t as isTiledLayer,n as isVoxelLayer,u as serializeLayerDefinitions,a as serializeTimeOptions};
5
+ function e(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function t(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function n(e){return"voxel"===e?.type}function r(e){return"imagery-tile"===e?.type}function i(e){return"esri.Basemap"===e.parent?.declaredClass&&e.parent.baseLayers.includes(e)}function a(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function l(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function o(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach(((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)})),n.length>0)){let e;if(r){const t={};n.forEach((e=>{t[e[0]]=e[1]})),e=JSON.stringify(t)}else{const t=[];n.forEach((e=>{t.push(e[0]+":"+e[1])})),e=t.join(";")}return e}return null}function u(e){if(!e)return;const t=[];return e.forEach(((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))})),t.length?"{"+t.join(",")+"}":void 0}function c(e,t){const n=[];if(e>0&&t)for(let r=0;r<t.length;r++)if(!(t[r].parentLayerId>=0&&!n.includes(t[r].parentLayerId)&&t.some((e=>e.id===t[r].parentLayerId)))&&t[r].id>=0){let i=!0;const a=t[r].maxScale,l=t[r].minScale;(a>0||l>0)&&(a>0&&l>0?i=a<=e&&e<=l:a>0?i=a<=e:l>0&&(i=e<=l)),i&&n.push(t[r].id)}return n}function s(e){return!0===e.labelsVisible&&null!=e.labelingInfo&&e.labelingInfo.length>0}function f(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}export{s as areLabelsVisible,c as getLayersForScale,f as getTileMaxtrixSetFromActiveLayer,i as isBaseLayer,e as isBasemapSupportedLayer,a as isFeatureCollectionLayer,l as isFeatureServiceLayer,r as isImageryTileLayer,t as isTiledLayer,n as isVoxelLayer,o as serializeLayerDefinitions,u as serializeTimeOptions};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../core/Collection.js";import"../../core/has.js";import{eachAlways as r}from"../../core/promiseUtils.js";import{layerLookupMap as a}from"./lazyLayerLoader.js";import y from"../../portal/PortalItem.js";import{isMapNotesLayer as t,isRouteLayer as i}from"../../portal/support/featureCollectionUtils.js";import{selectLayerClassPath as o}from"../../portal/support/portalLayers.js";import{loadStyleRenderer as L}from"../../renderers/support/styleUtils.js";async function n(e,a,y){if(!a)return;const t=[];for(const r of a){const e=d(r,y);"GroupLayer"===r.layerType?t.push(G(e,r,y)):t.push(e)}const i=await r(t);for(const r of i)!r.value||y.filter&&!y.filter(r.value)||e.add(r.value)}const l={ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer"},c={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},s={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",DefaultTileLayer:"TileLayer"},p={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",OGCFeatureLayer:"OGCFeatureLayer",SubtypeGroupLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},u={ArcGISFeatureLayer:"FeatureLayer"},S={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"};async function d(e,r){return I(await m(e,r),e,r)}async function I(e,r,a){const y=new e;return y.read(r,a.context),"group"===y.type&&T(r)&&await M(y,r,a.context),await L(y,a.context),y}async function m(e,r){const L=r.context,n=g(L);let l=e.layerType||e.type;!l&&r&&r.defaultLayerType&&(l=r.defaultLayerType);const c=n[l];let s=c?a[c]:a.UnknownLayer;if(f(e)){const r=null==L?void 0:L.portal;if(e.itemId){const t=new y({id:e.itemId,portal:r});await t.load();const i=(await o(t)).className||"UnknownLayer";s=a[i]}}else"ArcGISFeatureLayer"===l?t(e)?s=a.MapNotesLayer:i(e)?s=a.RouteLayer:T(e)&&(s=a.GroupLayer):e.wmtsInfo&&e.wmtsInfo.url&&e.wmtsInfo.layerIdentifier?s=a.WMTSLayer:"WFS"===l&&"2.0.0"!==e.wfsInfo.version&&(s=a.UnsupportedLayer);return s()}function T(e){var r,a,y;if("ArcGISFeatureLayer"!==e.layerType||f(e))return!1;return(null!=(r=null==(a=e.featureCollection)||null==(y=a.layers)?void 0:y.length)?r:0)>1}function f(e){return"Feature Collection"===e.type}function g(e){let r;if("web-scene"===e.origin)switch(e.layerContainerType){case"basemap":r=s;break;case"ground":r=c;break;default:r=l}else switch(e.layerContainerType){case"basemap":r=S;break;case"tables":r=u;break;default:r=p}return r}async function G(r,a,y){const t=new e,i=n(t,Array.isArray(a.layers)?a.layers:[],y),o=await r;if(await i,"group"===o.type)return o.layers.addMany(t),o}async function M(e,r,y){const t=a.FeatureLayer,i=await t(),o=r.featureCollection,L=o.showLegend,n=o.layers.map(((a,t)=>{var o,n;const l=new i;l.read(a,y);const c={...y,ignoreDefaults:!0};return l.read({id:`${e.id}-sublayer-${t}`,visibility:null==(o=null==(n=r.visibleLayers)?void 0:n.includes(t))||o},c),null!=L&&l.read({showLegend:L},c),l}));e.layers.addMany(n)}export{n as populateOperationalLayers};
5
+ import e from"../../core/Collection.js";import"../../core/has.js";import{eachAlways as r}from"../../core/promiseUtils.js";import{layerLookupMap as a}from"./lazyLayerLoader.js";import y from"../../portal/PortalItem.js";import{isMapNotesLayer as t,isRouteLayer as i}from"../../portal/support/featureCollectionUtils.js";import{selectLayerClassPath as L}from"../../portal/support/portalLayers.js";import{loadStyleRenderer as o}from"../../renderers/support/styleUtils.js";async function n(e,a,y){if(!a)return;const t=[];for(const r of a){const e=I(r,y);"GroupLayer"===r.layerType?t.push(G(e,r,y)):t.push(e)}const i=await r(t);for(const r of i)!r.value||y.filter&&!y.filter(r.value)||e.add(r.value)}const l={ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer"},c={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},s={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",DefaultTileLayer:"TileLayer"},p={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",OGCFeatureLayer:"OGCFeatureLayer",SubtypeGroupLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},S={ArcGISFeatureLayer:"FeatureLayer"},u={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"};async function I(e,r){return d(await m(e,r),e,r)}async function d(e,r,a){const y=new e;return y.read(r,a.context),"group"===y.type&&T(r)&&await M(y,r,a.context),await o(y,a.context),y}async function m(e,r){const o=r.context,n=g(o);let l=e.layerType||e.type;!l&&r&&r.defaultLayerType&&(l=r.defaultLayerType);const c=n[l];let s=c?a[c]:a.UnknownLayer;if(f(e)){const r=o?.portal;if(e.itemId){const t=new y({id:e.itemId,portal:r});await t.load();const i=(await L(t)).className||"UnknownLayer";s=a[i]}}else"ArcGISFeatureLayer"===l?t(e)?s=a.MapNotesLayer:i(e)?s=a.RouteLayer:T(e)&&(s=a.GroupLayer):e.wmtsInfo&&e.wmtsInfo.url&&e.wmtsInfo.layerIdentifier?s=a.WMTSLayer:"WFS"===l&&"2.0.0"!==e.wfsInfo.version&&(s=a.UnsupportedLayer);return s()}function T(e){if("ArcGISFeatureLayer"!==e.layerType||f(e))return!1;return(e.featureCollection?.layers?.length??0)>1}function f(e){return"Feature Collection"===e.type}function g(e){let r;if("web-scene"===e.origin)switch(e.layerContainerType){case"basemap":r=s;break;case"ground":r=c;break;default:r=l}else switch(e.layerContainerType){case"basemap":r=u;break;case"tables":r=S;break;default:r=p}return r}async function G(r,a,y){const t=new e,i=n(t,Array.isArray(a.layers)?a.layers:[],y),L=await r;if(await i,"group"===L.type)return L.layers.addMany(t),L}async function M(e,r,y){const t=a.FeatureLayer,i=await t(),L=r.featureCollection,o=L.showLegend,n=L.layers.map(((a,t)=>{const L=new i;L.read(a,y);const n={...y,ignoreDefaults:!0};return L.read({id:`${e.id}-sublayer-${t}`,visibility:r.visibleLayers?.includes(t)??!0},n),null!=o&&L.read({showLegend:o},n),L}));e.layers.addMany(n)}export{n as populateOperationalLayers};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../request.js";import i from"../../../core/Error.js";import{JSONSupport as r}from"../../../core/JSONSupport.js";import n from"../../../core/Logger.js";import{isSome as o,unwrap as s,isNone as a}from"../../../core/maybe.js";import{EsriPromiseMixin as l}from"../../../core/Promise.js";import{onAbort as c}from"../../../core/promiseUtils.js";import{property as u}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import{sanitizeUrl as f}from"../arcgisLayerUrl.js";import{url as h}from"../commonProperties.js";import d from"../RasterStorageInfo.js";import p from"../TileInfo.js";import{isMultiSliceOrRangeDefinition as x,createSlices as g,getSliceIds as y}from"./multidimensionalUtils.js";import{getRasterId as I,getBlock as w,putBlock as v,deleteBlock as R,decreaseRefCount as b}from"./RawBlockCache.js";import{decode as k}from"../rasterFormats/RasterCodec.js";import{mosaic as T,approximateTransform as S,getLocalArithmeticNorthRotations as M}from"../rasterFunctions/pixelUtils.js";import{load as B,getWorldWidth as C,projectPoint as P,snapPyramid as W,snapExtent as _,getWorldWrapCount as D,projectExtent as j,getProjectionOffsetGrid as H,getRasterDatasetAlignmentInfo as L,projectResolution as E}from"../rasterFunctions/rasterProjectionHelper.js";import{convertToLocalDirections as F,uvComponentToVector as A}from"../rasterFunctions/vectorFieldUtils.js";import z from"../../../geometry/Extent.js";import O from"../../../geometry/Point.js";const N=8;let U=class extends(l(r)){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=B();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:p.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=C(e.spatialReference);return o(t)&&e.extent.width>=t/2}set url(e){this._set("url",f(e,n.getLogger(this.declaredClass)))}async open(e){throw new i("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,i,r={}){const n=r.tileInfo||this.rasterInfo.storageInfo.tileInfo,o=this.getTileExtentFromTileInfo(e,t,i,n);return this.fetchPixels(o,n.size[0],n.size[1],r)}async identify(e,t={}){var i,r;const{multidimensionalDefinition:n,timeExtent:l}=t,{hasMultidimensionalTranspose:c,multidimensionalInfo:u}=this.rasterInfo;let{transposedVariableName:m}=t;const f=o(u)&&c&&(null!=l||x(n));if(f&&!m){m=o(n)&&n.length>0?n[0].variableName:u.variables[0].name,t={...t,transposedVariableName:m}}t=this._getRequestOptionsWithSliceId(t);const{spatialReference:h,extent:d}=this.rasterInfo,{datumTransformation:p}=t;let g=P(e,h,p);if(!d.intersects(g))return{location:g,value:null};if(o(this.rasterInfo.transform)){const e=this.rasterInfo.transform.inverseTransform(g);if(!this.rasterInfo.nativeExtent.intersects(e))return{location:e,value:null};g=e}let y=0;const R=m&&o(u)&&this.rasterInfo.hasMultidimensionalTranspose;if(!R)if(t.srcResolution){y=W(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel}else if(y=await this.computeBestPyramidLevelForLocation(e,t),null==y)return{location:g,value:null};const b=this.identifyPixelLocation(g,y,null,R);if(null===b)return{location:g,value:null};const{row:k,col:T,rowOffset:S,colOffset:M,blockWidth:B}=b,C=null!=(i=m)?i:s(t.sliceId),_=I(this.url,C),D=`${y}/${k}/${T}`;let j=w(_,null,D);a(j)&&(j=this.fetchRawTile(y,k,T,t),v(_,null,D,j));const H=await j;if(a(H)||null==(r=H.pixels)||!r.length)return{location:g,value:null};const L=S*B+M;return this._processIdentifyResult(H,{srcLocation:g,position:L,pyramidLevel:y,useTransposedTile:R,requestSomeSlices:f,identifyOptions:t})}async fetchPixels(e,t,i,r={}){if(e=_(e),(r=this._getRequestOptionsWithSliceId(r)).requestRawData)return this._fetchPixels(e,t,i,r);const n=C(e.spatialReference),o=D(e);if(a(n)||0===o||1===o&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,i,r);if(o>=3)return{extent:e,pixelBlock:null};const s=[],{xmin:l,xmax:c}=e,u=Math.round(n/(c-l)*t),m=u-Math.round((n/2-l)/(c-l)*t);let f=0;const h=[];for(let a=0;a<=o;a++){const d=new z({xmin:0===a?l:-n/2,xmax:a===o?c-n*a:n/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),p=0===a?u-m:a===o?t-f:u;f+=p,h.push(p);const x=r.disableWrapAround&&a>0?null:this._fetchPixels(d,p,i,r);s.push(x)}const d=(await Promise.all(s)).map((e=>null==e?void 0:e.pixelBlock));let p=null;const x={width:t,height:i};if(this.rasterJobHandler){p=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:x,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:h},r)).pixelBlock}else p=T(d,x,{blockWidths:h});return{extent:e,srcExtent:j(e,this.rasterInfo.spatialReference,r.datumTransformation),pixelBlock:p}}async fetchRawPixels(e,t,i,r={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const n=await this._fetchRawTiles(e,t,i,r),{nativeExtent:s,nativePixelSize:a,storageInfo:l}=this.rasterInfo,c=2**e,u=a.x*c,m=a.y*c,f=new z({xmin:s.xmin+u*t.x,xmax:s.xmin+u*(t.x+i.width-1),ymin:s.ymax-m*(t.y+i.height-1),ymax:s.ymax-m*t.y,spatialReference:s.spatialReference});if(!n)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:h,mosaicSize:d}=n;if(1===h.length&&o(h[0])&&h[0].width===i.width&&h[0].height===i.height)return{extent:f,srcExtent:f,pixelBlock:n.pixelBlocks[0]};const p=e>0?l.pyramidBlockWidth:l.blockWidth,x=e>0?l.pyramidBlockHeight:l.blockHeight,g={x:t.x%p,y:t.y%x};let y;if(this.rasterJobHandler){y=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:h,srcMosaicSize:d,destDimension:i,clipOffset:g,clipSize:i,coefs:null,sampleSpacing:null,interpolation:r.interpolation,alignmentInfo:null,blockWidths:null},r)).pixelBlock}else y=T(h,d,{clipOffset:g,clipSize:i});return{extent:f,srcExtent:f,pixelBlock:y}}fetchRawTile(e,t,r,n){throw new i("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return j(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?k(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,i,r){var n,o;const{customFetchParameters:s}=this.ioConfig,{range:a,query:l,headers:c}=i;r=null!=(n=null!=(o=r)?o:i.retryCount)?n:this.ioConfig.retryCount;const u=a?{Range:`bytes=${a.from}-${a.to}`}:null;try{return await t(e,{...i,query:{...l,...s},headers:{...c,...u}})}catch(m){if(r>0)return r--,this.request(e,i,r);throw m}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;if(a(t))return null;if(a(e)||0===e.length)return null;let i=0;const r=e[0].variableName;for(let n=0;n<t.variables.length;n++){const o=t.variables[n],s=o.dimensions;if(o.name!==r){i+=s.map((e=>this._getDimensionValuesCount(e))).reduce(((e,t)=>e+t));break}const a=s.map((e=>this._getDimensionValuesCount(e))),l=s.length;for(let t=0;t<l;t++){const r=e.find((e=>e.dimensionName===s[t].name));if(null==r)return null;const n=Array.isArray(r.values[0])?r.values[0][0]:r.values[0],o=this._getIndexFromDimensions(n,s[t]);if(-1===o)return null;a.shift(),i+=t===l-1?o:o*a.reduce(((e,t)=>e+t))}}return i}getTileExtentFromTileInfo(e,t,i,r){const n=r.lodAt(e);return this.getTileExtent({x:n.resolution,y:n.resolution},t,i,r.origin,r.spatialReference,r.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:r}=this.rasterInfo;if(!e.tileInfo){const n=[],o=e.maximumPyramidLevel||0;let s=Math.max(r.x,r.y),a=1/.0254*96*s;for(let e=0;e<=o;e++)n.push({level:o-e,resolution:s,scale:a}),s*=2,a*=2;const l=new O({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new p({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:n}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,r){const{width:n,height:o,nativeExtent:s,pixelSize:a,spatialReference:l}=e,c=new O({x:s.xmin,y:s.ymax,spatialReference:l});null==r&&(r=Math.max(0,Math.round(Math.log(Math.max(n,o))/Math.LN2-8)));const u=this.computeBlockBoundary(s,512,512,{x:s.xmin,y:s.ymax},[a],r);e.storageInfo=new d({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:r,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,r,n,o=0,s=2){if(1===n.length&&o>0){n=[...n];let{x:e,y:t}=n[0];for(let i=0;i<o;i++)e*=s,t*=s,n.push({x:e,y:t})}const a=[],{x:l,y:c}=r;for(let u=0;u<n.length;u++){const{x:r,y:o}=n[u];a.push({minCol:Math.floor((e.xmin-l+.1*r)/t/r),maxCol:Math.floor((e.xmax-l-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return a}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:r}=this.rasterInfo.storageInfo;if(0===e)return t;if(o(i)&&i.length)return i[e-1];const n=r**e;return{x:t.x*n,y:t.y*n}}identifyPixelLocation(e,t,i,r){const{spatialReference:n,nativeExtent:s,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:l,origin:c,transposeInfo:u}=a,m=r&&o(u)?u.tileSize[0]:a.blockWidth,f=r&&o(u)?u.tileSize[1]:a.blockHeight,h=P(e,n,i);if(!s.intersects(h))return null;if(t<0||t>l)return null;const d=this.getPyramidPixelSize(t),{x:p,y:x}=d,g=(c.y-h.y)/x/f,y=(h.x-c.x)/p/m,I=Math.min(f-1,Math.floor((g-Math.floor(g))*f)),w=Math.min(m-1,Math.floor((y-Math.floor(y))*m));return{pyramidLevel:t,row:Math.floor(g),col:Math.floor(y),rowOffset:I,colOffset:w,blockWidth:m,srcLocation:h}}getTileExtent(e,t,i,r,n,o){const[s,a]=o,l=r.x+i*s*e.x,c=l+s*e.x,u=r.y-t*a*e.y,m=u-a*e.y;return new z({xmin:l,xmax:c,ymin:m,ymax:u,spatialReference:n})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const r=this.rasterInfo.storageInfo.blockBoundary[e];return!r||r.maxRow<t||r.maxCol<i||r.minRow>t||r.minCol>i}async _fetchPixels(e,t,i,r={}){let n=D(e);if(n>=2)return{extent:e,pixelBlock:null};const a=this._getSourceDataInfo(e,t,i,r),{pyramidLevel:l,pyramidResolution:c,srcResolution:u,srcExtent:m,srcWidth:f,srcHeight:h}=a;if(0===f||0===h)return{extent:e,srcExtent:m,pixelBlock:null};const d=s(this.rasterInfo.transform),p="gcs-shift"===(null==d?void 0:d.type),x=o(C(e.spatialReference));!p&&x||(n=D(a.srcExtent,p));const g=this.rasterInfo.storageInfo,y={x:Math.floor((m.xmin-g.origin.x)/c.x+.1),y:Math.floor((g.origin.y-m.ymax)/c.y+.1)},I=await this._fetchRawTiles(l,y,{width:f,height:h,wrapCount:n},r);if(!I)return{extent:e,srcExtent:m,pixelBlock:null};const w=l>0?g.pyramidBlockWidth:g.blockWidth,v=l>0?g.pyramidBlockHeight:g.blockHeight,R=w===f&&v===h&&y.x%w==0&&y.y%v==0,b=new O({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),k=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:P}=r;if(!k&&R&&1===I.pixelBlocks.length&&w===t&&v===i&&u.x===b.x&&u.y===b.y)return{extent:e,srcExtent:m,pixelBlock:I.pixelBlocks[0]};const W=x&&o(C(m.spatialReference)),_=r.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");_&&!this.rasterJobHandler&&await B();const j=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:I.extent,pixelSize:b.toJSON(),datumTransformation:P,rasterTransform:d,hasWrapAround:n>0||W,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:_},r):H({projectedExtent:e,srcBufferExtent:I.extent,pixelSize:b,datumTransformation:P,rasterTransform:d,hasWrapAround:n>0||W,isAdaptive:!1,includeGCSGrid:_});let L;const E=!r.requestRawData,A={rows:j.spacing[0],cols:j.spacing[1]},z=s(this._getRasterTileAlignmentInfo(l,I.extent.xmin)),{pixelBlocks:N,mosaicSize:U,isPartiallyFilled:q}=I;let G=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:N,srcMosaicSize:U,destDimension:E?{width:t,height:i}:null,coefs:E?j.coefficients:null,sampleSpacing:E?A:null,projectDirections:_,gcsGrid:_?j.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:r.interpolation,alignmentInfo:z,blockWidths:null},r);({pixelBlock:L,localNorthDirections:G}=e)}else{const e=T(N,U,{alignmentInfo:z});L=E?S(e,{width:t,height:i},j.coefficients,A,r.interpolation):e,_&&j.gcsGrid&&(G=M({width:t,height:i},j.gcsGrid),L=F(L,this.rasterInfo.dataType,G))}return r.requestRawData||_?{srcExtent:m,pixelBlock:L,transformGrid:j,localNorthDirections:G,extent:e,isPartiallyFilled:q}:{srcExtent:m,extent:e,pixelBlock:L}}async _fetchRawTiles(e,t,i,r){const{origin:n,blockBoundary:s}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:l}=this.getBlockWidthHeight(e);let{x:c,y:u}=t,{width:m,height:f,wrapCount:h}=i;const d=this._getRasterTileAlignmentInfo(e,0);r.buffer&&(c-=r.buffer.cols,u-=r.buffer.rows,m+=2*r.buffer.cols,f+=2*r.buffer.rows);let p=0,x=0,g=0;if(h&&o(d)){({worldColumnCountFromOrigin:x,originColumnOffset:g,rightPadding:p}=d);x*d.blockWidth-p>=c+m&&(p=0)}const y=Math.floor(c/a),I=Math.floor(u/l),w=Math.floor((c+m+p-1)/a),v=Math.floor((u+f+p-1)/l),R=s[e];if(!R)return null;const{minRow:b,minCol:k,maxCol:T,maxRow:S}=R;if(0===h&&(v<b||w<k||I>S||y>T))return null;const M=new Array;let B=!1;const C=null==this.ioConfig.allowPartialFill?r.allowPartialFill:this.ioConfig.allowPartialFill;for(let L=I;L<=v;L++)for(let t=y;t<=w;t++){let i=t;if(!r.disableWrapAround&&h&&o(d)&&x<=t&&(i=t-x-g),L>=b&&i>=k&&S>=L&&T>=i){const t=this._fetchRawTile(e,L,i,r);C?M.push(new Promise((e=>{t.then((t=>e(t))).catch((()=>{B=!0,e(null)}))}))):M.push(t)}else M.push(null)}if(0===M.length)return null;const P=await Promise.all(M),W={height:(v-I+1)*l,width:(w-y+1)*a},{spatialReference:_}=this.rasterInfo,D=this.getPyramidPixelSize(e),{x:j,y:H}=D;return{extent:new z({xmin:n.x+y*a*j,xmax:n.x+(w+1)*a*j,ymin:n.y-(v+1)*l*H,ymax:n.y-I*l*H,spatialReference:_}),pixelBlocks:P,mosaicSize:W,isPartiallyFilled:B}}_fetchRawTile(e,t,i,r){const n=this.rasterInfo.storageInfo.blockBoundary[e];if(!n)return Promise.resolve(null);const{minRow:o,minCol:s,maxCol:l,maxRow:u}=n;if(t<o||i<s||t>u||i>l)return Promise.resolve(null);const m=I(this.url,r.sliceId),f=`${e}/${t}/${i}`;let h=w(m,r.registryId,f);if(a(h)){const n=new AbortController;h=this.fetchRawTile(e,t,i,{...r,signal:n.signal}),v(m,r.registryId,f,h,n),h.catch((()=>R(m,r.registryId,f)))}return r.signal&&c(r,(()=>{b(m,r.registryId,f)})),h}_computeMagDirValues(e){var t;const{bandCount:i,dataType:r}=this.rasterInfo;if(!(2===i&&"vector-magdir"===r||"vector-uv"===r)||2!==(null==e?void 0:e.length)||null==(t=e[0])||!t.length)return null;const n=e[0].length;if("vector-magdir"===r){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[o,s]=e,a=[],l=[];for(let c=0;c<n;c++){const[e,t]=A([o[c],s[c]]);a.push(e),l.push(t)}return[a,l]}_getIndexFromDimensions(e,t){const{extent:i,interval:r,unit:n,values:o}=t;if(null!=o&&o.length)return Array.isArray(o[0])?o.findIndex((t=>t[0]<=e&&t[1]>=e)):o.indexOf(e);if(e>i[1])return-1;const s=i[0];let a=-1;if("ISO8601"===n){var l;switch((null==(l=t.intervalUnit)?void 0:l.toLowerCase())||"seconds"){case"seconds":a=Math.round((e-s)/1e3/r);break;case"minutes":a=Math.round((e-s)/6e4/r);break;case"hours":a=Math.round((e-s)/36e5/r);break;case"days":a=Math.round((e-s)/864e5/r);break;case"years":a=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/r);break;case"decades":a=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/10/r)}return a}return Math.round((e-s)/r)}_getDimensionValuesCount(e){const{extent:t,interval:i,unit:r,values:n}=e;let o=(null==n?void 0:n.length)||0;if(o)return o;const s=t[0];if(0===o&&"ISO8601"===r){var a;switch((null==(a=e.intervalUnit)?void 0:a.toLowerCase())||"seconds"){case"seconds":o=Math.round((t[1]-t[0])/1e3/i);break;case"minutes":o=Math.round((t[1]-t[0])/6e4/i);break;case"hours":o=Math.round((t[1]-t[0])/36e5/i);break;case"days":o=Math.round((t[1]-t[0])/864e5/i);break;case"years":o=Math.round((new Date(t[1]).getUTCFullYear()-new Date(s).getUTCFullYear())/i);break;case"decades":o=Math.round((new Date(t[1]).getUTCFullYear()-new Date(s).getUTCFullYear())/10/i)}return o}return Math.round((t[1]-t[0])/i)}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=L(this.rasterInfo)),a(this._rasterTileAlighmentInfo.pyramidsInfo)?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,r={}){const n={datumTransformation:r.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0};r.srcResolution&&(n.srcResolution=r.srcResolution,this._updateSourceDataInfo(e,n));const o=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:s,srcHeight:a,pyramidLevel:l}=n,c=s/t,u=a/i,m=l<o&&c*u>=16;if(m||l===o&&(c>N||u>N)||(0===s||0===a)){const s=new O({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let a=E(s,this.rasterInfo.spatialReference,e,n.datumTransformation);const f=!a||r.srcResolution&&a.x+a.y<r.srcResolution.x+r.srcResolution.y;if(m&&r.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,u))/Math.LN2)-1;if(o-l+3>=e){const t=2**e;a={x:r.srcResolution.x*t,y:r.srcResolution.y*t}}}a&&(n.srcResolution=a,this._updateSourceDataInfo(e,n))}return(n.srcWidth/t>N||n.srcHeight/i>N)&&(n.srcWidth=0,n.srcHeight=0),n}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const i=this.rasterInfo.spatialReference,{srcResolution:r,datumTransformation:n}=t,{pyramidLevel:o,pyramidResolution:a,excessiveReading:l}=W(r,this.rasterInfo,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||j(e,i,n);if(null==c)return;const u=s(this.rasterInfo.transform);u&&(c=u.inverseTransform(c)),t.srcExtent=c;const m=Math.ceil((c.xmax-c.xmin)/a.x-.1),f=Math.ceil((c.ymax-c.ymin)/a.y-.1);t.pyramidLevel=o,t.pyramidResolution=a,t.srcWidth=m,t.srcHeight=f}_getRequestOptionsWithSliceId(e){return o(this.rasterInfo.multidimensionalInfo)&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:r,pyramidLevel:n,useTransposedTile:o}=t,l=e.pixels[0].length/e.width/e.height;if(!(!e.mask||e.mask[r]))return{location:i,value:null};const{multidimensionalInfo:c}=this.rasterInfo;if(a(c)||!o){const t=e.pixels.map((e=>e[r])),o={location:i,value:t,pyramidLevel:n},s=this._computeMagDirValues(t.map((e=>[e])));return null!=s&&s.length&&(o.magdirValue=s.map((e=>e[0]))),o}let u=e.pixels.map((e=>Array.prototype.slice.call(e,r*l,r*l+l))),m=this._computeMagDirValues(u);const{requestSomeSlices:f,identifyOptions:h}=t;let d=g(c,h.transposedVariableName);if(f){var p;const e=y(d,s(h.multidimensionalDefinition),s(h.timeExtent));u=u.map((t=>e.map((e=>t[e])))),m=null==(p=m)?void 0:p.map((t=>e.map((e=>t[e])))),d=e.map((e=>d[e]))}return{location:i,value:null,dataSeries:d.map(((e,t)=>{var i;const r={value:u.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition,variableName:e.multidimensionalDefinition[0].variableName,dimensionValues:{}};return null!=(i=m)&&i.length&&(r.magdirValue=[m[0][t],m[1][t]]),e.multidimensionalDefinition.forEach((e=>r.dimensionValues[e.dimensionName]=e.values[0])),r})),pyramidLevel:n}}};e([u()],U.prototype,"_rasterTileAlighmentInfo",void 0),e([u({readOnly:!0})],U.prototype,"_isGlobalWrappableSource",null),e([u(h)],U.prototype,"url",null),e([u({type:String,json:{write:!0}})],U.prototype,"datasetName",void 0),e([u({type:String,json:{write:!0}})],U.prototype,"datasetFormat",void 0),e([u()],U.prototype,"rasterInfo",void 0),e([u()],U.prototype,"ioConfig",void 0),e([u()],U.prototype,"sourceJSON",void 0),U=e([m("esri.layers.support.rasterDatasets.BaseRaster")],U);const q=U;export{q as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../request.js";import i from"../../../core/Error.js";import{JSONSupport as r}from"../../../core/JSONSupport.js";import n from"../../../core/Logger.js";import{isSome as o,unwrap as s,isNone as a}from"../../../core/maybe.js";import{EsriPromiseMixin as l}from"../../../core/Promise.js";import{onAbort as c}from"../../../core/promiseUtils.js";import{property as m}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as u}from"../../../core/accessorSupport/decorators/subclass.js";import{sanitizeUrl as f}from"../arcgisLayerUrl.js";import{url as h}from"../commonProperties.js";import d from"../RasterStorageInfo.js";import p from"../TileInfo.js";import{isMultiSliceOrRangeDefinition as x,createSlices as g,getSliceIds as y}from"./multidimensionalUtils.js";import{getRasterId as I,getBlock as w,putBlock as R,deleteBlock as b,decreaseRefCount as k}from"./RawBlockCache.js";import{decode as v}from"../rasterFormats/RasterCodec.js";import{mosaic as T,approximateTransform as S,getLocalArithmeticNorthRotations as M}from"../rasterFunctions/pixelUtils.js";import{load as B,getWorldWidth as C,projectPoint as P,snapPyramid as W,snapExtent as _,getWorldWrapCount as D,projectExtent as j,getProjectionOffsetGrid as H,getRasterDatasetAlignmentInfo as L,projectResolution as E}from"../rasterFunctions/rasterProjectionHelper.js";import{convertToLocalDirections as F,uvComponentToVector as A}from"../rasterFunctions/vectorFieldUtils.js";import z from"../../../geometry/Extent.js";import O from"../../../geometry/Point.js";const N=8;let U=class extends(l(r)){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=B();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:p.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=C(e.spatialReference);return o(t)&&e.extent.width>=t/2}set url(e){this._set("url",f(e,n.getLogger(this.declaredClass)))}async open(e){throw new i("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,i,r={}){const n=r.tileInfo||this.rasterInfo.storageInfo.tileInfo,o=this.getTileExtentFromTileInfo(e,t,i,n);return this.fetchPixels(o,n.size[0],n.size[1],r)}async identify(e,t={}){const{multidimensionalDefinition:i,timeExtent:r}=t,{hasMultidimensionalTranspose:n,multidimensionalInfo:l}=this.rasterInfo;let{transposedVariableName:c}=t;const m=o(l)&&n&&(null!=r||x(i));if(m&&!c){c=o(i)&&i.length>0?i[0].variableName:l.variables[0].name,t={...t,transposedVariableName:c}}t=this._getRequestOptionsWithSliceId(t);const{spatialReference:u,extent:f}=this.rasterInfo,{datumTransformation:h}=t;let d=P(e,u,h);if(!f.intersects(d))return{location:d,value:null};if(o(this.rasterInfo.transform)){const e=this.rasterInfo.transform.inverseTransform(d);if(!this.rasterInfo.nativeExtent.intersects(e))return{location:e,value:null};d=e}let p=0;const g=c&&o(l)&&this.rasterInfo.hasMultidimensionalTranspose;if(!g)if(t.srcResolution){p=W(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel}else if(p=await this.computeBestPyramidLevelForLocation(e,t),null==p)return{location:d,value:null};const y=this.identifyPixelLocation(d,p,null,g);if(null===y)return{location:d,value:null};const{row:b,col:k,rowOffset:v,colOffset:T,blockWidth:S}=y,M=c??s(t.sliceId),B=I(this.url,M),C=`${p}/${b}/${k}`;let _=w(B,null,C);a(_)&&(_=this.fetchRawTile(p,b,k,t),R(B,null,C,_));const D=await _;if(a(D)||!D.pixels?.length)return{location:d,value:null};const j=v*S+T;return this._processIdentifyResult(D,{srcLocation:d,position:j,pyramidLevel:p,useTransposedTile:g,requestSomeSlices:m,identifyOptions:t})}async fetchPixels(e,t,i,r={}){if(e=_(e),(r=this._getRequestOptionsWithSliceId(r)).requestRawData)return this._fetchPixels(e,t,i,r);const n=C(e.spatialReference),o=D(e);if(a(n)||0===o||1===o&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,i,r);if(o>=3)return{extent:e,pixelBlock:null};const s=[],{xmin:l,xmax:c}=e,m=Math.round(n/(c-l)*t),u=m-Math.round((n/2-l)/(c-l)*t);let f=0;const h=[];for(let a=0;a<=o;a++){const d=new z({xmin:0===a?l:-n/2,xmax:a===o?c-n*a:n/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),p=0===a?m-u:a===o?t-f:m;f+=p,h.push(p);const x=r.disableWrapAround&&a>0?null:this._fetchPixels(d,p,i,r);s.push(x)}const d=(await Promise.all(s)).map((e=>e?.pixelBlock));let p=null;const x={width:t,height:i};if(this.rasterJobHandler){p=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:x,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:h},r)).pixelBlock}else p=T(d,x,{blockWidths:h});return{extent:e,srcExtent:j(e,this.rasterInfo.spatialReference,r.datumTransformation),pixelBlock:p}}async fetchRawPixels(e,t,i,r={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const n=await this._fetchRawTiles(e,t,i,r),{nativeExtent:s,nativePixelSize:a,storageInfo:l}=this.rasterInfo,c=2**e,m=a.x*c,u=a.y*c,f=new z({xmin:s.xmin+m*t.x,xmax:s.xmin+m*(t.x+i.width-1),ymin:s.ymax-u*(t.y+i.height-1),ymax:s.ymax-u*t.y,spatialReference:s.spatialReference});if(!n)return{extent:f,srcExtent:f,pixelBlock:null};const{pixelBlocks:h,mosaicSize:d}=n;if(1===h.length&&o(h[0])&&h[0].width===i.width&&h[0].height===i.height)return{extent:f,srcExtent:f,pixelBlock:n.pixelBlocks[0]};const p=e>0?l.pyramidBlockWidth:l.blockWidth,x=e>0?l.pyramidBlockHeight:l.blockHeight,g={x:t.x%p,y:t.y%x};let y;if(this.rasterJobHandler){y=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:h,srcMosaicSize:d,destDimension:i,clipOffset:g,clipSize:i,coefs:null,sampleSpacing:null,interpolation:r.interpolation,alignmentInfo:null,blockWidths:null},r)).pixelBlock}else y=T(h,d,{clipOffset:g,clipSize:i});return{extent:f,srcExtent:f,pixelBlock:y}}fetchRawTile(e,t,r,n){throw new i("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return j(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?v(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,i,r){const{customFetchParameters:n}=this.ioConfig,{range:o,query:s,headers:a}=i;r=r??i.retryCount??this.ioConfig.retryCount;const l=o?{Range:`bytes=${o.from}-${o.to}`}:null;try{return await t(e,{...i,query:{...s,...n},headers:{...a,...l}})}catch(c){if(r>0)return r--,this.request(e,i,r);throw c}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;if(a(t))return null;if(a(e)||0===e.length)return null;let i=0;const r=e[0].variableName;for(let n=0;n<t.variables.length;n++){const o=t.variables[n],s=o.dimensions;if(o.name!==r){i+=s.map((e=>this._getDimensionValuesCount(e))).reduce(((e,t)=>e+t));break}const a=s.map((e=>this._getDimensionValuesCount(e))),l=s.length;for(let t=0;t<l;t++){const r=e.find((e=>e.dimensionName===s[t].name));if(null==r)return null;const n=Array.isArray(r.values[0])?r.values[0][0]:r.values[0],o=this._getIndexFromDimensions(n,s[t]);if(-1===o)return null;a.shift(),i+=t===l-1?o:o*a.reduce(((e,t)=>e+t))}}return i}getTileExtentFromTileInfo(e,t,i,r){const n=r.lodAt(e);return this.getTileExtent({x:n.resolution,y:n.resolution},t,i,r.origin,r.spatialReference,r.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:r}=this.rasterInfo;if(!e.tileInfo){const n=[],o=e.maximumPyramidLevel||0;let s=Math.max(r.x,r.y),a=1/.0254*96*s;for(let e=0;e<=o;e++)n.push({level:o-e,resolution:s,scale:a}),s*=2,a*=2;const l=new O({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new p({origin:l,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:n}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,r){const{width:n,height:o,nativeExtent:s,pixelSize:a,spatialReference:l}=e,c=new O({x:s.xmin,y:s.ymax,spatialReference:l});null==r&&(r=Math.max(0,Math.round(Math.log(Math.max(n,o))/Math.LN2-8)));const m=this.computeBlockBoundary(s,512,512,{x:s.xmin,y:s.ymax},[a],r);e.storageInfo=new d({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:r,blockBoundary:m})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,r,n,o=0,s=2){if(1===n.length&&o>0){n=[...n];let{x:e,y:t}=n[0];for(let i=0;i<o;i++)e*=s,t*=s,n.push({x:e,y:t})}const a=[],{x:l,y:c}=r;for(let m=0;m<n.length;m++){const{x:r,y:o}=n[m];a.push({minCol:Math.floor((e.xmin-l+.1*r)/t/r),maxCol:Math.floor((e.xmax-l-.1*r)/t/r),minRow:Math.floor((c-e.ymax+.1*o)/i/o),maxRow:Math.floor((c-e.ymin-.1*o)/i/o)})}return a}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:r}=this.rasterInfo.storageInfo;if(0===e)return t;if(o(i)&&i.length)return i[e-1];const n=r**e;return{x:t.x*n,y:t.y*n}}identifyPixelLocation(e,t,i,r){const{spatialReference:n,nativeExtent:s,storageInfo:a}=this.rasterInfo,{maximumPyramidLevel:l,origin:c,transposeInfo:m}=a,u=r&&o(m)?m.tileSize[0]:a.blockWidth,f=r&&o(m)?m.tileSize[1]:a.blockHeight,h=P(e,n,i);if(!s.intersects(h))return null;if(t<0||t>l)return null;const d=this.getPyramidPixelSize(t),{x:p,y:x}=d,g=(c.y-h.y)/x/f,y=(h.x-c.x)/p/u,I=Math.min(f-1,Math.floor((g-Math.floor(g))*f)),w=Math.min(u-1,Math.floor((y-Math.floor(y))*u));return{pyramidLevel:t,row:Math.floor(g),col:Math.floor(y),rowOffset:I,colOffset:w,blockWidth:u,srcLocation:h}}getTileExtent(e,t,i,r,n,o){const[s,a]=o,l=r.x+i*s*e.x,c=l+s*e.x,m=r.y-t*a*e.y,u=m-a*e.y;return new z({xmin:l,xmax:c,ymin:u,ymax:m,spatialReference:n})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const r=this.rasterInfo.storageInfo.blockBoundary[e];return!r||r.maxRow<t||r.maxCol<i||r.minRow>t||r.minCol>i}async _fetchPixels(e,t,i,r={}){let n=D(e);if(n>=2)return{extent:e,pixelBlock:null};const a=this._getSourceDataInfo(e,t,i,r),{pyramidLevel:l,pyramidResolution:c,srcResolution:m,srcExtent:u,srcWidth:f,srcHeight:h}=a;if(0===f||0===h)return{extent:e,srcExtent:u,pixelBlock:null};const d=s(this.rasterInfo.transform),p="gcs-shift"===d?.type,x=o(C(e.spatialReference));!p&&x||(n=D(a.srcExtent,p));const g=this.rasterInfo.storageInfo,y={x:Math.floor((u.xmin-g.origin.x)/c.x+.1),y:Math.floor((g.origin.y-u.ymax)/c.y+.1)},I=await this._fetchRawTiles(l,y,{width:f,height:h,wrapCount:n},r);if(!I)return{extent:e,srcExtent:u,pixelBlock:null};const w=l>0?g.pyramidBlockWidth:g.blockWidth,R=l>0?g.pyramidBlockHeight:g.blockHeight,b=w===f&&R===h&&y.x%w==0&&y.y%R==0,k=new O({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),v=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:P}=r;if(!v&&b&&1===I.pixelBlocks.length&&w===t&&R===i&&m.x===k.x&&m.y===k.y)return{extent:e,srcExtent:u,pixelBlock:I.pixelBlocks[0]};const W=x&&o(C(u.spatialReference)),_=r.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");_&&!this.rasterJobHandler&&await B();const j=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:I.extent,pixelSize:k.toJSON(),datumTransformation:P,rasterTransform:d,hasWrapAround:n>0||W,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:_},r):H({projectedExtent:e,srcBufferExtent:I.extent,pixelSize:k,datumTransformation:P,rasterTransform:d,hasWrapAround:n>0||W,isAdaptive:!1,includeGCSGrid:_});let L;const E=!r.requestRawData,A={rows:j.spacing[0],cols:j.spacing[1]},z=s(this._getRasterTileAlignmentInfo(l,I.extent.xmin)),{pixelBlocks:N,mosaicSize:U,isPartiallyFilled:q}=I;let G=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:N,srcMosaicSize:U,destDimension:E?{width:t,height:i}:null,coefs:E?j.coefficients:null,sampleSpacing:E?A:null,projectDirections:_,gcsGrid:_?j.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:r.interpolation,alignmentInfo:z,blockWidths:null},r);({pixelBlock:L,localNorthDirections:G}=e)}else{const e=T(N,U,{alignmentInfo:z});L=E?S(e,{width:t,height:i},j.coefficients,A,r.interpolation):e,_&&j.gcsGrid&&(G=M({width:t,height:i},j.gcsGrid),L=F(L,this.rasterInfo.dataType,G))}return r.requestRawData||_?{srcExtent:u,pixelBlock:L,transformGrid:j,localNorthDirections:G,extent:e,isPartiallyFilled:q}:{srcExtent:u,extent:e,pixelBlock:L}}async _fetchRawTiles(e,t,i,r){const{origin:n,blockBoundary:s}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:l}=this.getBlockWidthHeight(e);let{x:c,y:m}=t,{width:u,height:f,wrapCount:h}=i;const d=this._getRasterTileAlignmentInfo(e,0);r.buffer&&(c-=r.buffer.cols,m-=r.buffer.rows,u+=2*r.buffer.cols,f+=2*r.buffer.rows);let p=0,x=0,g=0;if(h&&o(d)){({worldColumnCountFromOrigin:x,originColumnOffset:g,rightPadding:p}=d);x*d.blockWidth-p>=c+u&&(p=0)}const y=Math.floor(c/a),I=Math.floor(m/l),w=Math.floor((c+u+p-1)/a),R=Math.floor((m+f+p-1)/l),b=s[e];if(!b)return null;const{minRow:k,minCol:v,maxCol:T,maxRow:S}=b;if(0===h&&(R<k||w<v||I>S||y>T))return null;const M=new Array;let B=!1;const C=null==this.ioConfig.allowPartialFill?r.allowPartialFill:this.ioConfig.allowPartialFill;for(let L=I;L<=R;L++)for(let t=y;t<=w;t++){let i=t;if(!r.disableWrapAround&&h&&o(d)&&x<=t&&(i=t-x-g),L>=k&&i>=v&&S>=L&&T>=i){const t=this._fetchRawTile(e,L,i,r);C?M.push(new Promise((e=>{t.then((t=>e(t))).catch((()=>{B=!0,e(null)}))}))):M.push(t)}else M.push(null)}if(0===M.length)return null;const P=await Promise.all(M),W={height:(R-I+1)*l,width:(w-y+1)*a},{spatialReference:_}=this.rasterInfo,D=this.getPyramidPixelSize(e),{x:j,y:H}=D;return{extent:new z({xmin:n.x+y*a*j,xmax:n.x+(w+1)*a*j,ymin:n.y-(R+1)*l*H,ymax:n.y-I*l*H,spatialReference:_}),pixelBlocks:P,mosaicSize:W,isPartiallyFilled:B}}_fetchRawTile(e,t,i,r){const n=this.rasterInfo.storageInfo.blockBoundary[e];if(!n)return Promise.resolve(null);const{minRow:o,minCol:s,maxCol:l,maxRow:m}=n;if(t<o||i<s||t>m||i>l)return Promise.resolve(null);const u=I(this.url,r.sliceId),f=`${e}/${t}/${i}`;let h=w(u,r.registryId,f);if(a(h)){const n=new AbortController;h=this.fetchRawTile(e,t,i,{...r,signal:n.signal}),R(u,r.registryId,f,h,n),h.catch((()=>b(u,r.registryId,f)))}return r.signal&&c(r,(()=>{k(u,r.registryId,f)})),h}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if(!(2===t&&"vector-magdir"===i||"vector-uv"===i)||2!==e?.length||!e[0]?.length)return null;const r=e[0].length;if("vector-magdir"===i){const t=e[1].map((e=>(e+360)%360));return[e[0],t]}const[n,o]=e,s=[],a=[];for(let l=0;l<r;l++){const[e,t]=A([n[l],o[l]]);s.push(e),a.push(t)}return[s,a]}_getIndexFromDimensions(e,t){const{extent:i,interval:r,unit:n,values:o}=t;if(o?.length)return Array.isArray(o[0])?o.findIndex((t=>t[0]<=e&&t[1]>=e)):o.indexOf(e);if(e>i[1])return-1;const s=i[0];let a=-1;if("ISO8601"===n){switch(t.intervalUnit?.toLowerCase()||"seconds"){case"seconds":a=Math.round((e-s)/1e3/r);break;case"minutes":a=Math.round((e-s)/6e4/r);break;case"hours":a=Math.round((e-s)/36e5/r);break;case"days":a=Math.round((e-s)/864e5/r);break;case"years":a=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/r);break;case"decades":a=Math.round((new Date(e).getUTCFullYear()-new Date(s).getUTCFullYear())/10/r)}return a}return Math.round((e-s)/r)}_getDimensionValuesCount(e){const{extent:t,interval:i,unit:r,values:n}=e;let o=n?.length||0;if(o)return o;const s=t[0];if(0===o&&"ISO8601"===r){switch(e.intervalUnit?.toLowerCase()||"seconds"){case"seconds":o=Math.round((t[1]-t[0])/1e3/i);break;case"minutes":o=Math.round((t[1]-t[0])/6e4/i);break;case"hours":o=Math.round((t[1]-t[0])/36e5/i);break;case"days":o=Math.round((t[1]-t[0])/864e5/i);break;case"years":o=Math.round((new Date(t[1]).getUTCFullYear()-new Date(s).getUTCFullYear())/i);break;case"decades":o=Math.round((new Date(t[1]).getUTCFullYear()-new Date(s).getUTCFullYear())/10/i)}return o}return Math.round((t[1]-t[0])/i)}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlighmentInfo&&(this._rasterTileAlighmentInfo=L(this.rasterInfo)),a(this._rasterTileAlighmentInfo.pyramidsInfo)?null:{startX:t,halfWorldWidth:this._rasterTileAlighmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlighmentInfo.hasGCSSShiftTransform,...this._rasterTileAlighmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,r={}){const n={datumTransformation:r.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0};r.srcResolution&&(n.srcResolution=r.srcResolution,this._updateSourceDataInfo(e,n));const o=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:s,srcHeight:a,pyramidLevel:l}=n,c=s/t,m=a/i,u=l<o&&c*m>=16;if(u||l===o&&(c>N||m>N)||(0===s||0===a)){const s=new O({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let a=E(s,this.rasterInfo.spatialReference,e,n.datumTransformation);const f=!a||r.srcResolution&&a.x+a.y<r.srcResolution.x+r.srcResolution.y;if(u&&r.srcResolution&&f){const e=Math.round(Math.log(Math.max(c,m))/Math.LN2)-1;if(o-l+3>=e){const t=2**e;a={x:r.srcResolution.x*t,y:r.srcResolution.y*t}}}a&&(n.srcResolution=a,this._updateSourceDataInfo(e,n))}return(n.srcWidth/t>N||n.srcHeight/i>N)&&(n.srcWidth=0,n.srcHeight=0),n}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const i=this.rasterInfo.spatialReference,{srcResolution:r,datumTransformation:n}=t,{pyramidLevel:o,pyramidResolution:a,excessiveReading:l}=W(r,this.rasterInfo,this.ioConfig.sampling);if(l)return;let c=t.srcExtent||j(e,i,n);if(null==c)return;const m=s(this.rasterInfo.transform);m&&(c=m.inverseTransform(c)),t.srcExtent=c;const u=Math.ceil((c.xmax-c.xmin)/a.x-.1),f=Math.ceil((c.ymax-c.ymin)/a.y-.1);t.pyramidLevel=o,t.pyramidResolution=a,t.srcWidth=u,t.srcHeight=f}_getRequestOptionsWithSliceId(e){return o(this.rasterInfo.multidimensionalInfo)&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:r,pyramidLevel:n,useTransposedTile:o}=t,l=e.pixels[0].length/e.width/e.height;if(!(!e.mask||e.mask[r]))return{location:i,value:null};const{multidimensionalInfo:c}=this.rasterInfo;if(a(c)||!o){const t=e.pixels.map((e=>e[r])),o={location:i,value:t,pyramidLevel:n},s=this._computeMagDirValues(t.map((e=>[e])));return s?.length&&(o.magdirValue=s.map((e=>e[0]))),o}let m=e.pixels.map((e=>Array.prototype.slice.call(e,r*l,r*l+l))),u=this._computeMagDirValues(m);const{requestSomeSlices:f,identifyOptions:h}=t;let d=g(c,h.transposedVariableName);if(f){const e=y(d,s(h.multidimensionalDefinition),s(h.timeExtent));m=m.map((t=>e.map((e=>t[e])))),u=u?.map((t=>e.map((e=>t[e])))),d=e.map((e=>d[e]))}return{location:i,value:null,dataSeries:d.map(((e,t)=>{const i={value:m.map((e=>e[t])),multidimensionalDefinition:e.multidimensionalDefinition,variableName:e.multidimensionalDefinition[0].variableName,dimensionValues:{}};return u?.length&&(i.magdirValue=[u[0][t],u[1][t]]),e.multidimensionalDefinition.forEach((e=>i.dimensionValues[e.dimensionName]=e.values[0])),i})),pyramidLevel:n}}};e([m()],U.prototype,"_rasterTileAlighmentInfo",void 0),e([m({readOnly:!0})],U.prototype,"_isGlobalWrappableSource",null),e([m(h)],U.prototype,"url",null),e([m({type:String,json:{write:!0}})],U.prototype,"datasetName",void 0),e([m({type:String,json:{write:!0}})],U.prototype,"datasetFormat",void 0),e([m()],U.prototype,"rasterInfo",void 0),e([m()],U.prototype,"ioConfig",void 0),e([m()],U.prototype,"sourceJSON",void 0),U=e([u("esri.layers.support.rasterDatasets.BaseRaster")],U);const q=U;export{q as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import{isNone as r,isSome as i}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import s from"../RasterInfo.js";import n from"../RasterStorageInfo.js";import l from"../TileInfo.js";import f from"./BaseRaster.js";import m from"./DBFParser.js";import{isTransformSupported as c,readTransform as p}from"../rasterTransforms/utils.js";import d from"../../../rest/support/FeatureSet.js";import u from"../../../geometry/SpatialReference.js";import h from"../../../geometry/Extent.js";import g from"../../../geometry/Point.js";const y=new Map;y.set("int16","esriFieldTypeSmallInteger"),y.set("int32","esriFieldTypeInteger"),y.set("int64","esriFieldTypeInteger"),y.set("float32","esriFieldTypeSingle"),y.set("float64","esriFieldTypeDouble"),y.set("text","esriFieldTypeString");const x=8;let S=class extends f{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:r}=await this.request(this.url+"/conf.json",{signal:null==e?void 0:e.signal});if(!this._validateHeader(r))throw new t("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:i,rasterInfo:o}=this._parseHeader(r);if("thematic"===o.dataType){const e=await this._fetchAuxiliaryInformation();o.attributeTable=e}this._set("storageInfo",i),this._set("rasterInfo",o),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,r,i={}){const{transposeInfo:o}=this.rasterInfo.storageInfo,{transposedVariableName:a}=i,s=!(!o||!a),n=s?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(n<0)return null;const l=this._buildCacheFilePath(n,t,r,i.multidimensionalDefinition,a),f=this._getIndexRecordFromBundle(t,r,s),m=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:i.signal});if(!m)return null;const c=new Uint8Array(m.data),p=this._getTileEndAndContentType(c,f);if(0===p.recordSize)return null;const d=await this.request(l,{range:{from:p.position,to:p.position+p.recordSize},responseType:"array-buffer",signal:i.signal});if(!d)return null;const[u,h]=this._getTileSize(s);return this.decodePixelBlock(d.data,{width:u,height:h,planes:null,pixelType:null,returnPixelInterleavedDims:s})}_validateHeader(e){const t=["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"];return e&&"RasterInfo"===e.type&&!t.some((t=>!e[t]))}_parseHeader(e){var t,r;const i=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:o,histograms:a,colormap:f,blockWidth:m,blockHeight:c,firstPyramidLevel:p,maximumPyramidLevel:d}=e,y=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),S=e.extent.spatialReference,I=null==(t=e.geodataXform)?void 0:t.spatialReference,v=new u(null!=S&&S.wkid||null!=S&&S.wkt?S:I);let w=new h({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:v});const _=new g({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:v}),b=Math.round((w.xmax-w.xmin)/_.x),z=Math.round((w.ymax-w.ymin)/_.y),T=this._parseTransform(e.geodataXform),k=T?w:null;T&&(w=T.forwardTransform(w),_.x=(w.xmax-w.xmin)/b,_.y=(w.ymax-w.ymin)/z);const j=null!=(r=e.properties)?r:{},C=e.format.toLowerCase().replace("cache/",""),R=new g(e.origin.x,e.origin.y,v);let F,P,H,D;if(f&&f.colors)for(F=[],P=0;P<f.colors.length;P++)H=f.colors[P],D=f.values?f.values[P]:P,F.push([D,255&H,H<<16>>>24,H<<8>>>24,H>>>24]);const L=e.LODInfos,M=[];for(P=0;P<L.levels.length;P++)M.push({level:L.levels[P],resolution:L.resolutions[P],scale:96/.0254*L.resolutions[P]});const B=new l({dpi:96,lods:M,format:C,origin:R,size:[m,c],spatialReference:v}),O={recordSize:x,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*x+64},$=[{maxCol:Math.ceil(b/m)-1,maxRow:Math.ceil(z/c)-1,minCol:0,minRow:0}];let N=2;if(d>0)for(P=0;P<d;P++)$.push({maxCol:Math.ceil(b/N/m)-1,maxRow:Math.ceil(z/N/c)-1,minCol:0,minRow:0}),N*=2;const q=e.mdInfo;let X=null;if(q&&j._yxs){const e=j._yxs;X={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:O,rasterInfo:new s({width:b,height:z,pixelType:i,bandCount:o,extent:w,nativeExtent:k,transform:T,spatialReference:v,pixelSize:_,keyProperties:j,statistics:y,histograms:a,multidimensionalInfo:q,colormap:F,storageInfo:new n({blockWidth:m,blockHeight:c,pyramidBlockWidth:m,pyramidBlockHeight:c,origin:R,tileInfo:B,transposeInfo:X,firstPyramidLevel:p,maximumPyramidLevel:d,blockBoundary:$})})}}_parseTransform(e){var r,i;if(!c(e))throw new t("cloudraster:open","the data contains unsupported geodata transform types");const o=p(e);if("identity"===o.type)return null;if("polynomial"!==o.type||null==(r=o.forwardCoefficients)||!r.length||null==(i=o.inverseCoefficients)||!i.length)throw new t("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return o}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),r=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),i=await Promise.all([t,r]);let o;if(i[0]){let e=i[0].fields;const t=i[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":y.get(e.type),name:e.name,alias:e.alias||e.name})));const r=t.map((e=>({attributes:e})));e&&t&&(o={fields:e,features:r})}}if(!o&&i[1]){o=m.parse(i[1]).recordSet}return d.fromJSON(o)}_buildCacheFilePath(e,t,i,o,a){const s=this._getPackageSize(!!a),n=Math.floor(t/s)*s,l=Math.floor(i/s)*s,f="R"+this._toHexString4(n)+"C"+this._toHexString4(l);let m="L";m+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:c}=this.rasterInfo,p=null==o?void 0:o[0];if(r(c)||!p)return`${this.url}/_alllayers/${m}/${f}.bundle`;let d="_yxs";if(!a){d=c.variables.find((e=>e.name===p.variableName)).dimensions[0].values.indexOf(p.values[0]).toString(16);const e=4-d.length;for(let t=0;t<e;t++)d="0"+d;d="S"+d}const u=this._getVariableFolderName(a||p.variableName);return`${this.url}/_alllayers/${u}/${d}/${m}/${f}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&i(t)?t.packetSize:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:r}=t;return e&&i(r)?r.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replace(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,r=!1){const i=this._getPackageSize(r),o=i*(e%i)+t%i;if(o<0)throw"Invalid level / row / col";return 20+o*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const r=e.subarray(t,t+8);let i,o=0;for(i=0;i<5;i++)o|=(255&r[i])<<8*i;const a=0xffffffffff&o;for(o=0,i=5;i<8;i++)o|=(255&r[i])<<8*(i-5);return{position:a,recordSize:0xffffffffff&o}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};e([o({readOnly:!0})],S.prototype,"storageInfo",void 0),e([o({type:String,json:{write:!0}})],S.prototype,"datasetFormat",void 0),S=e([a("esri.layers.support.rasterDatasets.CloudRaster")],S);const I=S;export{I as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import{isNone as r,isSome as i}from"../../../core/maybe.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../RasterInfo.js";import n from"../RasterStorageInfo.js";import l from"../TileInfo.js";import f from"./BaseRaster.js";import m from"./DBFParser.js";import{isTransformSupported as c,readTransform as p}from"../rasterTransforms/utils.js";import d from"../../../rest/support/FeatureSet.js";import u from"../../../geometry/SpatialReference.js";import h from"../../../geometry/Extent.js";import g from"../../../geometry/Point.js";const y=new Map;y.set("int16","esriFieldTypeSmallInteger"),y.set("int32","esriFieldTypeInteger"),y.set("int64","esriFieldTypeInteger"),y.set("float32","esriFieldTypeSingle"),y.set("float64","esriFieldTypeDouble"),y.set("text","esriFieldTypeString");const x=8;let S=class extends f{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:r}=await this.request(this.url+"/conf.json",{signal:e?.signal});if(!this._validateHeader(r))throw new t("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:i,rasterInfo:o}=this._parseHeader(r);if("thematic"===o.dataType){const e=await this._fetchAuxiliaryInformation();o.attributeTable=e}this._set("storageInfo",i),this._set("rasterInfo",o),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,r,i={}){const{transposeInfo:o}=this.rasterInfo.storageInfo,{transposedVariableName:s}=i,a=!(!o||!s),n=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(n<0)return null;const l=this._buildCacheFilePath(n,t,r,i.multidimensionalDefinition,s),f=this._getIndexRecordFromBundle(t,r,a),m=await this.request(l,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:i.signal});if(!m)return null;const c=new Uint8Array(m.data),p=this._getTileEndAndContentType(c,f);if(0===p.recordSize)return null;const d=await this.request(l,{range:{from:p.position,to:p.position+p.recordSize},responseType:"array-buffer",signal:i.signal});if(!d)return null;const[u,h]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:u,height:h,planes:null,pixelType:null,returnPixelInterleavedDims:a})}_validateHeader(e){const t=["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"];return e&&"RasterInfo"===e.type&&!t.some((t=>!e[t]))}_parseHeader(e){const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:r,histograms:i,colormap:o,blockWidth:s,blockHeight:f,firstPyramidLevel:m,maximumPyramidLevel:c}=e,p=e.statistics&&e.statistics.map((e=>({min:e.min,max:e.max,avg:e.mean,stddev:e.standardDeviation,median:e.median,mode:e.mode}))),d=e.extent.spatialReference,y=e.geodataXform?.spatialReference,S=new u(d?.wkid||d?.wkt?d:y);let I=new h({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:S});const w=new g({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:S}),_=Math.round((I.xmax-I.xmin)/w.x),v=Math.round((I.ymax-I.ymin)/w.y),b=this._parseTransform(e.geodataXform),z=b?I:null;b&&(I=b.forwardTransform(I),w.x=(I.xmax-I.xmin)/_,w.y=(I.ymax-I.ymin)/v);const T=e.properties??{},k=e.format.toLowerCase().replace("cache/",""),j=new g(e.origin.x,e.origin.y,S);let C,R,F,P;if(o&&o.colors)for(C=[],R=0;R<o.colors.length;R++)F=o.colors[R],P=o.values?o.values[R]:R,C.push([P,255&F,F<<16>>>24,F<<8>>>24,F>>>24]);const H=e.LODInfos,D=[];for(R=0;R<H.levels.length;R++)D.push({level:H.levels[R],resolution:H.resolutions[R],scale:96/.0254*H.resolutions[R]});const L=new l({dpi:96,lods:D,format:k,origin:j,size:[s,f],spatialReference:S}),M={recordSize:x,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*x+64},B=[{maxCol:Math.ceil(_/s)-1,maxRow:Math.ceil(v/f)-1,minCol:0,minRow:0}];let O=2;if(c>0)for(R=0;R<c;R++)B.push({maxCol:Math.ceil(_/O/s)-1,maxRow:Math.ceil(v/O/f)-1,minCol:0,minRow:0}),O*=2;const $=e.mdInfo;let N=null;if($&&T._yxs){const e=T._yxs;N={packetSize:e.PacketSize,tileSize:[e.TileXSize,e.TileYSize]}}return{storageInfo:M,rasterInfo:new a({width:_,height:v,pixelType:t,bandCount:r,extent:I,nativeExtent:z,transform:b,spatialReference:S,pixelSize:w,keyProperties:T,statistics:p,histograms:i,multidimensionalInfo:$,colormap:C,storageInfo:new n({blockWidth:s,blockHeight:f,pyramidBlockWidth:s,pyramidBlockHeight:f,origin:j,tileInfo:L,transposeInfo:N,firstPyramidLevel:m,maximumPyramidLevel:c,blockBoundary:B})})}}_parseTransform(e){if(!c(e))throw new t("cloudraster:open","the data contains unsupported geodata transform types");const r=p(e);if("identity"===r.type)return null;if("polynomial"!==r.type||!r.forwardCoefficients?.length||!r.inverseCoefficients?.length)throw new t("cloudraster:open","the data contains unsupported geodata transforms - both forward and inverse coefficients are required currently");return r}async _fetchAuxiliaryInformation(e){const t=this.request(this.url+"/conf.vat.json",{signal:e}).then((e=>e.data)).catch((()=>null)),r=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then((e=>e.data)).catch((()=>null)),i=await Promise.all([t,r]);let o;if(i[0]){let e=i[0].fields;const t=i[0].values;if(e&&t){e=e.map((e=>({type:"OID"===e.name?"esriFieldTypeOID":y.get(e.type),name:e.name,alias:e.alias||e.name})));const r=t.map((e=>({attributes:e})));e&&t&&(o={fields:e,features:r})}}if(!o&&i[1]){o=m.parse(i[1]).recordSet}return d.fromJSON(o)}_buildCacheFilePath(e,t,i,o,s){const a=this._getPackageSize(!!s),n=Math.floor(t/a)*a,l=Math.floor(i/a)*a,f="R"+this._toHexString4(n)+"C"+this._toHexString4(l);let m="L";m+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:c}=this.rasterInfo,p=o?.[0];if(r(c)||!p)return`${this.url}/_alllayers/${m}/${f}.bundle`;let d="_yxs";if(!s){d=c.variables.find((e=>e.name===p.variableName)).dimensions[0].values.indexOf(p.values[0]).toString(16);const e=4-d.length;for(let t=0;t<e;t++)d="0"+d;d="S"+d}const u=this._getVariableFolderName(s||p.variableName);return`${this.url}/_alllayers/${u}/${d}/${m}/${f}.bundle`}_getPackageSize(e=!1){const{transposeInfo:t}=this.rasterInfo.storageInfo;return e&&i(t)?t.packetSize:this.storageInfo.packetSize}_getTileSize(e=!1){const{storageInfo:t}=this.rasterInfo,{transposeInfo:r}=t;return e&&i(r)?r.tileSize:t.tileInfo.size}_getVariableFolderName(e){return""===(e=e.trim())?"_v":e.replace(/[\{|\}\-]/g,"_").replace("\\*","_v")}_getIndexRecordFromBundle(e,t,r=!1){const i=this._getPackageSize(r),o=i*(e%i)+t%i;if(o<0)throw"Invalid level / row / col";return 20+o*this.storageInfo.recordSize+44}_getTileEndAndContentType(e,t){const r=e.subarray(t,t+8);let i,o=0;for(i=0;i<5;i++)o|=(255&r[i])<<8*i;const s=0xffffffffff&o;for(o=0,i=5;i<8;i++)o|=(255&r[i])<<8*(i-5);return{position:s,recordSize:0xffffffffff&o}}_toHexString4(e){let t=e.toString(16);if(4!==t.length){let e=4-t.length;for(;e-- >0;)t="0"+t}return t}};e([o({readOnly:!0})],S.prototype,"storageInfo",void 0),e([o({type:String,json:{write:!0}})],S.prototype,"datasetFormat",void 0),S=e([s("esri.layers.support.rasterDatasets.CloudRaster")],S);const I=S;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/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import e from"../../../core/Error.js";import{unwrap as r}from"../../../core/maybe.js";import{eachAlways as s,createAbortError as a}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import n from"./BaseRaster.js";import l from"./InMemoryRaster.js";import{parsePAMInfo as m}from"./pamParser.js";import{getFormat as p}from"../rasterFormats/RasterCodec.js";import{estimateStatisticsFromHistograms as c}from"../rasterFunctions/stretchUtils.js";import f from"../rasterTransforms/PolynomialTransform.js";import u from"../../../geometry/SpatialReference.js";import h from"../../../geometry/Extent.js";let d=class extends n{async open(t){await this.init();const e=await this._fetchData(t);let{spatialReference:r,statistics:s,histograms:a,transform:o}=await this._fetchAuxiliaryData(t);const i=!r;i&&(r=new u({wkid:3857})),null!=a&&a.length&&null==s&&(s=c(a));const{width:n,height:m}=e;let p=new h({xmin:-.5,ymin:.5-m,xmax:n-.5,ymax:.5,spatialReference:r});const f=o?o.forwardTransform(p):p;let d=!0;if(o){const t=o.forwardCoefficients;d=t&&0===t[1]&&0===t[2],d&&(o=null,p=f)}const y=new l({data:{extent:f,nativeExtent:p,transform:o,pixelBlock:e,statistics:s,histograms:a,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:i}});await y.open(),this._set("rasterInfo",y.rasterInfo),this._inMemoryRaster=y}fetchRawTile(t,e,r,s={}){return this._inMemoryRaster.fetchRawTile(t,e,r,s)}async _fetchData(t){const{data:r}=await this.request(this.url,{responseType:"array-buffer",signal:null==t?void 0:t.signal}),s=p(r).toUpperCase();if("JPG"!==s&&"PNG"!==s&&"GIF"!==s&&"BMP"!==s)throw new e("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",s);return await this.decodePixelBlock(r,{format:"jpg",width:1,height:1,useCanvas:!0})}async _fetchAuxiliaryData(t){var e,o;const i=r(null==t?void 0:t.signal),n=null!=(e=this.ioConfig.skipExtensions)?e:[],l=n.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:i}),p=this.datasetFormat,c="JPG"===p?"jgw":"PNG"===p?"pgw":"BMP"===p?"bpw":null,u=n.includes(c)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+c,{responseType:"text",signal:i}),h=await s([l,u]);if(null!=i&&i.aborted)throw a();const d=m(null==(o=h[0].value)?void 0:o.data);if(!d.transform){const t=h[1].value?h[1].value.data.split("\n").slice(0,6).map((t=>Number(t))):null;d.transform=6===(null==t?void 0:t.length)?new f({forwardCoefficients:[t[4],t[5],t[0],-t[1],t[2],-t[3]]}):null}return d}};t([o({type:String,json:{write:!0}})],d.prototype,"datasetFormat",void 0),d=t([i("esri.layers.support.rasterDatasets.ImageAuxRaster")],d);const y=d;export{y as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import e from"../../../core/Error.js";import{unwrap as s}from"../../../core/maybe.js";import{eachAlways as r,createAbortError as a}from"../../../core/promiseUtils.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as i}from"../../../core/accessorSupport/decorators/subclass.js";import n from"./BaseRaster.js";import m from"./InMemoryRaster.js";import{parsePAMInfo as l}from"./pamParser.js";import{getFormat as p}from"../rasterFormats/RasterCodec.js";import{estimateStatisticsFromHistograms as c}from"../rasterFunctions/stretchUtils.js";import f from"../rasterTransforms/PolynomialTransform.js";import u from"../../../geometry/SpatialReference.js";import h from"../../../geometry/Extent.js";let d=class extends n{async open(t){await this.init();const e=await this._fetchData(t);let{spatialReference:s,statistics:r,histograms:a,transform:o}=await this._fetchAuxiliaryData(t);const i=!s;i&&(s=new u({wkid:3857})),a?.length&&null==r&&(r=c(a));const{width:n,height:l}=e;let p=new h({xmin:-.5,ymin:.5-l,xmax:n-.5,ymax:.5,spatialReference:s});const f=o?o.forwardTransform(p):p;let d=!0;if(o){const t=o.forwardCoefficients;d=t&&0===t[1]&&0===t[2],d&&(o=null,p=f)}const y=new m({data:{extent:f,nativeExtent:p,transform:o,pixelBlock:e,statistics:r,histograms:a,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:i}});await y.open(),this._set("rasterInfo",y.rasterInfo),this._inMemoryRaster=y}fetchRawTile(t,e,s,r={}){return this._inMemoryRaster.fetchRawTile(t,e,s,r)}async _fetchData(t){const{data:s}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),r=p(s).toUpperCase();if("JPG"!==r&&"PNG"!==r&&"GIF"!==r&&"BMP"!==r)throw new e("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r);return await this.decodePixelBlock(s,{format:"jpg",width:1,height:1,useCanvas:!0})}async _fetchAuxiliaryData(t){const e=s(t?.signal),o=this.ioConfig.skipExtensions??[],i=o.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),n=this.datasetFormat,m="JPG"===n?"jgw":"PNG"===n?"pgw":"BMP"===n?"bpw":null,p=o.includes(m)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+m,{responseType:"text",signal:e}),c=await r([i,p]);if(e?.aborted)throw a();const u=l(c[0].value?.data);if(!u.transform){const t=c[1].value?c[1].value.data.split("\n").slice(0,6).map((t=>Number(t))):null;u.transform=6===t?.length?new f({forwardCoefficients:[t[4],t[5],t[0],-t[1],t[2],-t[3]]}):null}return u}};t([o({type:String,json:{write:!0}})],d.prototype,"datasetFormat",void 0),d=t([i("esri.layers.support.rasterDatasets.ImageAuxRaster")],d);const y=d;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import{isSome as i,isNone as s,unwrap as a}from"../../../core/maybe.js";import{urlToObject as l}from"../../../core/urlUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../RasterInfo.js";import m from"../RasterStorageInfo.js";import{readServiceTileInfo as c}from"../serviceTileInfoProperty.js";import h from"../TileInfo.js";import{TilemapCache as u}from"../TilemapCache.js";import p from"./BaseRaster.js";import{setValidBoundary as f}from"../rasterFunctions/pixelUtils.js";import d from"../rasterTransforms/GCSShiftTransform.js";import y from"../../../rest/support/FeatureSet.js";import x from"../../../geometry/SpatialReference.js";import v from"../../../geometry/Extent.js";import g from"../../../geometry/Point.js";let S=class extends p{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer"}async open(e){await this.init();const s=e&&e.signal,a=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:s});a.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const r=a.data;if(this.sourceJSON=r,!r)throw new t("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!r.tileInfo)throw new t("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const n=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=r.cacheType,null==this.tileType&&(n.includes(r.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===r.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=r.name.slice(r.name.indexOf("/")+1);const o=await this._fetchRasterInfo({signal:s});if(!i(o))throw new t("image-server-raster:open","cannot initialize image service");{const e="Map"===this.tileType?c(r.tileInfo,r):h.fromJSON(r.tileInfo),{extent:t,pixelSize:i}=o,s=.5/o.width*i.x;let a,l;const n=e.lodAt(Math.max.apply(null,e.lods.map((e=>e.level))));"Map"!==this.tileType&&0!==r.maxScale&&("Raster"===this.tileType?(a=e.lods.find((e=>e.resolution===i.x)),a||(a=e.lods[e.lods.length-1])):(a=e.lods.find((e=>Math.abs(e.scale-r.maxScale)<s)),a||(a=e.lods.filter((e=>e.scale>r.maxScale)).sort(((e,t)=>e.scale>t.scale?1:-1))[0])),i.x=i.y=a.resolution,o.width=Math.ceil((t.xmax-t.xmin)/i.x-.1),o.height=Math.ceil((t.ymax-t.ymin)/i.y-.1)),a||(a=n);const u=e.lodAt(Math.min.apply(null,e.lods.map((e=>e.level))));"Map"===this.tileType?this._levelOffset=e.lods[0].level:0!==r.minScale&&"Elevation"===this.tileType&&(l=e.lods.find((e=>Math.abs(e.scale-r.minScale)<s)),this._levelOffset=l.level-u.level),l||(l=u);const d=Math.max(i.x,i.y);(Math.abs(i.x-i.y)>s||!e.lods.some((e=>Math.abs(e.resolution-d)<s)))&&(i.x=i.y=a.resolution,o.width=Math.ceil((t.xmax-t.xmin)/i.x-.1),o.height=Math.ceil((t.ymax-t.ymin)/i.y-.1));const y=a.level-l.level,[x,v]=e.size,g=[];e.lods.forEach((e=>{e.level>=l.level&&e.level<=a.level&&g.push({x:e.resolution,y:e.resolution})})),g.sort(((e,t)=>e.x-t.x));const S=this.computeBlockBoundary(t,x,v,e.origin,g,y),I=g.length>1?g.slice(1):null;let w;var p,f;if(r.transposeInfo)w={tileSize:[r.transposeInfo.rows,r.transposeInfo.cols],packetSize:null!=(p=null==(f=o.keyProperties)?void 0:f._yxs.PacketSize)?p:0};o.storageInfo=new m({blockWidth:e.size[0],blockHeight:e.size[1],pyramidBlockWidth:e.size[0],pyramidBlockHeight:e.size[1],pyramidResolutions:I,compression:e.format,origin:e.origin,firstPyramidLevel:1,maximumPyramidLevel:y,tileInfo:e,transposeInfo:w,blockBoundary:S}),this._fixGCSShift(o),this._set("rasterInfo",o)}if(r.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:o.storageInfo.tileInfo,parsedUrl:l(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new u({layer:e})}}async fetchRawTile(e,t,s,a={}){const{storageInfo:l,extent:r}=this.rasterInfo,{transposeInfo:n}=l,o=i(n)&&!!a.transposedVariableName;if(this._slices&&!o&&null==a.sliceId)return null;const m=o?0:l.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${m}/${t}/${s}`,h=this._slices?o?{variable:a.transposedVariableName}:{sliceId:a.sliceId||0}:null,{data:u}=await this.request(c,{query:h,responseType:"array-buffer",signal:a.signal});if(!u)return null;const p=o?n.tileSize:l.tileInfo.size,d=await this.decodePixelBlock(u,{width:p[0],height:p[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnPixelInterleavedDims:o}),y=l.blockBoundary[e];if("jpg"!==l.compression||s>y.minCol&&s<y.maxCol&&t>y.minRow&&t<y.maxRow)return d;const{origin:x,blockWidth:v,blockHeight:g}=l,{x:S,y:I}=this.getPyramidPixelSize(e),w=Math.round((r.xmin-x.x)/S)%v,b=Math.round((r.xmax-x.x)/S)%v||v,j=Math.round((x.y-r.ymax)/I)%g,T=Math.round((x.y-r.ymin)/I)%g||g,_=s===y.minCol?w:0,M=t===y.minRow?j:0,R=s===y.maxCol?b:v,z=t===y.maxRow?T:g;return f(d,{x:_,y:M},{width:R-_,height:z-M}),d}getSliceIndex(e){if(!this._slices||s(e)||0===e.length)return null;const t=e;for(let i=0;i<this._slices.length;i++){const e=this._slices[i].multidimensionalDefinition;if(e.length===t.length&&!e.some((e=>{const i=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));if(!i)return!0;return(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])})))return i}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>{var t;return null==(t=e.data)?void 0:t.statistics})),s=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>{var t;return null==(t=e.data)?void 0:t.histograms})),a=await Promise.all([i,s]);return a[0]&&a[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:a[0]||null,histograms:a[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,a(t.datumTransformation));if(null===i)return null;let s=0;const{maximumPyramidLevel:l}=this.rasterInfo.storageInfo;let r=l-s+this._levelOffset;const n=i.srcLocation;for(;r>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(r,i.row,i.col,t))break}catch{}if(r--,s++,i=this.identifyPixelLocation(n,s,a(t.datumTransformation)),null===i)return null}return-1===r||null==i?null:s}async _fetchRasterInfo(e){const t=this.sourceJSON,i=Math.ceil((t.extent.xmax-t.extent.xmin)/t.pixelSizeX-.1),s=Math.ceil((t.extent.ymax-t.extent.ymin)/t.pixelSizeY-.1),a=x.fromJSON(t.spatialReference||t.extent.spatialReference);if("Map"===this.tileType)return new o({width:i,height:s,bandCount:3,extent:v.fromJSON(t.extent),spatialReference:a,pixelSize:new g({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:a}),pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}});const{slice:l,signal:r}=e,n=!!t.hasRasterAttributeTable&&this.request(this.url+"/rasterAttributeTable",{query:{slice:l,f:"json"},signal:r}).then((e=>y.fromJSON(e.data))).catch((()=>null)),m=!!t.hasColormap&&this.request(this.url+"/colormap",{query:{slice:l,f:"json"},signal:r}).then((e=>{var t;return null==(t=e.data)?void 0:t.colormap})),c=!!t.hasHistograms&&this.request(this.url+"/histograms",{query:{slice:l,f:"json"},signal:r}).then((e=>{var t;return null==(t=e.data)?void 0:t.histograms})),h=this.request(this.url+"/keyProperties",{query:{f:"json"},signal:r}).then((e=>e.data)).catch((()=>{})),u=!!t.hasMultidimensions&&this._fetchMultidimensionalInfo(),p=!!t.hasMultidimensions&&this.request(this.url+"/slices",{query:{f:"json"},signal:r}).then((e=>e.data&&e.data.slices)).catch((()=>{}));return Promise.all([n,m,c,h,u,p]).then((e=>{let l=null;if(t.minValues&&t.minValues.length===t.bandCount){l=[];for(let e=0;e<t.minValues.length;e++)l.push({min:t.minValues[e],max:t.maxValues[e],avg:t.meanValues[e],stddev:t.stdvValues[e]})}return this._slices=e[5]||null,new o({width:i,height:s,bandCount:t.bandCount,extent:v.fromJSON(t.extent),spatialReference:a,pixelSize:new g({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:a}),pixelType:t.pixelType.toLowerCase(),statistics:l,attributeTable:e[0]||null,colormap:e[1]||null,histograms:e[2]||null,keyProperties:e[3]||{},multidimensionalInfo:e[4]||null})}))}async _fetchMultidimensionalInfo(e){var t;const i=await this.request(this.url+"/multidimensionalInfo",{query:{f:"json"},signal:e}).then((e=>{var t;return null==(t=e.data)?void 0:t.multidimensionalInfo}));return null!=(t=i.variables)&&t.length&&i.variables.forEach((e=>{var t;null!=(t=e.statistics)&&t.length&&e.statistics.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation}))})),i}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:i}=e;0===t.xmin&&360===t.xmax&&i.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new d,e.extent=e.transform.forwardTransform(t))}};e([r({type:String,json:{write:!0}})],S.prototype,"datasetFormat",void 0),e([r()],S.prototype,"tileType",void 0),S=e([n("esri.layers.support.rasterDatasets.ImageServerRaster")],S);const I=S;export{I as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import{isSome as i,isNone as s,unwrap as a}from"../../../core/maybe.js";import{urlToObject as l}from"../../../core/urlUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import o from"../RasterInfo.js";import m from"../RasterStorageInfo.js";import{readServiceTileInfo as c}from"../serviceTileInfoProperty.js";import h from"../TileInfo.js";import{TilemapCache as u}from"../TilemapCache.js";import p from"./BaseRaster.js";import{setValidBoundary as f}from"../rasterFunctions/pixelUtils.js";import d from"../rasterTransforms/GCSShiftTransform.js";import y from"../../../rest/support/FeatureSet.js";import x from"../../../geometry/SpatialReference.js";import g from"../../../geometry/Extent.js";import v from"../../../geometry/Point.js";let S=class extends p{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer"}async open(e){await this.init();const s=e&&e.signal,a=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:s});a.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const r=a.data;if(this.sourceJSON=r,!r)throw new t("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!r.tileInfo)throw new t("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const n=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=r.cacheType,null==this.tileType&&(n.includes(r.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===r.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=r.name.slice(r.name.indexOf("/")+1);const o=await this._fetchRasterInfo({signal:s});if(!i(o))throw new t("image-server-raster:open","cannot initialize image service");{const e="Map"===this.tileType?c(r.tileInfo,r):h.fromJSON(r.tileInfo),{extent:t,pixelSize:i}=o,s=.5/o.width*i.x;let a,l;const n=e.lodAt(Math.max.apply(null,e.lods.map((e=>e.level))));"Map"!==this.tileType&&0!==r.maxScale&&("Raster"===this.tileType?(a=e.lods.find((e=>e.resolution===i.x)),a||(a=e.lods[e.lods.length-1])):(a=e.lods.find((e=>Math.abs(e.scale-r.maxScale)<s)),a||(a=e.lods.filter((e=>e.scale>r.maxScale)).sort(((e,t)=>e.scale>t.scale?1:-1))[0])),i.x=i.y=a.resolution,o.width=Math.ceil((t.xmax-t.xmin)/i.x-.1),o.height=Math.ceil((t.ymax-t.ymin)/i.y-.1)),a||(a=n);const u=e.lodAt(Math.min.apply(null,e.lods.map((e=>e.level))));"Map"===this.tileType?this._levelOffset=e.lods[0].level:0!==r.minScale&&"Elevation"===this.tileType&&(l=e.lods.find((e=>Math.abs(e.scale-r.minScale)<s)),this._levelOffset=l.level-u.level),l||(l=u);const p=Math.max(i.x,i.y);(Math.abs(i.x-i.y)>s||!e.lods.some((e=>Math.abs(e.resolution-p)<s)))&&(i.x=i.y=a.resolution,o.width=Math.ceil((t.xmax-t.xmin)/i.x-.1),o.height=Math.ceil((t.ymax-t.ymin)/i.y-.1));const f=a.level-l.level,[d,y]=e.size,x=[];e.lods.forEach((e=>{e.level>=l.level&&e.level<=a.level&&x.push({x:e.resolution,y:e.resolution})})),x.sort(((e,t)=>e.x-t.x));const g=this.computeBlockBoundary(t,d,y,e.origin,x,f),v=x.length>1?x.slice(1):null;let S;r.transposeInfo&&(S={tileSize:[r.transposeInfo.rows,r.transposeInfo.cols],packetSize:o.keyProperties?._yxs.PacketSize??0}),o.storageInfo=new m({blockWidth:e.size[0],blockHeight:e.size[1],pyramidBlockWidth:e.size[0],pyramidBlockHeight:e.size[1],pyramidResolutions:v,compression:e.format,origin:e.origin,firstPyramidLevel:1,maximumPyramidLevel:f,tileInfo:e,transposeInfo:S,blockBoundary:g}),this._fixGCSShift(o),this._set("rasterInfo",o)}if(r.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:o.storageInfo.tileInfo,parsedUrl:l(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new u({layer:e})}}async fetchRawTile(e,t,s,a={}){const{storageInfo:l,extent:r}=this.rasterInfo,{transposeInfo:n}=l,o=i(n)&&!!a.transposedVariableName;if(this._slices&&!o&&null==a.sliceId)return null;const m=o?0:l.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${m}/${t}/${s}`,h=this._slices?o?{variable:a.transposedVariableName}:{sliceId:a.sliceId||0}:null,{data:u}=await this.request(c,{query:h,responseType:"array-buffer",signal:a.signal});if(!u)return null;const p=o?n.tileSize:l.tileInfo.size,d=await this.decodePixelBlock(u,{width:p[0],height:p[1],planes:null,pixelType:null,isPoint:"Elevation"===this.tileType,returnPixelInterleavedDims:o}),y=l.blockBoundary[e];if("jpg"!==l.compression||s>y.minCol&&s<y.maxCol&&t>y.minRow&&t<y.maxRow)return d;const{origin:x,blockWidth:g,blockHeight:v}=l,{x:S,y:I}=this.getPyramidPixelSize(e),w=Math.round((r.xmin-x.x)/S)%g,b=Math.round((r.xmax-x.x)/S)%g||g,j=Math.round((x.y-r.ymax)/I)%v,T=Math.round((x.y-r.ymin)/I)%v||v,_=s===y.minCol?w:0,M=t===y.minRow?j:0,R=s===y.maxCol?b:g,z=t===y.maxRow?T:v;return f(d,{x:_,y:M},{width:R-_,height:z-M}),d}getSliceIndex(e){if(!this._slices||s(e)||0===e.length)return null;const t=e;for(let i=0;i<this._slices.length;i++){const e=this._slices[i].multidimensionalDefinition;if(e.length===t.length&&!e.some((e=>{const i=t.find((t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName));if(!i)return!0;return(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])})))return i}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.statistics)),s=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then((e=>e.data?.histograms)),a=await Promise.all([i,s]);return a[0]&&a[0].forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation})),{statistics:a[0]||null,histograms:a[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,a(t.datumTransformation));if(null===i)return null;let s=0;const{maximumPyramidLevel:l}=this.rasterInfo.storageInfo;let r=l-s+this._levelOffset;const n=i.srcLocation;for(;r>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(r,i.row,i.col,t))break}catch{}if(r--,s++,i=this.identifyPixelLocation(n,s,a(t.datumTransformation)),null===i)return null}return-1===r||null==i?null:s}async _fetchRasterInfo(e){const t=this.sourceJSON,i=Math.ceil((t.extent.xmax-t.extent.xmin)/t.pixelSizeX-.1),s=Math.ceil((t.extent.ymax-t.extent.ymin)/t.pixelSizeY-.1),a=x.fromJSON(t.spatialReference||t.extent.spatialReference);if("Map"===this.tileType)return new o({width:i,height:s,bandCount:3,extent:g.fromJSON(t.extent),spatialReference:a,pixelSize:new v({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:a}),pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}});const{slice:l,signal:r}=e,n=!!t.hasRasterAttributeTable&&this.request(this.url+"/rasterAttributeTable",{query:{slice:l,f:"json"},signal:r}).then((e=>y.fromJSON(e.data))).catch((()=>null)),m=!!t.hasColormap&&this.request(this.url+"/colormap",{query:{slice:l,f:"json"},signal:r}).then((e=>e.data?.colormap)),c=!!t.hasHistograms&&this.request(this.url+"/histograms",{query:{slice:l,f:"json"},signal:r}).then((e=>e.data?.histograms)),h=this.request(this.url+"/keyProperties",{query:{f:"json"},signal:r}).then((e=>e.data)).catch((()=>{})),u=!!t.hasMultidimensions&&this._fetchMultidimensionalInfo(),p=!!t.hasMultidimensions&&this.request(this.url+"/slices",{query:{f:"json"},signal:r}).then((e=>e.data&&e.data.slices)).catch((()=>{}));return Promise.all([n,m,c,h,u,p]).then((e=>{let l=null;if(t.minValues&&t.minValues.length===t.bandCount){l=[];for(let e=0;e<t.minValues.length;e++)l.push({min:t.minValues[e],max:t.maxValues[e],avg:t.meanValues[e],stddev:t.stdvValues[e]})}return this._slices=e[5]||null,new o({width:i,height:s,bandCount:t.bandCount,extent:g.fromJSON(t.extent),spatialReference:a,pixelSize:new v({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:a}),pixelType:t.pixelType.toLowerCase(),statistics:l,attributeTable:e[0]||null,colormap:e[1]||null,histograms:e[2]||null,keyProperties:e[3]||{},multidimensionalInfo:e[4]||null})}))}async _fetchMultidimensionalInfo(e){const t=await this.request(this.url+"/multidimensionalInfo",{query:{f:"json"},signal:e}).then((e=>e.data?.multidimensionalInfo));return t.variables?.length&&t.variables.forEach((e=>{e.statistics?.length&&e.statistics.forEach((e=>{e.avg=e.mean,e.stddev=e.standardDeviation}))})),t}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:i}=e;0===t.xmin&&360===t.xmax&&i.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new d,e.extent=e.transform.forwardTransform(t))}};e([r({type:String,json:{write:!0}})],S.prototype,"datasetFormat",void 0),e([r()],S.prototype,"tileType",void 0),S=e([n("esri.layers.support.rasterDatasets.ImageServerRaster")],S);const I=S;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/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import e from"../../../core/Error.js";import{isSome as s}from"../../../core/maybe.js";import{eachAlways as r}from"../../../core/promiseUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../RasterInfo.js";import m from"./BaseRaster.js";import{split as n}from"../rasterFunctions/pixelUtils.js";import{estimateStatisticsHistograms as l}from"../rasterFunctions/stretchUtils.js";import p from"../../../geometry/Extent.js";import c from"../../../geometry/SpatialReference.js";let h=class extends m{constructor(){super(...arguments),this.datasetFormat="MEMORY"}async open(t){var e;await this.init();const{pixelBlock:s,statistics:r,histograms:i,name:o,keyProperties:m,nativeExtent:n,transform:l}=this.data,{width:h,height:d,pixelType:f}=s,u=this.data.extent||new p({xmin:-.5,ymin:.5,xmax:h-.5,ymax:d-.5,spatialReference:new c({wkid:3857})}),y=null!=(e=this.data.isPseudoSpatialReference)?e:!this.data.extent,x={x:u.width/h,y:u.height/d},v=new a({width:h,height:d,pixelType:f,extent:u,nativeExtent:n,transform:l,pixelSize:x,spatialReference:u.spatialReference,bandCount:3,keyProperties:m||{},statistics:r,isPseudoSpatialReference:y,histograms:i});this.createRemoteDatasetStorageInfo(v,512,512),this._set("rasterInfo",v),this.updateTileInfo(),await this._buildInMemoryRaster(s,{width:512,height:512},t),this.datasetName=o,this.url="/InMemory/"+o}fetchRawTile(t,e,s,r={}){const i=this._pixelBlockTiles.get(`${t}/${e}/${s}`);return Promise.resolve(i)}async _buildInMemoryRaster(t,i,o){const a=this.rasterInfo.storageInfo.maximumPyramidLevel,m=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:i,maximumPyramidLevel:a},o):Promise.resolve(n(t,i,a)),p=s(this.rasterInfo.statistics),c=s(this.rasterInfo.histograms),h=p&&c?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},o):Promise.resolve(l(t)),d=await r([m,h]);if(!d[0].value&&d[1].value)throw new e("inmemory-raster:open","failed to build in memory raster");var f,u;(this._pixelBlockTiles=d[0].value,p)||(this.rasterInfo.statistics=null==(f=d[1].value)?void 0:f.statistics);c&&(this.rasterInfo.histograms=null==(u=d[1].value)?void 0:u.histograms)}};t([i({type:String,json:{write:!0}})],h.prototype,"datasetFormat",void 0),t([i()],h.prototype,"data",void 0),h=t([o("esri.layers.support.rasterDatasets.InMemoryRaster")],h);const d=h;export{d as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import e from"../../../core/Error.js";import{isSome as s}from"../../../core/maybe.js";import{eachAlways as r}from"../../../core/promiseUtils.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as o}from"../../../core/accessorSupport/decorators/subclass.js";import a from"../RasterInfo.js";import m from"./BaseRaster.js";import{split as n}from"../rasterFunctions/pixelUtils.js";import{estimateStatisticsHistograms as l}from"../rasterFunctions/stretchUtils.js";import p from"../../../geometry/Extent.js";import c from"../../../geometry/SpatialReference.js";let h=class extends m{constructor(){super(...arguments),this.datasetFormat="MEMORY"}async open(t){await this.init();const{pixelBlock:e,statistics:s,histograms:r,name:i,keyProperties:o,nativeExtent:m,transform:n}=this.data,{width:l,height:h,pixelType:f}=e,d=this.data.extent||new p({xmin:-.5,ymin:.5,xmax:l-.5,ymax:h-.5,spatialReference:new c({wkid:3857})}),u=this.data.isPseudoSpatialReference??!this.data.extent,y={x:d.width/l,y:d.height/h},x=new a({width:l,height:h,pixelType:f,extent:d,nativeExtent:m,transform:n,pixelSize:y,spatialReference:d.spatialReference,bandCount:3,keyProperties:o||{},statistics:s,isPseudoSpatialReference:u,histograms:r});this.createRemoteDatasetStorageInfo(x,512,512),this._set("rasterInfo",x),this.updateTileInfo(),await this._buildInMemoryRaster(e,{width:512,height:512},t),this.datasetName=i,this.url="/InMemory/"+i}fetchRawTile(t,e,s,r={}){const i=this._pixelBlockTiles.get(`${t}/${e}/${s}`);return Promise.resolve(i)}async _buildInMemoryRaster(t,i,o){const a=this.rasterInfo.storageInfo.maximumPyramidLevel,m=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:i,maximumPyramidLevel:a},o):Promise.resolve(n(t,i,a)),p=s(this.rasterInfo.statistics),c=s(this.rasterInfo.histograms),h=p&&c?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},o):Promise.resolve(l(t)),f=await r([m,h]);if(!f[0].value&&f[1].value)throw new e("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=f[0].value,p||(this.rasterInfo.statistics=f[1].value?.statistics),c&&(this.rasterInfo.histograms=f[1].value?.histograms)}};t([i({type:String,json:{write:!0}})],h.prototype,"datasetFormat",void 0),t([i()],h.prototype,"data",void 0),h=t([o("esri.layers.support.rasterDatasets.InMemoryRaster")],h);const f=h;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/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import e from"../../../core/Error.js";import{unwrap as r,isNone as s,isSome as o}from"../../../core/maybe.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../PixelBlock.js";import l from"../RasterInfo.js";import f from"../RasterStorageInfo.js";import c from"./BaseRaster.js";import{parseSpatialReference as m,parsePAMInfo as p}from"./pamParser.js";import{getElement as h,getElementValue as u}from"./xmlUtilities.js";import{isPlatformLittleEndian as g}from"../rasterFormats/utils.js";import{estimateStatisticsFromHistograms as d}from"../rasterFunctions/stretchUtils.js";import y from"../../../geometry/SpatialReference.js";import x from"../../../geometry/Extent.js";import w from"../../../geometry/Point.js";const I=new Map;I.set("Int8","s8"),I.set("UInt8","u8"),I.set("Int16","s16"),I.set("UInt16","u16"),I.set("Int32","s32"),I.set("UInt32","u32"),I.set("Float32","f32"),I.set("Float64","f32"),I.set("Double64","f32");const b=new Map;b.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),b.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),b.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),b.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let A=class extends c{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(t){var e;await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const o=t?r(t.signal):null,i=await this.request(this.url,{responseType:"xml",signal:o}),{rasterInfo:a,files:n}=this._parseHeader(i.data);if(-1===(null==(e=this.ioConfig.skipExtensions)?void 0:e.indexOf("aux.xml"))){const e=await this._fetchAuxiliaryData(t);var l;if(null!=e)a.statistics=null!=(l=e.statistics)?l:a.statistics,a.histograms=e.histograms,e.histograms&&s(a.statistics)&&(a.statistics=d(e.histograms))}this._set("rasterInfo",a),this._files=n;const f=await this.request(n.index,{responseType:"array-buffer",signal:o});this._storageIndex=this._parseIndex(f.data);const{blockWidth:c,blockHeight:m}=this.rasterInfo.storageInfo,p=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:h,height:u}=this.rasterInfo,g=[],y=this._getBandSegmentCount();let x=0,w=-1;for(;x<this._storageIndex.length;){w++;const t=Math.ceil(h/c/p**w)-1,e=Math.ceil(u/m/p**w)-1;x+=(t+1)*(e+1)*y*4,g.push({maxRow:e,maxCol:t,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=g,w>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=w),this.updateTileInfo()}async fetchRawTile(t,e,r,s={}){const{blockWidth:i,blockHeight:a,blockBoundary:l}=this.rasterInfo.storageInfo,f=l[t];if(!f||f.maxRow<e||f.maxCol<r||f.minRow>e||f.minCol>r)return null;const{bandCount:c,pixelType:m}=this.rasterInfo,{ranges:p,actualTileWidth:h,actualTileHeight:u}=this._getTileLocation(t,e,r);if(!p||0===p.length)return null;if(0===p[0].from&&0===p[0].to){const t=new Uint8Array(i*a);return new n({width:i,height:a,pixels:null,mask:t,validPixelCount:0})}const{bandIds:g}=this.ioConfig,d=this._getBandSegmentCount(),y=[];let x=0;for(x=0;x<d;x++)(!g||g.indexOf[x]>-1)&&y.push(this.request(this._files.data,{range:{from:p[x].from,to:p[x].to},responseType:"array-buffer",signal:s.signal}));const w=await Promise.all(y),I=w.map((t=>t.data.byteLength)).reduce(((t,e)=>t+e)),A=new Uint8Array(I);let F=0;for(x=0;x<d;x++)A.set(new Uint8Array(w[x].data),F),F+=w[x].data.byteLength;const _=b.get(this.rasterInfo.storageInfo.compression).decoderFormat,R=await this.decodePixelBlock(A.buffer,{width:i,height:a,format:_,planes:(null==g?void 0:g.length)||c,pixelType:m});if(o(this.rasterInfo.noDataValue)&&"lerc"!==_&&!R.mask){const t=this.rasterInfo.noDataValue[0];if(null!=t){const e=R.width*R.height,r=new Uint8Array(e);if(Math.abs(t)>1e24)for(x=0;x<e;x++)Math.abs((R.pixels[0][x]-t)/t)>1e-6&&(r[x]=1);else for(x=0;x<e;x++)R.pixels[0][x]!==t&&(r[x]=1);R.mask=r}}let j=0,k=0;if(h!==i||u!==a){let t=R.mask;if(t)for(x=0;x<a;x++)if(k=x*i,x<u)for(j=h;j<i;j++)t[k+j]=0;else for(j=0;j<i;j++)t[k+j]=0;else for(t=new Uint8Array(i*a),R.mask=t,x=0;x<u;x++)for(k=x*i,j=0;j<h;j++)t[k+j]=1}return R}_parseIndex(t){if(t.byteLength%16>0)throw"invalid array buffer must be multiples of 16";let e,r,s,o,i,a;if(g){for(r=new Uint8Array(t),o=new ArrayBuffer(t.byteLength),s=new Uint8Array(o),i=0;i<t.byteLength/4;i++)for(a=0;a<4;a++)s[4*i+a]=r[4*i+3-a];e=new Uint32Array(o)}else e=new Uint32Array(t);return e}_getBandSegmentCount(){return b.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,r){const{blockWidth:s,blockHeight:o,pyramidScalingFactor:i}=this.rasterInfo.storageInfo,{width:a,height:n}=this.rasterInfo,l=this._getBandSegmentCount();let f,c,m,p=0,h=0;for(m=0;m<t;m++)h=i**m,f=Math.ceil(a/s/h),c=Math.ceil(n/o/h),p+=f*c;h=i**t,f=Math.ceil(a/s/h),c=Math.ceil(n/o/h),p+=e*f+r,p*=4*l;const u=this._storageIndex.subarray(p,p+4*l);let g=0,d=0;const y=[];for(let x=0;x<l;x++)g=u[4*x+0]*2**32+u[4*x+1],d=g+u[4*x+2]*2**32+u[4*x+3],y.push({from:g,to:d});return{ranges:y,actualTileWidth:r<f-1?s:Math.ceil(a/h)-s*(f-1),actualTileHeight:e<c-1?o:Math.ceil(n/h)-o*(c-1)}}_parseHeader(t){const r=h(t,"MRF_META/Raster");if(!r)throw new e("mrf:open","not a valid MRF format");const s=h(r,"Size"),o=parseInt(s.getAttribute("x"),10),i=parseInt(s.getAttribute("y"),10),a=parseInt(s.getAttribute("c"),10),n=(u(r,"Compression")||"none").toLowerCase();if(!b.has(n))throw new e("mrf:open","currently does not support compression "+n);const c=u(r,"DataType")||"UInt8",p=I.get(c);if(null==p)throw new e("mrf:open","currently does not support pixel type "+c);const g=h(r,"PageSize"),d=parseInt(g.getAttribute("x"),10),A=parseInt(g.getAttribute("y"),10),F=h(r,"DataValues");let _,R;F&&(R=F.getAttribute("NoData"),null!=R&&(_=R.trim().split(" ").map((t=>parseFloat(t)))));if(h(t,"MRF_META/CachedSource"))throw new e("mrf:open","currently does not support MRF referencing other data files");const j=h(t,"MRF_META/GeoTags"),k=h(j,"BoundingBox");let M,S=!1;if(null!=k){const t=parseFloat(k.getAttribute("minx")),e=parseFloat(k.getAttribute("miny")),r=parseFloat(k.getAttribute("maxx")),s=parseFloat(k.getAttribute("maxy")),o=u(j,"Projection")||"";let i;if("LOCAL_CS[]"!==o)if(o.toLowerCase().startsWith("epsg:")){const t=Number(o.slice(5));isNaN(t)||0===t||(i=new y({wkid:t}))}else i=m(o);else S=!0,i=new y({wkid:3857});M=new x(t,e,r,s),M.spatialReference=i}else S=!0,M=new x({xmin:-.5,ymin:.5-i,xmax:o-.5,ymax:.5,spatialReference:new y({wkid:3857})});const T=h(t,"MRF_META/Rsets"),C=parseInt(T&&T.getAttribute("scale")||"2",10),U=M.spatialReference,B=new f({origin:new w({x:M.xmin,y:M.ymax,spatialReference:U}),blockWidth:d,blockHeight:A,pyramidBlockWidth:d,pyramidBlockHeight:A,compression:n,pyramidScalingFactor:C}),v=new w({x:M.width/o,y:M.height/i,spatialReference:U}),L=new l({width:o,height:i,extent:M,isPseudoSpatialReference:S,spatialReference:U,bandCount:a,pixelType:p,pixelSize:v,noDataValue:_,storageInfo:B}),E=u(t,"datafile"),P=u(t,"IndexFile");return{rasterInfo:L,files:{mrf:this.url,index:P||this.url.replace(".mrf",".idx"),data:E||this.url.replace(".mrf",b.get(n).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:null==t?void 0:t.signal});return p(e)}catch{return null}}};t([i()],A.prototype,"_files",void 0),t([i()],A.prototype,"_storageIndex",void 0),t([i({type:String,json:{write:!0}})],A.prototype,"datasetFormat",void 0),A=t([a("esri.layers.support.rasterIO.MRFRaster")],A);const F=A;export{F as default};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import e from"../../../core/Error.js";import{unwrap as r,isNone as s,isSome as o}from"../../../core/maybe.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../PixelBlock.js";import l from"../RasterInfo.js";import f from"../RasterStorageInfo.js";import c from"./BaseRaster.js";import{parseSpatialReference as m,parsePAMInfo as p}from"./pamParser.js";import{getElement as h,getElementValue as u}from"./xmlUtilities.js";import{isPlatformLittleEndian as g}from"../rasterFormats/utils.js";import{estimateStatisticsFromHistograms as d}from"../rasterFunctions/stretchUtils.js";import y from"../../../geometry/SpatialReference.js";import x from"../../../geometry/Extent.js";import w from"../../../geometry/Point.js";const I=new Map;I.set("Int8","s8"),I.set("UInt8","u8"),I.set("Int16","s16"),I.set("UInt16","u16"),I.set("Int32","s32"),I.set("UInt32","u32"),I.set("Float32","f32"),I.set("Float64","f32"),I.set("Double64","f32");const b=new Map;b.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),b.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),b.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),b.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"});let A=class extends c{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async open(t){await this.init(),this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const e=t?r(t.signal):null,o=await this.request(this.url,{responseType:"xml",signal:e}),{rasterInfo:i,files:a}=this._parseHeader(o.data);if(-1===this.ioConfig.skipExtensions?.indexOf("aux.xml")){const e=await this._fetchAuxiliaryData(t);null!=e&&(i.statistics=e.statistics??i.statistics,i.histograms=e.histograms,e.histograms&&s(i.statistics)&&(i.statistics=d(e.histograms)))}this._set("rasterInfo",i),this._files=a;const n=await this.request(a.index,{responseType:"array-buffer",signal:e});this._storageIndex=this._parseIndex(n.data);const{blockWidth:l,blockHeight:f}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:m,height:p}=this.rasterInfo,h=[],u=this._getBandSegmentCount();let g=0,y=-1;for(;g<this._storageIndex.length;){y++;const t=Math.ceil(m/l/c**y)-1,e=Math.ceil(p/f/c**y)-1;g+=(t+1)*(e+1)*u*4,h.push({maxRow:e,maxCol:t,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=h,y>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=y),this.updateTileInfo()}async fetchRawTile(t,e,r,s={}){const{blockWidth:i,blockHeight:a,blockBoundary:l}=this.rasterInfo.storageInfo,f=l[t];if(!f||f.maxRow<e||f.maxCol<r||f.minRow>e||f.minCol>r)return null;const{bandCount:c,pixelType:m}=this.rasterInfo,{ranges:p,actualTileWidth:h,actualTileHeight:u}=this._getTileLocation(t,e,r);if(!p||0===p.length)return null;if(0===p[0].from&&0===p[0].to){const t=new Uint8Array(i*a);return new n({width:i,height:a,pixels:null,mask:t,validPixelCount:0})}const{bandIds:g}=this.ioConfig,d=this._getBandSegmentCount(),y=[];let x=0;for(x=0;x<d;x++)(!g||g.indexOf[x]>-1)&&y.push(this.request(this._files.data,{range:{from:p[x].from,to:p[x].to},responseType:"array-buffer",signal:s.signal}));const w=await Promise.all(y),I=w.map((t=>t.data.byteLength)).reduce(((t,e)=>t+e)),A=new Uint8Array(I);let F=0;for(x=0;x<d;x++)A.set(new Uint8Array(w[x].data),F),F+=w[x].data.byteLength;const _=b.get(this.rasterInfo.storageInfo.compression).decoderFormat,R=await this.decodePixelBlock(A.buffer,{width:i,height:a,format:_,planes:g?.length||c,pixelType:m});if(o(this.rasterInfo.noDataValue)&&"lerc"!==_&&!R.mask){const t=this.rasterInfo.noDataValue[0];if(null!=t){const e=R.width*R.height,r=new Uint8Array(e);if(Math.abs(t)>1e24)for(x=0;x<e;x++)Math.abs((R.pixels[0][x]-t)/t)>1e-6&&(r[x]=1);else for(x=0;x<e;x++)R.pixels[0][x]!==t&&(r[x]=1);R.mask=r}}let j=0,k=0;if(h!==i||u!==a){let t=R.mask;if(t)for(x=0;x<a;x++)if(k=x*i,x<u)for(j=h;j<i;j++)t[k+j]=0;else for(j=0;j<i;j++)t[k+j]=0;else for(t=new Uint8Array(i*a),R.mask=t,x=0;x<u;x++)for(k=x*i,j=0;j<h;j++)t[k+j]=1}return R}_parseIndex(t){if(t.byteLength%16>0)throw"invalid array buffer must be multiples of 16";let e,r,s,o,i,a;if(g){for(r=new Uint8Array(t),o=new ArrayBuffer(t.byteLength),s=new Uint8Array(o),i=0;i<t.byteLength/4;i++)for(a=0;a<4;a++)s[4*i+a]=r[4*i+3-a];e=new Uint32Array(o)}else e=new Uint32Array(t);return e}_getBandSegmentCount(){return b.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,r){const{blockWidth:s,blockHeight:o,pyramidScalingFactor:i}=this.rasterInfo.storageInfo,{width:a,height:n}=this.rasterInfo,l=this._getBandSegmentCount();let f,c,m,p=0,h=0;for(m=0;m<t;m++)h=i**m,f=Math.ceil(a/s/h),c=Math.ceil(n/o/h),p+=f*c;h=i**t,f=Math.ceil(a/s/h),c=Math.ceil(n/o/h),p+=e*f+r,p*=4*l;const u=this._storageIndex.subarray(p,p+4*l);let g=0,d=0;const y=[];for(let x=0;x<l;x++)g=u[4*x+0]*2**32+u[4*x+1],d=g+u[4*x+2]*2**32+u[4*x+3],y.push({from:g,to:d});return{ranges:y,actualTileWidth:r<f-1?s:Math.ceil(a/h)-s*(f-1),actualTileHeight:e<c-1?o:Math.ceil(n/h)-o*(c-1)}}_parseHeader(t){const r=h(t,"MRF_META/Raster");if(!r)throw new e("mrf:open","not a valid MRF format");const s=h(r,"Size"),o=parseInt(s.getAttribute("x"),10),i=parseInt(s.getAttribute("y"),10),a=parseInt(s.getAttribute("c"),10),n=(u(r,"Compression")||"none").toLowerCase();if(!b.has(n))throw new e("mrf:open","currently does not support compression "+n);const c=u(r,"DataType")||"UInt8",p=I.get(c);if(null==p)throw new e("mrf:open","currently does not support pixel type "+c);const g=h(r,"PageSize"),d=parseInt(g.getAttribute("x"),10),A=parseInt(g.getAttribute("y"),10),F=h(r,"DataValues");let _,R;F&&(R=F.getAttribute("NoData"),null!=R&&(_=R.trim().split(" ").map((t=>parseFloat(t)))));if(h(t,"MRF_META/CachedSource"))throw new e("mrf:open","currently does not support MRF referencing other data files");const j=h(t,"MRF_META/GeoTags"),k=h(j,"BoundingBox");let M,S=!1;if(null!=k){const t=parseFloat(k.getAttribute("minx")),e=parseFloat(k.getAttribute("miny")),r=parseFloat(k.getAttribute("maxx")),s=parseFloat(k.getAttribute("maxy")),o=u(j,"Projection")||"";let i;if("LOCAL_CS[]"!==o)if(o.toLowerCase().startsWith("epsg:")){const t=Number(o.slice(5));isNaN(t)||0===t||(i=new y({wkid:t}))}else i=m(o);else S=!0,i=new y({wkid:3857});M=new x(t,e,r,s),M.spatialReference=i}else S=!0,M=new x({xmin:-.5,ymin:.5-i,xmax:o-.5,ymax:.5,spatialReference:new y({wkid:3857})});const T=h(t,"MRF_META/Rsets"),C=parseInt(T&&T.getAttribute("scale")||"2",10),U=M.spatialReference,B=new f({origin:new w({x:M.xmin,y:M.ymax,spatialReference:U}),blockWidth:d,blockHeight:A,pyramidBlockWidth:d,pyramidBlockHeight:A,compression:n,pyramidScalingFactor:C}),L=new w({x:M.width/o,y:M.height/i,spatialReference:U}),E=new l({width:o,height:i,extent:M,isPseudoSpatialReference:S,spatialReference:U,bandCount:a,pixelType:p,pixelSize:L,noDataValue:_,storageInfo:B}),P=u(t,"datafile"),O=u(t,"IndexFile");return{rasterInfo:E,files:{mrf:this.url,index:O||this.url.replace(".mrf",".idx"),data:P||this.url.replace(".mrf",b.get(n).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return p(e)}catch{return null}}};t([i()],A.prototype,"_files",void 0),t([i()],A.prototype,"_storageIndex",void 0),t([i({type:String,json:{write:!0}})],A.prototype,"datasetFormat",void 0),A=t([a("esri.layers.support.rasterIO.MRFRaster")],A);const F=A;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/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import{unwrap as r,isNone as i}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../RasterInfo.js";import o from"../RasterStorageInfo.js";import l from"./BaseRaster.js";import{parseSpatialReference as f,parsePAMInfo as u}from"./pamParser.js";import{parseSignature as m,getImageInfo as p,parseIFD as c,parseFieldValues as h,isBSQConfig as d}from"../rasterFormats/TiffDecoder.js";import y from"../rasterFormats/TiffTags.js";import{estimateStatisticsFromHistograms as g}from"../rasterFunctions/stretchUtils.js";import x from"../rasterTransforms/PolynomialTransform.js";import T from"../../../geometry/SpatialReference.js";import I from"../../../geometry/Extent.js";import w from"../../../geometry/Point.js";const _=(e,t)=>{const r=e.get(t);return r&&r.values},b=(e,t)=>{const r=e.get(t);return r&&r.values[0]};let E=class extends l{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){var s,a,l;await this.init();const u=e?r(e.signal):null,{data:c}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:u});if(!c)throw new t("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{littleEndian:h,firstIFD:d,isBigTiff:y}=m(c),_=[];await this._readIFDs(_,c,h,d,0,y?8:4,u);const b=p(_),{width:E,height:S,tileWidth:F,tileHeight:v,planes:R,pixelType:k,compression:j,firstPyramidLevel:B,maximumPyramidLevel:D,pyramidBlockWidth:L,pyramidBlockHeight:z,tileBoundary:O,affine:P,metadata:H}=b,A=(null==(s=b.extent.spatialReference)?void 0:s.wkt)||(null==(a=b.extent.spatialReference)?void 0:a.wkid);let G=f(A),q=!1;null==G&&(q=!0,G=new T({wkid:3857}));const C=new I({...b.extent,spatialReference:G}),W=new w(C?{x:C.xmin,y:C.ymax,spatialReference:G}:{x:0,y:0}),U=new o({blockWidth:F,blockHeight:v,pyramidBlockWidth:L,pyramidBlockHeight:z,compression:j,origin:W,firstPyramidLevel:B,maximumPyramidLevel:D,blockBoundary:O}),Y=new w({x:(C.xmax-C.xmin)/E,y:(C.ymax-C.ymin)/S,spatialReference:G}),M=H?{BandProperties:H.bandProperties,DataType:H.dataType}:{},N=new n({width:E,height:S,bandCount:R,pixelType:k,compression:j,pixelSize:Y,storageInfo:U,spatialReference:G,isPseudoSpatialReference:q,keyProperties:M,extent:C,statistics:H?H.statistics:null});if(null!=P&&P.length&&(N.nativeExtent=new I({xmin:-.5,ymin:.5-S,xmax:E-.5,ymax:.5,spatialReference:G}),N.transform=new x({polynomialOrder:1,forwardCoefficients:[P[2]+P[0]/2,P[5]-P[3]/2,P[0],P[3],-P[1],-P[4]]}),N.extent=N.transform.forwardTransform(N.nativeExtent),N.pixelSize=new w({x:(C.xmax-C.xmin)/E,y:(C.ymax-C.ymin)/S,spatialReference:G}),U.origin.x=-.5,U.origin.y=.5),null==(l=this.ioConfig.skipExtensions)||!l.includes("aux.xml")){const t=await this._fetchAuxiliaryData(e);if(null!=t){var K;if(N.statistics=null!=(K=t.statistics)?K:N.statistics,N.histograms=t.histograms,t.histograms&&i(N.statistics)&&(N.statistics=g(t.histograms)),t.transform&&!P){N.transform=t.transform,N.nativeExtent=N.extent;const e=N.transform.forwardTransform(N.nativeExtent);N.pixelSize=new w({x:(e.xmax-e.xmin)/E,y:(e.ymax-e.ymin)/S,spatialReference:G}),N.extent=e}N.spatialReference||(N.spatialReference=t.spatialReference)}}if(this._set("rasterInfo",N),this._headerInfo={littleEndian:h,isBigTiff:y,ifds:_,...b},!this._headerInfo.isSupported)throw new t("tiffraster:open","this tiff is not supported: "+this._headerInfo.message);this.updateTileInfo()}async fetchRawTile(e,t,r,i={}){var s;if(null==(s=this._headerInfo)||!s.isSupported||this.isBlockOutside(e,t,r))return null;const a=this._getTileLocation(e,t,r);if(!a)return null;const{ranges:n,actualTileWidth:o,actualTileHeight:l,ifd:f}=a,u=n.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:i.signal}))),m=await Promise.all(u),p=m.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),c=1===m.length?m[0].data:new ArrayBuffer(p),h=[0],d=[0];if(m.length>1){const e=new Uint8Array(c);for(let t=0,r=0;t<m.length;t++){const i=m[t].data;e.set(new Uint8Array(i),r),h[t]=r,r+=i.byteLength,d[t]=i.byteLength}}const{blockWidth:y,blockHeight:g}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(c,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:f,offsets:h,sizes:d},width:y,height:g,planes:null,pixelType:null});let T,I,w;if(o!==y||l!==g){let e=x.mask;if(e)for(T=0;T<g;T++)if(w=T*y,T<l)for(I=o;I<y;I++)e[w+I]=0;else for(I=0;I<y;I++)e[w+I]=0;else for(e=new Uint8Array(y*g),x.mask=e,T=0;T<l;T++)for(w=T*y,I=0;I<o;I++)e[w+I]=1}return x}async _readIFDs(e,t,r,i,s,a=4,n){if(!i)return null;if(i>=t.byteLength||i<0){t=(await this.request(this.url,{range:{from:i+s,to:i+s+this._bufferSize},responseType:"array-buffer",signal:n})).data,s=i+s,i=0}const o=await this._readIFD(t,r,i,s,y.TIFF_TAGS,a,n);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,r,o.nextIFD-s,s,a,n)}async _readIFD(e,t,r,i,s=y.TIFF_TAGS,a=4,n){if(!e)return null;const o=c(e,t,r,i,s,a);if(o.success){const r=[];if(o.ifd.forEach((e=>{e.values||r.push(e)})),r.length>0){const s=r.map((e=>e.offlineOffsetSize)),a=Math.min.apply(null,s.map((e=>e[0])));if(Math.min.apply(null,s.map((e=>e[0]+e[1])))-a<=this._bufferSize){const{data:s}=await this.request(this.url,{range:{from:a,to:a+this._bufferSize},responseType:"array-buffer",signal:n});e=s,i=a,r.forEach((r=>h(e,t,r,i)))}}if(o.ifd.has("GEOKEYDIRECTORY")){const r=o.ifd.get("GEOKEYDIRECTORY"),s=r.values;if(s&&s.length>4){const a=s[0]+"."+s[1]+"."+s[2],o=await this._readIFD(e,t,r.valueOffset+6-i,i,y.GEO_KEYS,2,n);r.data=o.ifd,r.data&&r.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const r=await this.request(this.url,{range:{from:i,to:i+o.requiredBufferSize+4},responseType:"array-buffer",signal:n});return(e=r.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,i,y.TIFF_TAGS,4,n)}}_getTileLocation(e,t,r){const{firstPyramidLevel:i,blockBoundary:s}=this.rasterInfo.storageInfo,a=0===e?0:e-(i-1),n=this._headerInfo.ifds[a];if(!n)return null;const o=d(n,this._headerInfo),l=_(n,"TILEOFFSETS");if(void 0===l)return null;const f=_(n,"TILEBYTECOUNTS"),{minRow:u,minCol:m,maxRow:p,maxCol:c}=s[a];if(t>p||r>c||t<u||r<m)return null;const h=b(n,"IMAGEWIDTH"),y=b(n,"IMAGELENGTH"),g=b(n,"TILEWIDTH"),x=b(n,"TILELENGTH"),T=o?this.rasterInfo.bandCount:1,I=T*t*(c+1)+r,w=[{from:l[I],to:l[I+T-1]+f[I+T-1]-1}];if(o){let e=!0;for(let t=0;t<T;t++)if(l[I+t]+f[I+t]!==l[I+t+1]){e=!1;break}if(!e)for(let t=0;t<T;t++)w[t]={from:l[I+t],to:l[I+t]+f[I+t]-1}}const E=l[I],S=f[I];if(null==E||null==S)return null;return{ranges:w,ifd:n,actualTileWidth:r===c?h%g:g,actualTileHeight:t===p?y%x:x}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:null==e?void 0:e.signal});return u(t)}catch{return null}}};e([s()],E.prototype,"_files",void 0),e([s()],E.prototype,"_headerInfo",void 0),e([s()],E.prototype,"_bufferSize",void 0),e([s({type:String,json:{write:!0}})],E.prototype,"datasetFormat",void 0),E=e([a("esri.layers.support.rasterDatasets.TIFFRaster")],E);const S=E;export{S as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import{unwrap as r,isNone as i}from"../../../core/maybe.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import n from"../RasterInfo.js";import o from"../RasterStorageInfo.js";import f from"./BaseRaster.js";import{parseSpatialReference as l,parsePAMInfo as m}from"./pamParser.js";import{parseSignature as u,getImageInfo as p,parseIFD as c,parseFieldValues as h,isBSQConfig as d}from"../rasterFormats/TiffDecoder.js";import y from"../rasterFormats/TiffTags.js";import{estimateStatisticsFromHistograms as g}from"../rasterFunctions/stretchUtils.js";import x from"../rasterTransforms/PolynomialTransform.js";import T from"../../../geometry/SpatialReference.js";import I from"../../../geometry/Extent.js";import w from"../../../geometry/Point.js";const _=(e,t)=>{const r=e.get(t);return r&&r.values},b=(e,t)=>{const r=e.get(t);return r&&r.values[0]};let E=class extends f{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const s=e?r(e.signal):null,{data:a}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:s});if(!a)throw new t("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{littleEndian:f,firstIFD:m,isBigTiff:c}=u(a),h=[];await this._readIFDs(h,a,f,m,0,c?8:4,s);const d=p(h),{width:y,height:_,tileWidth:b,tileHeight:E,planes:S,pixelType:F,compression:R,firstPyramidLevel:k,maximumPyramidLevel:v,pyramidBlockWidth:j,pyramidBlockHeight:B,tileBoundary:D,affine:L,metadata:z}=d,O=d.extent.spatialReference?.wkt||d.extent.spatialReference?.wkid;let P=l(O),H=!1;null==P&&(H=!0,P=new T({wkid:3857}));const A=new I({...d.extent,spatialReference:P}),G=new w(A?{x:A.xmin,y:A.ymax,spatialReference:P}:{x:0,y:0}),q=new o({blockWidth:b,blockHeight:E,pyramidBlockWidth:j,pyramidBlockHeight:B,compression:R,origin:G,firstPyramidLevel:k,maximumPyramidLevel:v,blockBoundary:D}),C=new w({x:(A.xmax-A.xmin)/y,y:(A.ymax-A.ymin)/_,spatialReference:P}),W=z?{BandProperties:z.bandProperties,DataType:z.dataType}:{},U=new n({width:y,height:_,bandCount:S,pixelType:F,compression:R,pixelSize:C,storageInfo:q,spatialReference:P,isPseudoSpatialReference:H,keyProperties:W,extent:A,statistics:z?z.statistics:null});if(L?.length&&(U.nativeExtent=new I({xmin:-.5,ymin:.5-_,xmax:y-.5,ymax:.5,spatialReference:P}),U.transform=new x({polynomialOrder:1,forwardCoefficients:[L[2]+L[0]/2,L[5]-L[3]/2,L[0],L[3],-L[1],-L[4]]}),U.extent=U.transform.forwardTransform(U.nativeExtent),U.pixelSize=new w({x:(A.xmax-A.xmin)/y,y:(A.ymax-A.ymin)/_,spatialReference:P}),q.origin.x=-.5,q.origin.y=.5),!this.ioConfig.skipExtensions?.includes("aux.xml")){const t=await this._fetchAuxiliaryData(e);if(null!=t){if(U.statistics=t.statistics??U.statistics,U.histograms=t.histograms,t.histograms&&i(U.statistics)&&(U.statistics=g(t.histograms)),t.transform&&!L){U.transform=t.transform,U.nativeExtent=U.extent;const e=U.transform.forwardTransform(U.nativeExtent);U.pixelSize=new w({x:(e.xmax-e.xmin)/y,y:(e.ymax-e.ymin)/_,spatialReference:P}),U.extent=e}U.spatialReference||(U.spatialReference=t.spatialReference)}}if(this._set("rasterInfo",U),this._headerInfo={littleEndian:f,isBigTiff:c,ifds:h,...d},!this._headerInfo.isSupported)throw new t("tiffraster:open","this tiff is not supported: "+this._headerInfo.message);this.updateTileInfo()}async fetchRawTile(e,t,r,i={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,r))return null;const s=this._getTileLocation(e,t,r);if(!s)return null;const{ranges:a,actualTileWidth:n,actualTileHeight:o,ifd:f}=s,l=a.map((e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:i.signal}))),m=await Promise.all(l),u=m.map((e=>e.data.byteLength)).reduce(((e,t)=>e+t)),p=1===m.length?m[0].data:new ArrayBuffer(u),c=[0],h=[0];if(m.length>1){const e=new Uint8Array(p);for(let t=0,r=0;t<m.length;t++){const i=m[t].data;e.set(new Uint8Array(i),r),c[t]=r,r+=i.byteLength,h[t]=i.byteLength}}const{blockWidth:d,blockHeight:y}=this.getBlockWidthHeight(e),g=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:f,offsets:c,sizes:h},width:d,height:y,planes:null,pixelType:null});let x,T,I;if(n!==d||o!==y){let e=g.mask;if(e)for(x=0;x<y;x++)if(I=x*d,x<o)for(T=n;T<d;T++)e[I+T]=0;else for(T=0;T<d;T++)e[I+T]=0;else for(e=new Uint8Array(d*y),g.mask=e,x=0;x<o;x++)for(I=x*d,T=0;T<n;T++)e[I+T]=1}return g}async _readIFDs(e,t,r,i,s,a=4,n){if(!i)return null;if(i>=t.byteLength||i<0){t=(await this.request(this.url,{range:{from:i+s,to:i+s+this._bufferSize},responseType:"array-buffer",signal:n})).data,s=i+s,i=0}const o=await this._readIFD(t,r,i,s,y.TIFF_TAGS,a,n);if(e.push(o.ifd),!o.nextIFD)return null;await this._readIFDs(e,t,r,o.nextIFD-s,s,a,n)}async _readIFD(e,t,r,i,s=y.TIFF_TAGS,a=4,n){if(!e)return null;const o=c(e,t,r,i,s,a);if(o.success){const r=[];if(o.ifd.forEach((e=>{e.values||r.push(e)})),r.length>0){const s=r.map((e=>e.offlineOffsetSize)),a=Math.min.apply(null,s.map((e=>e[0])));if(Math.min.apply(null,s.map((e=>e[0]+e[1])))-a<=this._bufferSize){const{data:s}=await this.request(this.url,{range:{from:a,to:a+this._bufferSize},responseType:"array-buffer",signal:n});e=s,i=a,r.forEach((r=>h(e,t,r,i)))}}if(o.ifd.has("GEOKEYDIRECTORY")){const r=o.ifd.get("GEOKEYDIRECTORY"),s=r.values;if(s&&s.length>4){const a=s[0]+"."+s[1]+"."+s[2],o=await this._readIFD(e,t,r.valueOffset+6-i,i,y.GEO_KEYS,2,n);r.data=o.ifd,r.data&&r.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[a]})}}return o}if(o.requiredBufferSize&&o.requiredBufferSize!==e.byteLength){const r=await this.request(this.url,{range:{from:i,to:i+o.requiredBufferSize+4},responseType:"array-buffer",signal:n});return(e=r.data).byteLength<o.requiredBufferSize?null:this._readIFD(e,t,0,i,y.TIFF_TAGS,4,n)}}_getTileLocation(e,t,r){const{firstPyramidLevel:i,blockBoundary:s}=this.rasterInfo.storageInfo,a=0===e?0:e-(i-1),n=this._headerInfo.ifds[a];if(!n)return null;const o=d(n,this._headerInfo),f=_(n,"TILEOFFSETS");if(void 0===f)return null;const l=_(n,"TILEBYTECOUNTS"),{minRow:m,minCol:u,maxRow:p,maxCol:c}=s[a];if(t>p||r>c||t<m||r<u)return null;const h=b(n,"IMAGEWIDTH"),y=b(n,"IMAGELENGTH"),g=b(n,"TILEWIDTH"),x=b(n,"TILELENGTH"),T=o?this.rasterInfo.bandCount:1,I=T*t*(c+1)+r,w=[{from:f[I],to:f[I+T-1]+l[I+T-1]-1}];if(o){let e=!0;for(let t=0;t<T;t++)if(f[I+t]+l[I+t]!==f[I+t+1]){e=!1;break}if(!e)for(let t=0;t<T;t++)w[t]={from:f[I+t],to:f[I+t]+l[I+t]-1}}const E=f[I],S=l[I];if(null==E||null==S)return null;return{ranges:w,ifd:n,actualTileWidth:r===c?h%g:g,actualTileHeight:t===p?y%x:x}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return m(t)}catch{return null}}};e([s()],E.prototype,"_files",void 0),e([s()],E.prototype,"_headerInfo",void 0),e([s()],E.prototype,"_bufferSize",void 0),e([s({type:String,json:{write:!0}})],E.prototype,"datasetFormat",void 0),E=e([a("esri.layers.support.rasterDatasets.TIFFRaster")],E);const S=E;export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import{isSome as i,isNone as s,unwrap as n}from"../../../core/maybe.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{isAxesOrderReversedForWkid as l}from"../../ogc/crsUtils.js";import c from"../DimensionalDefinition.js";import d from"./BaseRaster.js";import{parse as p}from"./multipartParser.js";import{parseCapabilities as h}from"./wcsCapabilitiesParser.js";import{standardizeInterpolations as u,parseCoverages as f}from"./wcsCoverageParser.js";import{clip as g}from"../rasterFunctions/pixelUtils.js";import m from"../../../geometry/Extent.js";const v=["nearest neighbor","bilinear","bicubic"],w=["nearest","linear","cubic"];let x=class extends d{constructor(){super(...arguments),this.datasetFormat="WCSServer"}async open(e){await this.init();const i=null==e?void 0:e.signal,s=await this._getCapabilities(i);if(this.capabilities=s,!this.version){var n;let e=null==(n=s.capabilitiesVersion)?void 0:n.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=s.capabilitiesVersion:(e=s.supportedVersions.find((e=>"2.0.1"===e))||s.supportedVersions.find((e=>"2.0"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.1"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.0"===e.slice(0,3)))||"1.0.0",this.version=e)}null==this.coverageId&&(this.coverageId=s.coverages[0].id);const o=s.coverages.find((e=>e.id===this.coverageId));if(null==o)throw new t("wcsraster-open",`the coverageId ${this.coverageId} does not exist in capabilities`);const r=await this._describeCoverage(i);this.coverageInfo=r[0],"2.0"===this.version.slice(0,3)&&(this.coverageInfo.lonLatEnvelope=o.lonLatEnvelope,this.coverageInfo.supportedInterpolations=u(s.supportedInterpolations)),this.datasetName=this.coverageInfo.title;const{rasterInfo:a}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(a,512,512),this._set("rasterInfo",a),null==a.spatialReference)throw new t("wcsraster-open",`coverage without spatial referernce is not supported: ${this.coverageId}`);const{pixelType:l,bandCount:c}=await this._getPixelTypeAndBandCount(i);a.pixelType=l,1===a.bandCount&&c>1&&(a.bandCount=c),this.updateTileInfo()}async fetchRawTile(e,n,o,r={}){if(this.isBlockOutside(e,n,o))return null;const{nativePixelSize:a,spatialReference:l}=this.rasterInfo,c=2**e,d=a.x*c,p=a.y*c,{blockWidth:h,blockHeight:u}=this.getBlockWidthHeight(e),{origin:f}=this.rasterInfo.storageInfo.tileInfo,m=this.getTileExtent({x:d,y:p},n,o,f,l,[h,u]),v=this.rasterInfo.extent,w=m.xmax>v.xmax||m.ymin<v.ymin;let x=m,y=h,I=u;if(w&&(x=m.clone().intersection(v),i(x)&&(y=Math.floor((x.xmax-x.xmin)/d),I=Math.floor((x.ymax-x.ymin)/p),x.xmax=x.xmin+d*y,x.ymin=x.ymax-p*I)),s(x)||y<=1||I<=1)return null;const b=await this._getCoverage(x,y,I,c,r);if(!b)return null;const C=await this.decodePixelBlock(b,{width:y,height:I,planes:null,pixelType:null});if(C&&(C.width!==y||C.height!==I))throw new t("wcsraster-fetch",`the reponse has unexpected dimension width: ${C.width}, height: {pixelBlock.height}`);return w?g(C,{x:0,y:0},{width:u,height:u}):C}async _getCapabilities(e){const i={service:"WCS",request:"GetCapabilities"};this.version&&(i.version=this.version,i.acceptVersions=this.version);try{const{data:t}=await this.request(this.url,{query:i,responseType:"xml",signal:e});return h(t)}catch(s){if(!o(s))throw new t("wcslayer:open","wcs capabilities is not valid or supported");throw s}}async _describeCoverage(e){const i={service:"WCS",request:"DescribeCoverage",version:this.version},s=this.version.slice(0,3);"1.0"===s?i.coverage=this.coverageId:"1.1"===s?i.identifiers=this.coverageId:"2.0"===s&&(i.coverageId=this.coverageId);try{const{data:t}=await this.request(this.url,{query:i,responseType:"xml",signal:e});return f(t,this.version)}catch(n){if(!o(n))throw new t("wcslayer:open","wcs coverage description is not valid or supported");throw n}}async _getPixelTypeAndBandCount(e){const{pixelSize:s,extent:o,multidimensionalInfo:r}=this.rasterInfo,a=o.center,l=new m({xmin:a.x-s.x,xmax:a.x+s.x,ymin:a.y-s.y,ymax:a.y+s.y,spatialReference:o.spatialReference});let d;if(i(r)){const e=r.variables[0];d=[],e.dimensions.forEach((t=>{d.push(new c({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent[0]:t.values[0],isSlice:!0}))}))}const p=await this._getCoverage(l,2,2,1,{multidimensionalDefinition:d,signal:n(e)});if(!p)throw new t("wcsraster-open","unable to determine pixel type");const h=await this.decodePixelBlock(p,{width:2,height:2,planes:null,pixelType:null});return{pixelType:h.pixelType,bandCount:h.getPlaneCount()}}async _getCoverage(e,i,s,n,o){const{coverageDescription:r}=this.coverageInfo,{version:a}=r,l="2.0"===r.version?this._getCoverage201Parameters(e,i,s,n,o,r):"1.1"===r.version?this._getCoverage110Parameters(e,i,s,o,r):this._getCoverage100Parameters(e,i,s,o),c="2.0"===r.version?await this.request(this._constructWCS201Url(l),{signal:o.signal,responseType:"array-buffer"}):await this.request(this.url,{query:l,signal:o.signal,responseType:"array-buffer"});if("1.0"===a)return c.data;const d=p(c);if(d.isMultipart&&d.data){const e=d.data.find((e=>{var t;return(null==(t=e.contentType)?void 0:t.toLowerCase().includes("image"))&&null!=e.contentData}));return null==e?void 0:e.contentData}if(this.ioConfig.allowAnyMediaType)return c.data;throw new t("wcsraster:getcoverage","response is not a valid coverage, multipart response is expected")}_getInterpolationIndex(e){return this.coverageInfo.supportedInterpolations.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,i,s){const n=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,o=e.spatialReference.wkid,r=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"GEOTIFF",{bandIds:a,interpolation:l}=s,c=this._getInterpolationIndex(l),d=a?a.map((e=>this.coverageInfo.bandNames[e])):null,p=v[c];return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:r,crs:`EPSG:${o}`,bbox:n,width:t,height:i,interpolation:p,band:null==d?void 0:d.join(",")}}_getCoverage110Parameters(e,t,s,n,o){var r;const{multidimensionalDefinition:a,bandIds:c,interpolation:d}=n,p=e.spatialReference.wkid,h=`urn:ogc:def:crs:EPSG::${p}`,u=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",f=this._getInterpolationIndex(d),g=w[f],m=null==d||0===(null==(r=this.coverageInfo.supportedInterpolations)?void 0:r.indexOf(d)),v=o.domain.spatialDomain,x=v.origin.x<=v.envelope.xmin&&v.origin.y<=v.envelope.ymin,y=e.width/t,I=e.height/s*(x?1:-1),b=x?[e.xmin,e.ymin]:[e.xmin,e.ymax],C=v.useEPSGAxis&&l(p),$=C?`${b[1]},${b[0]}`:`${b[0]},${b[1]}`,S=C?`${I},0,0,${y}`:`${y},0,0,${I}`,j=y/2,T=e.xmin+j,_=e.xmax-j,P=Math.abs(I)/2,L=e.ymin+P,E=e.ymax-P,R=C?`${L},${T},${E},${_},${h}`:`${T},${L},${_},${E},${h}`,q=o.range.find((e=>e.axis.some((e=>e.identifier.toLowerCase().includes("band")))));let k,D=q&&g&&c?m?`${q.identifier}[${q.axis[0].identifier}[${c.join(",")}]]`:`${q.identifier}:${g}[${q.axis[0].identifier}[${c.join(",")}]]`:null;if(i(a)&&a.length)for(let i=0;i<a.length;i++){let e=a[i].values;const t=a[i].dimensionName.toLowerCase(),s=a[i].variableName.toLowerCase();if(e.length>0)if(e[0]instanceof Array&&(e=e[0]),"stdtime"===t)k=e.map((e=>this._convertToISOTime(e))).join(",");else{const i=o.range.find((e=>e.identifier.toLowerCase()===s));if(i){const s=i.axis.find((e=>e.identifier.toLowerCase()===t));s&&(D=m?i.identifier+"["+s.identifier+"["+e.join(",")+"]]":i.identifier+":"+g+"["+s.identifier+"["+e.join(",")+"]]")}}}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:u,crs:`EPSG:${p}`,boundingbox:R,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:$,gridOffsets:S,gridBaseCRS:h,timeSequence:k,rangeSubset:D}}_convertToISOTime(e,t=!1){return(t?new Date(24*(e-25569)*60*60*1e3):new Date(e)).toISOString()}_getCoverage201Parameters(e,t,s,n,o,r){const{multidimensionalDefinition:a,interpolation:l}=o,c=this._getInterpolationIndex(l);let d=null;const{supportedInterpolations:p}=this.capabilities;if(null!=p&&p.length)switch(c){case 0:d=p.find((e=>e.includes("nearest")));break;case 1:d=p.find((e=>e.includes("linear")));break;case 2:d=p.find((e=>e.includes("cubic")||e.includes("quadratic")))}const h=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",{bandNames:u}=this.coverageInfo,{boundedBy:f,domainSet:g,rangeType:m}=r,v=f.isEastFirst?0:1,w=1-v,{axisLabels:x}=f,y=x[v],I=x[w],b=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=b,$=[];$.push(`${y}(${e.xmin},${e.xmax})`),$.push(`${I}(${e.ymin},${e.ymax})`);const S=[];if(x.length>2)for(let i=2;i<x.length;i++){const e=g.origin[i];if(x[i].toLowerCase().includes("time")){let t=e.toString();f.uomLabels[i].toLowerCase().includes("ole")&&(S.push(x[i]),t=this._convertToISOTime(e,!0)),$.push(x[i]+",http://www.opengis.net("+t+")")}else $.push(x[i]+",http://www.opengis.net("+e+")")}let j=null;if(i(a)&&a.length){const e=[];m.forEach((t=>t.forEach((t=>e.push(t.name)))));const t=[];for(let i=0;i<a.length;i++){const s=x.find((e=>e===a[i].dimensionName)),n=e.find((e=>e===a[i].variableName));if(t.includes(n)||t.push(n),s){let e=a[i].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=s.toLowerCase().includes("time")?e.map((e=>this._convertToISOTime(e))).join(","):e.join(",");const i=$.findIndex((e=>0===e.indexOf(s+",http://www.opengis.net")));-1===i&&$.push(s+",http://www.opengis.net("+t+")"),-1===i||$[i].includes("("+t+")")||$.splice(i,1,s+",http://www.opengis.net("+t+")")}}}t.length&&(j=t.join(","))}else if(null!=u&&u.length){j=(o.bandIds?o.bandIds.map((e=>u[e])):u).join(",")}const T=$.join("&subset="),_=!(r.domainSet.axisLabels.join("")===r.boundedBy.axisLabels.join(""))&&!1!==this.ioConfig.allowScaleFactor,P=_?null:`${y}(${t}),${I}(${s})`,L=_?1/n:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:j,interpolation:d,scaleSize:P,scaleFactor:L,subset:T,format:h,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:b,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},i=[];Object.keys(t).forEach((e=>{const s=t[e];null!=s&&("subset"===e?s.split("&subset=").forEach((e=>{e&&i.push(`subset=${encodeURIComponent(e)}`)})):i.push(`${e}=${encodeURIComponent(s)}`))}));return`${encodeURI(this.url)}?${i.join("&")}`}};e([r({type:String,json:{write:!0}})],x.prototype,"datasetFormat",void 0),e([r()],x.prototype,"tileType",void 0),e([r({type:String,json:{write:!0}})],x.prototype,"version",void 0),e([r({type:String,json:{write:!0}})],x.prototype,"coverageId",void 0),x=e([a("esri.layers.support.rasterDatasets.ImageServerRaster")],x);const y=x;export{y as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import{isSome as i,isNone as s,unwrap as n}from"../../../core/maybe.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/arrayUtils.js";import"../../../core/has.js";import"../../../core/accessorSupport/ensureType.js";import{subclass as a}from"../../../core/accessorSupport/decorators/subclass.js";import{isAxesOrderReversedForWkid as l}from"../../ogc/crsUtils.js";import c from"../DimensionalDefinition.js";import p from"./BaseRaster.js";import{parse as d}from"./multipartParser.js";import{parseCapabilities as h}from"./wcsCapabilitiesParser.js";import{standardizeInterpolations as u,parseCoverages as f}from"./wcsCoverageParser.js";import{clip as g}from"../rasterFunctions/pixelUtils.js";import m from"../../../geometry/Extent.js";const v=["nearest neighbor","bilinear","bicubic"],w=["nearest","linear","cubic"];let x=class extends p{constructor(){super(...arguments),this.datasetFormat="WCSServer"}async open(e){await this.init();const i=e?.signal,s=await this._getCapabilities(i);if(this.capabilities=s,!this.version){let e=s.capabilitiesVersion?.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=s.capabilitiesVersion:(e=s.supportedVersions.find((e=>"2.0.1"===e))||s.supportedVersions.find((e=>"2.0"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.1"===e.slice(0,3)))||s.supportedVersions.find((e=>"1.0"===e.slice(0,3)))||"1.0.0",this.version=e)}null==this.coverageId&&(this.coverageId=s.coverages[0].id);const n=s.coverages.find((e=>e.id===this.coverageId));if(null==n)throw new t("wcsraster-open",`the coverageId ${this.coverageId} does not exist in capabilities`);const o=await this._describeCoverage(i);this.coverageInfo=o[0],"2.0"===this.version.slice(0,3)&&(this.coverageInfo.lonLatEnvelope=n.lonLatEnvelope,this.coverageInfo.supportedInterpolations=u(s.supportedInterpolations)),this.datasetName=this.coverageInfo.title;const{rasterInfo:r}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(r,512,512),this._set("rasterInfo",r),null==r.spatialReference)throw new t("wcsraster-open",`coverage without spatial referernce is not supported: ${this.coverageId}`);const{pixelType:a,bandCount:l}=await this._getPixelTypeAndBandCount(i);r.pixelType=a,1===r.bandCount&&l>1&&(r.bandCount=l),this.updateTileInfo()}async fetchRawTile(e,n,o,r={}){if(this.isBlockOutside(e,n,o))return null;const{nativePixelSize:a,spatialReference:l}=this.rasterInfo,c=2**e,p=a.x*c,d=a.y*c,{blockWidth:h,blockHeight:u}=this.getBlockWidthHeight(e),{origin:f}=this.rasterInfo.storageInfo.tileInfo,m=this.getTileExtent({x:p,y:d},n,o,f,l,[h,u]),v=this.rasterInfo.extent,w=m.xmax>v.xmax||m.ymin<v.ymin;let x=m,y=h,I=u;if(w&&(x=m.clone().intersection(v),i(x)&&(y=Math.floor((x.xmax-x.xmin)/p),I=Math.floor((x.ymax-x.ymin)/d),x.xmax=x.xmin+p*y,x.ymin=x.ymax-d*I)),s(x)||y<=1||I<=1)return null;const b=await this._getCoverage(x,y,I,c,r);if(!b)return null;const C=await this.decodePixelBlock(b,{width:y,height:I,planes:null,pixelType:null});if(C&&(C.width!==y||C.height!==I))throw new t("wcsraster-fetch",`the reponse has unexpected dimension width: ${C.width}, height: {pixelBlock.height}`);return w?g(C,{x:0,y:0},{width:u,height:u}):C}async _getCapabilities(e){const i={service:"WCS",request:"GetCapabilities"};this.version&&(i.version=this.version,i.acceptVersions=this.version);try{const{data:t}=await this.request(this.url,{query:i,responseType:"xml",signal:e});return h(t)}catch(s){if(!o(s))throw new t("wcslayer:open","wcs capabilities is not valid or supported");throw s}}async _describeCoverage(e){const i={service:"WCS",request:"DescribeCoverage",version:this.version},s=this.version.slice(0,3);"1.0"===s?i.coverage=this.coverageId:"1.1"===s?i.identifiers=this.coverageId:"2.0"===s&&(i.coverageId=this.coverageId);try{const{data:t}=await this.request(this.url,{query:i,responseType:"xml",signal:e});return f(t,this.version)}catch(n){if(!o(n))throw new t("wcslayer:open","wcs coverage description is not valid or supported");throw n}}async _getPixelTypeAndBandCount(e){const{pixelSize:s,extent:o,multidimensionalInfo:r}=this.rasterInfo,a=o.center,l=new m({xmin:a.x-s.x,xmax:a.x+s.x,ymin:a.y-s.y,ymax:a.y+s.y,spatialReference:o.spatialReference});let p;if(i(r)){const e=r.variables[0];p=[],e.dimensions.forEach((t=>{p.push(new c({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent[0]:t.values[0],isSlice:!0}))}))}const d=await this._getCoverage(l,2,2,1,{multidimensionalDefinition:p,signal:n(e)});if(!d)throw new t("wcsraster-open","unable to determine pixel type");const h=await this.decodePixelBlock(d,{width:2,height:2,planes:null,pixelType:null});return{pixelType:h.pixelType,bandCount:h.getPlaneCount()}}async _getCoverage(e,i,s,n,o){const{coverageDescription:r}=this.coverageInfo,{version:a}=r,l="2.0"===r.version?this._getCoverage201Parameters(e,i,s,n,o,r):"1.1"===r.version?this._getCoverage110Parameters(e,i,s,o,r):this._getCoverage100Parameters(e,i,s,o),c="2.0"===r.version?await this.request(this._constructWCS201Url(l),{signal:o.signal,responseType:"array-buffer"}):await this.request(this.url,{query:l,signal:o.signal,responseType:"array-buffer"});if("1.0"===a)return c.data;const p=d(c);if(p.isMultipart&&p.data){return p.data.find((e=>e.contentType?.toLowerCase().includes("image")&&null!=e.contentData))?.contentData}if(this.ioConfig.allowAnyMediaType)return c.data;throw new t("wcsraster:getcoverage","response is not a valid coverage, multipart response is expected")}_getInterpolationIndex(e){return this.coverageInfo.supportedInterpolations.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,i,s){const n=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,o=e.spatialReference.wkid,r=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"GEOTIFF",{bandIds:a,interpolation:l}=s,c=this._getInterpolationIndex(l),p=a?a.map((e=>this.coverageInfo.bandNames[e])):null,d=v[c];return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:r,crs:`EPSG:${o}`,bbox:n,width:t,height:i,interpolation:d,band:p?.join(",")}}_getCoverage110Parameters(e,t,s,n,o){const{multidimensionalDefinition:r,bandIds:a,interpolation:c}=n,p=e.spatialReference.wkid,d=`urn:ogc:def:crs:EPSG::${p}`,h=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",u=this._getInterpolationIndex(c),f=w[u],g=null==c||0===this.coverageInfo.supportedInterpolations?.indexOf(c),m=o.domain.spatialDomain,v=m.origin.x<=m.envelope.xmin&&m.origin.y<=m.envelope.ymin,x=e.width/t,y=e.height/s*(v?1:-1),I=v?[e.xmin,e.ymin]:[e.xmin,e.ymax],b=m.useEPSGAxis&&l(p),C=b?`${I[1]},${I[0]}`:`${I[0]},${I[1]}`,$=b?`${y},0,0,${x}`:`${x},0,0,${y}`,S=x/2,j=e.xmin+S,T=e.xmax-S,_=Math.abs(y)/2,P=e.ymin+_,L=e.ymax-_,E=b?`${P},${j},${L},${T},${d}`:`${j},${P},${T},${L},${d}`,R=o.range.find((e=>e.axis.some((e=>e.identifier.toLowerCase().includes("band")))));let q,k=R&&f&&a?g?`${R.identifier}[${R.axis[0].identifier}[${a.join(",")}]]`:`${R.identifier}:${f}[${R.axis[0].identifier}[${a.join(",")}]]`:null;if(i(r)&&r.length)for(let i=0;i<r.length;i++){let e=r[i].values;const t=r[i].dimensionName.toLowerCase(),s=r[i].variableName.toLowerCase();if(e.length>0)if(e[0]instanceof Array&&(e=e[0]),"stdtime"===t)q=e.map((e=>this._convertToISOTime(e))).join(",");else{const i=o.range.find((e=>e.identifier.toLowerCase()===s));if(i){const s=i.axis.find((e=>e.identifier.toLowerCase()===t));s&&(k=g?i.identifier+"["+s.identifier+"["+e.join(",")+"]]":i.identifier+":"+f+"["+s.identifier+"["+e.join(",")+"]]")}}}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:h,crs:`EPSG:${p}`,boundingbox:E,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:C,gridOffsets:$,gridBaseCRS:d,timeSequence:q,rangeSubset:k}}_convertToISOTime(e,t=!1){return(t?new Date(24*(e-25569)*60*60*1e3):new Date(e)).toISOString()}_getCoverage201Parameters(e,t,s,n,o,r){const{multidimensionalDefinition:a,interpolation:l}=o,c=this._getInterpolationIndex(l);let p=null;const{supportedInterpolations:d}=this.capabilities;if(d?.length)switch(c){case 0:p=d.find((e=>e.includes("nearest")));break;case 1:p=d.find((e=>e.includes("linear")));break;case 2:p=d.find((e=>e.includes("cubic")||e.includes("quadratic")))}const h=(this.coverageInfo.supportedFormats||[]).find((e=>e.toLowerCase().includes("tiff")))||"image/tiff",{bandNames:u}=this.coverageInfo,{boundedBy:f,domainSet:g,rangeType:m}=r,v=f.isEastFirst?0:1,w=1-v,{axisLabels:x}=f,y=x[v],I=x[w],b=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=b,$=[];$.push(`${y}(${e.xmin},${e.xmax})`),$.push(`${I}(${e.ymin},${e.ymax})`);const S=[];if(x.length>2)for(let i=2;i<x.length;i++){const e=g.origin[i];if(x[i].toLowerCase().includes("time")){let t=e.toString();f.uomLabels[i].toLowerCase().includes("ole")&&(S.push(x[i]),t=this._convertToISOTime(e,!0)),$.push(x[i]+",http://www.opengis.net("+t+")")}else $.push(x[i]+",http://www.opengis.net("+e+")")}let j=null;if(i(a)&&a.length){const e=[];m.forEach((t=>t.forEach((t=>e.push(t.name)))));const t=[];for(let i=0;i<a.length;i++){const s=x.find((e=>e===a[i].dimensionName)),n=e.find((e=>e===a[i].variableName));if(t.includes(n)||t.push(n),s){let e=a[i].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=s.toLowerCase().includes("time")?e.map((e=>this._convertToISOTime(e))).join(","):e.join(",");const i=$.findIndex((e=>0===e.indexOf(s+",http://www.opengis.net")));-1===i&&$.push(s+",http://www.opengis.net("+t+")"),-1===i||$[i].includes("("+t+")")||$.splice(i,1,s+",http://www.opengis.net("+t+")")}}}t.length&&(j=t.join(","))}else if(u?.length){j=(o.bandIds?o.bandIds.map((e=>u[e])):u).join(",")}const T=$.join("&subset="),_=!(r.domainSet.axisLabels.join("")===r.boundedBy.axisLabels.join(""))&&!1!==this.ioConfig.allowScaleFactor,P=_?null:`${y}(${t}),${I}(${s})`,L=_?1/n:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:j,interpolation:p,scaleSize:P,scaleFactor:L,subset:T,format:h,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:b,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},i=[];Object.keys(t).forEach((e=>{const s=t[e];null!=s&&("subset"===e?s.split("&subset=").forEach((e=>{e&&i.push(`subset=${encodeURIComponent(e)}`)})):i.push(`${e}=${encodeURIComponent(s)}`))}));return`${encodeURI(this.url)}?${i.join("&")}`}};e([r({type:String,json:{write:!0}})],x.prototype,"datasetFormat",void 0),e([r()],x.prototype,"tileType",void 0),e([r({type:String,json:{write:!0}})],x.prototype,"version",void 0),e([r({type:String,json:{write:!0}})],x.prototype,"coverageId",void 0),x=e([a("esri.layers.support.rasterDatasets.ImageServerRaster")],x);const y=x;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- const t=5e4;function n(t){const n=o(t);if(!n)return{isMultipart:!1,data:null};return{isMultipart:!0,data:n.boundary?r(t.data,n,0):null}}function e(t){const n=new Uint8Array(t,0,2e3),e=String.fromCharCode.apply(null,n),r=e.indexOf('boundary="'),o=-1!==r?e.slice(r+10,e.indexOf('"',r+10)):"";return{boundary:o,offset:-1!==r?r+12+o.length:0}}function r(n,e,r=0){const o="--"+e.boundary,a=[];for(let t=0;t<o.length;t++)a.push(o.charCodeAt(t));const s=[],l="\n--"+e.boundary+"--";for(let t=0;t<l.length;t++)s.push(l.charCodeAt(t));const c=[10],u=[13,10],f=[],h=a.length,d=new Uint8Array(n,r),p=Math.min(t,d.length-h);let g=0,y=0;for(let t=0;t<p;t++){for(y=0;y<h&&d[t+y]===a[y];y++);y===h&&(g&&f.push(i(d.subarray(g,t),e)),t+=h-1,d[t+1]===c[0]?t+=1:d[t+1]===u[0]&&d[t+2]===u[1]&&(t+=2),g=t+1)}const b=s.length;for(let t=d.length-b-10;t<d.length-b;t++){for(y=0;y<b&&d[t+y]===s[y];y++);if(y===b){f.push(i(d.subarray(g,t),e));break}}return f}function o(t){var n,e;const r=null==(n=t.getHeader("Content-Type"))?void 0:n.split(";");if(!(null!=(e=null==r?void 0:r[0].trim())?e:"").startsWith("multipart/"))return null;const o={boundary:"",start:"",type:""};for(let i=1;i<r.length;i++){const t=r[i].split("="),n=t[1].trim();o[t[0].trim()]=n.startsWith('"')?n.slice(1,t[1].length-1):n}return o}function i(t,n){const e=String.fromCharCode.apply(null,t.subarray(0,Math.min(300,t.length))).split("\n"),r=Math.min(e.length,7),o={contentDisposition:"inline"};let i=0;for(let s=0;s<r;s++){var a;if(e[s].length<4)i=i+e[s].length+1;else if("content"===e[s].slice(0,7).toLowerCase()){if(i=i+e[s].length+1,!e[s].includes(":"))continue;const t=e[s].substring(0,e[s].indexOf(":")).trim(),n=e[s].substring(e[s].indexOf(":")+1).trim();switch(t.toLowerCase()){case"content-type":o.contentType=n;break;case"content-description":o.contentDescription=n;break;case"content-transfer-encoding":o.contentTransferEncoding=n;break;case"content-id":o.contentID=n;break;case"content-disposition":o.contentDisposition=n;break;case"content-location":o.contentLocation=n}}else{if(o.contentDisposition.toLowerCase().includes("inline")&&e[s].length>=4&&(null==(a=o.contentType)?void 0:a.toLowerCase().indexOf("image"))>-1){let n=!0;if(o.contentType.toLowerCase().indexOf("tif")>0&&(n=73===t[i]&&73===t[i+1]||77===t[i]&&77===t[i+1]),n){const n=new ArrayBuffer(t.length-i);new Uint8Array(n).set(t.subarray(i,t.length)),o.contentData=n}break}if((""===n.start||o.contentID===n.start)&&o.contentType){if(o.contentType.includes("text")||o.contentType.includes("xml")){o.contentData=String.fromCharCode.apply(null,t.subarray(i,t.length));break}o.contentData=t.subarray(i,t.length)}}}return o}export{e as getBoundary,n as parse};
5
+ const t=5e4;function n(t){const n=o(t);if(!n)return{isMultipart:!1,data:null};return{isMultipart:!0,data:n.boundary?r(t.data,n,0):null}}function e(t){const n=new Uint8Array(t,0,2e3),e=String.fromCharCode.apply(null,n),r=e.indexOf('boundary="'),o=-1!==r?e.slice(r+10,e.indexOf('"',r+10)):"";return{boundary:o,offset:-1!==r?r+12+o.length:0}}function r(n,e,r=0){const o="--"+e.boundary,a=[];for(let t=0;t<o.length;t++)a.push(o.charCodeAt(t));const s=[],c="\n--"+e.boundary+"--";for(let t=0;t<c.length;t++)s.push(c.charCodeAt(t));const l=[10],u=[13,10],f=[],h=a.length,p=new Uint8Array(n,r),d=Math.min(t,p.length-h);let g=0,y=0;for(let t=0;t<d;t++){for(y=0;y<h&&p[t+y]===a[y];y++);y===h&&(g&&f.push(i(p.subarray(g,t),e)),t+=h-1,p[t+1]===l[0]?t+=1:p[t+1]===u[0]&&p[t+2]===u[1]&&(t+=2),g=t+1)}const b=s.length;for(let t=p.length-b-10;t<p.length-b;t++){for(y=0;y<b&&p[t+y]===s[y];y++);if(y===b){f.push(i(p.subarray(g,t),e));break}}return f}function o(t){const n=t.getHeader("Content-Type")?.split(";");if(!(n?.[0].trim()??"").startsWith("multipart/"))return null;const e={boundary:"",start:"",type:""};for(let r=1;r<n.length;r++){const t=n[r].split("="),o=t[1].trim();e[t[0].trim()]=o.startsWith('"')?o.slice(1,t[1].length-1):o}return e}function i(t,n){const e=String.fromCharCode.apply(null,t.subarray(0,Math.min(300,t.length))).split("\n"),r=Math.min(e.length,7),o={contentDisposition:"inline"};let i=0;for(let a=0;a<r;a++)if(e[a].length<4)i=i+e[a].length+1;else if("content"===e[a].slice(0,7).toLowerCase()){if(i=i+e[a].length+1,!e[a].includes(":"))continue;const t=e[a].substring(0,e[a].indexOf(":")).trim(),n=e[a].substring(e[a].indexOf(":")+1).trim();switch(t.toLowerCase()){case"content-type":o.contentType=n;break;case"content-description":o.contentDescription=n;break;case"content-transfer-encoding":o.contentTransferEncoding=n;break;case"content-id":o.contentID=n;break;case"content-disposition":o.contentDisposition=n;break;case"content-location":o.contentLocation=n}}else{if(o.contentDisposition.toLowerCase().includes("inline")&&e[a].length>=4&&o.contentType?.toLowerCase().indexOf("image")>-1){let n=!0;if(o.contentType.toLowerCase().indexOf("tif")>0&&(n=73===t[i]&&73===t[i+1]||77===t[i]&&77===t[i+1]),n){const n=new ArrayBuffer(t.length-i);new Uint8Array(n).set(t.subarray(i,t.length)),o.contentData=n}break}if((""===n.start||o.contentID===n.start)&&o.contentType){if(o.contentType.includes("text")||o.contentType.includes("xml")){o.contentData=String.fromCharCode.apply(null,t.subarray(i,t.length));break}o.contentData=t.subarray(i,t.length)}}return o}export{e as getBoundary,n as parse};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.24/esri/copyright.txt for details.
4
4
  */
5
- import"../../../geometry.js";import{isSameTagIgnoreNS as e,getElementValue as t,getElements as n,getElement as r,getElementNumericValue as s,getElementNumericValues as a}from"./xmlUtilities.js";import i from"../rasterTransforms/PolynomialTransform.js";import l from"../../../geometry/SpatialReference.js";function o(e,t){if(!e||!t)return null;const n=[];for(let r=0;r<e.length;r++)n.push(e[r]),n.push(t[r]);return n}function u(e){var n;const l=r(e,"GeodataXform"),u=c(s(l,"SpatialReference/WKID")||t(l,"SpatialReference/WKT"));if("typens:PolynomialXform"!==l.getAttribute("xsi:type"))return{spatialReference:u,transform:null};const f=null!=(n=s(l,"PolynomialOrder"))?n:1,m=a(l,"CoeffX/Double"),d=a(l,"CoeffY/Double"),p=a(l,"InverseCoeffX/Double"),S=a(l,"InverseCoeffY/Double"),C=o(m,d),I=o(p,S);return{spatialReference:u,transform:new i({spatialReference:u,polynomialOrder:f,forwardCoefficients:C,inverseCoefficients:I})}}function f(e){var a;const i=s(e,"NoDataValue"),l=r(e,"Histograms/HistItem"),o=s(l,"HistMin"),u=s(l,"HistMax"),f=s(l,"BucketCount"),c=null==(a=t(l,"HistCounts"))?void 0:a.split("|").map((e=>Number(e)));let m,d,p,S;n(e,"Metadata/MDI").forEach((e=>{var t;const n=Number(null!=(t=e.textContent)?t:e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":m=n;break;case"STATISTICS_MAXIMUM":d=n;break;case"STATISTICS_MEAN":p=n;break;case"STATISTICS_STDDEV":S=n}}));const C=s(e,"Metadata/SourceBandIndex");return{noDataValue:i,histogram:null!=c&&c.length&&null!=m&&null!=d?{min:o,max:u,size:f||c.length,counts:c}:null,sourceBandIndex:C,statistics:null!=m&&null!=d?{min:m,max:d,avg:p,stddev:S}:null}}function c(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new l({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const n=e.indexOf("VERTCS"),r=e.indexOf("PROJCS"),s=r>-1?r:e.indexOf("GEOGCS");if(-1===s)return null;const a=e.slice(s,e.lastIndexOf("]",n)+1).trim(),i=e.slice(n,e.lastIndexOf("]")).trim();t=m(a);const o=new l(t?{wkid:t}:{wkt:a}),u=m(i);return u&&(o.vcsWkid=u),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=m(e),new l(0!==t?{wkid:t}:{wkt:e})):null}function m(e){var t;const n=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map((e=>e.trim())).filter((e=>""!==e)),r=n[n.length-1].split(","),s=null==(t=r[0])?void 0:t.toLowerCase();if(("epsg"===s||"esri"===s)&&e.endsWith('"]]')){const e=Number(r[1]);if(!isNaN(e)&&0!==e)return e}return 0}function d(r){var s;if("pamdataset"!==(null==r||null==(s=r.documentElement.tagName)?void 0:s.toLowerCase()))return{};const a={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};r.documentElement.childNodes.forEach((r=>{if(1===r.nodeType)if(e(r,"SRS")){if(!a.spatialReference){const e=t(r);a.spatialReference=c(e)}}else if(e(r,"Metadata"))if("xml:ESRI"===r.getAttribute("domain")){const{spatialReference:e,transform:t}=u(r);a.transform=t,a.spatialReference||(a.spatialReference=e)}else{n(r,"MDI").forEach((e=>a.metadata[e.getAttribute("key")]=t(e)))}else if(e(r,"PAMRasterBand")){const e=f(r);null!=e.sourceBandIndex&&null==a.rasterBands[e.sourceBandIndex]?a.rasterBands[e.sourceBandIndex]=e:a.rasterBands.push(e)}}));const i=a.rasterBands;if(i){const e=!!i[0].statistics;a.statistics=e?i.map((e=>e.statistics)):null;const t=!!i[0].histogram;a.histograms=t?i.map((e=>e.histogram)):null}return a}export{d as parsePAMInfo,c as parseSpatialReference};
5
+ import"../../../geometry.js";import{isSameTagIgnoreNS as e,getElementValue as t,getElements as n,getElement as s,getElementNumericValue as r,getElementNumericValues as a}from"./xmlUtilities.js";import i from"../rasterTransforms/PolynomialTransform.js";import l from"../../../geometry/SpatialReference.js";function o(e,t){if(!e||!t)return null;const n=[];for(let s=0;s<e.length;s++)n.push(e[s]),n.push(t[s]);return n}function u(e){const n=s(e,"GeodataXform"),l=c(r(n,"SpatialReference/WKID")||t(n,"SpatialReference/WKT"));if("typens:PolynomialXform"!==n.getAttribute("xsi:type"))return{spatialReference:l,transform:null};const u=r(n,"PolynomialOrder")??1,f=a(n,"CoeffX/Double"),m=a(n,"CoeffY/Double"),d=a(n,"InverseCoeffX/Double"),p=a(n,"InverseCoeffY/Double"),S=o(f,m),C=o(d,p);return{spatialReference:l,transform:new i({spatialReference:l,polynomialOrder:u,forwardCoefficients:S,inverseCoefficients:C})}}function f(e){const a=r(e,"NoDataValue"),i=s(e,"Histograms/HistItem"),l=r(i,"HistMin"),o=r(i,"HistMax"),u=r(i,"BucketCount"),f=t(i,"HistCounts")?.split("|").map((e=>Number(e)));let c,m,d,p;n(e,"Metadata/MDI").forEach((e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":c=t;break;case"STATISTICS_MAXIMUM":m=t;break;case"STATISTICS_MEAN":d=t;break;case"STATISTICS_STDDEV":p=t}}));const S=r(e,"Metadata/SourceBandIndex");return{noDataValue:a,histogram:f?.length&&null!=c&&null!=m?{min:l,max:o,size:u||f.length,counts:f}:null,sourceBandIndex:S,statistics:null!=c&&null!=m?{min:c,max:m,avg:d,stddev:p}:null}}function c(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new l({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const n=e.indexOf("VERTCS"),s=e.indexOf("PROJCS"),r=s>-1?s:e.indexOf("GEOGCS");if(-1===r)return null;const a=e.slice(r,e.lastIndexOf("]",n)+1).trim(),i=e.slice(n,e.lastIndexOf("]")).trim();t=m(a);const o=new l(t?{wkid:t}:{wkt:a}),u=m(i);return u&&(o.vcsWkid=u),o}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=m(e),new l(0!==t?{wkid:t}:{wkt:e})):null}function m(e){const t=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map((e=>e.trim())).filter((e=>""!==e)),n=t[t.length-1].split(","),s=n[0]?.toLowerCase();if(("epsg"===s||"esri"===s)&&e.endsWith('"]]')){const e=Number(n[1]);if(!isNaN(e)&&0!==e)return e}return 0}function d(s){if("pamdataset"!==s?.documentElement.tagName?.toLowerCase())return{};const r={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};s.documentElement.childNodes.forEach((s=>{if(1===s.nodeType)if(e(s,"SRS")){if(!r.spatialReference){const e=t(s);r.spatialReference=c(e)}}else if(e(s,"Metadata"))if("xml:ESRI"===s.getAttribute("domain")){const{spatialReference:e,transform:t}=u(s);r.transform=t,r.spatialReference||(r.spatialReference=e)}else{n(s,"MDI").forEach((e=>r.metadata[e.getAttribute("key")]=t(e)))}else if(e(s,"PAMRasterBand")){const e=f(s);null!=e.sourceBandIndex&&null==r.rasterBands[e.sourceBandIndex]?r.rasterBands[e.sourceBandIndex]=e:r.rasterBands.push(e)}}));const a=r.rasterBands;if(a){const e=!!a[0].statistics;r.statistics=e?a.map((e=>e.statistics)):null;const t=!!a[0].histogram;r.histograms=t?a.map((e=>e.histogram)):null}return r}export{d as parsePAMInfo,c as parseSpatialReference};