@arcgis/core 5.0.0-next.86 → 5.0.0-next.87

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 (290) hide show
  1. package/Ground.js +1 -1
  2. package/WebScene.js +1 -1
  3. package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +14 -2
  4. package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.js +1 -1
  5. package/applications/Components/OrientedImageryViewer/galleryUtils.d.ts +80 -0
  6. package/applications/Components/OrientedImageryViewer/galleryUtils.js +5 -0
  7. package/applications/Components/clipboard.d.ts +106 -0
  8. package/applications/Components/clipboard.js +5 -0
  9. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  10. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  11. package/assets/esri/core/t9n/Units.json +1 -1
  12. package/assets/esri/core/workers/RemoteClient.js +1 -1
  13. package/assets/esri/core/workers/chunks/{6298e71e6c480d6f46e3.js → 0276e689e1371b40cff3.js} +1 -1
  14. package/assets/esri/core/workers/chunks/045a9cc900bb4ac8afde.js +1 -0
  15. package/assets/esri/core/workers/chunks/048173088bbeb1f6b8b6.js +1 -0
  16. package/assets/esri/core/workers/chunks/0be8b9d9ef56c37e74c3.js +1 -0
  17. package/assets/esri/core/workers/chunks/0bef671165e64f90ac86.js +1 -0
  18. package/assets/esri/core/workers/chunks/0c025d2b0d3162b07feb.js +1 -0
  19. package/assets/esri/core/workers/chunks/0c4ed18d67dea0c99f01.js +1 -0
  20. package/assets/esri/core/workers/chunks/0e0208b87566f4470f1d.js +1 -0
  21. package/assets/esri/core/workers/chunks/{981f05b5ef6f9c3f7e8a.js → 0fc0fd7618ef25dd6b67.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{f1e1666bede364c069fc.js → 15c180deb8d09127ad31.js} +1 -1
  23. package/assets/esri/core/workers/chunks/1616ee2f6dce0203f1d5.js +1 -0
  24. package/assets/esri/core/workers/chunks/21bb414cb0623ffad577.js +1 -0
  25. package/assets/esri/core/workers/chunks/21c84e014c73bd85f4a3.js +1 -0
  26. package/assets/esri/core/workers/chunks/262677294d8c653e2b0b.js +1 -0
  27. package/assets/esri/core/workers/chunks/{5139bbe8f94df01467c7.js → 28a6a59033baa44bafab.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{c5d56b85d34026507902.js → 28c273f34ffde25cebc6.js} +1 -1
  29. package/assets/esri/core/workers/chunks/{b7e40118b4d645e9f8e1.js → 2a12026f1ca9e8900a8b.js} +1 -1
  30. package/assets/esri/core/workers/chunks/2bc9f407f89d554a43ce.js +1 -0
  31. package/assets/esri/core/workers/chunks/2f21c5ae4fbe85c2792b.js +1 -0
  32. package/assets/esri/core/workers/chunks/3332ee9727874953523c.js +1 -0
  33. package/assets/esri/core/workers/chunks/{c477b0ce55211339c4cb.js → 33f44cc192c72064b5b6.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{1cf27708d17a4de75b68.js → 3672125daca3df24c8ab.js} +1 -1
  35. package/assets/esri/core/workers/chunks/37a607f3835ec6f60834.js +1 -0
  36. package/assets/esri/core/workers/chunks/{3ebd4cdafa7682062447.js → 39dd80c184ac48f877f1.js} +1 -1
  37. package/assets/esri/core/workers/chunks/3a3adf9b6502ad698aea.js +1 -0
  38. package/assets/esri/core/workers/chunks/3b5f24bb824c95996308.js +1 -0
  39. package/assets/esri/core/workers/chunks/{4a857a7f5e00dfab2b44.js → 3c663035cf872b66cb98.js} +1 -1
  40. package/assets/esri/core/workers/chunks/{32b09ca094377a305881.js → 3d924488471601a17915.js} +1 -1
  41. package/assets/esri/core/workers/chunks/{743165f9bc4d85748a0d.js → 42b56932340b6d0bc712.js} +1 -1
  42. package/assets/esri/core/workers/chunks/4de93e9f91fd891ed96f.js +1 -0
  43. package/assets/esri/core/workers/chunks/4eb02a03956d1c9c77ee.js +1 -0
  44. package/assets/esri/core/workers/chunks/{15132d36e7ccbb3c009e.js → 555a252bdb87e340bd02.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{5d791bfca20791d8e0af.js → 5670e430584f020a3530.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{70df4331ed29d823bf38.js → 5b297353b058323f8080.js} +1 -1
  47. package/assets/esri/core/workers/chunks/5ef5dcca7c9b376f7f77.js +1 -0
  48. package/assets/esri/core/workers/chunks/{c12c095937b21e39ad3c.js → 614c63dae0158da0ed3d.js} +1 -1
  49. package/assets/esri/core/workers/chunks/{8f3abaabc61858e929a5.js → 641450da2680ae09b8e7.js} +1 -1
  50. package/assets/esri/core/workers/chunks/{8b575ac55bc396c0c477.js → 687677acc05b5e87effe.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{1aee859eaffa54ef2515.js → 727321c615f35d708d46.js} +1 -1
  52. package/assets/esri/core/workers/chunks/782c24211daacb47b0b2.js +1 -0
  53. package/assets/esri/core/workers/chunks/79067e7d1ebc46afd775.js +1 -0
  54. package/assets/esri/core/workers/chunks/7a454e4d6df3360e0ab9.js +1 -0
  55. package/assets/esri/core/workers/chunks/7da56ba34c81d2bbaf25.js +1 -0
  56. package/assets/esri/core/workers/chunks/{d8b72c6f5f9b2d013b7f.js → 824b45b04b4f4f91dbce.js} +1 -1
  57. package/assets/esri/core/workers/chunks/836d10ceb93ed19f0aa6.js +1 -0
  58. package/assets/esri/core/workers/chunks/{68d0bae1816061d96307.js → 837d39e70880e4310bda.js} +1 -1
  59. package/assets/esri/core/workers/chunks/8bcb2180ecc88a39b317.js +1 -0
  60. package/assets/esri/core/workers/chunks/{e95f90d59041640727da.js → 8c5d827cbf8869defb87.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{7449af8f3637c1694660.js → 97155c8ac832d7c46f24.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{fbf21fda283836e8633c.js → 98cb131b62e30aee35e1.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{e067bbf12f711fd5b9a6.js → 9b3b9df0aa0fdcc77aa2.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{5852d291ef41201030d5.js → 9fa1512baa6e95d3f878.js} +21 -21
  65. package/assets/esri/core/workers/chunks/{96616126aaf319cd1c6f.js → a5ed35f53769feb751db.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{b6530c66804bede649d7.js → aa09e261d1f7dffaad8c.js} +1 -1
  67. package/assets/esri/core/workers/chunks/b268b4cbf5b0c856f88e.js +1 -0
  68. package/assets/esri/core/workers/chunks/b2f6cee006788ce3bd16.js +1 -0
  69. package/assets/esri/core/workers/chunks/{198ae9e02366870d3ec8.js → b46e772e415e2cfca896.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{cee29c3a94376f6740d7.js → b4ab715a3c506e122f35.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{b5ca894a6cb1a19676d5.js → b9756dce0b3af1a9dc54.js} +1 -1
  72. package/assets/esri/core/workers/chunks/baa7e90ec5259057d86b.js +1 -0
  73. package/assets/esri/core/workers/chunks/{52ae2073604deef63ea2.js → c083045d21636b95f26f.js} +1 -1
  74. package/assets/esri/core/workers/chunks/{5a0c5271304189a2401d.js → c38098f7073a10efdb1e.js} +1 -1
  75. package/assets/esri/core/workers/chunks/{adecd31fd64d6753682d.js → c7c865dc1a93e781a3e3.js} +1 -1
  76. package/assets/esri/core/workers/chunks/c8e56dc1239118ac2a60.js +1 -0
  77. package/assets/esri/core/workers/chunks/{e7e508258ad27468a6a5.js → cc6d9b2062b9de629111.js} +1 -1
  78. package/assets/esri/core/workers/chunks/d5386c0e77063c87fddd.js +1 -0
  79. package/assets/esri/core/workers/chunks/d782671235af2db1c458.js +1 -0
  80. package/assets/esri/core/workers/chunks/de33ce9b6f4e6c0e1389.js +1 -0
  81. package/assets/esri/core/workers/chunks/{0abb084b8a137f4fcdfc.js → e1c5773c12d9947bdc5f.js} +1 -1
  82. package/assets/esri/core/workers/chunks/e55ce8466aa979ac1e6b.js +1 -0
  83. package/assets/esri/core/workers/chunks/{21739c37160061f229ef.js → e585883d0036aa866420.js} +1 -1
  84. package/assets/esri/core/workers/chunks/e6d6d664fc9f2cd6a042.js +1 -0
  85. package/assets/esri/core/workers/chunks/e7cdc2a21104d84aec4a.js +1 -0
  86. package/assets/esri/core/workers/chunks/e9edf3987039def65859.js +1 -0
  87. package/assets/esri/core/workers/chunks/{3b434f318fdbbe4111e3.js → edbe52c2848486d64b16.js} +1 -1
  88. package/assets/esri/core/workers/chunks/{4f8895eb57ec6ab4b318.js → f5a61fa75ac877b5bb74.js} +1 -1
  89. package/assets/esri/core/workers/chunks/f9bc4edfdb1590be2d92.js +1 -0
  90. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  91. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  92. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  93. package/assets/esri/themes/base/widgets/_FeatureTable.scss +9 -1
  94. package/assets/esri/themes/dark/main.css +1 -1
  95. package/assets/esri/themes/light/main.css +1 -1
  96. package/assets/esri/themes/light/view.css +1 -1
  97. package/chunks/bundle.js +1 -1
  98. package/chunks/libtess-f32.js +1 -1
  99. package/chunks/libtess-f64.js +1 -1
  100. package/config.js +1 -1
  101. package/copyright.txt +84 -0
  102. package/core/Promise.d.ts +1 -1
  103. package/core/quantity.js +1 -1
  104. package/core/quantityFormatUtils.js +1 -1
  105. package/core/units.d.ts +1 -1
  106. package/core/units.js +1 -1
  107. package/core/workers/WorkerHandle.js +1 -1
  108. package/editing/Clipboard.js +5 -0
  109. package/geometry/ellipsoidUtils.js +1 -1
  110. package/geometry/libtess.js +1 -1
  111. package/geometry/projection/projectors.js +1 -1
  112. package/geometry/projectionUtils.js +1 -1
  113. package/geometry/support/meshUtils/projection.js +1 -1
  114. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  115. package/geometry/support/planetGCSUtils.js +1 -1
  116. package/geometry/support/spatialReferenceUtils.js +1 -1
  117. package/identity/IdentityModal.js +1 -1
  118. package/kernel.js +1 -1
  119. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  120. package/layers/mixins/ArcGISImageService.d.ts +30 -16
  121. package/layers/mixins/ImageryTileMixin.d.ts +2 -1
  122. package/layers/mixins/ImageryTileMixin.js +1 -1
  123. package/layers/orientedImagery/transformations/utils.js +1 -1
  124. package/layers/raster/functions/SpectralConversionFunction.js +5 -0
  125. package/layers/raster/functions/SpectralConversionFunctionArguments.js +5 -0
  126. package/layers/raster/functions/conversionUtils.js +1 -1
  127. package/layers/raster/functions/rasterFunctionHelper.js +1 -1
  128. package/layers/raster/functions/vectorFieldUtils.js +1 -1
  129. package/layers/support/rasterFunctionUtils.d.ts +0 -4
  130. package/package.json +1 -1
  131. package/rest/imageService.d.ts +36 -19
  132. package/rest/imageService.js +1 -1
  133. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  134. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  135. package/support/revision.js +1 -1
  136. package/views/2d/engine/imagery/RasterVFContainer.js +1 -1
  137. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  138. package/views/2d/engine/imagery/RasterVFTileContainer.js +1 -1
  139. package/views/2d/engine/rasterBrushes.js +1 -1
  140. package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +5 -0
  141. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/AspectTechnique.js +1 -1
  142. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BandArithmeticTechnique.js +1 -1
  143. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ColormapToRGBTechnique.js +1 -1
  144. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CompositeBandTechnique.js +1 -1
  145. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ComputeChangeTechnique.js +1 -1
  146. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ContrastBrightnessTechnique.js +1 -1
  147. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ConvolutionTechnique.js +1 -1
  148. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CurvatureTechnique.js +1 -1
  149. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ExtractBandTechnique.js +1 -1
  150. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/FocalStatisticsTechnique.js +1 -1
  151. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/GrayscaleTechnique.js +1 -1
  152. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/HillshadeTechnique.js +1 -1
  153. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/LocalTechnique.js +1 -1
  154. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/MaskTechnique.js +1 -1
  155. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/NDVITechnique.js +1 -1
  156. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/RemapTechnique.js +1 -1
  157. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
  158. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ShadedReliefTechnique.js +1 -1
  159. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SlopeTechnique.js +1 -1
  160. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/StretchTechnique.js +1 -1
  161. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/MagDirShader.js +5 -0
  162. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/ScalarShader.js +5 -0
  163. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  164. package/views/2d/layers/MediaLayerView2D.js +1 -1
  165. package/views/2d/layers/TileLayerView2D.js +1 -1
  166. package/views/2d/layers/imagery/ImageryVFStrategy.js +1 -1
  167. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  168. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  169. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  170. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  171. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  172. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementRawResult.js +5 -0
  173. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.d.ts +5 -1
  174. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.js +1 -1
  175. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  176. package/views/3d/environment/EnvironmentManager.js +1 -1
  177. package/views/3d/layers/FlowSubView3D.js +1 -1
  178. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  179. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  180. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  181. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  182. package/views/3d/layers/graphics/emissiveUtils.js +5 -0
  183. package/views/3d/layers/support/layerUtils.js +1 -1
  184. package/views/3d/support/mathUtils.js +1 -1
  185. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  186. package/views/3d/support/supportedSpatialReference.js +1 -1
  187. package/views/3d/terrain/terrainUtils.js +1 -1
  188. package/views/3d/webgl-engine/core/shaderLibrary/util/EllipsoidMode.js +1 -1
  189. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  190. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +31 -23
  191. package/views/VideoView.js +1 -1
  192. package/views/input/ViewEvents.js +1 -1
  193. package/views/input/recognizers/VerticalTwoFingerDrag.js +1 -1
  194. package/views/input/types.d.ts +94 -0
  195. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  196. package/views/support/MeasurementWorker.js +1 -1
  197. package/views/support/MeasurementWorkerHandle.js +1 -1
  198. package/views/support/measurementUtils.js +1 -1
  199. package/views/support/screenUtils.js +1 -1
  200. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  201. package/widgets/AreaMeasurement2D.d.ts +1 -0
  202. package/widgets/AreaMeasurement2D.js +1 -1
  203. package/widgets/BasemapLayerList.d.ts +1 -0
  204. package/widgets/BasemapLayerList.js +1 -1
  205. package/widgets/CatalogLayerList.d.ts +1 -0
  206. package/widgets/CatalogLayerList.js +1 -1
  207. package/widgets/Directions.d.ts +1 -0
  208. package/widgets/Directions.js +1 -1
  209. package/widgets/DistanceMeasurement2D.d.ts +1 -0
  210. package/widgets/DistanceMeasurement2D.js +1 -1
  211. package/widgets/Editor.d.ts +1 -0
  212. package/widgets/Editor.js +1 -1
  213. package/widgets/FeatureForm.d.ts +1 -0
  214. package/widgets/FeatureForm.js +1 -1
  215. package/widgets/FeatureTable.d.ts +1 -0
  216. package/widgets/FeatureTable.js +1 -1
  217. package/widgets/FloorFilter.d.ts +1 -0
  218. package/widgets/FloorFilter.js +1 -1
  219. package/widgets/LayerList.d.ts +1 -0
  220. package/widgets/LayerList.js +1 -1
  221. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  222. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  223. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  224. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  225. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  226. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  227. package/widgets/OrientedImageryViewer/components/OverlayLayersListViewModel.js +1 -1
  228. package/widgets/OrientedImageryViewer/services/TransformationService.js +5 -0
  229. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +5 -0
  230. package/widgets/OrientedImageryViewer/support/geometryUtils.js +5 -0
  231. package/widgets/OrientedImageryViewer/support/typeUtils.js +5 -0
  232. package/widgets/ScaleRangeSlider.d.ts +1 -0
  233. package/widgets/ScaleRangeSlider.js +1 -1
  234. package/widgets/Sketch.d.ts +1 -0
  235. package/widgets/Sketch.js +1 -1
  236. package/widgets/TableList.d.ts +1 -0
  237. package/widgets/TableList.js +1 -1
  238. package/widgets/TimeSlider.d.ts +1 -0
  239. package/widgets/TimeSlider.js +1 -1
  240. package/widgets/UtilityNetworkAssociations.d.ts +1 -0
  241. package/widgets/UtilityNetworkAssociations.js +1 -1
  242. package/widgets/UtilityNetworkTrace.d.ts +1 -0
  243. package/widgets/UtilityNetworkTrace.js +1 -1
  244. package/widgets/UtilityNetworkValidateTopology.d.ts +1 -0
  245. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  246. package/widgets/ValuePicker.d.ts +1 -0
  247. package/widgets/ValuePicker.js +1 -1
  248. package/assets/esri/core/workers/chunks/00e135dc1b4cb024973d.js +0 -1
  249. package/assets/esri/core/workers/chunks/03d037f9f04f165aac63.js +0 -1
  250. package/assets/esri/core/workers/chunks/03da31c7635d077e8d99.js +0 -1
  251. package/assets/esri/core/workers/chunks/0dcf1f3b6aa84cbe03a9.js +0 -1
  252. package/assets/esri/core/workers/chunks/185c97bc63ce546995ce.js +0 -1
  253. package/assets/esri/core/workers/chunks/1a62c456e791c82050fe.js +0 -1
  254. package/assets/esri/core/workers/chunks/21163137e345badb1aaf.js +0 -1
  255. package/assets/esri/core/workers/chunks/25dead73dfc5a4c19285.js +0 -1
  256. package/assets/esri/core/workers/chunks/2767b69085c9f7a1e1af.js +0 -1
  257. package/assets/esri/core/workers/chunks/43e9eaedf65921b58eb2.js +0 -1
  258. package/assets/esri/core/workers/chunks/4caec60ac0a5851730c6.js +0 -1
  259. package/assets/esri/core/workers/chunks/5119e3159617b8e1ea13.js +0 -1
  260. package/assets/esri/core/workers/chunks/59d3f3fbae775fd7686e.js +0 -1
  261. package/assets/esri/core/workers/chunks/5a706eecd8a988fae6b7.js +0 -1
  262. package/assets/esri/core/workers/chunks/5ba2bbbb42ef1920579d.js +0 -1
  263. package/assets/esri/core/workers/chunks/5cc731f161012b63c77a.js +0 -1
  264. package/assets/esri/core/workers/chunks/5fa8fe6353dbdda0b06a.js +0 -1
  265. package/assets/esri/core/workers/chunks/6107b58457a70c8de9da.js +0 -1
  266. package/assets/esri/core/workers/chunks/654eef3ad30f34c42e12.js +0 -1
  267. package/assets/esri/core/workers/chunks/6d9e92d9c2503d5dc8dd.js +0 -1
  268. package/assets/esri/core/workers/chunks/7130b09300032d3a5925.js +0 -1
  269. package/assets/esri/core/workers/chunks/7f7c4ffbdf7b20dc7a54.js +0 -1
  270. package/assets/esri/core/workers/chunks/804c9666d0dc548b9f79.js +0 -1
  271. package/assets/esri/core/workers/chunks/8258b1c8ba6d44ba19c3.js +0 -1
  272. package/assets/esri/core/workers/chunks/8f2fc50eb988c0228b05.js +0 -1
  273. package/assets/esri/core/workers/chunks/97ad3eb25ad003c16148.js +0 -1
  274. package/assets/esri/core/workers/chunks/a270e34bb248114ec280.js +0 -1
  275. package/assets/esri/core/workers/chunks/a56a5e00964d4cd59a66.js +0 -1
  276. package/assets/esri/core/workers/chunks/a774b4fc7df801503bea.js +0 -1
  277. package/assets/esri/core/workers/chunks/b1015e1f25b60c08d2cf.js +0 -1
  278. package/assets/esri/core/workers/chunks/c18a2948ae3cb527d8bb.js +0 -1
  279. package/assets/esri/core/workers/chunks/d4f4c0201d8b641709c0.js +0 -1
  280. package/assets/esri/core/workers/chunks/d6d9d56b3733622deab6.js +0 -1
  281. package/assets/esri/core/workers/chunks/dedd9d47ccc019ffc484.js +0 -1
  282. package/assets/esri/core/workers/chunks/e271065410ba5c872f53.js +0 -1
  283. package/assets/esri/core/workers/chunks/e8a0654cebafa22b5b56.js +0 -1
  284. package/assets/esri/core/workers/chunks/ecf7d34b37ce6f0877af.js +0 -1
  285. package/assets/esri/core/workers/chunks/f25eb512592a84a508c1.js +0 -1
  286. package/assets/esri/core/workers/chunks/f64ec13167eb51da2f9b.js +0 -1
  287. package/views/2d/engine/imagery/BrushVectorField.js +0 -5
  288. package/views/3d/analysis/AreaMeasurement/support/utils.js +0 -5
  289. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementUtils.js +0 -5
  290. package/widgets/OrientedImageryViewer/dataCaptureUtils.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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import i from"../../core/Logger.js";import{property as n,subclass as s}from"../../core/accessorSupport/decorators.js";import{Integer as o,ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import u from"../../geometry/SpatialReference.js";import{getInfo as c}from"../../geometry/support/spatialReferenceUtils.js";import{isFunctionRaster as m}from"../raster/datasets/datasetUtils.js";import d from"../raster/datasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as p,getDefaultVariableInfo as h,isMultiSliceOrRangeDefinition as f,convertOleDateTimeToEpoch as y,getSubsetVariablesFromMdInfo as g,getDefaultMultidimensionalDefinition as R}from"../raster/datasets/multidimensionalUtils.js";import{snapToRaster as b,clip as I}from"../raster/functions/clipUtils.js";import{create as x}from"../raster/functions/rasterFunctionHelper.js";import{load as w,projectExtent as S,projectPolygon as _}from"../raster/functions/rasterProjectionHelper.js";import{computeStatisticsHistograms as F}from"../raster/functions/stretchUtils.js";import{sanitizeUrl as v}from"../support/arcgisLayerUrl.js";import{url as J}from"../support/commonProperties.js";import j from"../support/DimensionalDefinition.js";import D from"../support/MultidimensionalSubset.js";import{interpolationKebab as N}from"../support/rasterEnums.js";import T from"../support/RasterFunction.js";import H from"../support/RasterJobHandler.js";import C from"../support/TileInfo.js";import{getVariableRasterInfo as O,getDefaultInterpolation as z,matchPresetRenderer as P,getDefaultBandCombination as E,getFunctionColorRamp as B,createDefaultRenderer as M,normalizeRendererJSON as A}from"../../renderers/support/rasterRendererHelper.js";import U from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as q,websceneRasterRendererTypes as k,read as L}from"../../renderers/support/rasterTypeUtils.js";import V from"../../rest/support/ImageHistogramParameters.js";import $ from"../../rest/support/ImageSample.js";import G from"../../rest/support/ImageSampleParameters.js";import W from"../../rest/support/ImageSampleResult.js";import{enumeration as K}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as Q}from"../../core/accessorSupport/decorators/reader.js";const X=1e3,Y=Y=>{const Z=Y;let ee=class extends Z{constructor(...e){super(...e),this._draRasterConfig=null,this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=m(e[0]?.raster)}destroy(){this._draRasterConfig?.rasterJobHandler?.destroy(),this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",v(e,i.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const r=t?.find(({name:t})=>t===e);return r?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer;return L(i,r)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=a(V,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new r("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:n}=e;if(null==n)throw new r("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let s=n;const{spatialReference:o}=i;if(!n.spatialReference.equals(o)){await w();const e="extent"===n.type?S(n,o):_(n,o);if(null==e)throw new r("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");s=e}const u=e.pixelSize??new l({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:m,height:d}=b(i,s,u),p=await this.fetchPixels(c,m,d,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new r("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await I(p.pixelBlock,c,s),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):F(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const r=p({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:r,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:r}=this;if(!e||!t||!r)return;const{rasterInfo:i}=this.raster,n=h(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=n?.name,o=O(i,s);return this._updateSymbolizer(t,r,s,o)}async applyRenderer(e,t,r){const i=e?.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;await this.updateRenderer();const n=this.bandIds??[],{pixelBlock:s}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:n,symbolizer:this.symbolizer},r);return s}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&m(t)){const r=t.rasterFunction.rawInputBandIds;e=e?.length&&r?.length&&1!==t.rasterInfo.bandCount?e.map(e=>r[Math.min(e,r.length-1)]):r}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}getTileUrl(e,t,r){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${r}`:""}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||null==t)return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const i=c(e);return C.create({size:256,spatialReference:e,origin:i?{x:i.origin[0],y:i.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,r,i,n={}){if(te(this),n.requestAsImageElement){const s=this.getTileUrl(e,r,i);return t(s,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then(e=>e.data)}const{serviceRasterInfo:s}=this;if(null!=s.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition){const t=n.tileInfo||s.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,r,i,t);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,r,i,n)}async fetchPixels(e,t,r,i={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(i=this.normalizeRasterFetchOptions(i)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),r=Math.round(r);const n=await this.raster.fetchPixels(e,t,r,i);return i.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(n.pixelBlock=n.pixelBlock?.extractBands(i.bandIds)),n}async getSamples(e,t){if(await this.load(),(e=a(G,e).clone()).interpolation&&"nearest"!==e.interpolation)throw new r("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const i=e.mosaicRule?.multidimensionalDefinition,n={...t,multidimensionalDefinition:i},s=(await this._getSampleLocations(e)).map(e=>this.identify(e,n).then(t=>(t.location=e,t))),o=(await Promise.all(s)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new W({samples:o})}async identify(e,t={}){await this.load(),e=a(l,e).clone().normalize();const{raster:i,serviceRasterInfo:n}=this;if(null!=n?.multidimensionalInfo){if(!(n.hasMultidimensionalTranspose&&!(!f(t.multidimensionalDefinition)&&!t.transposedVariableName))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const s=this.multidimensionalSubset?.areaOfInterest;if(s&&!s.contains(e))throw new r("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let o;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=m(i)?this.getRawDisplayBandIds():this.bandIds;o=e?.length?e:void 0}return i.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,r=t?.[0]?.variableName;return e.variables.some(e=>e.name===r&&(!t?.[0].dimensionName||e.dimensions.some(e=>"StdTime"===e.name)))}getStandardTimeValue(e){return new Date(y(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return g(this.multidimensionalSubset,t)}async getDynamicRangeInputRaster(){if(!this.rasterFunction||!m(this.raster)||!this._cachedRasterFunctionJson)return null;const e=JSON.stringify(this._cachedRasterFunctionJson);if(this._draRasterConfig?.functionJson===e)return this._draRasterConfig;const t=this.raster.rasterFunction.queryRasterFunction(e=>"Stretch"===e.functionName&&e.functionArguments.dynamicRangeAdjustment);if(!t)return null;const r=t.toJSON(),i=this.raster.primaryRasters.rasters,n=t.functionArguments.raster,s=r.rasterFunctionArguments;if(!n||"object"!=typeof n||!("functionName"in n))return this._draRasterConfig={functionJson:e,raster:i[0],functionArguments:s,rasterJobHandler:this._draRasterConfig?.rasterJobHandler},this._draRasterConfig;const o={raster:i[0]};i.length>1&&i.forEach(e=>o[e.url]=e);const a=x(n.toJSON(),o),l=new d({rasterFunction:a});await l.open();let u=this._draRasterConfig?.rasterJobHandler;try{u||(u=new H,await u.initialize()),l.rasterJobHandler=u,await l.syncJobHandler()}catch{}return this._draRasterConfig={functionJson:e,raster:l,functionArguments:s,rasterJobHandler:u},this._draRasterConfig}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=R(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&m(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;te(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,m(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:r,type:i}=t;if("multipoint"===i)return t.points.map(e=>new l({x:e[0],y:e[1],spatialReference:r}));if("polyline"===i){let i=t;if(e.sampleCount||e.sampleDistance){const r=await import("../../geometry/operators/densifyOperator.js"),n=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),s=Math.min(e.sampleCount||100,X);let o=e.sampleDistance;if(!o){o=n/(s+(2===i.paths[0].length?1:0))}i=r.execute(t,o,{unit:"meters"})}return i.paths.flatMap(e=>e.map(e=>new l({x:e[0],y:e[1],spatialReference:r})))}const n=Math.min(e.sampleCount||100,X),s="extent"===t.type,o=s?t:t.extent,a=Math.sqrt(o.width*o.height/n),u=o.height/a,c=o.width/a,{xmin:m,ymax:d}=o,p=[];for(let h=0;h<u;h++)for(let e=0;e<c;e++){const i=new l({x:m+(e+.5)*a,y:d-(h+.5)*a,spatialReference:r});(s||t.contains(i))&&p.push(i)}return p}_configDefaultInterpolation(){if(null==this.interpolation){te(this);const{raster:e}=this,t=z(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){te(this);const{rasterInfo:t}=this.raster,r=h(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=r?.name,s=P({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=s?.bandIds??E(t)),!this.renderer||"override"===e){const e=B(this.raster),r=s?.renderer??M(t,{bandIds:this.bandIds,variableName:n,rasterFunctionColorRamp:e}),i=t.statistics,o=i&&i.length>0?i[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===r.type&&(a>1e24||l<-1e24)&&(r.dynamicRangeAdjustment=!0,r.customStatistics=null,"none"===r.stretchType&&(r.stretchType="min-max")),this.renderer=r}const o=A({...this.renderer.toJSON(),variableName:n}),a=O(t,n);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new U({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=M(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,r=t.customStatistics?.length;!t.dynamicRangeAdjustment&&r&&e&&r!==e&&this._configDefaultRenderer("override")}}}else i.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&m(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",T.fromJSON(e)))}let e,t=this.raster,r=!1;m(t)?(e=t.primaryRasters.rasters,t=e[0],r=!0):e=[t];const{rasterFunction:i}=this;if(i){const r={raster:t};e.length>1&&e.forEach(e=>r[e.url]=e);const n=x(i.functionDefinition?.toJSON()??i.toJSON(),r),s=new d({rasterFunction:n});s.rasterJobHandler=this._rasterJobHandler,await s.open(),this.raster=s}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!r&&!i)return;const{bandIds:n}=this,{bandCount:s}=this.raster.rasterInfo,o=n?.length?n.some(e=>e>=s):s>=3;n&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:r}=this.raster,i=r.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),n=(r.pixelSize.x+r.pixelSize.y)/2*i;if(!e.dataSeries?.length)return[new $({location:e.location,pixelValue:e.value,locationId:t,resolution:n})];const s=[];return e.dataSeries.forEach(({value:r,multidimensionalDefinition:i},o)=>{const a={Variables:i[0].variableName,Dimensions:i.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of i){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const r=t[t.length-1];a[`${e}_Max`]=Array.isArray(r)?r[r.length-1]:r}const l=new $({location:e.location,pixelValue:r,rasterId:o,locationId:t,resolution:n,attributes:a});s.push(l)}),s}};function te(e){if(!e.raster||!e.serviceRasterInfo)throw new r("imagery-tile","no raster")}return e([n({clonable:!1})],ee.prototype,"_cachedRasterFunctionJson",void 0),e([n({clonable:!1})],ee.prototype,"_compatibleFullExtent",void 0),e([n({clonable:!1})],ee.prototype,"_draRasterConfig",void 0),e([n({clonable:!1})],ee.prototype,"_isConstructedFromFunctionRaster",void 0),e([n({clonable:!1})],ee.prototype,"_rasterFunctionUpdatePromise",void 0),e([n({type:[o],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],ee.prototype,"bandIds",void 0),e([n({json:{origins:{service:{read:{source:"copyrightText"}}}}})],ee.prototype,"copyright",void 0),e([n({json:{read:!1}})],ee.prototype,"fullExtent",null),e([n({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),K(N)],ee.prototype,"interpolation",void 0),e([n()],ee.prototype,"ioConfig",void 0),e([n({type:[j],json:{write:!0}})],ee.prototype,"multidimensionalDefinition",null),e([n({type:D,json:{write:!0}})],ee.prototype,"multidimensionalSubset",void 0),e([n()],ee.prototype,"raster",void 0),e([n({type:T})],ee.prototype,"rasterFunction",null),e([n()],ee.prototype,"serviceRasterInfo",void 0),e([n()],ee.prototype,"sourceJSON",void 0),e([n({readOnly:!0,type:u,json:{read:!1}})],ee.prototype,"spatialReference",void 0),e([n({type:C})],ee.prototype,"tileInfo",void 0),e([n(J)],ee.prototype,"url",null),e([n({types:q})],ee.prototype,"renderer",null),e([n({types:q,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:k,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],ee.prototype,"internalRenderer",null),e([Q("internalRenderer")],ee.prototype,"readRenderer",null),e([n({clonable:!1})],ee.prototype,"symbolizer",void 0),ee=e([s("esri.layers.mixins.ImageryTileMixin")],ee),ee};export{Y as ImageryTileMixin};
5
+ import{__decorate as e}from"tslib";import t from"../../request.js";import r from"../../core/Error.js";import i from"../../core/Logger.js";import{property as n,subclass as s}from"../../core/accessorSupport/decorators.js";import{Integer as o,ensureClass as a}from"../../core/accessorSupport/ensureType.js";import l from"../../geometry/Point.js";import u from"../../geometry/SpatialReference.js";import{getInfo as c}from"../../geometry/support/spatialReferenceUtils.js";import{isFunctionRaster as m}from"../raster/datasets/datasetUtils.js";import d from"../raster/datasets/FunctionRaster.js";import{getEffectiveMultidimensionalDefinition as p,getDefaultVariableInfo as h,isMultiSliceOrRangeDefinition as f,convertOleDateTimeToEpoch as y,getSubsetVariablesFromMdInfo as g,getDefaultMultidimensionalDefinition as R}from"../raster/datasets/multidimensionalUtils.js";import{snapToRaster as b,clip as I}from"../raster/functions/clipUtils.js";import{create as x}from"../raster/functions/rasterFunctionHelper.js";import{load as w,projectExtent as S,projectPolygon as _}from"../raster/functions/rasterProjectionHelper.js";import{computeStatisticsHistograms as F}from"../raster/functions/stretchUtils.js";import{sanitizeUrl as v}from"../support/arcgisLayerUrl.js";import{url as J}from"../support/commonProperties.js";import j from"../support/DimensionalDefinition.js";import D from"../support/MultidimensionalSubset.js";import{interpolationKebab as N}from"../support/rasterEnums.js";import T from"../support/RasterFunction.js";import H from"../support/RasterJobHandler.js";import C from"../support/TileInfo.js";import{getVariableRasterInfo as O,getDefaultInterpolation as z,matchPresetRenderer as P,getDefaultBandCombination as E,getFunctionColorRamp as B,createDefaultRenderer as M,normalizeRendererJSON as A}from"../../renderers/support/rasterRendererHelper.js";import U from"../../renderers/support/RasterSymbolizer.js";import{rasterRendererTypes as q,websceneRasterRendererTypes as k,read as L}from"../../renderers/support/rasterTypeUtils.js";import V from"../../rest/support/ImageHistogramParameters.js";import $ from"../../rest/support/ImageSample.js";import G from"../../rest/support/ImageSampleParameters.js";import W from"../../rest/support/ImageSampleResult.js";import{enumeration as K}from"../../core/accessorSupport/decorators/enumeration.js";import{reader as Q}from"../../core/accessorSupport/decorators/reader.js";const X=1e3,Y=Y=>{const Z=Y;let ee=class extends Z{constructor(...e){super(...e),this._draRasterConfig=null,this._isConstructedFromFunctionRaster=!1,this.bandIds=null,this.copyright=null,this.interpolation=null,this.multidimensionalSubset=null,this.raster=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.spatialReference=null,this.symbolizer=null,this._isConstructedFromFunctionRaster=m(e[0]?.raster)}destroy(){this._draRasterConfig?.rasterJobHandler?.destroy(),this._shutdownJobHandler()}get fullExtent(){return this.serviceRasterInfo?.extent}set multidimensionalDefinition(e){this._set("multidimensionalDefinition",e),this.updateRenderer()}set rasterFunction(e){"none"===e?.functionName?.toLowerCase()&&(e=void 0),this._set("rasterFunction",e),this.updateRasterFunction()}set url(e){this._set("url",v(e,i.getLogger(this)))}get renderer(){if("imagery-tile"!==this.type)return this.internalRenderer;const{activePresetRendererName:e,presetRenderers:t}=this;if(e){const r=t?.find(({name:t})=>t===e);return r?.renderer.clone()}return this.internalRenderer}set renderer(e){"imagery-tile"===this.type&&(this.activePresetRendererName=null),this.internalRenderer=e}set internalRenderer(e){null==e&&null==this.rasterFunction?this._configDefaultRenderer("override"):(this._set("internalRenderer",e),this.updateRenderer())}readRenderer(e,t,r){const i=t?.layerDefinition?.drawingInfo?.renderer;return L(i,r)||void 0}async computeStatisticsHistograms(e,t){await this.load(t),e=a(V,e).clone();const{serviceRasterInfo:i}=this;if(null==i)throw new r("imagery-tile-mixin:compute-statistics-histograms","serviceRasterInfo must be specified");const{geometry:n}=e;if(null==n)throw new r("imagery-tile-mixin:compute-statistics-histograms","geometry must be specified");let s=n;const{spatialReference:o}=i;if(!n.spatialReference.equals(o)){await w();const e="extent"===n.type?S(n,o):_(n,o);if(null==e)throw new r("imagery-tile-mixin:compute-statistics-histograms","geometry cannot be projected to the data source");s=e}const u=e.pixelSize??new l({x:i.pixelSize.x,y:i.pixelSize.y,spatialReference:o}),{extent:c,width:m,height:d}=b(i,s,u),p=await this.fetchPixels(c,m,d,{...t,interpolation:"nearest"});if(null==p.pixelBlock)throw new r("imagery-tile-mixin:compute-statistics-histograms","failed to fetch pixels");const h=await I(p.pixelBlock,c,s),f=this._rasterJobHandler;return f?f.computeStatisticsHistograms({pixelBlock:h},t):F(h)}normalizeRasterFetchOptions(e){const{multidimensionalInfo:t}=this.serviceRasterInfo??{};if(null==t)return e;const r=p({rasterInfo:this.raster.rasterInfo,multidimensionalDefinition:e.multidimensionalDefinition||this.multidimensionalDefinition,timeExtent:e.timeExtent??this.timeExtent,multidimensionalSubset:this.multidimensionalSubset});return{...e,multidimensionalDefinition:r,timeExtent:void 0}}async updateRasterFunction(){return this.loaded&&"imagery-tile"===this.type&&(this.rasterFunction||this._cachedRasterFunctionJson)&&JSON.stringify(this.rasterFunction)!==JSON.stringify(this._cachedRasterFunctionJson)?(this._cachedRasterFunctionJson=this.rasterFunction?.toJSON(),this._rasterFunctionUpdatePromise=this._updateRasterFunction(),this._rasterFunctionUpdatePromise):this._rasterFunctionUpdatePromise}async updateRenderer(){const{loaded:e,symbolizer:t,renderer:r}=this;if(!e||!t||!r)return;const{rasterInfo:i}=this.raster,n=h(i,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),s=n?.name,o=O(i,s);return this._updateSymbolizer(t,r,s,o)}async applyRenderer(e,t,r){const i=e?.pixelBlock;if(!(null!=i&&i.pixels&&i.pixels.length>0))return null;await this.updateRenderer();const n=this.bandIds??[],{pixelBlock:s}=await this._symbolize({pixelData:e,simpleStretchParams:t,bandIds:n,symbolizer:this.symbolizer},r);return s}getRawDisplayBandIds(){let{bandIds:e,raster:t}=this;if(this.rasterFunction&&m(t)){const r=t.rasterFunction.rawInputBandIds;e=e?.length&&r?.length&&1!==t.rasterInfo.bandCount?e.map(e=>r[Math.min(e,r.length-1)]):r}return e&&e.length>3&&e.every((e,t)=>e===t)?null:e}getTileUrl(e,t,r){return"RasterTileServer"===this.raster.datasetFormat?`${this.url}/tile/${e}/${t}/${r}`:""}getCompatibleTileInfo(e,t,r=!1){if(!this.loaded||null==t)return null;if(r&&e.equals(this.spatialReference))return this.tileInfo;const i=c(e);return C.create({size:256,spatialReference:e,origin:i?{x:i.origin[0],y:i.origin[1]}:{x:t.xmin,y:t.ymax}})}getCompatibleFullExtent(e){return this.loaded?(this._compatibleFullExtent?.spatialReference.equals(e)||(this._compatibleFullExtent=this.raster.computeExtent(e)),this._compatibleFullExtent):null}async fetchTile(e,r,i,n={}){if(te(this),n.requestAsImageElement){const s=this.getTileUrl(e,r,i);return t(s,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:n.signal}).then(e=>e.data)}const{serviceRasterInfo:s}=this;if(null!=s.multidimensionalInfo&&null==(n=this.normalizeRasterFetchOptions(n)).multidimensionalDefinition){const t=n.tileInfo||s.storageInfo.tileInfo,o=this.raster.getTileExtentFromTileInfo(e,r,i,t);if(o)return{extent:o,pixelBlock:null}}return await this._initJobHandler(),await this.updateRasterFunction(),"raster-shaded-relief"===this.renderer?.type&&(n={...n,buffer:{cols:1,rows:1}}),this.raster.fetchTile(e,r,i,n)}async fetchPixels(e,t,r,i={}){if(null!=this.serviceRasterInfo.multidimensionalInfo&&null==(i=this.normalizeRasterFetchOptions(i)).multidimensionalDefinition)return{extent:e,pixelBlock:null};await this._initJobHandler(),await this.updateRasterFunction(),t=Math.round(t),r=Math.round(r);const n=await this.raster.fetchPixels(e,t,r,i);return i.bandIds?.length&&!this.raster.rasterInfo.storageInfo.isBsqTile&&(n.pixelBlock=n.pixelBlock?.extractBands(i.bandIds)),n}async getSamples(e,t){await this.load();const i=a(G,e).clone();if(i.interpolation&&"nearest"!==i.interpolation)throw new r("imagery-tile-mixin:get-samples","only nearest interpolation is currently supported");const n=i.mosaicRule?.multidimensionalDefinition,s={...t,multidimensionalDefinition:n},o=(await this._getSampleLocations(i)).map(e=>this.identify(e,s).then(t=>(t.location=e,t))),l=(await Promise.all(o)).flatMap((e,t)=>this._convertRasterIdentifyResultToSample(e,t));return new W({samples:l})}async identify(e,t={}){await this.load(),e=a(l,e).clone().normalize();const{raster:i,serviceRasterInfo:n}=this;if(null!=n?.multidimensionalInfo){if(!(n.hasMultidimensionalTranspose&&!(!f(t.multidimensionalDefinition)&&!t.transposedVariableName))&&null==(t=this.normalizeRasterFetchOptions(t)).multidimensionalDefinition)return{location:e,value:null}}const s=this.multidimensionalSubset?.areaOfInterest;if(s&&!s.contains(e))throw new r("imagery-tile-mixin:identify","the request cannot be fulfilled when falling outside of the multidimensional subset");let o;if(this.serviceRasterInfo?.storageInfo.isBsqTile){const e=m(i)?this.getRawDisplayBandIds():this.bandIds;o=e?.length?e:void 0}return i.identify(e,{...t,bandIds:o})}hasStandardTime(){const e=this.serviceRasterInfo?.multidimensionalInfo;if(null==e||"standard-time"!==this.serviceRasterInfo?.dataType)return!1;const t=this.multidimensionalDefinition,r=t?.[0]?.variableName;return e.variables.some(e=>e.name===r&&(!t?.[0].dimensionName||e.dimensions.some(e=>"StdTime"===e.name)))}getStandardTimeValue(e){return new Date(y(e)).toISOString()}getMultidimensionalSubsetVariables(e){const t=e??this.serviceRasterInfo?.multidimensionalInfo;return g(this.multidimensionalSubset,t)}async getDynamicRangeInputRaster(){if(!this.rasterFunction||!m(this.raster)||!this._cachedRasterFunctionJson)return null;const e=JSON.stringify(this._cachedRasterFunctionJson);if(this._draRasterConfig?.functionJson===e)return this._draRasterConfig;const t=this.raster.rasterFunction.queryRasterFunction(e=>"Stretch"===e.functionName&&e.functionArguments.dynamicRangeAdjustment);if(!t)return null;const r=t.toJSON(),i=this.raster.primaryRasters.rasters,n=t.functionArguments.raster,s=r.rasterFunctionArguments;if(!n||"object"!=typeof n||!("functionName"in n))return this._draRasterConfig={functionJson:e,raster:i[0],functionArguments:s,rasterJobHandler:this._draRasterConfig?.rasterJobHandler},this._draRasterConfig;const o={raster:i[0]};i.length>1&&i.forEach(e=>o[e.url]=e);const a=x(n.toJSON(),o),l=new d({rasterFunction:a});await l.open();let u=this._draRasterConfig?.rasterJobHandler;try{u||(u=new H,await u.initialize()),l.rasterJobHandler=u,await l.syncJobHandler()}catch{}return this._draRasterConfig={functionJson:e,raster:l,functionArguments:s,rasterJobHandler:u},this._draRasterConfig}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=R(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this.rasterFunction&&m(this.raster)&&(this._cachedRasterFunctionJson=this.rasterFunction.toJSON()),this._configDefaultRenderer()}async _initJobHandler(){if(!this._rasterJobHandler)return super._initJobHandler().then(async()=>{if(!this._rasterJobHandler)return;te(this);const{raster:e}=this;e.rasterJobHandler=this._rasterJobHandler,m(e)&&e.syncJobHandler(),this.rasterFunction&&await this.updateRasterFunction().catch(()=>{}),this.renderer&&this.updateRenderer()}).catch(()=>{})}_shutdownJobHandler(){super._shutdownJobHandler(),this.raster&&(this.raster.rasterJobHandler=null)}async _getSampleLocations(e){const{geometry:t}=e;if("point"===t.type)return[t];const{spatialReference:r,type:i}=t;if("multipoint"===i)return t.points.map(e=>new l({x:e[0],y:e[1],spatialReference:r}));if("polyline"===i){let i=t;if(e.sampleCount||e.sampleDistance){const r=await import("../../geometry/operators/densifyOperator.js"),n=(await import("../../geometry/operators/lengthOperator.js")).execute(t,{unit:"meters"}),s=Math.min(e.sampleCount||100,X);let o=e.sampleDistance;if(!o){o=n/(s+(2===i.paths[0].length?1:0))}i=r.execute(t,o,{unit:"meters"})}return i.paths.flatMap(e=>e.map(e=>new l({x:e[0],y:e[1],spatialReference:r})))}const n=Math.min(e.sampleCount||100,X),s="extent"===t.type,o=s?t:t.extent,a=Math.sqrt(o.width*o.height/n),u=o.height/a,c=o.width/a,{xmin:m,ymax:d}=o,p=[];for(let h=0;h<u;h++)for(let e=0;e<c;e++){const i=new l({x:m+(e+.5)*a,y:d-(h+.5)*a,spatialReference:r});(s||t.contains(i))&&p.push(i)}return p}_configDefaultInterpolation(){if(null==this.interpolation){te(this);const{raster:e}=this,t=z(e.rasterInfo,e.tileType,this.sourceJSON?.defaultResamplingMethod);this._set("interpolation",t)}}_configDefaultRenderer(e="no"){te(this);const{rasterInfo:t}=this.raster,r=h(t,{multidimensionalDefinition:this.multidimensionalDefinition,multidimensionalSubset:this.multidimensionalSubset}),n=r?.name,s=P({variableName:n,rasterFunctionName:this.rasterFunction?.functionName,presetRenderers:this.presetRenderers});if(!this.bandIds&&t.bandCount>1&&(this.bandIds=s?.bandIds??E(t)),!this.renderer||"override"===e){const e=B(this.raster),r=s?.renderer??M(t,{bandIds:this.bandIds,variableName:n,rasterFunctionColorRamp:e}),i=t.statistics,o=i&&i.length>0?i[0]:null,a=o?.max??0,l=o?.min??0;"WCSServer"===this.raster.datasetFormat&&"raster-stretch"===r.type&&(a>1e24||l<-1e24)&&(r.dynamicRangeAdjustment=!0,r.customStatistics=null,"none"===r.stretchType&&(r.stretchType="min-max")),this.renderer=r}const o=A({...this.renderer.toJSON(),variableName:n}),a=O(t,n);this.symbolizer?(this.symbolizer.rendererJSON=o,this.symbolizer.rasterInfo=a):this.symbolizer=new U({rendererJSON:o,rasterInfo:a});const l=this.symbolizer.bind();if(l.success){if("auto"===e){const{colormap:e}=this.raster.rasterInfo,t=this.renderer;if(null!=e&&"raster-colormap"===t.type){const e=M(this.raster.rasterInfo);JSON.stringify(e)!==JSON.stringify(t)&&this._configDefaultRenderer("override")}else if("raster-stretch"===t.type){const e=this.bandIds?.length,r=t.customStatistics?.length;!t.dynamicRangeAdjustment&&r&&e&&r!==e&&this._configDefaultRenderer("override")}}}else i.getLogger(this).warn("imagery-tile-mixin",l.error||"The given renderer is not supported by the layer."),"auto"===e&&this._configDefaultRenderer("override")}async _updateRasterFunction(){if(this._isConstructedFromFunctionRaster&&m(this.raster)){const e=this.raster.rasterFunction.toJSON();return void(!this.rasterFunction&&e&&this._set("rasterFunction",T.fromJSON(e)))}let e,t=this.raster,r=!1;m(t)?(e=t.primaryRasters.rasters,t=e[0],r=!0):e=[t];const{rasterFunction:i}=this;if(i){const r={raster:t};e.length>1&&e.forEach(e=>r[e.url]=e);const n=x(i.functionDefinition?.toJSON()??i.toJSON(),r),s=new d({rasterFunction:n});s.rasterJobHandler=this._rasterJobHandler,await s.open(),this.raster=s}else this.raster=t,await t.open();if(this._cachedRendererJson=void 0,!r&&!i)return;const{bandIds:n}=this,{bandCount:s}=this.raster.rasterInfo,o=n?.length?n.some(e=>e>=s):s>=3;n&&(o||this.renderer&&"raster-stretch"!==this.renderer.type)&&this._set("bandIds",null),this._configDefaultRenderer("auto")}_convertRasterIdentifyResultToSample(e,t){const{rasterInfo:r}=this.raster,i=r.storageInfo.pyramidScalingFactor**(e.pyramidLevel??0),n=(r.pixelSize.x+r.pixelSize.y)/2*i;if(!e.dataSeries?.length)return[new $({location:e.location,pixelValue:e.value,locationId:t,resolution:n})];const s=[];return e.dataSeries.forEach(({value:r,multidimensionalDefinition:i},o)=>{const a={Variables:i[0].variableName,Dimensions:i.flatMap(({dimensionName:e})=>e).join(",")};for(const{dimensionName:e,values:t}of i){a[e]=Array.isArray(t[0])?t[0][0]:t[0];const r=t[t.length-1];a[`${e}_Max`]=Array.isArray(r)?r[r.length-1]:r}const l=new $({location:e.location,pixelValue:r,rasterId:o,locationId:t,resolution:n,attributes:a});s.push(l)}),s}};function te(e){if(!e.raster||!e.serviceRasterInfo)throw new r("imagery-tile","no raster")}return e([n({clonable:!1})],ee.prototype,"_cachedRasterFunctionJson",void 0),e([n({clonable:!1})],ee.prototype,"_compatibleFullExtent",void 0),e([n({clonable:!1})],ee.prototype,"_draRasterConfig",void 0),e([n({clonable:!1})],ee.prototype,"_isConstructedFromFunctionRaster",void 0),e([n({clonable:!1})],ee.prototype,"_rasterFunctionUpdatePromise",void 0),e([n({type:[o],json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"0,1,2"!==this.bandIds?.join(",")}}}}})],ee.prototype,"bandIds",void 0),e([n({json:{origins:{service:{read:{source:"copyrightText"}}}}})],ee.prototype,"copyright",void 0),e([n({json:{read:!1}})],ee.prototype,"fullExtent",null),e([n({json:{write:{overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType||"bilinear"!==this.interpolation}}}}}),K(N)],ee.prototype,"interpolation",void 0),e([n()],ee.prototype,"ioConfig",void 0),e([n({type:[j],json:{write:!0}})],ee.prototype,"multidimensionalDefinition",null),e([n({type:D,json:{write:!0}})],ee.prototype,"multidimensionalSubset",void 0),e([n()],ee.prototype,"raster",void 0),e([n({type:T})],ee.prototype,"rasterFunction",null),e([n()],ee.prototype,"serviceRasterInfo",void 0),e([n()],ee.prototype,"sourceJSON",void 0),e([n({readOnly:!0,type:u,json:{read:!1}})],ee.prototype,"spatialReference",void 0),e([n({type:C})],ee.prototype,"tileInfo",void 0),e([n(J)],ee.prototype,"url",null),e([n({types:q})],ee.prototype,"renderer",null),e([n({types:q,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){const e="raster-stretch"===this.renderer?.type&&"none"===this.renderer.stretchType&&!this.renderer.useGamma;return{enabled:!this.loaded||"Raster"===this.raster.tileType||!e}}},origins:{"web-scene":{types:k,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],ee.prototype,"internalRenderer",null),e([Q("internalRenderer")],ee.prototype,"readRenderer",null),e([n({clonable:!1})],ee.prototype,"symbolizer",void 0),ee=e([s("esri.layers.mixins.ImageryTileMixin")],ee),ee};export{Y as ImageryTileMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as i,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromArray as r}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{zeros as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transpose as s,multiply as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as f,mul as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{sub as m,add as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as p}from"../../../core/support/jsonUtils.js";import g from"../../../geometry/Point.js";import{projectAsync as v}from"../../../geometry/projectionUtils.js";import{earth as M}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as d}from"../../../geometry/support/spatialReferenceUtils.js";import{a as x}from"../../../chunks/vec3.js";import{isConstantElevation as w,ConstantElevation as y,isElevationSource as b}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as j}from"../core/utils.js";import{getElevationSampler as O}from"./updateElevationUtils.js";import{isNumber as z}from"../../../support/guards.js";import{defaultImageSphereSize as F}from"../../../widgets/PanoramicViewer/constants.js";function E(t,n,a){const[e,o,r,c]=n,[s,l,m,h]=a;P(e,o,r,c);const p=P(s,l,m,h),g=R(e,o,r,c),v=R(s,l,m,h),M=f(i(),g),d=u(i(),M,v),[x,w,y,b]=V(t,d);return[x/b,w/b,p?0:y/b]}function P(t,n,a,e){return 0===t[2]&&0===n[2]&&0===a[2]&&0===e[2]&&(t[2]=n[2]=a[2]=e[2]=1,!0)}function S(t){return 0===t?1:t}function V(t,n){const[a,e,i]=t,o=[0,0,0,0];return o[0]=a*n[0]+e*n[1]+i*n[2]+n[3],o[1]=a*n[4]+e*n[5]+i*n[6]+n[7],o[2]=a*n[8]+e*n[9]+i*n[10]+n[11],o[3]=S(a*n[12]+e*n[13]+i*n[14]+n[15]),o}function R(t,n,a,e){const c=N(r([...e,1]),f(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),s=c[0],l=c[1],u=c[2],m=i();return m[0]=s*t[0],m[1]=l*n[0],m[2]=u*a[0],m[3]=0,m[4]=s*t[1],m[5]=l*n[1],m[6]=u*a[1],m[7]=0,m[8]=s*t[2],m[9]=l*n[2],m[10]=u*a[2],m[11]=0,m[12]=s,m[13]=l,m[14]=u,m[15]=1,m}function D(t,n,a,e,i=c()){return i[0]=t[0]+n[0]*a,i[1]=t[1]+n[1]*a,i[2]=t[2]+n[2]*(a/e),i}function H(t,n,a){const e=c();return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*(n/a),e}function L(t,n){const[a,e,i]=t,o=c();return o[0]=a*n[0]+e*n[3]+i*n[6],o[1]=a*n[1]+e*n[4]+i*n[7],o[2]=a*n[2]+e*n[5]+i*n[8],o}function N(t,n){const[a,e,i,o]=t,r=new Array(4);return r[0]=a*n[0]+e*n[1]+i*n[2]+o*n[3],r[1]=a*n[4]+e*n[5]+i*n[6]+o*n[7],r[2]=a*n[8]+e*n[9]+i*n[10]+o*n[11],r[3]=a*n[12]+e*n[13]+i*n[14]+o*n[15],r}function A(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const I={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]]};function k(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=A(n[t],e,r,i);l(o,c,o)}return o}function q(t,n=!0){return k(t,I.OPK,n)}function U(t,n=!0){return k(t,I.HPR,n)}function C(t,n,e){const i=Math.sin(a(e)),o=Math.cos(a(e)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-i*t[1],i*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function K(t,e){const i=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=e,u=a(c),m=a(s),h=l/Math.sqrt(1-f*Math.sin(u)**2),p=i/h,g=o/h,v=r/h,M=Math.cos(u)-Math.sin(u)*g+Math.cos(u)*v,d=Math.sin(u)+Math.cos(u)*g+Math.sin(u)*v,x=Math.sqrt(M**2+p**2),w=f*h*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(h*x))},b=y(u),j=Math.atan(i/(h*M))+m,O=n(b);return[n(j),O,i/(Math.cos(b)*Math.sin(j-m))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function T(t,n,a){const e=360/n,i=180/a;return{heading:(t.x-n/2)*e,pitch:90-(t.y-a/2)*i}}function W(t,n,a,e=F/2){const{heading:i,pitch:o}=Y(t,e);return X(i,o,n,a)}function X(t,n,a,e){const i=t%360;return{x:a/2+(i<-180?i+360:i>180?i-360:i)/(360/a),y:e-n/(180/e),heading:t,pitch:n}}function Y(t,a){const e=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:e}}function Z(t,n,e=F/2){return[e*(Math.sin(a(t))*Math.sin(a(n))),e*(Math.cos(a(t))*Math.sin(a(n))),e*Math.cos(a(180-n))]}function G(t,n,a,e=F/2){const{heading:i,pitch:o}=T(t,n,a);return Z(i,o,e)}async function J(t,a,e){const i=await v(a,t.spatialReference,e);let o=n(Math.atan2(i.y-t.y,i.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function $(t,n,a){const e=Math.cos(a),i=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*e+o[2]*i,c=o[1]*e+o[3]*i,s=-o[0]*i+o[2]*e,l=-o[1]*i+o[3]*e;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const B=t=>t.toArray(),Q=(...t)=>t.some(t=>t);function _(t,n){if(Q(0===t.length,t.some(({x:t,y:n})=>Q(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function tt(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function nt(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function at(t,n){return d(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/M.radius))):1}const et=t=>n=>new g(n,t),it=t=>null!=t&&"queryExtent"in t;function ot(t,n,a,e){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,i])=>E(x(c(),a,[n,i,0]),e,t))}function rt({a0:t,a1:n,a2:a,b0:e,b1:i,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,e??c/2-.5,i??0,o].map(ct);return null!=s&&st(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function ct(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function st(t){return null!=t[1]&&null!=t[5]}function lt(t,n,a){const{cameraHeight:e,cameraPitch:i,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=jt(t,t.location.spatialReference),u=r??(l.z??0)-e;return{...mt(t,n,a),averageElevation:u,cameraPitch:i,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function ft(t,n,a,e){return wt(e)?q([e.omega,e.phi,e.kappa]):yt(e)?U([e.heading,e.pitch,e.roll]):U([t,n,a??0])}function ut(t,n,a){const{cameraHeading:e,cameraHeight:i,farDistance:o,horizontalFieldOfView:r,location:c,verticalFieldOfView:s}=jt(t,t.location.spatialReference);return{averageElevation:(c.z??0)-i,cameraLocation:c,cameraHeading:e,farDistance:o,horizontalFieldOfView:r,imageHeight:a,imageWidth:n,verticalFieldOfView:s}}function mt(t,n,a){const{a0:e,a1:i,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:m,focalLength:h,horizontalFieldOfView:p,location:g,matrix:v,principalX:M,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=rt({a0:e,a1:i,a2:o,b0:r,b1:c,b2:s},n,a,h),O=v??ft(l,u,m,f),z=null!=M&&null!=d?[M,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:g.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??z,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const ht=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,pt=t=>b(t?.elevationSource)&&null!=t?.extent,gt=t=>w(t?.elevationSource),vt=async(t,n,a,e,i)=>{const o=j(t),r=n-a/o;return gt(e)?(e.elevationSource=new y({constantElevation:e.elevationSource.constantElevation/o}),e):ht(e)?e:pt(e)?{elevationSample:await O({...p(e.elevationSource)?e.elevationSource.toJSON():e.elevationSource,extent:e.extent},i),elevationSource:new y({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},Mt=t=>z(t?.heading)&&z(t?.pitch),dt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function xt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:r,scalingFactor:l,verticalFieldOfView:f}=t,u=e();s(u,r);const p=2*Math.tan(a(f)/2)*i*l,g=2*Math.tan(a(o)/2)*i*l,v=L([0,0,-1],u),M=D([n.x,n.y,n.z],v,t.farDistance*l,l),d=L([0,1,0],u),x=L([1,0,0],u),w=H(d,p/2,l),y=H(x,g/2,l),b=m(c(),w,y),j=h(c(),w,y);return[h(c(),M,b),h(c(),M,j),m(c(),M,b),m(c(),M,j)]}const wt=t=>2===t?.type,yt=t=>1===t?.type;function bt(t,n,a){if("panoramic"===t){const[t,e]=a;return W({x:n.x,y:n.y,z:n.z},t,e)}return{x:n.x+.5,y:.5-n.y}}function jt(t,n,a=!0){const e=j(n),i=a?t.clone():t;return i.cameraHeight/=e,i.farDistance/=e,i.nearDistance/=e,w(i.elevationSource)&&(i.elevationSource.constantElevation/=e),i}export{xt as computeFarplaneVertices,C as computeHFOVAndVFOV,ot as computeNewReferenceCoordinates,Z as convertHeadingPitchToSphereVertex,X as convertOrientationToPixelLocation,G as convertPixelLocationToSphereVertex,T as convertPixelToHeadingPitch,Y as convertSphereVertexToOrientation,W as convertSphereVertexToPixelLocation,jt as convertToSRUnits,k as createRotationMatrix,U as createRotationMatrixFromHPR,q as createRotationMatrixFromOPK,rt as getAffinesAndFocalLength,ut as getImageToWorldPanoramicProperties,lt as getImageToWorldProperties,J as getInitialAngle,vt as getUpdateElevationProps,at as getWebMercatorScalingFactor,mt as getWorldToImageProperties,Mt as hasAngles,yt as hasHeadingPitchRoll,wt as hasOmegaPhiKappa,it as isElevationSampler,ht as isUpdateElevationWithElevationSampler,pt as isUpdateElevationWithElevationSource,gt as isUpdateUsingConstantElevation,st as isValidAffines,R as linearEquationSolve,K as ltpToGeographic,Q as or,B as pointToArray,E as projectiveTransform,dt as reducerFn,$ as rotatePixel,D as scaleAndAddWithFactor,H as scaleWithFactor,bt as transformGraphicCoordinatesToPixel,L as transformMat3,N as transformMat4,_ as validatePixelsToTransform,tt as validatePointsToTransform,nt as validateRotationMatrix,et as vecToPoint};
5
+ import t from"../../../core/Error.js";import{rad2deg as n,deg2rad as a}from"../../../core/mathUtils.js";import{create as e}from"../../../core/libs/gl-matrix-2/factories/mat3f64.js";import{create as i,fromValues as o}from"../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{fromArray as r}from"../../../core/libs/gl-matrix-2/factories/vec4f64.js";import{zeros as c}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{transpose as s,multiply as l}from"../../../core/libs/gl-matrix-2/math/mat3.js";import{invertOrIdentity as f,mul as u}from"../../../core/libs/gl-matrix-2/math/mat4.js";import{sub as m,add as h}from"../../../core/libs/gl-matrix-2/math/vec3.js";import{isSerializable as p}from"../../../core/support/jsonUtils.js";import g from"../../../geometry/Point.js";import{projectAsync as v}from"../../../geometry/projectionUtils.js";import{earth as M}from"../../../geometry/support/Ellipsoid.js";import{isWebMercator as d}from"../../../geometry/support/spatialReferenceUtils.js";import{a as x}from"../../../chunks/vec3.js";import{isConstantElevation as w,ConstantElevation as y,isElevationSource as b}from"../core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as j}from"../core/utils.js";import{getElevationSampler as O}from"./updateElevationUtils.js";import{isNumber as F}from"../../../support/guards.js";import{defaultImageSphereSize as E}from"../../../widgets/PanoramicViewer/constants.js";function z(t,n,a){const[e,o,r,c]=n,[s,l,m,h]=a;P(e,o,r,c);const p=P(s,l,m,h),g=R(e,o,r,c),v=R(s,l,m,h),M=f(i(),g),d=u(i(),M,v),[x,w,y,b]=V(t,d);return[x/b,w/b,p?0:y/b]}function P(t,n,a,e){return 0===t[2]&&0===n[2]&&0===a[2]&&0===e[2]&&(t[2]=n[2]=a[2]=e[2]=1,!0)}function S(t){return 0===t?1:t}function V(t,n){const[a,e,i]=t,o=[0,0,0,0];return o[0]=a*n[0]+e*n[1]+i*n[2]+n[3],o[1]=a*n[4]+e*n[5]+i*n[6]+n[7],o[2]=a*n[8]+e*n[9]+i*n[10]+n[11],o[3]=S(a*n[12]+e*n[13]+i*n[14]+n[15]),o}function R(t,n,a,e){const c=N(r([...e,1]),f(new Array(16),o(t[0],n[0],a[0],0,t[1],n[1],a[1],0,t[2],n[2],a[2],0,1,1,1,1))),s=c[0],l=c[1],u=c[2],m=i();return m[0]=s*t[0],m[1]=l*n[0],m[2]=u*a[0],m[3]=0,m[4]=s*t[1],m[5]=l*n[1],m[6]=u*a[1],m[7]=0,m[8]=s*t[2],m[9]=l*n[2],m[10]=u*a[2],m[11]=0,m[12]=s,m[13]=l,m[14]=u,m[15]=1,m}function D(t,n,a,e,i=c()){return i[0]=t[0]+n[0]*a,i[1]=t[1]+n[1]*a,i[2]=t[2]+n[2]*(a/e),i}function H(t,n,a){const e=c();return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*(n/a),e}function L(t,n){const[a,e,i]=t,o=c();return o[0]=a*n[0]+e*n[3]+i*n[6],o[1]=a*n[1]+e*n[4]+i*n[7],o[2]=a*n[2]+e*n[5]+i*n[8],o}function N(t,n){const[a,e,i,o]=t,r=new Array(4);return r[0]=a*n[0]+e*n[1]+i*n[2]+o*n[3],r[1]=a*n[4]+e*n[5]+i*n[6]+o*n[7],r[2]=a*n[8]+e*n[9]+i*n[10]+o*n[11],r[3]=a*n[12]+e*n[13]+i*n[14]+o*n[15],r}function A(n,i,o,r=!0){if(!Number.isFinite(n))throw new t("InvalidRotationAngle","Please specify a valid angle for rotation");const c=o*(r?a(n):n),s=Math.cos(c),l=Math.sin(c),f=e();switch(i){case 0:f[4]=s,f[5]=-l,f[7]=l,f[8]=s;break;case 1:f[0]=s,f[2]=l,f[6]=-l,f[8]=s;break;case 2:f[0]=s,f[1]=-l,f[3]=l,f[4]=s;break;default:throw new t("InvalidRotationAxis","Please specify either 0, 1 or 2 for X, Y or Z axis respectively")}return f}const I={HPR:[[2,-1],[0,1],[2,-1]],OPK:[[0,1],[1,1],[2,1]]};function k(n,a,i=!0){if(3!==n?.length||3!==a?.length)throw new t("InvalidRotationAngles","Please specify three angles with config for rotation");const o=e();for(let t=0;t<3;t++){const[e,r]=a[t],c=A(n[t],e,r,i);l(o,c,o)}return o}function q(t,n=!0){return k(t,I.OPK,n)}function U(t,n=!0){return k(t,I.HPR,n)}function C(t,n,e){const i=Math.sin(a(e)),o=Math.cos(a(e)),r=[[t,0],[t,n],[0,n]];r.forEach((t,n)=>{r[n]=[o*t[0]-i*t[1],i*t[0]+o*t[1]]});const c={xmin:Math.min(0,r[0][0],r[1][0],r[2][0]),xmax:Math.max(0,r[0][0],r[1][0],r[2][0]),ymin:Math.min(0,r[0][1],r[1][1],r[2][1]),ymax:Math.max(0,r[0][1],r[1][1],r[2][1])};return{hfov:Math.abs(c.xmax-c.xmin),vfov:Math.abs(c.ymax-c.ymin)}}function K(t,e){const i=Number(t[0]),o=Number(t[1]),r=Number(t[2]),[c,s,l,f]=e,u=a(c),m=a(s),h=l/Math.sqrt(1-f*Math.sin(u)**2),p=i/h,g=o/h,v=r/h,M=Math.cos(u)-Math.sin(u)*g+Math.cos(u)*v,d=Math.sin(u)+Math.cos(u)*g+Math.sin(u)*v,x=Math.sqrt(M**2+p**2),w=f*h*Math.sin(u),y=(t,n=5)=>{if(0===n)return t;const a=y(t,n-1);return Math.atan(d/x-(w-f*(l/Math.sqrt(1-f*Math.sin(a)**2))*Math.sin(a))/(h*x))},b=y(u),j=Math.atan(i/(h*M))+m,O=n(b);return[n(j),O,i/(Math.cos(b)*Math.sin(j-m))-l/Math.sqrt(1-f*Math.sin(b)**2)]}function T(t,n,a){const e=360/n,i=180/a;return{heading:(t.x-n/2)*e,pitch:90-(t.y-a/2)*i}}function W(t,n,a,e=E/2){const{heading:i,pitch:o}=Y(t,e);return X(i,o,n,a)}function X(t,n,a,e){const i=t%360;return{x:a/2+(i<-180?i+360:i>180?i-360:i)/(360/a),y:e-n/(180/e),heading:t,pitch:n}}function Y(t,a){const e=n(Math.acos(-t.z/a));return{heading:n(Math.atan2(t.x,t.y)),pitch:e}}function Z(t,n,e=E/2){return[e*(Math.sin(a(t))*Math.sin(a(n))),e*(Math.cos(a(t))*Math.sin(a(n))),e*Math.cos(a(180-n))]}function G(t,n,a,e=E/2){const{heading:i,pitch:o}=T(t,n,a);return Z(i,o,e)}async function J(t,a,e){const i=await v(a,t.spatialReference,e);let o=n(Math.atan2(i.y-t.y,i.x-t.x));return o=o>=0&&o<=90?90-o:o>90&&o<=180?360-o+90:90+Math.abs(o),o}function $(t,n,a){const e=Math.cos(a),i=Math.sin(a),o=[1,0,0,1,0,0],r=o[0]*e+o[2]*i,c=o[1]*e+o[3]*i,s=-o[0]*i+o[2]*e,l=-o[1]*i+o[3]*e;o[0]=r,o[1]=c,o[2]=s,o[3]=l;return[t*o[0]+n*o[2]+o[4],t*o[1]+n*o[3]+o[5]]}const B=t=>t.toArray(),Q=(...t)=>t.some(t=>t);function _(t,n){if(Q(0===t.length,t.some(({x:t,y:n})=>Q(null==t,null==n)),!n.hasZ))throw new Error("Input pixels must have x, y and camera location must have z value")}function tt(t,n){if(t.some(t=>null==t.z)||null==n.z)throw new Error("Input points and camera location must have z value")}function nt(t){if(9!==t?.length)throw new Error("Rotation matrix is not provided or is not a valid 3x3 matrix")}function at(t,n){return d(n)?1/Math.cos(Math.PI/2-2*Math.atan(Math.exp(-1*t/M.radius))):1}const et=t=>n=>new g(n,t),it=t=>null!=t&&"queryExtent"in t;function ot(t,n,a,e){return[[-n,-n],[+n,-n],[+n,+n],[-n,+n]].map(([n,i])=>z(x(c(),a,[n,i,0]),e,t))}function rt({a0:t,a1:n,a2:a,b0:e,b1:i,b2:o},r,c,s){const l=[t??r/2-.5,n,a??0,e??c/2-.5,i??0,o].map(ct);return null!=s&&st(l)?{affines:l,focalLength:s}:{affines:[r/2-.5,1,0,c/2-.5,0,-1]}}function ct(t,n){if(null==t)return null;const a=parseFloat(`${t}`);return isNaN(a)?null:a}function st(t){return null!=t[1]&&null!=t[5]}function lt(t,n,a){const{cameraHeight:e,cameraPitch:i,cameraRoll:o,elevation:r,farDistance:c,horizontalFieldOfView:s,location:l,verticalFieldOfView:f}=bt(t,t.location.spatialReference),u=r??(l.z??0)-e;return{...mt(t,n,a),averageElevation:u,cameraPitch:i,cameraRoll:o??0,farDistance:c,horizontalFieldOfView:s,verticalFieldOfView:f}}function ft(t,n,a,e){return wt(e)?q([e.omega,e.phi,e.kappa]):yt(e)?U([e.heading,e.pitch,e.roll]):U([t,n,a??0])}function ut(t,n,a){const{cameraHeading:e,cameraHeight:i,farDistance:o,horizontalFieldOfView:r,location:c,verticalFieldOfView:s}=bt(t,t.location.spatialReference);return{averageElevation:(c.z??0)-i,cameraLocation:c,cameraHeading:e,farDistance:o,horizontalFieldOfView:r,imageHeight:a,imageWidth:n,verticalFieldOfView:s}}function mt(t,n,a){const{a0:e,a1:i,a2:o,b0:r,b1:c,b2:s,cameraHeading:l,cameraOrientation:f,cameraPitch:u,cameraRoll:m,focalLength:h,horizontalFieldOfView:p,location:g,matrix:v,principalX:M,principalY:d,radial:x,tangential:w,verticalFieldOfView:y}=t,{affines:b,focalLength:j}=rt({a0:e,a1:i,a2:o,b0:r,b1:c,b2:s},n,a,h),O=v??ft(l,u,m,f),F=null!=M&&null!=d?[M,d]:void 0;return{affineTransformations:f?.affineTransformations??b,cameraLocation:g.clone(),focalLength:f?.focalLength??j,horizontalFieldOfView:p,imageHeight:a,imageWidth:n,principalOffsetPoint:f?.principalOffsetPoint??F,radialDistortionCoefficients:f?.radialDistortionCoefficients??x,rotationMatrix:O,tangentialDistortionCoefficients:f?.tangentialDistortionCoefficients??w,verticalFieldOfView:y}}const ht=t=>null!=t&&"elevationSample"in t&&null!=t.elevationSample,pt=t=>b(t?.elevationSource)&&null!=t?.extent,gt=t=>w(t?.elevationSource),vt=async(t,n,a,e,i)=>{const o=j(t),r=n-a/o;return gt(e)?(e.elevationSource=new y({constantElevation:e.elevationSource.constantElevation/o}),e):ht(e)?e:pt(e)?{elevationSample:await O({...p(e.elevationSource)?e.elevationSource.toJSON():e.elevationSource,extent:e.extent},i),elevationSource:new y({constantElevation:r})}:{averageGroundElevation:r,spatialReference:t}},Mt=t=>F(t?.heading)&&F(t?.pitch),dt=(t,n)=>[[-t,-n],[t,-n],[t,n],[-t,n]];function xt(t){const{cameraLocation:n,farDistance:i,horizontalFieldOfView:o,rotationMatrix:r,scalingFactor:l,verticalFieldOfView:f}=t,u=e();s(u,r);const p=2*Math.tan(a(f)/2)*i*l,g=2*Math.tan(a(o)/2)*i*l,v=L([0,0,-1],u),M=D([n.x,n.y,n.z],v,t.farDistance*l,l),d=L([0,1,0],u),x=L([1,0,0],u),w=H(d,p/2,l),y=H(x,g/2,l),b=m(c(),w,y),j=h(c(),w,y);return[h(c(),M,b),h(c(),M,j),m(c(),M,b),m(c(),M,j)]}const wt=t=>2===t?.type,yt=t=>1===t?.type;function bt(t,n,a=!0){const e=j(n),i=a?t.clone():t;return i.cameraHeight/=e,i.farDistance/=e,i.nearDistance/=e,w(i.elevationSource)&&(i.elevationSource.constantElevation/=e),i}export{xt as computeFarplaneVertices,C as computeHFOVAndVFOV,ot as computeNewReferenceCoordinates,Z as convertHeadingPitchToSphereVertex,X as convertOrientationToPixelLocation,G as convertPixelLocationToSphereVertex,T as convertPixelToHeadingPitch,Y as convertSphereVertexToOrientation,W as convertSphereVertexToPixelLocation,bt as convertToSRUnits,k as createRotationMatrix,U as createRotationMatrixFromHPR,q as createRotationMatrixFromOPK,rt as getAffinesAndFocalLength,ut as getImageToWorldPanoramicProperties,lt as getImageToWorldProperties,J as getInitialAngle,vt as getUpdateElevationProps,at as getWebMercatorScalingFactor,mt as getWorldToImageProperties,Mt as hasAngles,yt as hasHeadingPitchRoll,wt as hasOmegaPhiKappa,it as isElevationSampler,ht as isUpdateElevationWithElevationSampler,pt as isUpdateElevationWithElevationSource,gt as isUpdateUsingConstantElevation,st as isValidAffines,R as linearEquationSolve,K as ltpToGeographic,Q as or,B as pointToArray,z as projectiveTransform,dt as reducerFn,$ as rotatePixel,D as scaleAndAddWithFactor,H as scaleWithFactor,L as transformMat3,N as transformMat4,_ as validatePixelsToTransform,tt as validatePointsToTransform,nt as validateRotationMatrix,et as vecToPoint};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../../core/accessorSupport/decorators.js";import{getPixelValueRange as r}from"../formats/pixelRangeUtils.js";import o from"./BaseRasterFunction.js";import{spectralConversion as n}from"./conversionUtils.js";import i from"./SpectralConversionFunctionArguments.js";let u=class extends o{constructor(){super(...arguments),this.functionName="SpectralConversion",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();return this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this._removeStatsHistColormapVAT(t),this.rasterInfo=t,{success:!0,supportsGPU:!1}}_processPixels(t){const e=t.pixelBlocks?.[0];return null==e?null:n(e,this.functionArguments.conversionMatrix,this.outputPixelType)}_getWebGLParameters(){const t=r(this.outputPixelType);return{weights:this.functionArguments.conversionMatrix,clampRange:t}}};t([e({json:{write:!0,name:"rasterFunction"}})],u.prototype,"functionName",void 0),t([e({type:i,json:{write:!0,name:"rasterFunctionArguments"}})],u.prototype,"functionArguments",void 0),t([e()],u.prototype,"rasterArgumentNames",void 0),u=t([s("esri.layers.raster.functions.SpectralConversionFunction")],u);const p=u;export{p as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
+ */
5
+ import{__decorate as r}from"tslib";import{property as t,subclass as o}from"../../../core/accessorSupport/decorators.js";import e from"./BaseFunctionArguments.js";var s;let n=s=class extends e{clone(){return new s({conversionMatrix:[...this.conversionMatrix],raster:this.raster})}};r([t({type:[Number],json:{write:!0}})],n.prototype,"conversionMatrix",void 0),n=s=r([o("esri.layers.raster.functions.SpectralConversionFunctionArguments")],n);const i=n;export{i as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{getPixelValueRange as t}from"../formats/pixelRangeUtils.js";import e from"../../support/PixelBlock.js";function i(i,s,l){const{pixels:n,width:o,height:a,mask:r,bandMasks:p}=i,h=o*a,m=p?.length?e.combineBandMasks(p):r,f=Math.min(s.length,n.length),c=l.startsWith("f"),d=!c&&l!==i.pixelType,[x,g]=t(l),k=e.createEmptyBand(l,h);for(let t=0;t<a;t++){let e=t*o;for(let t=0;t<o;t++,e++)if(!m||m[e]){let t=0;for(let i=0;i<f;i++)t+=s[i]*n[i][e];c||(t=Math.round(t),d&&(t=t>g?g:t<x?x:t)),k[e]=t}}const u=new e({width:o,height:a,pixels:[k],pixelType:l,mask:m});return u.updateStatistics(),u}export{i as grayscale};
5
+ import{getPixelValueRange as t}from"../formats/pixelRangeUtils.js";import e from"../../support/PixelBlock.js";function s(s,i,n,h){const{pixels:o,width:a,height:l}=s,r=o.length,p=n.startsWith("f"),c=!p,[d,f]=t(n),m=a*l,g=e.createEmptyBand(n,m);for(let t=0;t<l;t++){let e=t*a;for(let t=0;t<a;t++,e++)if(!h||h[e]){let t=0;for(let s=0;s<r;s++)t+=i[s]*o[s][e];p||(t=Math.round(t),c&&(t=t>f?f:t<d?d:t)),g[e]=t}}return g}function i(t,i,n){const{width:h,height:o,mask:a,bandMasks:l}=t,r=l?.length?e.combineBandMasks(l):a,p=s(t,i,n,r),c=new e({width:h,height:o,pixels:[p],pixelType:n,mask:r});return c.updateStatistics(),c}function n(t,i,n){const{width:h,height:o,mask:a,bandMasks:l}=t,r=l?.length?e.combineBandMasks(l):a,p=[],c=t.pixels.length;for(let e=0;e<i.length/c;e++){const h=s(t,i.slice(e*c,(e+1)*c),n,r);p.push(h)}const d=new e({width:h,height:o,pixels:p,pixelType:n,mask:r});return d.updateStatistics(),d}export{i as grayscale,n as spectralConversion};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{toRGB as t}from"../../../core/colorUtils.js";import e from"../../../core/Error.js";import{clone as r}from"../../../core/lang.js";import n from"./ArithmeticFunction.js";import o from"./AspectFunction.js";import s from"./BandArithmeticFunction.js";import a from"./ClipFunction.js";import i from"./ColormapFunction.js";import c from"./ColormapToRGBFunction.js";import u from"./CompositeBandFunction.js";import m from"./ComputeChangeFunction.js";import l from"./ContrastBrightnessFunction.js";import p from"./ConvolutionFunction.js";import f from"./CurvatureFunction.js";import d from"./ExtractBandFunction.js";import g from"./GrayscaleFunction.js";import F from"./HillshadeFunction.js";import h from"./LocalFunction.js";import A from"./MaskFunction.js";import y from"./NDVIFunction.js";import b from"./RemapFunction.js";import j from"./ShadedReliefFunction.js";import C from"./SlopeFunction.js";import _ from"./StatisticsFunction.js";import R from"./StatisticsHistogramFunction.js";import N from"./StretchFunction.js";import S from"./TableFunction.js";const v=new Map;function w(t,e){const{rasterFunctionArguments:r}=t;if(!r)return;(r.rasters||[r.raster,r.raster2]).forEach(t=>{t&&"number"!=typeof t&&("string"==typeof t?t.startsWith("http")&&(e.includes(t)||e.push(t)):"rasterFunctionArguments"in t&&w(t,e))})}function T(t,n){n=n??{};try{if("function"in(t=r(t))&&"arguments"in t&&t.arguments){const r=$(t,new Map,n);if(L(r),!r.renderingRule)throw new e("raster-function-helper","Unsupported raster function json.");t=r.renderingRule}if("rasterFunction"in t){const e=k(t=B(t),n);return e.isRoot=!0,e}}catch{}throw new e("raster-function-helper","unsupported raster function json.")}function D(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map(e=>t[e])}function V(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function B(t){const{rasterFunction:e,rasterFunctionArguments:r}=t,n={};for(const o in r){let t=r[o];const e=o.toLowerCase();if("rasters"===e&&Array.isArray(t))n.rasters=t.map(t=>V(t)?B(t):t);else switch(V(t)&&(t=B(t)),e){case"dra":n.dra=t;break;case"pspower":n.psPower=t;break;case"pszfactor":n.psZFactor=t;break;case"bandids":n.bandIds=t;break;default:n[o[0].toLowerCase()+o.slice(1)]=t}}return"Local"!==e||n.rasters?.length||(n.rasters=["$$"]),{...t,rasterFunctionArguments:n}}function k(t,r){const{rasterFunction:n,rasterFunctionArguments:o}=t,s=t.outputPixelType?.toLowerCase();if(null==n||!v.has(n))throw new e("raster-function-helper",`unsupported raster function: ${n}`);const a=v.get(n),i=("function"==typeof a.ctor?a.ctor:a.ctor.default).fromJSON({...t,outputPixelType:s}),{rasterArgumentNames:c}=i,u=[],m=D(o,c),l="rasters"===c[0]||c.length>1,p=[];for(let e=0;e<m.length;e++){const t=m[e];let n;null==t||"string"==typeof t&&t.startsWith("$")?u.push(r?.raster):"string"==typeof t?r[t]&&u.push(r[t]):"number"!=typeof t&&"rasterFunction"in t&&(n=k(t,r),l||(i.functionArguments[c[e]]=n),u.push(n)),l&&p.push(n??t)}if(l&&("rasters"===c[0]?i.functionArguments.rasters=p:c.forEach((t,e)=>{i.functionArguments[t]=p[e]})),r){i.sourceRasters=u;const t=r.raster?.url;t&&(i.mainPrimaryRasterId=t)}return i}function x(t,e){if(t&&e)for(const r in t){const n=t[r];n&&"object"==typeof n&&"type"in n&&("RasterFunctionTemplate"===n.type?x(n.arguments,e):"RasterFunctionVariable"===n.type&&null!=e[n.name]&&(n.value=e[n.name]))}}function E(t,r){if(!t||"object"!=typeof t)return t;const{value:n}=t;if(!n||"object"!=typeof n)return t.isDataset?"$$":n;if(Array.isArray(n))return 0===n.length?[]:n.map(t=>t&&"object"==typeof t&&"RasterFunctionVariable"===t.type?E(t,r):t);if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&"Scalar"!==n.type)return"$$";if(!("type"in n))return n;let o=n;switch(n.type){case"Scalar":o=n.value;break;case"AlgorithmicColorRamp":o=M(n);break;case"MultiPartColorRamp":o={type:"multipart",colorRamps:n.ArrayOfColorRamp.map(M)};break;case"ArgumentArray":if(n.elements?.length&&"RasterStatistics"!==n.elements[0].type){const t=[];for(let o=0;o<n.elements.length;o++){const s=n.elements[o],{type:a}=s;if(a)if("RasterFunctionTemplate"===a){const{renderingRule:e}=$(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}else{if("RasterFunctionVariable"!==a)throw new e("raster-function-helper","unsupported raster function json.");{const e=E(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}}else t.push(s)}o=t}else o=n.elements}return null!=n._object_id&&r.set(n._object_id,o),o}function M(e){const r=e.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:o}=e;if(!Array.isArray(n)){const{r:e,g:r,b:o}=t({h:n.Hue,s:n.Saturation,v:n.Value});n=[e,r,o,n.AlphaValue]}if(!Array.isArray(o)){const{r:e,g:r,b:n}=t({h:o.Hue,s:o.Saturation,v:o.Value});o=[e,r,n,o.AlphaValue]}return{type:"algorithmic",algorithm:r,fromColor:n,toColor:o}}function $(t,e,r){r&&x(t,r);const n={renderingRule:{},templates:e};return H(t,n),n}function H(t,e){if(!t||!e.renderingRule)return;const{renderingRule:r,templates:n}=e,{function:o,arguments:s,_object_id:a}=t;if(!o||!s)return;null!=a&&n.set(a,r),r.rasterFunction=o.type.replace("Function",""),r.outputPixelType=o.pixelType;const i={};r.rasterFunctionArguments=i;for(const c in s){if("type"===c||"object_id"===c||"_object_ref_id"===c)continue;const t=s[c];t&&"object"==typeof t&&"type"in t&&("RasterFunctionTemplate"===t.type||"RasterFunctionVariable"===t.type)?("RasterFunctionVariable"===t.type?i[c]=E(t,n):(r.rasterFunctionArguments[c]={},H(t,{renderingRule:r.rasterFunctionArguments[c],templates:n})),null!=t._object_id&&n.set(t._object_id,i[c])):i[c]=t}switch(i.DEM&&!i.Raster&&(i.Raster=i.DEM,delete i.DEM),r.rasterFunction){case"Stretch":O(i);break;case"Colormap":G(i);break;case"Convolution":P(i);break;case"Mask":I(i)}}function L(t){const{renderingRule:r,templates:n}=t;if("object"!=typeof r||!r?.rasterFunctionArguments||!n.size)return;const{rasterFunctionArguments:o}=r;for(const s in o){const t=o[s],r="_object_ref_id"===s?t:t&&"object"==typeof t&&"_object_ref_id"in t?t._object_ref_id:null;if(null!=r){if(!n.has(r))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${r} does not exist`);const t=n.get(r);"_object_ref_id"!==s?o[s]=t:t&&"object"==typeof t&&Object.assign(o,t);continue}t&&"object"==typeof t&&(t.rasterFunctionArguments&&L({renderingRule:t,templates:n}),Array.isArray(t)&&t.forEach((o,s)=>{if(o&&"object"==typeof o)if(null!=o._object_ref_id){if(!n.has(o._object_ref_id))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${t} does not exist`);const a=n.get(r);a&&"object"==typeof a?Object.assign(o,a):t[s]=a}else L({renderingRule:o,templates:n})}))}}function O(t){t.Statistics?.length&&"object"==typeof t.Statistics&&(t.Statistics=t.Statistics.map(t=>[t.min,t.max,t.mean,t.standardDeviation])),null!=t.NumberOfStandardDeviation&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function G(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}function P(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function I(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter(t=>""!==t).map(t=>Number(t)))}v.set("Arithmetic",{desc:"Arithmetic Function",ctor:n,rasterArgumentNames:["rasters"]}),v.set("Aspect",{desc:"Aspect Function",ctor:o,rasterArgumentNames:["raster"]}),v.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:s,rasterArgumentNames:["raster"]}),v.set("Colormap",{desc:"Colormap Function",ctor:i,rasterArgumentNames:["raster"]}),v.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:c,rasterArgumentNames:["raster"]}),v.set("CompositeBand",{desc:"CompositeBand Function",ctor:u,rasterArgumentNames:["rasters"]}),v.set("ComputeChange",{desc:"ComputeChange Function",ctor:m,rasterArgumentNames:["rasters"]}),v.set("Convolution",{desc:"Convolution Function",ctor:p,rasterArgumentNames:["raster"]}),v.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:l,rasterArgumentNames:["raster"]}),v.set("ExtractBand",{desc:"ExtractBand Function",ctor:d,rasterArgumentNames:["raster"]}),v.set("Curvature",{desc:"Curvature Function",ctor:f,rasterArgumentNames:["raster"]}),v.set("Hillshade",{desc:"Hillshade Function",ctor:F,rasterArgumentNames:["raster"]}),v.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:j,rasterArgumentNames:["raster"]}),v.set("Grayscale",{desc:"Grayscale Function",ctor:g,rasterArgumentNames:["raster"]}),v.set("Clip",{desc:"Clip Function",ctor:a,rasterArgumentNames:["raster"]}),v.set("Local",{desc:"Local Function",ctor:h,rasterArgumentNames:["rasters"]}),v.set("Mask",{desc:"Mask Function",ctor:A,rasterArgumentNames:["raster"]}),v.set("NDVI",{desc:"NDVI Function",ctor:y,rasterArgumentNames:["raster"]}),v.set("Remap",{desc:"Remap Function",ctor:b,rasterArgumentNames:["raster"]}),v.set("Slope",{desc:"Slope Function",ctor:C,rasterArgumentNames:["raster"]}),v.set("Statistics",{desc:"Focal Statistics Function",ctor:_,rasterArgumentNames:["raster"]}),v.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:R,rasterArgumentNames:["raster"]}),v.set("Stretch",{desc:"Stretch Function",ctor:N,rasterArgumentNames:["raster"]}),v.set("Table",{desc:"Attribute Table Function",ctor:S,rasterArgumentNames:["raster"]});export{T as create,w as getPrimaryRasterUrls,D as getRasterValues};
5
+ import{toRGB as t}from"../../../core/colorUtils.js";import e from"../../../core/Error.js";import{clone as r}from"../../../core/lang.js";import n from"./ArithmeticFunction.js";import o from"./AspectFunction.js";import s from"./BandArithmeticFunction.js";import a from"./ClipFunction.js";import i from"./ColormapFunction.js";import c from"./ColormapToRGBFunction.js";import u from"./CompositeBandFunction.js";import m from"./ComputeChangeFunction.js";import l from"./ContrastBrightnessFunction.js";import p from"./ConvolutionFunction.js";import f from"./CurvatureFunction.js";import d from"./ExtractBandFunction.js";import g from"./GrayscaleFunction.js";import F from"./HillshadeFunction.js";import h from"./LocalFunction.js";import A from"./MaskFunction.js";import j from"./NDVIFunction.js";import y from"./RemapFunction.js";import b from"./ShadedReliefFunction.js";import C from"./SlopeFunction.js";import _ from"./SpectralConversionFunction.js";import R from"./StatisticsFunction.js";import N from"./StatisticsHistogramFunction.js";import S from"./StretchFunction.js";import v from"./TableFunction.js";const w=new Map;function T(t,e){const{rasterFunctionArguments:r}=t;if(!r)return;(r.rasters||[r.raster,r.raster2]).forEach(t=>{t&&"number"!=typeof t&&("string"==typeof t?t.startsWith("http")&&(e.includes(t)||e.push(t)):"rasterFunctionArguments"in t&&T(t,e))})}function D(t,n){n=n??{};try{if("function"in(t=r(t))&&"arguments"in t&&t.arguments){const r=H(t,new Map,n);if(O(r),!r.renderingRule)throw new e("raster-function-helper","Unsupported raster function json.");t=r.renderingRule}if("rasterFunction"in t){const e=x(t=k(t),n);return e.isRoot=!0,e}}catch{}throw new e("raster-function-helper","unsupported raster function json.")}function V(t,e){return"rasters"===e[0]&&Array.isArray(t.rasters)?t.rasters:e.map(e=>t[e])}function B(t){return!!(t&&"object"==typeof t&&t.rasterFunction&&t.rasterFunctionArguments)}function k(t){const{rasterFunction:e,rasterFunctionArguments:r}=t,n={};for(const o in r){let t=r[o];const e=o.toLowerCase();if("rasters"===e&&Array.isArray(t))n.rasters=t.map(t=>B(t)?k(t):t);else switch(B(t)&&(t=k(t)),e){case"dra":n.dra=t;break;case"pspower":n.psPower=t;break;case"pszfactor":n.psZFactor=t;break;case"bandids":n.bandIds=t;break;default:n[o[0].toLowerCase()+o.slice(1)]=t}}return"Local"!==e||n.rasters?.length||(n.rasters=["$$"]),{...t,rasterFunctionArguments:n}}function x(t,r){const{rasterFunction:n,rasterFunctionArguments:o}=t,s=t.outputPixelType?.toLowerCase();if(null==n||!w.has(n))throw new e("raster-function-helper",`unsupported raster function: ${n}`);const a=w.get(n),i=("function"==typeof a.ctor?a.ctor:a.ctor.default).fromJSON({...t,outputPixelType:s}),{rasterArgumentNames:c}=i,u=[],m=V(o,c),l="rasters"===c[0]||c.length>1,p=[];for(let e=0;e<m.length;e++){const t=m[e];let n;null==t||"string"==typeof t&&t.startsWith("$")?u.push(r?.raster):"string"==typeof t?r[t]&&u.push(r[t]):"number"!=typeof t&&"rasterFunction"in t&&(n=x(t,r),l||(i.functionArguments[c[e]]=n),u.push(n)),l&&p.push(n??t)}if(l&&("rasters"===c[0]?i.functionArguments.rasters=p:c.forEach((t,e)=>{i.functionArguments[t]=p[e]})),r){i.sourceRasters=u;const t=r.raster?.url;t&&(i.mainPrimaryRasterId=t)}return i}function E(t,e){if(t&&e)for(const r in t){const n=t[r];n&&"object"==typeof n&&"type"in n&&("RasterFunctionTemplate"===n.type?E(n.arguments,e):"RasterFunctionVariable"===n.type&&null!=e[n.name]&&(n.value=e[n.name]))}}function M(t,r){if(!t||"object"!=typeof t)return t;const{value:n}=t;if(!n||"object"!=typeof n)return t.isDataset?"$$":n;if(Array.isArray(n))return 0===n.length?[]:n.map(t=>t&&"object"==typeof t&&"RasterFunctionVariable"===t.type?M(t,r):t);if("value"in n&&["number","string","boolean"].includes(typeof n.value))return n.value;if(t.isDataset&&"Scalar"!==n.type)return"$$";if(!("type"in n))return n;let o=n;switch(n.type){case"Scalar":o=n.value;break;case"AlgorithmicColorRamp":o=$(n);break;case"MultiPartColorRamp":o={type:"multipart",colorRamps:n.ArrayOfColorRamp.map($)};break;case"ArgumentArray":if(n.elements?.length&&"RasterStatistics"!==n.elements[0].type){const t=[];for(let o=0;o<n.elements.length;o++){const s=n.elements[o],{type:a}=s;if(a)if("RasterFunctionTemplate"===a){const{renderingRule:e}=H(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}else{if("RasterFunctionVariable"!==a)throw new e("raster-function-helper","unsupported raster function json.");{const e=M(s,r);t.push(e),null!=s._object_id&&r.set(s._object_id,e)}}else t.push(s)}o=t}else o=n.elements}return null!=n._object_id&&r.set(n._object_id,o),o}function $(e){const r=e.algorithm??"esriHSVAlgorithm";let{FromColor:n,ToColor:o}=e;if(!Array.isArray(n)){const{r:e,g:r,b:o}=t({h:n.Hue,s:n.Saturation,v:n.Value});n=[e,r,o,n.AlphaValue]}if(!Array.isArray(o)){const{r:e,g:r,b:n}=t({h:o.Hue,s:o.Saturation,v:o.Value});o=[e,r,n,o.AlphaValue]}return{type:"algorithmic",algorithm:r,fromColor:n,toColor:o}}function H(t,e,r){r&&E(t,r);const n={renderingRule:{},templates:e};return L(t,n),n}function L(t,e){if(!t||!e.renderingRule)return;const{renderingRule:r,templates:n}=e,{function:o,arguments:s,_object_id:a}=t;if(!o||!s)return;null!=a&&n.set(a,r),r.rasterFunction=o.type.replace("Function",""),r.outputPixelType=o.pixelType;const i={};r.rasterFunctionArguments=i;for(const c in s){if("type"===c||"object_id"===c||"_object_ref_id"===c)continue;const t=s[c];t&&"object"==typeof t&&"type"in t&&("RasterFunctionTemplate"===t.type||"RasterFunctionVariable"===t.type)?("RasterFunctionVariable"===t.type?i[c]=M(t,n):(r.rasterFunctionArguments[c]={},L(t,{renderingRule:r.rasterFunctionArguments[c],templates:n})),null!=t._object_id&&n.set(t._object_id,i[c])):i[c]=t}switch(i.DEM&&!i.Raster&&(i.Raster=i.DEM,delete i.DEM),r.rasterFunction){case"Stretch":G(i);break;case"Colormap":P(i);break;case"Convolution":I(i);break;case"Mask":z(i)}}function O(t){const{renderingRule:r,templates:n}=t;if("object"!=typeof r||!r?.rasterFunctionArguments||!n.size)return;const{rasterFunctionArguments:o}=r;for(const s in o){const t=o[s],r="_object_ref_id"===s?t:t&&"object"==typeof t&&"_object_ref_id"in t?t._object_ref_id:null;if(null!=r){if(!n.has(r))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${r} does not exist`);const t=n.get(r);"_object_ref_id"!==s?o[s]=t:t&&"object"==typeof t&&Object.assign(o,t);continue}t&&"object"==typeof t&&(t.rasterFunctionArguments&&O({renderingRule:t,templates:n}),Array.isArray(t)&&t.forEach((o,s)=>{if(o&&"object"==typeof o)if(null!=o._object_ref_id){if(!n.has(o._object_ref_id))throw new e("raster-function-helper",`unsupported raster function json. _object_ref_id: ${t} does not exist`);const a=n.get(r);a&&"object"==typeof a?Object.assign(o,a):t[s]=a}else O({renderingRule:o,templates:n})}))}}function G(t){t.Statistics?.length&&"object"==typeof t.Statistics&&(t.Statistics=t.Statistics.map(t=>[t.min,t.max,t.mean,t.standardDeviation])),null!=t.NumberOfStandardDeviation&&(t.NumberOfStandardDeviations=t.NumberOfStandardDeviation,delete t.NumberOfStandardDeviation)}function P(t){"randomcolorramp"===t.ColorRamp?.type?.toLowerCase()&&(delete t.ColorRamp,t.ColormapName="Random"),0===t.ColorSchemeType&&delete t.ColorRamp}function I(t){null!=t.ConvolutionType&&(t.Type=t.ConvolutionType,delete t.ConvolutionType)}function z(t){t.NoDataValues?.length&&"string"==typeof t.NoDataValues[0]&&(t.NoDataValues=t.NoDataValues.filter(t=>""!==t).map(t=>Number(t)))}w.set("Arithmetic",{desc:"Arithmetic Function",ctor:n,rasterArgumentNames:["rasters"]}),w.set("Aspect",{desc:"Aspect Function",ctor:o,rasterArgumentNames:["raster"]}),w.set("BandArithmetic",{desc:"Band Arithmetic Function",ctor:s,rasterArgumentNames:["raster"]}),w.set("Colormap",{desc:"Colormap Function",ctor:i,rasterArgumentNames:["raster"]}),w.set("ColormapToRGB",{desc:"ColormapToRGB Function",ctor:c,rasterArgumentNames:["raster"]}),w.set("CompositeBand",{desc:"CompositeBand Function",ctor:u,rasterArgumentNames:["rasters"]}),w.set("ComputeChange",{desc:"ComputeChange Function",ctor:m,rasterArgumentNames:["rasters"]}),w.set("Convolution",{desc:"Convolution Function",ctor:p,rasterArgumentNames:["raster"]}),w.set("ContrastBrightness",{desc:"Contrast Brightness Function",ctor:l,rasterArgumentNames:["raster"]}),w.set("ExtractBand",{desc:"ExtractBand Function",ctor:d,rasterArgumentNames:["raster"]}),w.set("Curvature",{desc:"Curvature Function",ctor:f,rasterArgumentNames:["raster"]}),w.set("Hillshade",{desc:"Hillshade Function",ctor:F,rasterArgumentNames:["raster"]}),w.set("ShadedRelief",{desc:"ShadedRelief Function",ctor:b,rasterArgumentNames:["raster"]}),w.set("Grayscale",{desc:"Grayscale Function",ctor:g,rasterArgumentNames:["raster"]}),w.set("Clip",{desc:"Clip Function",ctor:a,rasterArgumentNames:["raster"]}),w.set("Local",{desc:"Local Function",ctor:h,rasterArgumentNames:["rasters"]}),w.set("Mask",{desc:"Mask Function",ctor:A,rasterArgumentNames:["raster"]}),w.set("NDVI",{desc:"NDVI Function",ctor:j,rasterArgumentNames:["raster"]}),w.set("Remap",{desc:"Remap Function",ctor:y,rasterArgumentNames:["raster"]}),w.set("Slope",{desc:"Slope Function",ctor:C,rasterArgumentNames:["raster"]}),w.set("SpectralConversion",{desc:"Spectral Conversion",ctor:_,rasterArgumentNames:["raster"]}),w.set("Statistics",{desc:"Focal Statistics Function",ctor:R,rasterArgumentNames:["raster"]}),w.set("StatisticsHistogram",{desc:"Statistics Histogram Function",ctor:N,rasterArgumentNames:["raster"]}),w.set("Stretch",{desc:"Stretch Function",ctor:S,rasterArgumentNames:["raster"]}),w.set("Table",{desc:"Attribute Table Function",ctor:v,rasterArgumentNames:["raster"]});export{D as create,T as getPrimaryRasterUrls,V as getRasterValues};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{JSONMap as t}from"../../../core/jsonMap.js";import{isValidPixelBlock as e}from"./pixelUtils.js";import n from"../../support/PixelBlock.js";const r=new Map;r.set("meter-per-second",1),r.set("kilometer-per-hour",.277778),r.set("knots",.514444),r.set("feet-per-second",.3048),r.set("mile-per-hour",.44704);const o=180/Math.PI,i=5,s=new t({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function a(t,e){return r.get(t)/r.get(e)||1}function h(t){return(450-t)%360}function l(t,e="geographic"){const[n,r]=t,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n)*o;return s=(360+s)%360,"geographic"===e&&(s=h(s)),[i,s]}function c(t,e="geographic"){let n=t[1];"geographic"===e&&(n=h(n)),n%=360;const r=t[0];return[r*Math.cos(n/o),r*Math.sin(n/o)]}function u(t,n,r,o="geographic"){if(!e(t)||null==r)return t;const i="vector-magdir"===n?t.clone():f(t,n),s=i.pixels[1];for(let e=0;e<s.length;e++)s[e]="geographic"===o?(s[e]+r[e]+270)%360:(s[e]+360-r[e])%360;return"vector-magdir"===n?i:f(i,"vector-magdir")}function f(t,r,o="geographic",i=1){if(!e(t))return t;const{pixels:s,width:a,height:h}=t,u=a*h,f=s[0],p=s[1],m=t.pixelType.startsWith("f")?t.pixelType:"f32",d=n.createEmptyBand(m,u),g=n.createEmptyBand(m,u);let x=0;for(let e=0;e<h;e++)for(let t=0;t<a;t++)"vector-uv"===r?([d[x],g[x]]=l([f[x],p[x]],o),d[x]*=i):([d[x],g[x]]=c([f[x],p[x]],o),d[x]*=i,g[x]*=i),x++;const M=new n({pixelType:m,width:t.width,height:t.height,mask:t.mask,validPixelCount:t.validPixelCount,maskIsAlpha:t.maskIsAlpha,pixels:[d,g]});return M.updateStatistics(),M}function p(t,n,r=1){if(1===r||!e(t))return t;const o=t.clone(),{pixels:i,width:s,height:a}=o,h=i[0],l=i[1];let c=0;for(let e=0;e<a;e++)for(let t=0;t<s;t++)"vector-uv"===n?(h[c]*=r,l[c]*=r):h[c]*=r,c++;return o.updateStatistics(),o}function m(t,e,n,r,o){if(null==o||!o.spatialReference.equals(t.spatialReference))return{extent:t,width:Math.round(e/r),height:Math.round(n/r),resolution:t.width/e};const i=o.xmin,s=o.ymax,a=(t.xmax-t.xmin)/e*r,h=(t.ymax-t.ymin)/n*r,l=(a+h)/2;return t.xmin=i+Math.floor((t.xmin-i)/a)*a,t.xmax=i+Math.ceil((t.xmax-i)/a)*a,t.ymin=s+Math.floor((t.ymin-s)/h)*h,t.ymax=s+Math.ceil((t.ymax-s)/h)*h,{extent:t,width:Math.round(t.width/a),height:Math.round(t.height/h),resolution:l}}const d=g(0,0,0);function g(t=0,e=0,n=Math.PI,r=!0){r&&(n=(2*Math.PI-n)%(2*Math.PI));const o=r?-1:1,i=13*o,s=-7*o,a=-2*o,h=-16*o,l=21.75,[c,u]=M(0,e+i,n,l),[f,p]=M(t-5.5,e+s,n,l),[m,d]=M(t+5.5,e+s,n,l),[g,x]=M(t-1.5,e+a,n,l),[k,w]=M(t+1.5,e+a,n,l),[y,P]=M(t-1.5,e+h,n,l),[b,v]=M(t+1.5,e+h,n,l);return[c,u,f,p,g,x,k,w,m,d,y,P,b,v]}function x(t=0,e=Math.PI,n=!0){n&&(e=(2*Math.PI-e)%(2*Math.PI));const r=10,o=n?-1:1,s=5*o,a=20*o,h=25*o,l=45,c=0,u=0,f=2,p=0,m=f*o,d=n?1:-1,g=r/2*d;let[x,k]=[c+g,u-a],[w,y]=[x+f*d,k],[P,b]=[w-p*d,y+m],[v,I]=[c-g,u-h],[A,_]=[v+p*d,I-m],U=Math.ceil(t/i),S=Math.floor(U/10);U-=8*S;const D=[],F=[];for(let i=0;i<U/2;i++,S--){S<=0&&U%2==1&&i===(U-1)/2&&(v=c,A=v+p*d,I=(I+k)/2,_=I-m);const[t,n]=M(v,I,e,l);if(S>0){const[r,o]=M(w,I,e,l),[i,s]=M(x,k,e,l);D.push(r),D.push(o),D.push(t),D.push(n),D.push(i),D.push(s)}else{const[r,o]=M(w,y,e,l),[i,s]=M(P,b,e,l),[a,h]=M(A,_,e,l);F.push(t),F.push(n),F.push(a),F.push(h),F.push(i),F.push(s),F.push(r),F.push(o)}I+=s,k+=s,y+=s,b+=s,_+=s}const[N,j]=M(c+g,u+a,e,l),J=(r/2+f)*d,[O,q]=M(c+J,u+a,e,l),[B,E]=M(c+g,u-h,e,l),[T,C]=M(c+J,u-h,e,l);return{pennants:D,barbs:F,shaft:[N,j,O,q,B,E,T,C]}}function M(t,e,n,r=1){const o=Math.sqrt(t*t+e*e)/r,i=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+i-n)%(2*Math.PI)]}const k=[0,1,3,6,10,16,21,27,33,40,47,55,63],w=[0,.5,1,1.5,2],y=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function P(t,e,n,r){const o=a(r||"knots",n);let i;for(i=1;i<e.length;i++)if(i===e.length-1){if(t<e[i]*o)break}else if(t<=e[i]*o)break;return Math.min(i-1,e.length-2)}function b(t,e,n,r,o){let i=0;switch(e){case"beaufort_kn":i=P(t,k,"knots",n);break;case"beaufort_km":i=P(t,k,"kilometer-per-hour",n);break;case"beaufort_ft":i=P(t,k,"feet-per-second",n);break;case"beaufort_m":i=P(t,k,"meter-per-second",n);break;case"classified_arrow":i=P(t,o??[],r,n);break;case"ocean_current_m":i=P(t,w,"meter-per-second",n);break;case"ocean_current_kn":i=P(t,y,"knots",n)}return i}function v(t,e){const{style:n,inputUnit:r,outputUnit:o,breakValues:i}=e,a=s.fromJSON(r),h=s.fromJSON(o),l=7*6,c=15;let u=0,f=0;const{width:p,height:m,mask:x}=t,M=t.pixels[0],k=t.pixels[1],w=null!=x?x.filter(t=>t>0).length:p*m,y=new Float32Array(w*l),P=new Uint32Array(c*w),v=e.invertDirection?g(0,0,0,!1):d;for(let s=0;s<m;s++)for(let t=0;t<p;t++){const e=s*p+t;if(!x||x[s*p+t]){const r=(k[e]+360)%360/180*Math.PI,o=b(M[e],n,a,h,i);for(let n=0;n<v.length;n+=2)y[u++]=(t+.5)/p,y[u++]=(s+.5)/m,y[u++]=v[n],y[u++]=v[n+1]+r,y[u++]=o,y[u++]=M[e];const c=7*(u/l-1);P[f++]=c,P[f++]=c+1,P[f++]=c+2,P[f++]=c+0,P[f++]=c+4,P[f++]=c+3,P[f++]=c+0,P[f++]=c+2,P[f++]=c+3,P[f++]=c+2,P[f++]=c+5,P[f++]=c+3,P[f++]=c+5,P[f++]=c+6,P[f++]=c+3}}return{vertexData:y,indexData:P}}const I=[];function A(t,e){if(0===I.length)for(let i=0;i<30;i++)I.push(x(5*i,0,!e.invertDirection));const n=a(s.fromJSON(e.inputUnit),"knots"),{width:r,height:o,mask:h}=t,l=t.pixels[0],c=t.pixels[1],u=6,f=[],p=[];let m=0,d=0;for(let s=0;s<o;s++)for(let t=0;t<r;t++){const e=s*r+t,a=l[e]*n;if((!h||h[s*r+t])&&a>=i){const n=(c[e]+360)%360/180*Math.PI,{pennants:i,barbs:h,shaft:l}=I[Math.min(Math.floor(a/5),29)];if(i.length+h.length===0)continue;let g=f.length/u;const x=(t+.5)/r,M=(s+.5)/o;for(let t=0;t<i.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=i[t],f[m++]=i[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<h.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=h[t],f[m++]=h[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<l.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=l[t],f[m++]=l[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<i.length/6;t++)p[d++]=g,p[d++]=g+1,p[d++]=g+2,g+=3;for(let t=0;t<h.length/8;t++)p[d++]=g,p[d++]=g+1,p[d++]=g+2,p[d++]=g+1,p[d++]=g+2,p[d++]=g+3,g+=4;p[d++]=g+0,p[d++]=g+1,p[d++]=g+2,p[d++]=g+1,p[d++]=g+3,p[d++]=g+2,g+=4}}return{vertexData:new Float32Array(f),indexData:new Uint32Array(p)}}function _(t,e){const n=4*6;let r=0,o=0;const{width:h,height:l,mask:c}=t,u=t.pixels[0],f=[],p=[],m=a(s.fromJSON(e.inputUnit),"knots"),d="wind_speed"===e.style?i:Number.MAX_VALUE;for(let i=0;i<l;i++)for(let t=0;t<h;t++){const e=u[i*h+t]*m;if((!c||c[i*h+t])&&e<d){for(let n=0;n<4;n++)f[r++]=(t+.5)/h,f[r++]=(i+.5)/l,f[r++]=n<2?-.5:.5,f[r++]=n%2==0?-.5:.5,f[r++]=0,f[r++]=e;const s=4*(r/n-1);p[o++]=s,p[o++]=s+1,p[o++]=s+2,p[o++]=s+1,p[o++]=s+2,p[o++]=s+3}}return{vertexData:new Float32Array(f),indexData:new Uint32Array(p)}}function U(t,e){return"simple_scalar"===e.style?_(t,e):"wind_speed"===e.style?A(t,e):v(t,e)}function S(t,e,r,o=[0,0],i=.5){const{width:s,height:a,mask:h}=t,[u,f]=t.pixels,[p,m]=o,d=Math.round((s-p)/r),g=Math.round((a-m)/r),x=d*g,M=new Float32Array(x),k=new Float32Array(x),w=new Uint8Array(x),y="vector-uv"===e;for(let n=0;n<g;n++)for(let t=0;t<d;t++){let e=0;const o=n*d+t,g=Math.max(0,n*r+m),x=Math.max(0,t*r+p),P=Math.min(a,g+r),b=Math.min(s,x+r);for(let t=g;t<P;t++)for(let n=x;n<b;n++){const r=t*s+n;if(!h||h[r]){e++;const t=y?[u[r],f[r]]:[u[r],(360+f[r])%360],[n,i]=y?t:c(t);M[o]+=n,k[o]+=i}}if(e>=(P-g)*(b-x)*(1-i)){w[o]=1;const[t,n]=l([M[o]/e,k[o]/e]);M[o]=t,k[o]=n}else w[o]=0,M[o]=0,k[o]=0}const P=new n({width:d,height:g,pixels:[M,k],mask:w});return P.updateStatistics(),P}export{u as convertToLocalDirections,f as convertVectorFieldData,p as convertVectorFieldUnit,U as createVFMesh,_ as createVFMeshScalar,a as getUnitConversionFactor,S as sampleVectorField,m as snapImageToSymbolTile,s as unitKebabDict,l as uvComponentToVector};
5
+ import{JSONMap as t}from"../../../core/jsonMap.js";import{isValidPixelBlock as e}from"./pixelUtils.js";import n from"../../support/PixelBlock.js";const r=new Map;r.set("meter-per-second",1),r.set("kilometer-per-hour",.277778),r.set("knots",.514444),r.set("feet-per-second",.3048),r.set("mile-per-hour",.44704);const o=180/Math.PI,i=5,s=new t({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function a(t,e){return r.get(t)/r.get(e)||1}function h(t){return(450-t)%360}function l(t,e="geographic"){const[n,r]=t,i=Math.sqrt(n*n+r*r);let s=Math.atan2(r,n)*o;return s=(360+s)%360,"geographic"===e&&(s=h(s)),[i,s]}function c(t,e="geographic"){let n=t[1];"geographic"===e&&(n=h(n)),n%=360;const r=t[0];return[r*Math.cos(n/o),r*Math.sin(n/o)]}function u(t,n,r,o="geographic"){if(!e(t)||null==r)return t;const i="vector-magdir"===n?t.clone():f(t,n),s=i.pixels[1];for(let e=0;e<s.length;e++)s[e]="geographic"===o?(s[e]+r[e]+270)%360:(s[e]+360-r[e])%360;return"vector-magdir"===n?i:f(i,"vector-magdir")}function f(t,r,o="geographic",i=1){if(!e(t))return t;const{pixels:s,width:a,height:h}=t,u=a*h,f=s[0],p=s[1],m=t.pixelType.startsWith("f")?t.pixelType:"f32",d=n.createEmptyBand(m,u),g=n.createEmptyBand(m,u);let x=0;for(let e=0;e<h;e++)for(let t=0;t<a;t++)"vector-uv"===r?([d[x],g[x]]=l([f[x],p[x]],o),d[x]*=i):([d[x],g[x]]=c([f[x],p[x]],o),d[x]*=i,g[x]*=i),x++;const M=new n({pixelType:m,width:t.width,height:t.height,mask:t.mask,validPixelCount:t.validPixelCount,maskIsAlpha:t.maskIsAlpha,pixels:[d,g]});return M.updateStatistics(),M}function p(t,n,r=1){if(1===r||!e(t))return t;const o=t.clone(),{pixels:i,width:s,height:a}=o,h=i[0],l=i[1];let c=0;for(let e=0;e<a;e++)for(let t=0;t<s;t++)"vector-uv"===n?(h[c]*=r,l[c]*=r):h[c]*=r,c++;return o.updateStatistics(),o}function m(t,e,n,r,o){if(null==o||!o.spatialReference.equals(t.spatialReference))return{extent:t,width:Math.round(e/r),height:Math.round(n/r),resolution:t.width/e};const i=o.xmin,s=o.ymax,a=(t.xmax-t.xmin)/e*r,h=(t.ymax-t.ymin)/n*r,l=(a+h)/2;return t.xmin=i+Math.floor((t.xmin-i)/a)*a,t.xmax=i+Math.ceil((t.xmax-i)/a)*a,t.ymin=s+Math.floor((t.ymin-s)/h)*h,t.ymax=s+Math.ceil((t.ymax-s)/h)*h,{extent:t,width:Math.round(t.width/a),height:Math.round(t.height/h),resolution:l}}const d=g(0,0,0);function g(t=0,e=0,n=Math.PI,r=!0){r&&(n=(2*Math.PI-n)%(2*Math.PI));const o=r?-1:1,i=13*o,s=-7*o,a=-2*o,h=-16*o,l=21.75,[c,u]=M(0,e+i,n,l),[f,p]=M(t-5.5,e+s,n,l),[m,d]=M(t+5.5,e+s,n,l),[g,x]=M(t-1.5,e+a,n,l),[k,w]=M(t+1.5,e+a,n,l),[y,P]=M(t-1.5,e+h,n,l),[b,v]=M(t+1.5,e+h,n,l);return[c,u,f,p,g,x,k,w,m,d,y,P,b,v]}function x(t=0,e=Math.PI,n=!0){n&&(e=(2*Math.PI-e)%(2*Math.PI));const r=10,o=n?-1:1,s=5*o,a=20*o,h=25*o,l=45,c=0,u=0,f=2,p=0,m=f*o,d=n?1:-1,g=r/2*d;let[x,k]=[c+g,u-a],[w,y]=[x+f*d,k],[P,b]=[w-p*d,y+m],[v,I]=[c-g,u-h],[A,_]=[v+p*d,I-m],U=Math.ceil(t/i),S=Math.floor(U/10);U-=8*S;const D=[],F=[];for(let i=0;i<U/2;i++,S--){S<=0&&U%2==1&&i===(U-1)/2&&(v=c,A=v+p*d,I=(I+k)/2,_=I-m);const[t,n]=M(v,I,e,l);if(S>0){const[r,o]=M(w,I,e,l),[i,s]=M(x,k,e,l);D.push(r),D.push(o),D.push(t),D.push(n),D.push(i),D.push(s)}else{const[r,o]=M(w,y,e,l),[i,s]=M(P,b,e,l),[a,h]=M(A,_,e,l);F.push(t),F.push(n),F.push(a),F.push(h),F.push(i),F.push(s),F.push(r),F.push(o)}I+=s,k+=s,y+=s,b+=s,_+=s}const[N,j]=M(c+g,u+a,e,l),J=(r/2+f)*d,[O,q]=M(c+J,u+a,e,l),[B,E]=M(c+g,u-h,e,l),[T,C]=M(c+J,u-h,e,l);return{pennants:D,barbs:F,shaft:[N,j,O,q,B,E,T,C]}}function M(t,e,n,r=1){const o=Math.sqrt(t*t+e*e)/r,i=(2*Math.PI+Math.atan2(e,t))%(2*Math.PI);return[o,(2*Math.PI+i-n)%(2*Math.PI)]}const k=[0,1,3,6,10,16,21,27,33,40,47,55,63],w=[0,.5,1,1.5,2],y=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function P(t,e,n,r){const o=a(r||"knots",n);let i;for(i=1;i<e.length;i++)if(i===e.length-1){if(t<e[i]*o)break}else if(t<=e[i]*o)break;return Math.min(i-1,e.length-2)}function b(t,e,n,r,o){let i=0;switch(e){case"beaufort_kn":i=P(t,k,"knots",n);break;case"beaufort_km":i=P(t,k,"kilometer-per-hour",n);break;case"beaufort_ft":i=P(t,k,"feet-per-second",n);break;case"beaufort_m":i=P(t,k,"meter-per-second",n);break;case"classified_arrow":i=P(t,o??[],r,n);break;case"ocean_current_m":i=P(t,w,"meter-per-second",n);break;case"ocean_current_kn":i=P(t,y,"knots",n)}return i}function v(t,e){const{style:n,inputUnit:r,outputUnit:o,breakValues:i}=e,a=s.fromJSON(r),h=s.fromJSON(o),l=7*6,c=15;let u=0,f=0;const{width:p,height:m,mask:x}=t,M=t.pixels[0],k=t.pixels[1],w=null!=x?x.filter(t=>t>0).length:p*m,y=new Float32Array(w*l),P=new Uint32Array(c*w),v=e.invertDirection?g(0,0,0,!1):d;for(let s=0;s<m;s++)for(let t=0;t<p;t++){const e=s*p+t;if(!x||x[s*p+t]){const r=(k[e]+360)%360/180*Math.PI,o=b(M[e],n,a,h,i);for(let n=0;n<v.length;n+=2)y[u++]=(t+.5)/p,y[u++]=(s+.5)/m,y[u++]=v[n],y[u++]=v[n+1]+r,y[u++]=o,y[u++]=M[e];const c=7*(u/l-1);P[f++]=c,P[f++]=c+1,P[f++]=c+2,P[f++]=c+0,P[f++]=c+4,P[f++]=c+3,P[f++]=c+0,P[f++]=c+2,P[f++]=c+3,P[f++]=c+2,P[f++]=c+5,P[f++]=c+3,P[f++]=c+5,P[f++]=c+6,P[f++]=c+3}}return{vertexData:y,indexData:P}}const I=[];function A(t,e){if(0===I.length)for(let i=0;i<30;i++)I.push(x(5*i,0,!e.invertDirection));const n=a(s.fromJSON(e.inputUnit),"knots"),{width:r,height:o,mask:h}=t,l=t.pixels[0],c=t.pixels[1],u=6,f=[],p=[];let m=0,d=0;for(let s=0;s<o;s++)for(let t=0;t<r;t++){const e=s*r+t,a=l[e]*n;if((!h||h[s*r+t])&&a>=i){const n=(c[e]+360)%360/180*Math.PI,{pennants:i,barbs:h,shaft:l}=I[Math.min(Math.floor(a/5),29)];if(i.length+h.length===0)continue;let g=f.length/u;const x=(t+.5)/r,M=(s+.5)/o;for(let t=0;t<i.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=i[t],f[m++]=i[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<h.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=h[t],f[m++]=h[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<l.length;t+=2)f[m++]=x,f[m++]=M,f[m++]=l[t],f[m++]=l[t+1]+n,f[m++]=0,f[m++]=a;for(let t=0;t<i.length/6;t++)p[d++]=g,p[d++]=g+1,p[d++]=g+2,g+=3;for(let t=0;t<h.length/8;t++)p[d++]=g,p[d++]=g+1,p[d++]=g+2,p[d++]=g+1,p[d++]=g+2,p[d++]=g+3,g+=4;p[d++]=g+0,p[d++]=g+1,p[d++]=g+2,p[d++]=g+1,p[d++]=g+3,p[d++]=g+2,g+=4}}return{vertexData:new Float32Array(f),indexData:new Uint32Array(p)}}function _(t,e){const n=4*6;let r=0,o=0;const{width:h,height:l,mask:c}=t,u=t.pixels[0],f=[],p=[],m=a(s.fromJSON(e.inputUnit),"knots"),d="wind_speed"===e.style?i:Number.MAX_VALUE;for(let i=0;i<l;i++)for(let t=0;t<h;t++){const e=u[i*h+t]*m;if((!c||c[i*h+t])&&e<d){for(let n=0;n<4;n++)f[r++]=(t+.5)/h,f[r++]=(i+.5)/l,f[r++]=n<2?-.5:.5,f[r++]=n%2==0?-.5:.5,f[r++]=0,f[r++]=e;const s=4*(r/n-1);p[o++]=s,p[o++]=s+1,p[o++]=s+2,p[o++]=s+1,p[o++]=s+2,p[o++]=s+3}}return{vertexData:new Float32Array(f),indexData:new Uint32Array(p)}}function U(t,e){return"simple_scalar"===e.style?_(t,e):"wind_speed"===e.style?A(t,e):v(t,e)}function S(t,e,r,o=[0,0],i=.5){const{width:s,height:a,mask:h}=t,[u,f]=t.pixels,[p,m]=o,d=Math.round((s-p)/r),g=Math.round((a-m)/r),x=d*g,M=new Float32Array(x),k=new Float32Array(x),w=new Uint8Array(x),y="vector-uv"===e;for(let n=0;n<g;n++)for(let t=0;t<d;t++){let e=0;const o=n*d+t,g=Math.max(0,n*r+m),x=Math.max(0,t*r+p),P=Math.min(a,g+r),b=Math.min(s,x+r);for(let t=g;t<P;t++)for(let n=x;n<b;n++){const r=t*s+n;if(!h||h[r]){e++;const t=y?[u[r],f[r]]:[u[r],(360+f[r])%360],[n,i]=y?t:c(t);M[o]+=n,k[o]+=i}}if(e>=(P-g)*(b-x)*(1-i)){w[o]=1;const[t,n]=l([M[o]/e,k[o]/e]);M[o]=t,k[o]=n}else w[o]=0,M[o]=0,k[o]=0}const P=new n({width:d,height:g,pixels:[M,k],mask:w});return P.updateStatistics(),P}export{u as convertToLocalDirections,f as convertVectorFieldData,p as convertVectorFieldUnit,U as createVFMeshData,_ as createVFScalarData,a as getUnitConversionFactor,S as sampleVectorField,m as snapImageToSymbolTile,s as unitKebabDict,l as uvComponentToVector};
@@ -791,10 +791,6 @@ export function colorspaceConversion(parameters: ColorspaceConversionParameters)
791
791
  * Each pixel of the output is the dot product of the conversion matrix and the raster pixel value vector.
792
792
  * See [Spectral Conversion function](https://pro.arcgis.com/en/pro-app/latest/help/analysis/raster-functions/spectral-conversion-function.htm).
793
793
  *
794
- * > [!WARNING]
795
- * >
796
- * > Note: This function is supported on server side by [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html) only.
797
- *
798
794
  * @param parameters - The parameters object has the following properties.
799
795
  * @returns Returns a RasterFunction.
800
796
  * @since 4.32
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.0.0-next.86",
3
+ "version": "5.0.0-next.87",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [
@@ -42,6 +42,23 @@ import type MeasureLengthFromImageResult from "./support/MeasureLengthFromImageR
42
42
  import type { GeometryUnion } from "../geometry/types.js";
43
43
  import type { RasterBandStatistics, RasterHistogram } from "../layers/raster/types.js";
44
44
  import type { RequestOptions } from "../request/types.js";
45
+ import type { FindImagesParametersProperties } from "./support/FindImagesParameters.js";
46
+ import type { ImageAngleParametersProperties } from "./support/ImageAngleParameters.js";
47
+ import type { ImageAreaParametersProperties } from "./support/ImageAreaParameters.js";
48
+ import type { ImageBoundaryParametersProperties } from "./support/ImageBoundaryParameters.js";
49
+ import type { ImageDistanceParametersProperties } from "./support/ImageDistanceParameters.js";
50
+ import type { ImageGPSInfoParametersProperties } from "./support/ImageGPSInfoParameters.js";
51
+ import type { ImageHeightParametersProperties } from "./support/ImageHeightParameters.js";
52
+ import type { ImageHistogramParametersProperties } from "./support/ImageHistogramParameters.js";
53
+ import type { ImageIdentifyParametersProperties } from "./support/ImageIdentifyParameters.js";
54
+ import type { ImagePixelLocationParametersProperties } from "./support/ImagePixelLocationParameters.js";
55
+ import type { ImagePointParametersProperties } from "./support/ImagePointParameters.js";
56
+ import type { ImageSampleParametersProperties } from "./support/ImageSampleParameters.js";
57
+ import type { ImageToMapMultirayParametersProperties } from "./support/ImageToMapMultirayParameters.js";
58
+ import type { ImageToMapParametersProperties } from "./support/ImageToMapParameters.js";
59
+ import type { ImageUrlParametersProperties } from "./support/ImageUrlParameters.js";
60
+ import type { MapToImageParametersProperties } from "./support/MapToImageParameters.js";
61
+ import type { MeasureFromImageParametersProperties } from "./support/MeasureFromImageParameters.js";
45
62
 
46
63
  export interface ImageServiceHistogramsResult {
47
64
  /** Result containing raster histograms. */
@@ -67,7 +84,7 @@ export interface ImageServiceStatisticsHistogramsResult {
67
84
  * @since 4.22
68
85
  * @see [ArcGIS REST API - Compute Angles](https://developers.arcgis.com/rest/services-reference/enterprise/compute-angles.htm)
69
86
  */
70
- export function computeAngles(url: string, parameters: ImageAngleParameters, requestOptions?: RequestOptions): Promise<ImageAngleResult>;
87
+ export function computeAngles(url: string, parameters: ImageAngleParameters | ImageAngleParametersProperties, requestOptions?: RequestOptions): Promise<ImageAngleResult>;
71
88
 
72
89
  /**
73
90
  * Computes the corresponding pixel location in columns and rows for an [ImageryLayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryLayer.html) based on input geometry.
@@ -81,7 +98,7 @@ export function computeAngles(url: string, parameters: ImageAngleParameters, req
81
98
  * @since 4.22
82
99
  * @see [ArcGIS REST API - Compute Pixel Location](https://developers.arcgis.com/rest/services-reference/enterprise/compute-pixel-location.htm)
83
100
  */
84
- export function computePixelSpaceLocations(url: string, parameters: ImagePixelLocationParameters, requestOptions?: RequestOptions): Promise<ImagePixelLocationResult>;
101
+ export function computePixelSpaceLocations(url: string, parameters: ImagePixelLocationParameters | ImagePixelLocationParametersProperties, requestOptions?: RequestOptions): Promise<ImagePixelLocationResult>;
85
102
 
86
103
  /**
87
104
  * Computes [statistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-raster-types.html#RasterBandStatistics) and [histograms](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-raster-types.html#RasterHistogram)
@@ -102,7 +119,7 @@ export function computePixelSpaceLocations(url: string, parameters: ImagePixelLo
102
119
  * histograms[] | [RasterHistogram](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-raster-types.html#RasterHistogram) | Result containing raster histograms.
103
120
  * bandStatistics[] | [RasterBandStatistics](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-raster-types.html#RasterBandStatistics) | Raster band statistics.
104
121
  */
105
- export function computeStatisticsHistograms(url: string, parameters: ImageHistogramParameters, requestOptions?: RequestOptions): Promise<ImageServiceStatisticsHistogramsResult>;
122
+ export function computeStatisticsHistograms(url: string, parameters: ImageHistogramParameters | ImageHistogramParametersProperties, requestOptions?: RequestOptions): Promise<ImageServiceStatisticsHistogramsResult>;
106
123
 
107
124
  /**
108
125
  * Computes histograms based on the provided [ImageHistogramParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ImageHistogramParameters.html).
@@ -115,7 +132,7 @@ export function computeStatisticsHistograms(url: string, parameters: ImageHistog
115
132
  * @param parameters - Specifies parameters for computing histograms.
116
133
  * @param requestOptions - Additional [options](https://developers.arcgis.com/javascript/latest/api-reference/esri-request.html#request) to be used for the data request.
117
134
  */
118
- export function computeHistograms(url: string, parameters: ImageHistogramParameters, requestOptions?: RequestOptions): Promise<ImageServiceHistogramsResult>;
135
+ export function computeHistograms(url: string, parameters: ImageHistogramParameters | ImageHistogramParametersProperties, requestOptions?: RequestOptions): Promise<ImageServiceHistogramsResult>;
119
136
 
120
137
  /**
121
138
  * Returns sample point locations, pixel values and corresponding resolutions of the source data for a given geometry. When the input geometry
@@ -159,7 +176,7 @@ export function computeHistograms(url: string, parameters: ImageHistogramParamet
159
176
  * console.log(error)
160
177
  * })
161
178
  */
162
- export function getSamples(url: string, parameters: ImageSampleParameters, requestOptions?: RequestOptions): Promise<ImageSampleResult>;
179
+ export function getSamples(url: string, parameters: ImageSampleParameters | ImageSampleParametersProperties, requestOptions?: RequestOptions): Promise<ImageSampleResult>;
163
180
 
164
181
  /**
165
182
  * Sends a request to the ArcGIS REST image service resource to identify content based on the
@@ -172,7 +189,7 @@ export function getSamples(url: string, parameters: ImageSampleParameters, reque
172
189
  * @returns When resolved, returns an instance of
173
190
  * [ImageIdentifyResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ImageIdentifyResult.html).
174
191
  */
175
- export function identify(url: string, parameters: ImageIdentifyParameters, requestOptions?: RequestOptions): Promise<ImageIdentifyResult>;
192
+ export function identify(url: string, parameters: ImageIdentifyParameters | ImageIdentifyParametersProperties, requestOptions?: RequestOptions): Promise<ImageIdentifyResult>;
176
193
 
177
194
  /**
178
195
  * Calculates the height of an object between two points on an image service. The result of this operation includes the name of the raster dataset being used,
@@ -186,7 +203,7 @@ export function identify(url: string, parameters: ImageIdentifyParameters, reque
186
203
  * containing the name of the raster dataset being used, the sensor name, and measured values.
187
204
  * @since 4.26
188
205
  */
189
- export function measureHeight(url: string, parameters: ImageHeightParameters, requestOptions?: RequestOptions): Promise<ImageHeightResult>;
206
+ export function measureHeight(url: string, parameters: ImageHeightParameters | ImageHeightParametersProperties, requestOptions?: RequestOptions): Promise<ImageHeightResult>;
190
207
 
191
208
  /**
192
209
  * Calculates the area and perimeter of a given geometry on an image service. The result of this operation includes the name of the raster dataset being used,
@@ -199,7 +216,7 @@ export function measureHeight(url: string, parameters: ImageHeightParameters, re
199
216
  * containing the name of the raster dataset being used, the sensor name, and measured values.
200
217
  * @since 4.26
201
218
  */
202
- export function measureAreaAndPerimeter(url: string, parameters: ImageAreaParameters, requestOptions?: RequestOptions): Promise<ImageAreaResult>;
219
+ export function measureAreaAndPerimeter(url: string, parameters: ImageAreaParameters | ImageAreaParametersProperties, requestOptions?: RequestOptions): Promise<ImageAreaResult>;
203
220
 
204
221
  /**
205
222
  * Returns the location for a given point or centroid of a given area on an image service.
@@ -212,7 +229,7 @@ export function measureAreaAndPerimeter(url: string, parameters: ImageAreaParame
212
229
  * containing the name of the raster dataset being used, the sensor name, and measured values.
213
230
  * @since 4.26
214
231
  */
215
- export function measurePointOrCentroid(url: string, parameters: ImagePointParameters, requestOptions?: RequestOptions): Promise<ImagePointResult>;
232
+ export function measurePointOrCentroid(url: string, parameters: ImagePointParameters | ImagePointParametersProperties, requestOptions?: RequestOptions): Promise<ImagePointResult>;
216
233
 
217
234
  /**
218
235
  * Calculates the distance and angle between two points on an image service. The result of this operation includes the name of the raster dataset being used,
@@ -225,7 +242,7 @@ export function measurePointOrCentroid(url: string, parameters: ImagePointParame
225
242
  * containing the name of the raster dataset being used, the sensor name, and measured values.
226
243
  * @since 4.26
227
244
  */
228
- export function measureDistanceAndAngle(url: string, parameters: ImageDistanceParameters, requestOptions?: RequestOptions): Promise<ImageDistanceResult>;
245
+ export function measureDistanceAndAngle(url: string, parameters: ImageDistanceParameters | ImageDistanceParametersProperties, requestOptions?: RequestOptions): Promise<ImageDistanceResult>;
229
246
 
230
247
  /**
231
248
  * Measures the length of a polyline in an image space on a selected raster when the following conditions are met:
@@ -240,7 +257,7 @@ export function measureDistanceAndAngle(url: string, parameters: ImageDistancePa
240
257
  * containing the name of the polyline's shape in map space and its length.
241
258
  * @since 4.29
242
259
  */
243
- export function measureLengthFromImage(url: string, parameters: MeasureFromImageParameters, requestOptions?: RequestOptions): Promise<MeasureLengthFromImageResult>;
260
+ export function measureLengthFromImage(url: string, parameters: MeasureFromImageParameters | MeasureFromImageParametersProperties, requestOptions?: RequestOptions): Promise<MeasureLengthFromImageResult>;
244
261
 
245
262
  /**
246
263
  * Measures the area and the perimeter of a polygon in an image space on a selected raster when the following conditions are met:
@@ -255,7 +272,7 @@ export function measureLengthFromImage(url: string, parameters: MeasureFromImage
255
272
  * containing the name of the polygon's shape in map space and its length, area, and center.
256
273
  * @since 4.29
257
274
  */
258
- export function measureAreaFromImage(url: string, parameters: MeasureFromImageParameters, requestOptions?: RequestOptions): Promise<MeasureAreaFromImageResult>;
275
+ export function measureAreaFromImage(url: string, parameters: MeasureFromImageParameters | MeasureFromImageParametersProperties, requestOptions?: RequestOptions): Promise<MeasureAreaFromImageResult>;
259
276
 
260
277
  /**
261
278
  * Returns the boundary of an image for the provided [ImageBoundaryParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ImageBoundaryParameters.html).
@@ -268,7 +285,7 @@ export function measureAreaFromImage(url: string, parameters: MeasureFromImagePa
268
285
  * @returns Resolves to an object containing boundary geometry of the image service.
269
286
  * @since 4.29
270
287
  */
271
- export function queryBoundary(url: string, parameters: ImageBoundaryParameters, requestOptions?: RequestOptions): Promise<ImageBoundaryResult>;
288
+ export function queryBoundary(url: string, parameters: ImageBoundaryParameters | ImageBoundaryParametersProperties, requestOptions?: RequestOptions): Promise<ImageBoundaryResult>;
272
289
 
273
290
  /**
274
291
  * Returns GPS information for the provided [ImageGPSInfoParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ImageGPSInfoParameters.html).
@@ -284,7 +301,7 @@ export function queryBoundary(url: string, parameters: ImageBoundaryParameters,
284
301
  * @returns Resolves to an object containing information about images and cameras.
285
302
  * @since 4.29
286
303
  */
287
- export function queryGPSInfo(url: string, parameters: ImageGPSInfoParameters, requestOptions?: RequestOptions): Promise<ImageGPSInfoResult>;
304
+ export function queryGPSInfo(url: string, parameters: ImageGPSInfoParameters | ImageGPSInfoParametersProperties, requestOptions?: RequestOptions): Promise<ImageGPSInfoResult>;
288
305
 
289
306
  /**
290
307
  * Convert a geometry from an image space to a map space using the provided [ImageToMapParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ImageToMapParameters.html).
@@ -297,7 +314,7 @@ export function queryGPSInfo(url: string, parameters: ImageGPSInfoParameters, re
297
314
  * @returns Resolves to a geometry object.
298
315
  * @since 4.29
299
316
  */
300
- export function imageToMap(url: string, parameters: ImageToMapParameters, requestOptions?: RequestOptions): Promise<GeometryUnion>;
317
+ export function imageToMap(url: string, parameters: ImageToMapParameters | ImageToMapParametersProperties, requestOptions?: RequestOptions): Promise<GeometryUnion>;
301
318
 
302
319
  /**
303
320
  * Creates a map space geometry from multiray image space geometries using the provided [ImageToMapMultirayParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ImageToMapMultirayParameters.html).
@@ -314,7 +331,7 @@ export function imageToMap(url: string, parameters: ImageToMapParameters, reques
314
331
  * @returns Resolves to a geometry object where the coordinates in map coordinates.
315
332
  * @since 4.29
316
333
  */
317
- export function imageToMapMultiray(url: string, parameters: ImageToMapMultirayParameters, requestOptions?: RequestOptions): Promise<GeometryUnion>;
334
+ export function imageToMapMultiray(url: string, parameters: ImageToMapMultirayParameters | ImageToMapMultirayParametersProperties, requestOptions?: RequestOptions): Promise<GeometryUnion>;
318
335
 
319
336
  /**
320
337
  * Converts a given geometry from a map space to an image space using the provided [MapToImageParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-MapToImageParameters.html).
@@ -326,7 +343,7 @@ export function imageToMapMultiray(url: string, parameters: ImageToMapMultirayPa
326
343
  * @returns Resolves to a geometry object where the coordinates are in image space.
327
344
  * @since 4.29
328
345
  */
329
- export function mapToImage(url: string, parameters: MapToImageParameters, requestOptions?: RequestOptions): Promise<GeometryUnion>;
346
+ export function mapToImage(url: string, parameters: MapToImageParameters | MapToImageParametersProperties, requestOptions?: RequestOptions): Promise<GeometryUnion>;
330
347
 
331
348
  /**
332
349
  * Retrieves an image's url using the provided [ImageUrlParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ImageUrlParameters.html).
@@ -338,7 +355,7 @@ export function mapToImage(url: string, parameters: MapToImageParameters, reques
338
355
  * @returns Resolves to a [ImageUrlResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-ImageUrlResult.html) containing the image's url.
339
356
  * @since 4.30
340
357
  */
341
- export function getImageUrl(url: string, parameters: ImageUrlParameters, requestOptions?: RequestOptions): Promise<ImageUrlResult>;
358
+ export function getImageUrl(url: string, parameters: ImageUrlParameters | ImageUrlParametersProperties, requestOptions?: RequestOptions): Promise<ImageUrlResult>;
342
359
 
343
360
  /**
344
361
  * Finds images based on the provided [FindImagesParameters](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FindImagesParameters.html).
@@ -355,4 +372,4 @@ export function getImageUrl(url: string, parameters: ImageUrlParameters, request
355
372
  * @returns Resolves to a [FindImagesResult](https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-FindImagesResult.html) containing images that met the search requirements.
356
373
  * @since 4.29
357
374
  */
358
- export function findImages(url: string, parameters: FindImagesParameters, requestOptions?: RequestOptions): Promise<FindImagesResult>;
375
+ export function findImages(url: string, parameters: FindImagesParameters | FindImagesParametersProperties, requestOptions?: RequestOptions): Promise<FindImagesResult>;
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import t from"../request.js";import{ensureClass as e}from"../core/accessorSupport/ensureType.js";import r from"../geometry/SpatialReference.js";import{fromJSON as o}from"../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as a}from"../geometry/support/normalizeUtils.js";import{srToRESTValue as s}from"../geometry/support/spatialReferenceUtils.js";import{parseUrl as n,encode as m,asValidOptions as i}from"./utils.js";import p from"./support/FindImagesParameters.js";import u from"./support/FindImagesResult.js";import c from"./support/ImageAngleParameters.js";import f from"./support/ImageAngleResult.js";import l from"./support/ImageAreaParameters.js";import g from"./support/ImageAreaResult.js";import y from"./support/ImageBoundaryParameters.js";import j from"./support/ImageBoundaryResult.js";import d from"./support/ImageDistanceParameters.js";import S from"./support/ImageDistanceResult.js";import I from"./support/ImageGPSInfoParameters.js";import N from"./support/ImageGPSInfoResult.js";import R from"./support/ImageHeightParameters.js";import h from"./support/ImageHeightResult.js";import O from"./support/ImageHistogramParameters.js";import J from"./support/ImageIdentifyParameters.js";import w from"./support/ImageIdentifyResult.js";import P from"./support/ImagePixelLocationParameters.js";import q from"./support/ImagePixelLocationResult.js";import G from"./support/ImagePointParameters.js";import $ from"./support/ImagePointResult.js";import C from"./support/ImageSampleParameters.js";import M from"./support/ImageSampleResult.js";import b from"./support/ImageToMapMultirayParameters.js";import v from"./support/ImageToMapParameters.js";import F from"./support/ImageUrlParameters.js";import T from"./support/ImageUrlResult.js";import A from"./support/ImageVolumeParameters.js";import L from"./support/ImageVolumeResult.js";import U from"./support/MapToImageParameters.js";import x from"./support/MeasureAreaFromImageResult.js";import H from"./support/MeasureFromImageParameters.js";import V from"./support/MeasureLengthFromImageResult.js";function B(t){const e=t?.time;if(e&&(null!=e.start||null!=e.end)){const r=[];null!=e.start&&r.push(e.start),null==e.end||r.includes(e.end)||r.push(e.end),t.time=r.join(",")}}async function D(t,r,o){r=e(O,r);const s=n(t),p=r.geometry?[r.geometry]:[],u=await a(p),c=r.toJSON();B(c);const f=u?.[0];null!=f&&(c.geometry=st(f));const l=m({...s.query,f:"json",...c});return i(l,o)}async function k(r,o,a){const s=(o=e(A,o)).toJSON();s.geometries=JSON.stringify(s.geometries);const p=n(r),u=m({...p.query,f:"json",...s}),c=i(u,a),{data:f}=await t(`${p.path}/calculateVolume`,c);return L.fromJSON({volumes:f.results})}async function z(o,a,s){const p=e(c,a),u=p.toJSON();null!=u.angleName&&(u.angleName=u.angleName.join(",")),p?.point?.spatialReference?.imageCoordinateSystem&&(u.point.spatialReference=nt(p.point.spatialReference)),p?.spatialReference?.imageCoordinateSystem&&(u.spatialReference=mt(p.spatialReference));const l=n(o),g=m({...l.query,f:"json",...u}),y=i(g,s),{data:j}=await t(`${l.path}/computeAngles`,y);return j.spatialReference=j.spatialReference?null!=j.spatialReference.geodataXform?new r({wkid:0,imageCoordinateSystem:j.spatialReference}):r.fromJSON(j.spatialReference):null,"NaN"===j.north&&(j.north=null),"NaN"===j.up&&(j.up=null),new f(j)}async function E(r,o,a){const s=(o=e(P,o)).toJSON(),{geometries:p}=o;if(p)for(let t=0;t<p.length;t++)p[t].spatialReference?.imageCoordinateSystem&&(s.geometries.geometries[t].spatialReference=nt(p[t].spatialReference));const u=n(r),c=m({...u.query,f:"json",...s}),f=i(c,a),{data:l}=await t(`${u.path}/computePixelLocation`,f);return q.fromJSON(l)}async function X(e,r,o){const a=await D(e,r,o),s=n(e),{data:m}=await t(`${s.path}/computeStatisticsHistograms`,a),{statistics:i}=m;return i?.length&&i.forEach(t=>{t.avg=t.mean,t.stddev=t.standardDeviation}),{statistics:i,histograms:m.histograms}}async function K(e,r,o){const a=await D(e,r,o),s=n(e),{data:m}=await t(`${s.path}/computeHistograms`,a);return{histograms:m.histograms}}async function Q(r,o,s){const p=(o=e(C,o)).toJSON();B(p),p.outFields?.length&&(p.outFields=p.outFields.join(","));const u=await a(o.geometry),c=u?.[0];null!=c&&(p.geometry=st(c));const f=n(r),l=m({...f.query,f:"json",...p}),g=i(l,s),{data:y}=await t(`${f.path}/getSamples`,g),j=y.samples.map(t=>{const e="NaN"===t.value||""===t.value?null:t.value.split(" ").map(t=>Number(t));return{...t,pixelValue:e}});return M.fromJSON({samples:j})}async function W(r,o,s){o=e(J,o);const p=n(r),u=o.geometry?[o.geometry]:[];return a(u).then(e=>{const r=o.toJSON(),a=e?.[0];null!=a&&(r.geometry=JSON.stringify(st(a)));const n=m({...p.query,f:"json",...r}),u=i(n,s);return t(p.path+"/identify",u)}).then(t=>w.fromJSON(t.data))}async function Y(t,r,o){const a=e(R,r),s=await et(t,a,[a.fromGeometry,a.toGeometry],o);return h.fromJSON(s)}async function Z(t,r,o){const a=e(l,r),s=await et(t,a,[a.geometry],o);return g.fromJSON(s)}async function _(t,r,o){const a=e(G,r),s=await et(t,a,[a.geometry],o);return $.fromJSON(s)}async function tt(t,r,o){const a=e(d,r),s=await et(t,a,[a.fromGeometry,a.toGeometry],o);return S.fromJSON(s)}async function et(e,r,o,s){const p=n(e),u=await a(o),c=r.toJSON();null!=u[0]&&(c.fromGeometry=JSON.stringify(st(u[0]))),null!=u[1]&&(c.toGeometry=JSON.stringify(st(u[1])));const f=m({...p.query,f:"json",...c}),l=i(f,s),{data:g}=await t(p.path+"/measure",l);return g}async function rt(t,e,r){const o=await at(t,e,r);return V.fromJSON(o)}async function ot(t,e,r){const o=await at(t,e,r);return x.fromJSON(o)}async function at(r,o,a){o=e(H,o);const s=n(r),p=o.toJSON(),u=m({...s.query,f:"json",...p}),c=i(u,a),{data:f}=await t(s.path+"/measureFromImage",c);return f}function st(t){const e=t.toJSON();return t.spatialReference?.imageCoordinateSystem&&(e.spatialReference=nt(t.spatialReference)),e}function nt(t){const{imageCoordinateSystem:e}=t;if(e){const{id:t,referenceServiceName:r}=e;return null!=t?r?{icsid:t,icsns:r}:{icsid:t}:{ics:e}}return t.toJSON()}function mt(t,e){if(!t.imageCoordinateSystem)return s(t);const r=nt(t),{icsid:o,icsns:a}=r;return null==o||null!=a&&!e?.toLowerCase().includes("/"+a.toLowerCase()+"/")?JSON.stringify(r):`0:${o}`}async function it(r,o,a){o=e(y,o);const s=n(r),p=o.toJSON();o.outSpatialReference&&(p.outSR=mt(o.outSpatialReference));const u=m({...s.query,f:"json",...p}),c=i(u,a),{data:f}=await t(s.path+"/queryBoundary",c);return j.fromJSON(f)}async function pt(r,o,s){const p=(o=e(I,o)).toJSON();B(p),p.objectIds?.length&&(p.objectIds=p.objectIds.join(",")),p.geometry||p.objectIds||p.time||p.where||(p.where="1=1");const u=await a(o.geometry),c=u?.[0];null!=c&&(p.geometry=st(c));const f=c?.spatialReference??o.geometry?.spatialReference;f&&(p.inSR=mt(f));const l=n(r),g=m({...l.query,f:"json",...p}),y=i(g,s),{data:j}=await t(`${l.path}/queryGPSInfo`,y);return N.fromJSON(j)}async function ut(r,a,s){const p=(a=e(v,a)).toJSON();a.geometry.spatialReference.imageCoordinateSystem&&(p.geometry=st(a.geometry)),a.depthOffset&&a.adjust||delete p.options;const u=n(r),c=m({...u.query,f:"json",...p}),f=i(c,s),{data:l}=await t(`${u.path}/imageToMap`,f);return o(l)}async function ct(r,a,s){const p=(a=e(b,a)).toJSON();a.rasterIds?.length&&(p.rasterIds=a.rasterIds.join(","));const u=n(r),c=m({...u.query,f:"json",...p}),f=i(c,s),{data:l}=await t(`${u.path}/imageToMapMultiray`,f);return o(l)}async function ft(r,s,p){const u=(s=e(U,s)).toJSON(),c=await a(s.geometry),f=c?.[0];null!=f&&(u.geometry=st(f)),s.visibleOnly||delete u.options;const l=f?.spatialReference??s.geometry?.spatialReference;l&&(u.inSR=mt(l));const g=n(r),y=m({...g.query,f:"json",...u}),j=i(y,p),{data:d}=await t(`${g.path}/mapToImage`,j);return o(d)}async function lt(r,o,a){const s=(o=e(F,o)).toJSON(),p=n(r),u=m({...p.query,f:"json",...s}),c=i(u,a),{data:f}=await t(`${p.path}/getImageUrl`,c);return T.fromJSON(f)}async function gt(r,o,s){const c=(o=e(p,o)).toJSON(),f=await a([o.fromGeometry,o.toGeometry]);null!=f[0]&&(c.fromGeometry=st(f[0]),f[0].spatialReference&&(c.inSR=mt(f[0].spatialReference))),null!=f[1]&&(c.toGeometry=st(f[1])),o.objectIds?.length&&(c.objectIds=c.objectIds.join(","));const l=n(r),g=m({...l.query,f:"json",...c}),y=i(g,s),{data:j}=await t(`${l.path}/find`,y);return u.fromJSON(j)}export{k as calculateVolume,z as computeAngles,K as computeHistograms,E as computePixelSpaceLocations,X as computeStatisticsHistograms,gt as findImages,nt as getImageSpatialReferenceJSON,mt as getImageSpatialReferenceQueryParameter,lt as getImageUrl,Q as getSamples,W as identify,ut as imageToMap,ct as imageToMapMultiray,ft as mapToImage,Z as measureAreaAndPerimeter,ot as measureAreaFromImage,tt as measureDistanceAndAngle,Y as measureHeight,rt as measureLengthFromImage,_ as measurePointOrCentroid,it as queryBoundary,pt as queryGPSInfo};
5
+ import t from"../request.js";import{ensureClass as e}from"../core/accessorSupport/ensureType.js";import r from"../geometry/SpatialReference.js";import{fromJSON as o}from"../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as a}from"../geometry/support/normalizeUtils.js";import{srToRESTValue as s}from"../geometry/support/spatialReferenceUtils.js";import{parseUrl as n,encode as m,asValidOptions as i}from"./utils.js";import p from"./support/FindImagesParameters.js";import u from"./support/FindImagesResult.js";import c from"./support/ImageAngleParameters.js";import f from"./support/ImageAngleResult.js";import l from"./support/ImageAreaParameters.js";import g from"./support/ImageAreaResult.js";import y from"./support/ImageBoundaryParameters.js";import j from"./support/ImageBoundaryResult.js";import d from"./support/ImageDistanceParameters.js";import S from"./support/ImageDistanceResult.js";import I from"./support/ImageGPSInfoParameters.js";import N from"./support/ImageGPSInfoResult.js";import R from"./support/ImageHeightParameters.js";import h from"./support/ImageHeightResult.js";import O from"./support/ImageHistogramParameters.js";import J from"./support/ImageIdentifyParameters.js";import w from"./support/ImageIdentifyResult.js";import P from"./support/ImagePixelLocationParameters.js";import q from"./support/ImagePixelLocationResult.js";import G from"./support/ImagePointParameters.js";import $ from"./support/ImagePointResult.js";import C from"./support/ImageSampleParameters.js";import M from"./support/ImageSampleResult.js";import b from"./support/ImageToMapMultirayParameters.js";import v from"./support/ImageToMapParameters.js";import F from"./support/ImageUrlParameters.js";import T from"./support/ImageUrlResult.js";import A from"./support/ImageVolumeParameters.js";import L from"./support/ImageVolumeResult.js";import U from"./support/MapToImageParameters.js";import x from"./support/MeasureAreaFromImageResult.js";import H from"./support/MeasureFromImageParameters.js";import V from"./support/MeasureLengthFromImageResult.js";function B(t){const e=t?.time;if(e&&(null!=e.start||null!=e.end)){const r=[];null!=e.start&&r.push(e.start),null==e.end||r.includes(e.end)||r.push(e.end),t.time=r.join(",")}}async function D(t,r,o){const s=e(O,r),p=n(t),u=s.geometry?[s.geometry]:[],c=await a(u),f=s.toJSON();B(f);const l=c?.[0];null!=l&&(f.geometry=st(l));const g=m({...p.query,f:"json",...f});return i(g,o)}async function k(r,o,a){const s=e(A,o).toJSON();s.geometries=JSON.stringify(s.geometries);const p=n(r),u=m({...p.query,f:"json",...s}),c=i(u,a),{data:f}=await t(`${p.path}/calculateVolume`,c);return L.fromJSON({volumes:f.results})}async function z(o,a,s){const p=e(c,a),u=p.toJSON();null!=u.angleName&&(u.angleName=u.angleName.join(",")),p?.point?.spatialReference?.imageCoordinateSystem&&(u.point.spatialReference=nt(p.point.spatialReference)),p?.spatialReference?.imageCoordinateSystem&&(u.spatialReference=mt(p.spatialReference));const l=n(o),g=m({...l.query,f:"json",...u}),y=i(g,s),{data:j}=await t(`${l.path}/computeAngles`,y);return j.spatialReference=j.spatialReference?null!=j.spatialReference.geodataXform?new r({wkid:0,imageCoordinateSystem:j.spatialReference}):r.fromJSON(j.spatialReference):null,"NaN"===j.north&&(j.north=null),"NaN"===j.up&&(j.up=null),new f(j)}async function E(r,o,a){const s=e(P,o),p=s.toJSON(),{geometries:u}=s;if(u)for(let t=0;t<u.length;t++)u[t].spatialReference?.imageCoordinateSystem&&(p.geometries.geometries[t].spatialReference=nt(u[t].spatialReference));const c=n(r),f=m({...c.query,f:"json",...p}),l=i(f,a),{data:g}=await t(`${c.path}/computePixelLocation`,l);return q.fromJSON(g)}async function X(e,r,o){const a=await D(e,r,o),s=n(e),{data:m}=await t(`${s.path}/computeStatisticsHistograms`,a),{statistics:i}=m;return i?.length&&i.forEach(t=>{t.avg=t.mean,t.stddev=t.standardDeviation}),{statistics:i,histograms:m.histograms}}async function K(e,r,o){const a=await D(e,r,o),s=n(e),{data:m}=await t(`${s.path}/computeHistograms`,a);return{histograms:m.histograms}}async function Q(r,o,s){const p=e(C,o),u=p.toJSON();B(u),u.outFields?.length&&(u.outFields=u.outFields.join(","));const c=await a(p.geometry),f=c?.[0];null!=f&&(u.geometry=st(f));const l=n(r),g=m({...l.query,f:"json",...u}),y=i(g,s),{data:j}=await t(`${l.path}/getSamples`,y),d=j.samples.map(t=>{const e="NaN"===t.value||""===t.value?null:t.value.split(" ").map(t=>Number(t));return{...t,pixelValue:e}});return M.fromJSON({samples:d})}async function W(r,o,s){const p=e(J,o),u=n(r),c=p.geometry?[p.geometry]:[];return a(c).then(e=>{const r=p.toJSON(),o=e?.[0];null!=o&&(r.geometry=JSON.stringify(st(o)));const a=m({...u.query,f:"json",...r}),n=i(a,s);return t(u.path+"/identify",n)}).then(t=>w.fromJSON(t.data))}async function Y(t,r,o){const a=e(R,r),s=await et(t,a,[a.fromGeometry,a.toGeometry],o);return h.fromJSON(s)}async function Z(t,r,o){const a=e(l,r),s=await et(t,a,[a.geometry],o);return g.fromJSON(s)}async function _(t,r,o){const a=e(G,r),s=await et(t,a,[a.geometry],o);return $.fromJSON(s)}async function tt(t,r,o){const a=e(d,r),s=await et(t,a,[a.fromGeometry,a.toGeometry],o);return S.fromJSON(s)}async function et(e,r,o,s){const p=n(e),u=await a(o),c=r.toJSON();null!=u[0]&&(c.fromGeometry=JSON.stringify(st(u[0]))),null!=u[1]&&(c.toGeometry=JSON.stringify(st(u[1])));const f=m({...p.query,f:"json",...c}),l=i(f,s),{data:g}=await t(p.path+"/measure",l);return g}async function rt(t,r,o){const a=e(H,r),s=await at(t,a,o);return V.fromJSON(s)}async function ot(t,r,o){const a=e(H,r),s=await at(t,a,o);return x.fromJSON(s)}async function at(r,o,a){o=e(H,o);const s=n(r),p=o.toJSON(),u=m({...s.query,f:"json",...p}),c=i(u,a),{data:f}=await t(s.path+"/measureFromImage",c);return f}function st(t){const e=t.toJSON();return t.spatialReference?.imageCoordinateSystem&&(e.spatialReference=nt(t.spatialReference)),e}function nt(t){const{imageCoordinateSystem:e}=t;if(e){const{id:t,referenceServiceName:r}=e;return null!=t?r?{icsid:t,icsns:r}:{icsid:t}:{ics:e}}return t.toJSON()}function mt(t,e){if(!t.imageCoordinateSystem)return s(t);const r=nt(t),{icsid:o,icsns:a}=r;return null==o||null!=a&&!e?.toLowerCase().includes("/"+a.toLowerCase()+"/")?JSON.stringify(r):`0:${o}`}async function it(r,o,a){const s=e(y,o),p=n(r),u=s.toJSON();s.outSpatialReference&&(u.outSR=mt(s.outSpatialReference));const c=m({...p.query,f:"json",...u}),f=i(c,a),{data:l}=await t(p.path+"/queryBoundary",f);return j.fromJSON(l)}async function pt(r,o,s){const p=e(I,o),u=p.toJSON();B(u),u.objectIds?.length&&(u.objectIds=u.objectIds.join(",")),u.geometry||u.objectIds||u.time||u.where||(u.where="1=1");const c=await a(p.geometry),f=c?.[0];null!=f&&(u.geometry=st(f));const l=f?.spatialReference??p.geometry?.spatialReference;l&&(u.inSR=mt(l));const g=n(r),y=m({...g.query,f:"json",...u}),j=i(y,s),{data:d}=await t(`${g.path}/queryGPSInfo`,j);return N.fromJSON(d)}async function ut(r,a,s){const p=e(v,a),u=p.toJSON();p.geometry.spatialReference.imageCoordinateSystem&&(u.geometry=st(p.geometry)),p.depthOffset&&p.adjust||delete u.options;const c=n(r),f=m({...c.query,f:"json",...u}),l=i(f,s),{data:g}=await t(`${c.path}/imageToMap`,l);return o(g)}async function ct(r,a,s){const p=e(b,a),u=p.toJSON();p.rasterIds?.length&&(u.rasterIds=p.rasterIds.join(","));const c=n(r),f=m({...c.query,f:"json",...u}),l=i(f,s),{data:g}=await t(`${c.path}/imageToMapMultiray`,l);return o(g)}async function ft(r,s,p){const u=e(U,s),c=u.toJSON(),f=await a(u.geometry),l=f?.[0];null!=l&&(c.geometry=st(l)),u.visibleOnly||delete c.options;const g=l?.spatialReference??u.geometry?.spatialReference;g&&(c.inSR=mt(g));const y=n(r),j=m({...y.query,f:"json",...c}),d=i(j,p),{data:S}=await t(`${y.path}/mapToImage`,d);return o(S)}async function lt(r,o,a){const s=e(F,o).toJSON(),p=n(r),u=m({...p.query,f:"json",...s}),c=i(u,a),{data:f}=await t(`${p.path}/getImageUrl`,c);return T.fromJSON(f)}async function gt(r,o,s){const c=e(p,o),f=c.toJSON(),l=await a([c.fromGeometry,c.toGeometry]);null!=l[0]&&(f.fromGeometry=st(l[0]),l[0].spatialReference&&(f.inSR=mt(l[0].spatialReference))),null!=l[1]&&(f.toGeometry=st(l[1])),c.objectIds?.length&&(f.objectIds=f.objectIds.join(","));const g=n(r),y=m({...g.query,f:"json",...f}),j=i(y,s),{data:d}=await t(`${g.path}/find`,j);return u.fromJSON(d)}export{k as calculateVolume,z as computeAngles,K as computeHistograms,E as computePixelSpaceLocations,X as computeStatisticsHistograms,gt as findImages,nt as getImageSpatialReferenceJSON,mt as getImageSpatialReferenceQueryParameter,lt as getImageUrl,Q as getSamples,W as identify,ut as imageToMap,ct as imageToMapMultiray,ft as mapToImage,Z as measureAreaAndPerimeter,ot as measureAreaFromImage,tt as measureDistanceAndAngle,Y as measureHeight,rt as measureLengthFromImage,_ as measurePointOrCentroid,it as queryBoundary,pt as queryGPSInfo};
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../../../core/accessorSupport/decorators.js";import r from"../../../../geometry/Point.js";import{estimateStatisticsFromHistograms as a}from"../../../../layers/raster/functions/stretchUtils.js";import i from"../../../../rest/support/ImageHistogramParameters.js";import o from"./RasterLayerAdapter.js";let n=class extends o{generateRasterInfo(t){const e=t?.rasterFunction;try{return this.layer.generateRasterInfo(e,{signal:t?.signal})}catch{return Promise.resolve(this.layer.serviceRasterInfo)}}async estimateStatisticsHistograms(t){const{layer:e}=this,s=e.mosaicRule?.multidimensionalDefinition?.[0]?.variableName??"",o=`${t?.rasterFunction?.functionName??"default"}${s}`,n=this._statsCache.get(o);if(n)return n;let{width:l,height:c,pixelSize:m}=e.rasterInfo,p=1;for(;l>2e3||c>2e3;)l/=2,c/=2,p*=2;const u=t?.rasterFunction??e.rasterFunction,{fullExtent:g,mosaicRule:h}=e;m=new r(m.x*p,m.y*p,g.spatialReference);const f=new i({geometry:g,pixelSize:m,renderingRule:u,mosaicRule:h});let d;if(e.capabilities.operations.supportsComputeStatisticsHistograms)d=await e.computeStatisticsHistograms(f,t);else{const{histograms:s}=await e.computeHistograms(f,t);d={statistics:a(s),histograms:s}}return d&&this._statsCache.put(o,d),d}supportsMultidirectionalHillshade(){return this.layer.version>=10.81}load(t){return this.addResolvingPromise(this.layer.load(t).then(async()=>{const e=t?.signal;this.rasterInfo=await this.generateRasterInfo({rasterFunction:this.rasterFunction,signal:e})})),Promise.resolve(this)}};t([e()],n.prototype,"layer",void 0),n=t([s("esri.smartMapping.raster.support.adapters.ImageryLayerAdapter")],n);const l=n;export{l as default};
5
+ import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../../../core/accessorSupport/decorators.js";import r from"../../../../geometry/Point.js";import{estimateStatisticsFromHistograms as a}from"../../../../layers/raster/functions/stretchUtils.js";import i from"../../../../rest/support/ImageHistogramParameters.js";import o from"./RasterLayerAdapter.js";let n=class extends o{generateRasterInfo(t){const e=t?.rasterFunction;try{return this.layer.generateRasterInfo(e,{signal:t?.signal})}catch{return Promise.resolve(this.layer.serviceRasterInfo)}}async estimateStatisticsHistograms(t){const{layer:e}=this,s=e.mosaicRule?.multidimensionalDefinition?.[0]?.variableName??"",o=`${t?.rasterFunction?.functionName??"default"}${s}`,n=this._statsCache.get(o);if(n)return n;let{width:l,height:c,pixelSize:m}=e.rasterInfo,p=1;for(;l>2e3||c>2e3;)l/=2,c/=2,p*=2;const u=t?.rasterFunction??e.rasterFunction,{fullExtent:h,mosaicRule:f}=e,g=new r(m.x*p,m.y*p,h.spatialReference),y=new i({geometry:h,pixelSize:g,rasterFunction:u,mosaicRule:f});let d;if(e.capabilities.operations.supportsComputeStatisticsHistograms)d=await e.computeStatisticsHistograms(y,t);else{const{histograms:s}=await e.computeHistograms(y,t);d={statistics:a(s),histograms:s}}return d&&this._statsCache.put(o,d),d}supportsMultidirectionalHillshade(){return this.layer.version>=10.81}load(t){return this.addResolvingPromise(this.layer.load(t).then(async()=>{const e=t?.signal;this.rasterInfo=await this.generateRasterInfo({rasterFunction:this.rasterFunction,signal:e})})),Promise.resolve(this)}};t([e()],n.prototype,"layer",void 0),n=t([s("esri.smartMapping.raster.support.adapters.ImageryLayerAdapter")],n);const l=n;export{l as default};