@arcgis/core 5.0.0-next.42 → 5.0.0-next.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/applications/Components/imageryUtils.js +1 -1
- package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{f97a7cb367634353177d.js → 001a7a4cf6fe74432ed6.js} +1 -1
- package/assets/esri/core/workers/chunks/00ff4ca88c9d291d82c3.js +1 -0
- package/assets/esri/core/workers/chunks/04a0685ee53ef74883aa.js +1 -0
- package/assets/esri/core/workers/chunks/{c320a29df40e85fb4a8e.js → 15a0750c10b510564a42.js} +1 -1
- package/assets/esri/core/workers/chunks/{9d95f38da21f97214f83.js → 1e0e7cef7ef947894bbe.js} +10 -10
- package/assets/esri/core/workers/chunks/20ad34f9d45c64392022.js +1 -0
- package/assets/esri/core/workers/chunks/23396a6318edf9264c1f.js +1 -0
- package/assets/esri/core/workers/chunks/{816227de5bd42b437df4.js → 233f9eb617f3d72995b5.js} +1 -1
- package/assets/esri/core/workers/chunks/{fb9643b74cf35221ff98.js → 249504f7d356be80d214.js} +1 -1
- package/assets/esri/core/workers/chunks/{ad891ac388fa6c1c9b94.js → 2b34a010f76e5f289868.js} +1 -1
- package/assets/esri/core/workers/chunks/2ef4c0092c59a98a5532.js +1 -0
- package/assets/esri/core/workers/chunks/35272810c2ed04eb403d.js +1 -0
- package/assets/esri/core/workers/chunks/{4f4d51181ae7db9fbe6d.js → 4404b6f931f681cca342.js} +1 -1
- package/assets/esri/core/workers/chunks/555a0ea44ba77819d493.js +1 -0
- package/assets/esri/core/workers/chunks/6e8925412fb90f88d688.js +1 -0
- package/assets/esri/core/workers/chunks/{d1f4152b2b8d47cbf586.js → 72fbee59d5d909615408.js} +1 -1
- package/assets/esri/core/workers/chunks/75c66e38bdc1c786c599.js +1 -0
- package/assets/esri/core/workers/chunks/7d3c2a063598bdd015e2.js +1 -0
- package/assets/esri/core/workers/chunks/83da9ee6544ee9d3c124.js +1 -0
- package/assets/esri/core/workers/chunks/897ce6fc9cefb1e14a64.js +1 -0
- package/assets/esri/core/workers/chunks/{da517b4b07d4d27ce94c.js → 8e26831f71634288f834.js} +1 -1
- package/assets/esri/core/workers/chunks/{c367c7e553be3682f2db.js → 93c5f097bb7b380bb175.js} +1 -1
- package/assets/esri/core/workers/chunks/992e9bbdf9d3787ddb0e.js +1 -0
- package/assets/esri/core/workers/chunks/9c7682b300b877f60095.js +1 -0
- package/assets/esri/core/workers/chunks/a2442549c5daf3653eb4.js +1 -0
- package/assets/esri/core/workers/chunks/a7cd795042ebb8585906.js +1 -0
- package/assets/esri/core/workers/chunks/{f3b3b193959db809c8c6.js → ab520fd1ae917daf07d8.js} +1 -1
- package/assets/esri/core/workers/chunks/{2c9865e34f32fb5683e5.js → af8d6e6949930d0e6c7b.js} +1 -1
- package/assets/esri/core/workers/chunks/c9942ca57f542582ab4d.js +1 -0
- package/assets/esri/core/workers/chunks/ca1c65eb7f5900c60170.js +1 -0
- package/assets/esri/core/workers/chunks/cddce67919e13e2f365e.js +1 -0
- package/assets/esri/core/workers/chunks/da2ba40bc017bff0fe49.js +1 -0
- package/assets/esri/core/workers/chunks/e5a6a646f27715152714.js +1 -0
- package/assets/esri/core/workers/chunks/e6784251bbb8b71ead93.js +1 -0
- package/assets/esri/core/workers/chunks/e8a9971c8354569cb81d.js +1 -0
- package/assets/esri/core/workers/chunks/{96f798ee286b59396131.js → ea3cba01c60d9bc72719.js} +1 -1
- package/assets/esri/core/workers/chunks/ed550bf27f2bbf8d30fa.js +1 -0
- package/assets/esri/core/workers/chunks/ee186ddbb1eb5144a790.js +1 -0
- package/assets/esri/core/workers/chunks/{1357cc637524cd254974.js → ffcdc7ae03b0570e0db8.js} +1 -1
- package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
- package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
- package/assets/esri/themes/base/widgets/_Attribution.scss +1 -1
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/config.js +1 -1
- package/core/PooledArray.js +1 -1
- package/geometry/FlatGeometry.js +1 -1
- package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
- package/geometry/support/meshUtils/exporters/gltf/gltf.js +1 -1
- package/geometry/support/meshUtils/loadGLTFMesh.js +1 -1
- package/interfaces.d.ts +109 -37
- package/kernel.js +1 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/graphics/sources/support/clientSideDefaults.js +1 -1
- package/layers/mixins/ArcGISImageService.js +1 -1
- package/layers/mixins/ImageryTileMixin.js +1 -1
- package/layers/mixins/RasterJobHandlerMixin.js +1 -1
- package/layers/ogc/wcsUtils.js +1 -1
- package/layers/raster/datasets/BaseRaster.js +5 -0
- package/layers/raster/datasets/CovJSONRaster.js +5 -0
- package/layers/raster/datasets/FunctionRaster.js +5 -0
- package/layers/raster/datasets/ImageAuxRaster.js +5 -0
- package/layers/raster/datasets/ImageServerRaster.js +5 -0
- package/layers/raster/datasets/InMemoryRaster.js +5 -0
- package/layers/raster/datasets/MRFRaster.js +5 -0
- package/layers/raster/datasets/RawBlockCache.js +5 -0
- package/layers/raster/datasets/TIFFRaster.js +5 -0
- package/layers/raster/datasets/WCSRaster.js +5 -0
- package/layers/raster/datasets/covJSONParser.js +5 -0
- package/layers/raster/datasets/multidimensionalUtils.js +5 -0
- package/layers/raster/datasets/pamParser.js +5 -0
- package/layers/raster/datasets/pixelReader.js +5 -0
- package/layers/raster/datasets/wcsCoverageParser.js +5 -0
- package/layers/raster/formats/Lerc.js +5 -0
- package/layers/raster/formats/Qb3.js +5 -0
- package/layers/raster/formats/RasterCodec.js +5 -0
- package/layers/raster/formats/TiffDecoder.js +5 -0
- package/layers/raster/functions/ArithmeticFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ArithmeticFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/AspectFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/AspectFunctionArguments.js +1 -1
- package/layers/raster/functions/BandArithmeticFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/BandArithmeticFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/BaseFunctionArguments.js +1 -1
- package/layers/raster/functions/BaseRasterFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ClipFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/ClipFunctionArguments.js +1 -1
- package/layers/raster/functions/ColormapFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ColormapFunctionArguments.js +1 -1
- package/layers/raster/functions/ColormapToRGBFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ColormapToRGBFunctionArguments.js +1 -1
- package/layers/raster/functions/CompositeBandFunction.js +5 -0
- package/layers/raster/functions/CompositeBandFunctionArguments.js +5 -0
- package/layers/raster/functions/ComputeChangeFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ComputeChangeFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/ContrastBrightnessFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/ContrastBrightnessFunctionArguments.js +1 -1
- package/layers/raster/functions/ConvolutionFunction.js +5 -0
- package/layers/raster/functions/ConvolutionFunctionArguments.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/CurvatureFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/CurvatureFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/ExtractBandFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/ExtractBandFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/GrayscaleFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/GrayscaleFunctionArguments.js +1 -1
- package/layers/raster/functions/HillshadeFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/HillshadeFunctionArguments.js +1 -1
- package/layers/raster/functions/LocalFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/LocalFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/MaskFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/MaskFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/NDVIFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/NDVIFunctionArguments.js +1 -1
- package/layers/raster/functions/RemapFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/RemapFunctionArguments.js +1 -1
- package/layers/raster/functions/ShadedReliefFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/ShadedReliefFunctionArguments.js +1 -1
- package/layers/raster/functions/SlopeFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/SlopeFunctionArguments.js +1 -1
- package/layers/raster/functions/StatisticsFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/StatisticsFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/StatisticsHistogramFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/StatisticsHistogramFunctionArguments.js +1 -1
- package/layers/raster/functions/StretchFunction.js +5 -0
- package/layers/{support/rasterFunctions → raster/functions}/StretchFunctionArguments.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/TableFunction.js +1 -1
- package/layers/{support/rasterFunctions → raster/functions}/TableFunctionArguments.js +1 -1
- package/layers/raster/functions/bandIndexUtils.js +5 -0
- package/layers/raster/functions/changeDetectionUtils.js +5 -0
- package/layers/raster/functions/clipUtils.js +5 -0
- package/layers/raster/functions/conversionUtils.js +5 -0
- package/layers/raster/functions/convolutionUtils.js +5 -0
- package/layers/raster/functions/creators/createDataManagementFunctions.js +5 -0
- package/layers/raster/functions/creators/utils.js +5 -0
- package/layers/raster/functions/focalStatUtils.js +5 -0
- package/layers/raster/functions/localUtils.js +5 -0
- package/layers/raster/functions/pixelTransformUtils.js +5 -0
- package/layers/raster/functions/pixelUtils.js +5 -0
- package/layers/raster/functions/stretchUtils.js +5 -0
- package/layers/raster/functions/surfaceUtils.js +5 -0
- package/layers/raster/functions/vectorFieldUtils.js +5 -0
- package/layers/raster/transforms/BaseRasterTransform.js +5 -0
- package/layers/{support/rasterTransforms → raster/transforms}/GCSShiftTransform.js +1 -1
- package/layers/{support/rasterTransforms → raster/transforms}/IdentityTransform.js +1 -1
- package/layers/{support/rasterTransforms → raster/transforms}/PolynomialTransform.js +1 -1
- package/layers/save/imageryUtils.js +1 -1
- package/layers/support/PixelBlock.js +1 -1
- package/layers/support/RasterWorker.js +1 -1
- package/layers/support/imageryRendererUtils.js +1 -1
- package/layers/support/rasterFunctionUtils.js +1 -1
- package/package.json +1 -1
- package/renderers/VectorFieldRenderer.js +1 -1
- package/renderers/support/RasterSymbolizer.js +1 -1
- package/renderers/support/rasterRendererHelper.js +1 -1
- package/rest/locator/addressToLocations.js +1 -1
- package/rest/locator/addressesToLocations.js +1 -1
- package/rest/locator/suggestLocations.js +1 -1
- package/rest/networks/support/Association.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
- package/views/2d/engine/webgl/cpuMapped/MappedMesh.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterRangeHighlightShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MaskShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/RemapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/math.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
- package/views/2d/engine/webgl/textureUtils.js +1 -1
- package/views/2d/layers/ImageryLayerView2D.js +1 -1
- package/views/2d/layers/ImageryTileLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/imagery/BaseImageryTileSubView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryTileView2D.js +1 -1
- package/views/2d/layers/imagery/ImageryView2D.js +1 -1
- package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
- package/views/2d/layers/imagery/VectorFieldView2D.js +1 -1
- package/views/3d/glTF/LoaderResult.js +1 -1
- package/views/3d/glTF/internal/Resource.js +1 -1
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/layers/ImageryTileLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/i3s/I3SGraphicsMap.js +1 -1
- package/views/3d/layers/i3s/I3SIndex.js +1 -1
- package/views/3d/support/buffer/glUtil.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/ShaderOutput.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +10 -10
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBufferView.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/bufferLayouts.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgeProcessing.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DrawParameters.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/Instance.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerBufferData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/PerOriginData.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +9 -9
- package/views/DOMContainer.js +1 -1
- package/views/GroundView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/layers/ImageryLayerViewMixin.js +1 -1
- package/views/layers/ImageryTileLayerViewMixin.js +1 -1
- package/views/support/imageReprojection.js +1 -1
- package/views/webgl/ShaderBuilder.js +1 -1
- package/views/webgl/Util.js +1 -1
- package/views/webgl/VertexElementDescriptor.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/BuildingExplorer/BuildingExplorerViewModel.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/DirectLineMeasurement3D.js +1 -1
- package/widgets/DistanceMeasurement2D.js +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/ElevationProfile.js +1 -1
- package/widgets/Feature.js +1 -1
- package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
- package/widgets/FeatureForm.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/support/GroupColumnTemplate.js +1 -1
- package/widgets/FeatureTable/support/TableTemplate.js +1 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/FeatureTemplates.js +1 -1
- package/widgets/Legend/support/ActiveLayerInfo.js +1 -1
- package/widgets/Legend.js +1 -1
- package/widgets/LineOfSight.js +1 -1
- package/widgets/Locate.js +1 -1
- package/widgets/OrientedImageryViewer/galleryUtils.js +1 -1
- package/widgets/OrientedImageryViewer/services/DepthImageService.js +1 -1
- package/widgets/PanoramicViewer/support/importUtils.js +1 -1
- package/widgets/Print.js +1 -1
- package/widgets/ScaleBar.js +1 -1
- package/widgets/ScaleRangeSlider.js +1 -1
- package/widgets/Search/SearchResultRenderer.js +1 -1
- package/widgets/Search/SearchViewModel.js +1 -1
- package/widgets/Search/types.js +1 -1
- package/widgets/Search.js +1 -1
- package/widgets/ShadowCast.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch.js +1 -1
- package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/0a5427127634738aa239.js +0 -1
- package/assets/esri/core/workers/chunks/110429583b28c28c36ee.js +0 -1
- package/assets/esri/core/workers/chunks/145c6a7cdcc9893efb27.js +0 -1
- package/assets/esri/core/workers/chunks/1bacdd17e199e22b5cd1.js +0 -1
- package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +0 -1
- package/assets/esri/core/workers/chunks/1f6ead46b723630db897.js +0 -1
- package/assets/esri/core/workers/chunks/3a16347e17312556e02c.js +0 -1
- package/assets/esri/core/workers/chunks/478def691ae6763686f3.js +0 -1
- package/assets/esri/core/workers/chunks/4c4a55be41ba105c091c.js +0 -1
- package/assets/esri/core/workers/chunks/4cbf5a97b2b3c6553f6f.js +0 -1
- package/assets/esri/core/workers/chunks/5dc0d853c21ccb6054c7.js +0 -1
- package/assets/esri/core/workers/chunks/613cbac9cb925cd20b48.js +0 -1
- package/assets/esri/core/workers/chunks/646f58b69d2354f1ef27.js +0 -1
- package/assets/esri/core/workers/chunks/800c91302eaad7f00877.js +0 -1
- package/assets/esri/core/workers/chunks/93d11075f65a5b6625ea.js +0 -1
- package/assets/esri/core/workers/chunks/9f2a8445a5848502c7e7.js +0 -1
- package/assets/esri/core/workers/chunks/a1b08aab73747f4e7e25.js +0 -1
- package/assets/esri/core/workers/chunks/ba59568e748f0ba53b78.js +0 -1
- package/assets/esri/core/workers/chunks/c4de24582c29fda5a033.js +0 -1
- package/assets/esri/core/workers/chunks/d786b17cc9062b1450ac.js +0 -1
- package/assets/esri/core/workers/chunks/d9958654c6438f28237b.js +0 -1
- package/assets/esri/core/workers/chunks/e6fa6f9c278589c8a713.js +0 -1
- package/assets/esri/core/workers/chunks/e7f4d135ef9665de1468.js +0 -1
- package/assets/esri/core/workers/chunks/f21cb5b34d4d1e3af1a9.js +0 -1
- package/assets/esri/core/workers/chunks/f93f0586ce10cb5d98b3.js +0 -1
- package/layers/support/rasterDatasets/BaseRaster.js +0 -5
- package/layers/support/rasterDatasets/CovJSONRaster.js +0 -5
- package/layers/support/rasterDatasets/FunctionRaster.js +0 -5
- package/layers/support/rasterDatasets/ImageAuxRaster.js +0 -5
- package/layers/support/rasterDatasets/ImageServerRaster.js +0 -5
- package/layers/support/rasterDatasets/InMemoryRaster.js +0 -5
- package/layers/support/rasterDatasets/MRFRaster.js +0 -5
- package/layers/support/rasterDatasets/RawBlockCache.js +0 -5
- package/layers/support/rasterDatasets/TIFFRaster.js +0 -5
- package/layers/support/rasterDatasets/WCSRaster.js +0 -5
- package/layers/support/rasterDatasets/covJSONParser.js +0 -5
- package/layers/support/rasterDatasets/multidimensionalUtils.js +0 -5
- package/layers/support/rasterDatasets/pamParser.js +0 -5
- package/layers/support/rasterDatasets/pixelReader.js +0 -5
- package/layers/support/rasterDatasets/wcsCoverageParser.js +0 -5
- package/layers/support/rasterFormats/Lerc.js +0 -5
- package/layers/support/rasterFormats/Qb3.js +0 -5
- package/layers/support/rasterFormats/RasterCodec.js +0 -5
- package/layers/support/rasterFormats/TiffDecoder.js +0 -5
- package/layers/support/rasterFunctions/ArithmeticFunction.js +0 -5
- package/layers/support/rasterFunctions/BandArithmeticFunction.js +0 -5
- package/layers/support/rasterFunctions/BaseRasterFunction.js +0 -5
- package/layers/support/rasterFunctions/ColormapFunction.js +0 -5
- package/layers/support/rasterFunctions/ColormapToRGBFunction.js +0 -5
- package/layers/support/rasterFunctions/CompositeBandFunction.js +0 -5
- package/layers/support/rasterFunctions/CompositeBandFunctionArguments.js +0 -5
- package/layers/support/rasterFunctions/ComputeChangeFunction.js +0 -5
- package/layers/support/rasterFunctions/ConvolutionFunction.js +0 -5
- package/layers/support/rasterFunctions/ConvolutionFunctionArguments.js +0 -5
- package/layers/support/rasterFunctions/HillshadeFunction.js +0 -5
- package/layers/support/rasterFunctions/LocalFunction.js +0 -5
- package/layers/support/rasterFunctions/RemapFunction.js +0 -5
- package/layers/support/rasterFunctions/ShadedReliefFunction.js +0 -5
- package/layers/support/rasterFunctions/SlopeFunction.js +0 -5
- package/layers/support/rasterFunctions/StatisticsFunction.js +0 -5
- package/layers/support/rasterFunctions/StretchFunction.js +0 -5
- package/layers/support/rasterFunctions/bandIndexUtils.js +0 -5
- package/layers/support/rasterFunctions/changeDetectionUtils.js +0 -5
- package/layers/support/rasterFunctions/clipUtils.js +0 -5
- package/layers/support/rasterFunctions/conversionUtils.js +0 -5
- package/layers/support/rasterFunctions/convolutionUtils.js +0 -5
- package/layers/support/rasterFunctions/creators/createDataManagementFunctions.js +0 -5
- package/layers/support/rasterFunctions/creators/utils.js +0 -5
- package/layers/support/rasterFunctions/focalStatUtils.js +0 -5
- package/layers/support/rasterFunctions/localUtils.js +0 -5
- package/layers/support/rasterFunctions/pixelTransformUtils.js +0 -5
- package/layers/support/rasterFunctions/pixelUtils.js +0 -5
- package/layers/support/rasterFunctions/stretchUtils.js +0 -5
- package/layers/support/rasterFunctions/surfaceUtils.js +0 -5
- package/layers/support/rasterFunctions/vectorFieldUtils.js +0 -5
- package/layers/support/rasterTransforms/BaseRasterTransform.js +0 -5
- /package/assets/esri/layers/{support/rasterFormats → raster/formats}/lerc-wasm.wasm +0 -0
- /package/assets/esri/layers/{support/rasterFormats → raster/formats}/qb3-wasm.wasm +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/DBFParser.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/EphemeralBlockCache.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/RasterFactory.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/byteStreamUtils.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/datasetUtils.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/multipartParser.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/wcsCapabilitiesParser.js +0 -0
- /package/layers/{support/rasterDatasets → raster/datasets}/xmlUtilities.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/ImageCanvasDecoder.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/JpgPlus.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/Lzw.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/Raw.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/pixelRangeUtils.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/tiffTag.js +0 -0
- /package/layers/{support/rasterFormats → raster/formats}/utils.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/colormaps.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createAppearenceFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createBandIndexFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createChangeFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createConversionFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createLocalFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createMultiRasterAnalysisFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createStatisticsFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/creators/createSurfaceFunctions.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/customBandIndexUtils.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/mirror.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/rasterFunctionHelper.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/rasterFunctionSchema.js +0 -0
- /package/layers/{support/rasterFunctions → raster/functions}/rasterProjectionHelper.js +0 -0
- /package/layers/{support/rasterTransforms → raster/transforms}/utils.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8535],{17136:(e,t,r)=>{r.d(t,{Y_:()=>S,O7:()=>B,el:()=>A});var n=r(92602),o=r(69052),s=r(49186),i=r(53966),a=r(39829),u=r(82799),l=r(16930),c=r(80754),f=r(21325),d=r(28735),p=r(11254),m=r(65864),h=r(2272),g=r(84952),y=r(92300);const x=()=>i.A.getLogger("esri.geometry.support.normalizeUtils");function w(e){return"polygon"===e[0].type}function b(e){return"polyline"===e[0].type}function v(e,t,r){if(t){const t=function(e,t){if(!(e instanceof u.A||e instanceof a.A)){const e="straightLineDensify: the input geometry is neither polyline nor polygon";throw x().error(e),new s.A("internal:geometry",e)}const r=(0,c.r8)(e),n=[];for(const e of r){const r=[];n.push(r),r.push([e[0][0],e[0][1]]);for(let n=0;n<e.length-1;n++){const o=e[n][0],s=e[n][1],i=e[n+1][0],a=e[n+1][1],u=Math.sqrt((i-o)*(i-o)+(a-s)*(a-s)),l=(a-s)/u,c=(i-o)/u,f=u/t;if(f>1){for(let e=1;e<=f-1;e++){const n=e*t,i=c*n+o,a=l*n+s;r.push([i,a])}const e=(u+Math.floor(f-1)*t)/2,n=c*e+o,i=l*e+s;r.push([n,i])}r.push([i,a])}}return function(e){return"polygon"===e.type}(e)?new a.A({rings:n,spatialReference:e.spatialReference}):new u.A({paths:n,spatialReference:e.spatialReference})}(e,1e6);e=(0,d.ci)(t,!0)}return r&&(e=(0,c.kS)(e,r)),e}function T(e,t,r){if(Array.isArray(e)){const n=e[0];if(n>t){const r=(0,c.kd)(n,t);e[0]=n+r*(-2*t)}else if(n<r){const t=(0,c.kd)(n,r);e[0]=n+t*(-2*r)}}else{const n=e.x;if(n>t){const r=(0,c.kd)(n,t);e=e.clone().offset(r*(-2*t),0)}else if(n<r){const t=(0,c.kd)(n,r);e=e.clone().offset(t*(-2*r),0)}}return e}function M(e,t){let r=-1;for(let n=0;n<t.cutIndexes.length;n++){const o=t.cutIndexes[n],s=t.geometries[n],i=(0,c.r8)(s);for(let e=0;e<i.length;e++){const t=i[e];t.some(r=>{if(r[0]<180)return!0;{let r=0;for(let e=0;e<t.length;e++){const n=t[e][0];r=n>r?n:r}r=Number(r.toFixed(9));const n=-360*(0,c.kd)(r,180);for(let r=0;r<t.length;r++){const t=s.getPoint(e,r);s.setPoint(e,r,t.clone().offset(n,0))}return!0}})}if(o===r){if(w(e))for(const t of(0,c.r8)(s))e[o]=e[o].addRing(t);else if(b(e))for(const t of(0,c.r8)(s))e[o]=e[o].addPath(t)}else r=o,e[o]=s}return e}async function A(e,t,r){if(!Array.isArray(e))return A([e],t);t&&"string"!=typeof t&&x().warn("normalizeCentralMeridian()","The url object is deprecated, use the url string instead");const o="string"==typeof t?t:t?.url??n.A.geometryServiceUrl;let s,i,l,w,b,B,R,S,I=0;const _=[],E=[];for(const t of e)if(null!=t)if(s||(s=t.spatialReference,i=(0,f.Vp)(s),l=s.isWebMercator,B=l?102100:4326,w=c.j7[B].maxX,b=c.j7[B].minX,R=c.j7[B].plus180Line,S=c.j7[B].minus180Line),i)if("mesh"===t.type)E.push(t);else if("point"===t.type)E.push(T(t.clone(),w,b));else if("multipoint"===t.type){const e=t.clone();e.points=e.points.map(e=>T(e,w,b)),E.push(e)}else if("extent"===t.type){const e=t.clone()._normalize(!1,!1,i);E.push(e.rings?new a.A(e):e)}else if(t.extent){const e=t.extent,r=(0,c.kd)(e.xmin,b)*(2*w);let n=0===r?t.clone():(0,c.kS)(t.clone(),r);e.offset(r,0);let{xmin:o,xmax:s}=e;o=Number(o.toFixed(9)),s=Number(s.toFixed(9)),e.intersects(R)&&s!==w?(I=s>I?s:I,n=v(n,l),_.push(n),E.push("cut")):e.intersects(S)&&o!==b?(I=s*(2*w)>I?s*(2*w):I,n=v(n,l,360),_.push(n),E.push("cut")):E.push(n)}else E.push(t.clone());else E.push(t);else E.push(t);let P=(0,c.kd)(I,w),O=-90;const U=P,L=new u.A;for(;P>0;){const e=360*P-180;L.addPath([[e,O],[e,-1*O]]),O*=-1,P--}if(_.length>0&&U>0){const t=M(_,await async function(e,t,r,n){const o=(0,h.Dl)(e),s=t[0].spatialReference,i={...n,responseType:"json",query:{...o.query,f:"json",sr:(0,f.YX)(s),target:JSON.stringify({geometryType:(0,m.$B)(t[0]),geometries:t}),cutter:JSON.stringify(r)}},a=await(0,p.A)(o.path+"/cut",i),{cutIndexes:u,geometries:l=[]}=a.data;return{cutIndexes:u,geometries:l.map(e=>{const t=(0,m.rS)(e);return t.spatialReference=s,t})}}(o,_,L,r)),n=[],s=[];for(let r=0;r<E.length;r++){const o=E[r];if("cut"!==o)s.push(o);else{const o=t.shift(),i=e[r];null!=i&&"polygon"===i.type&&i.rings&&i.rings.length>1&&o.rings.length>=i.rings.length?(n.push(o),s.push("simplify")):s.push(l?(0,d.Gh)(o):o)}}if(!n.length)return s;const i=await async function(e,t,r){const n="string"==typeof e?(0,g.An)(e):e,o=t[0].spatialReference,s=(0,m.$B)(t[0]),i={...r,query:{...n.query,f:"json",sr:(0,f.YX)(o),geometries:JSON.stringify((0,y.X)(t))}},{data:a}=await(0,p.A)(n.path+"/simplify",i);return(0,y.V)(a.geometries,s,o)}(o,n,r),a=[];for(let e=0;e<s.length;e++){const t=s[e];"simplify"!==t?a.push(t):a.push(l?(0,d.Gh)(i.shift()):i.shift())}return a}const k=[];for(let e=0;e<E.length;e++){const t=E[e];if("cut"!==t)k.push(t);else{const e=_.shift();k.push(!0===l?(0,d.Gh)(e):e)}}return k}function B(e,t,r){const n=(0,f.Vp)(r);if(null==n)return e;const[o,s]=n.valid,i=2*s;let a=0,u=0;t>s?a=Math.ceil(Math.abs(t-s)/i):t<o&&(a=-Math.ceil(Math.abs(t-o)/i)),e>s?u=Math.ceil(Math.abs(e-s)/i):e<o&&(u=-Math.ceil(Math.abs(e-o)/i));let l=e+(a-u)*i;const c=l-t;return c>s?l-=i:c<o&&(l+=i),l}function R(e){const t=(0,f.Vp)(e);if(null==t)return null;const[r,n]=t.valid;return new o.hr(r,n)}const S=R(l.A.WGS84);R(l.A.WebMercator)},21015:(e,t,r)=>{r.d(t,{R:()=>u});var n=r(11254),o=r(60999),s=r(49186),i=r(74887),a=r(84952);class u{constructor(e=e=>e){this._resolveURI=e}async loadJSON(e,t){return this._load("json",e,t)}async loadBinary(e,t){return(0,a.DB)(e)?((0,i.Te)(t),(0,a.lJ)(e)):this._load("array-buffer",e,t)}async loadImage(e,t){return this._load("image",e,t)}async _load(e,t,r){t=this._resolveURI(t);const a=await(0,o.Ke)((0,n.A)(t,{responseType:e,...r}));if(a.ok)return a.value.data;throw(0,i.QP)(a.error),new s.A("gltf-loader-request-error",`Request for resource failed: ${a.error}`)}}},43609:(e,t,r)=>{r.d(t,{a:()=>s,f:()=>i,n:()=>o});var n=r(34275);function o(e,t){s(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r=2,o=r){const s=t.length/2;let i=0,a=0;if(!(0,n.iu)(t)||(0,n.dk)(t)){for(let n=0;n<s;++n)e[i]=t[a],e[i+1]=t[a+1],i+=r,a+=o;return}const u=(0,n.a3)(t);if((0,n.JI)(t))for(let n=0;n<s;++n)e[i]=Math.max(t[a]/u,-1),e[i+1]=Math.max(t[a+1]/u,-1),i+=r,a+=o;else for(let n=0;n<s;++n)e[i]=t[a]/u,e[i+1]=t[a+1]/u,i+=r,a+=o}function i(e,t,r,n){const o=e.typedBuffer,s=e.typedBufferStride,i=n?.count??e.count;let a=(n?.dstIndex??0)*s;for(let e=0;e<i;++e)o[a]=t,o[a+1]=r,a+=s}Object.freeze(Object.defineProperty({__proto__:null,fill:i,normalizeIntegerBuffer:s,normalizeIntegerBufferView:o},Symbol.toStringTag,{value:"Module"}))},51530:(e,t,r)=>{r.d(t,{KB:()=>i,Xi:()=>o,pn:()=>a,x3:()=>s});var n=r(44208);class o{constructor(e){this.data=e,this.type="encoded-mesh-texture",this.encoding="image/ktx2"}}function s(e){return"encoded-mesh-texture"===e?.type}async function i(e){const t=new Blob([e]),r=await t.text();return JSON.parse(r)}async function a(e,t){if("image/ktx2"===t)return new o(e);const r=new Blob([e],{type:t});let s=URL.createObjectURL(r);switch(t){case"image/jpeg":s+="#.jpg";break;case"image/png":s+="#.png"}const i=new Image;if((0,n.A)("esri-iPhone"))return new Promise((e,t)=>{const r=()=>{o(),e(i)},n=e=>{o(),t(e)},o=()=>{URL.revokeObjectURL(s),i.removeEventListener("load",r),i.removeEventListener("error",n)};i.addEventListener("load",r),i.addEventListener("error",n),i.src=s});try{i.src=s,await i.decode()}catch(e){console.warn("Failed decoding HTMLImageElement")}return URL.revokeObjectURL(s),i}},61473:(e,t,r)=>{function n(e){return e=e||globalThis.location.hostname,l.some(t=>null!=e?.match(t))}function o(e,t){return e?(t=t||globalThis.location.hostname)?null!=t.match(s)||null!=t.match(a)?e.replace("static.arcgis.com","staticdev.arcgis.com"):null!=t.match(i)||null!=t.match(u)?e.replace("static.arcgis.com","staticqa.arcgis.com"):e:e:null}r.d(t,{EM:()=>o,b5:()=>n});const s=/^devext\.arcgis\.com$/,i=/^qaext\.arcgis\.com$/,a=/^[\w-]*\.mapsdevext\.arcgis\.com$/,u=/^[\w-]*\.mapsqa\.arcgis\.com$/,l=[/^([\w-]*\.)?[\w-]*\.zrh-dev-local\.esri\.com$/,s,i,/^jsapps\.esri\.com$/,a,u]},64304:(e,t,r)=>{r.d(t,{fetch:()=>J});var n=r(40876),o=r(61473),s=r(34727),i=r(77690),a=r(29242),u=r(58083),l=r(9093),c=r(48163),f=r(38954),d=r(51850),p=r(70328),m=r(11868),h=r(13030),g=r(73354),y=r(65686),x=r(43609),w=r(21015),b=r(84498),v=r(51530),T=r(88340);function M(e){if(null==e)return null;const t=null!=e.offset?e.offset:T.uY,r=null!=e.rotation?e.rotation:0,n=null!=e.scale?e.scale:T.Un,o=(0,a.fA)(1,0,0,0,1,0,t[0],t[1],1),s=(0,a.fA)(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),u=(0,a.fA)(n[0],0,0,0,n[1],0,0,0,1),l=(0,a.vt)();return(0,i.lw)(l,s,u),(0,i.lw)(l,o,l),l}class A{constructor(){this.geometries=new Array,this.materials=new Array,this.textures=new Array}}class B{constructor(e,t,r){this.name=e,this.lodThreshold=t,this.pivotOffset=r,this.stageResources=new A,this.numberOfVertices=0}}var R=r(11254),S=r(60999),I=r(49186),_=r(53966),E=r(69397);class P{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return 0===this._outer.size}get outerSize(){return this._outer.size}get size(){let e=0;for(const t of this._outer.values())e+=t.size;return e}get(e,t){return this._outer.get(e)?.get(t)}getInner(e){return this._outer.get(e)}set(e,t,r){const n=this._outer.get(e);n?n.set(t,r):this._outer.set(e,new Map([[t,r]]))}delete(e,t){const r=this._outer.get(e);r&&(r.delete(t),0===r.size&&this._outer.delete(e))}pop(e,t){const r=this.get(e,t);return this.delete(e,t),r}*outerMap(){for(const e of this._outer)yield e}*values(){for(const e of this._outer.values())yield*e.values()}*[Symbol.iterator](){for(const[e,t]of this._outer)for(const[r,n]of t)yield[e,r,n]}forEach(e){this._outer.forEach((t,r)=>e(t,r))}forAll(e){this._outer.forEach((t,r)=>t.forEach((t,n)=>e(t,r,n)))}copy(){const e=new P;return this.forAll((t,r,n)=>e.set(r,n,t)),e}}var O=r(74887),U=r(46140),L=r(97146),k=r(31217),j=r(46610),z=r(87170),F=r(46859),V=r(2495);const C=()=>_.A.getLogger("esri.views.3d.layers.graphics.objectResourceUtils");class ${constructor(e,t,r){this.resource=e,this.textures=t,this.usedMemory=r}}function N(e){const t=e.params,r=t.topology;let n=!0;switch(t.vertexAttributes||(C().warn("Geometry must specify vertex attributes"),n=!1),t.topology){case"PerAttributeArray":break;case"Indexed":case null:case void 0:{const e=t.faces;if(e){if(t.vertexAttributes)for(const r in t.vertexAttributes){const t=e[r];t?.values?(null!=t.valueType&&"UInt32"!==t.valueType&&(C().warn(`Unsupported indexed geometry indices type '${t.valueType}', only UInt32 is currently supported`),n=!1),null!=t.valuesPerElement&&1!==t.valuesPerElement&&(C().warn(`Unsupported indexed geometry values per element '${t.valuesPerElement}', only 1 is currently supported`),n=!1)):(C().warn(`Indexed geometry does not specify face indices for '${r}' attribute`),n=!1)}}else C().warn("Indexed geometries must specify faces"),n=!1;break}default:C().warn(`Unsupported topology '${r}'`),n=!1}e.params.material||(C().warn("Geometry requires material"),n=!1);const o=e.params.vertexAttributes;for(const e in o)o[e].values||(C().warn("Geometries with externally defined attributes are not yet supported"),n=!1);return n}function q(e){const t=(0,p.Ie)();return e.forEach(e=>{const r=e.boundingInfo;null!=r&&((0,p.iT)(t,r.bbMin),(0,p.iT)(t,r.bbMax))}),t}function G(e){switch(e){case"mask":return 2;case"maskAndTransparency":return 3;case"none":return 1;default:return 0}}function X(e){const t=e.params;return{id:1,material:t.material,texture:t.texture,region:t.texture}}const W=new U.R(1,2,"wosr");var D=r(74810);async function J(e,t){const a=function(e){const t=e.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return t?{fileType:"gltf",url:t[1],specifiedLodIndex:null!=t[4]?Number(t[4]):null}:e.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:e,specifiedLodIndex:null}:{fileType:"unknown",url:e,specifiedLodIndex:null}}((0,o.EM)(e));if("wosr"===a.fileType){const e=await(t.cache?t.cache.loadWOSR(a.url,t):async function(e,t){const r=await async function(e,t){const r=await(0,S.Ke)((0,R.A)(e,t));if(r.ok)return r.value.data;(0,O.QP)(r.error),function(e){throw new I.A("",`Request for object resource failed: ${e}`)}(r.error)}(e,t),n=await async function(e,t){const r=new Array;for(const n in e){const o=e[n],s=o.images[0].data;if(!s){C().warn("Externally referenced texture data is not yet supported");continue}const i=o.encoding+";base64,"+s,a="/textureDefinitions/"+n,u="rgba"===o.channels?o.alphaChannelUsage||"transparency":"none",l={noUnpackFlip:!0,wrap:{s:10497,t:10497},preMultiplyAlpha:1!==G(u)},c=t?.disableTextures?Promise.resolve(null):(0,k.D)(i,t);r.push(c.then(e=>({refId:a,image:e,parameters:l,alphaChannelUsage:u})))}const n=await Promise.all(r),o={};for(const e of n)o[e.refId]=e;return o}(r.textureDefinitions??{},t);let o=0;for(const e in n)if(n.hasOwnProperty(e)){const t=n[e];o+=t?.image?t.image.width*t.image.height*4:0}return new $(r,n,o+(0,E.Qh)(r))}(a.url,t)),{engineResources:r,referenceBoundingBox:n}=function(e,t){const r=new Array,n=new Array,o=new Array,s=new P,i=e.resource,a=U.R.parse(i.version||"1.0","wosr");W.validate(a);const u=i.model.name,l=i.model.geometries,c=i.materialDefinitions??{},f=e.textures;let p=0;const m=new Map;for(let e=0;e<l.length;e++){const i=l[e];if(!N(i))continue;const a=X(i),u=i.params.vertexAttributes,h=[],g=e=>{if("PerAttributeArray"===i.params.topology)return null;const t=i.params.faces;for(const r in t)if(r===e)return t[r].values;return null},y=u.position,x=y.values.length/y.valuesPerElement;for(const e in u){const t=u[e],r=t.values,n=g(e)??(0,L.tM)(x);h.push([e,new j.n(r,n,t.valuesPerElement,!0)])}const w=a.texture,b=f&&f[w];if(b&&!m.has(w)){const{image:e,parameters:t}=b,r=new F.h(e,t);n.push(r),m.set(w,r)}const v=m.get(w),T=v?v.id:void 0,M=a.material;let A=s.get(M,w);if(null==A){const e=c[M.slice(M.lastIndexOf("/")+1)].params;1===e.transparency&&(e.transparency=0);const r=b?G(b.alphaChannelUsage):void 0,n={ambient:(0,d.ci)(e.diffuse),diffuse:(0,d.ci)(e.diffuse),opacity:1-(e.transparency||0),textureAlphaMode:r,textureAlphaCutoff:.33,textureId:T,doubleSided:!0,cullFace:0,colorMixMode:e.externalColorMixMode||"tint",textureAlphaPremultiplied:b?.parameters.preMultiplyAlpha??!1};t?.materialParameters&&Object.assign(n,t.materialParameters),A=new V.$U(n,t),s.set(M,w,A)}o.push(A);const B=new z.V(A,h);p+=h.find(e=>"position"===e[0])?.[1]?.indices.length??0,r.push(B)}return{engineResources:[{name:u,stageResources:{textures:n,materials:o,geometries:r},pivotOffset:i.model.pivotOffset,numberOfVertices:p,lodThreshold:null}],referenceBoundingBox:q(r)}}(e,t);return{lods:r,referenceBoundingBox:n,isEsriSymbolResource:!1,isWosr:!0}}let T;if(t.cache)T=await t.cache.loadGLTF(a.url,t,!!t.usePBR);else{const{loadGLTF:e}=await r.e(1698).then(r.bind(r,51698));T=await e(new w.R,a.url,t,t.usePBR)}const A=T.model.meta?.ESRI_proxyEllipsoid,_=T.meta.isEsriSymbolResource&&null!=A&&"EsriRealisticTreesStyle"===T.meta.ESRI_webstyle;_&&!T.customMeta.esriTreeRendering&&(T.customMeta.esriTreeRendering=!0,function(e,t){for(let r=0;r<e.model.lods.length;++r){const o=e.model.lods[r];for(const s of o.parts){const o=s.attributes.normal;if(null==o)return;const i=s.attributes.position,a=i.count,c=(0,d.vt)(),p=(0,d.vt)(),m=(0,d.vt)(),g=new Float32Array(4*a),y=new Float32Array(3*a),x=(0,u.B8)((0,l.vt)(),s.transform);let w=0,b=0;for(let u=0;u<a;u++){i.getVec(u,p),o.getVec(u,c),(0,f.p)(p,p,s.transform),(0,f.e)(m,p,t.center),(0,f.B)(m,m,t.radius);const a=m[2],l=(0,f.b)(m),d=Math.min(.45+.55*l*l,1)**n.Tf;(0,f.B)(m,m,t.radius),null!==x&&(0,f.p)(m,m,x),(0,f.n)(m,m),r+1!==e.model.lods.length&&e.model.lods.length>1&&(0,f.l)(m,m,c,a>-1?.2:Math.min(-4*a-3.8,1)),y[w]=m[0],y[w+1]=m[1],y[w+2]=m[2],w+=3,g[b]=d,g[b+1]=d,g[b+2]=d,g[b+3]=1,b+=4}s.attributes.normal=new h.xs(y.buffer),s.attributes.color=new h.Eq(g.buffer)}}}(T,A));const J=!!t.usePBR,Q=T.meta.isEsriSymbolResource?{usePBR:J,isSchematic:!1,treeRendering:_,mrrFactors:D.SY}:{usePBR:J,isSchematic:!1,treeRendering:!1,mrrFactors:D.mb},K={...t.materialParameters,treeRendering:_},{engineResources:H,referenceBoundingBox:Z}=function(e,t,r,o,a,u){const l=e.model,f=new Array,d=new Map,w=new Map,T=l.lods.length,A=(0,p.Ie)();return l.lods.forEach((e,R)=>{const S=!0===o.skipHighLods&&(T>1&&0===R||T>3&&1===R)||!1===o.skipHighLods&&null!=a&&R!==a;if(S&&0!==R)return;const I=new B(e.name,e.lodThreshold,[0,0,0]);e.parts.forEach(e=>{const a=S?new V.$U({},o):function(e,t,r,o,s,i,a,u,l){const f=e.materials.get(t.material);if(null==f)return null;const{normal:d,color:p,texCoord0:m,tangent:h}=t.attributes,g=t.material+(d?"_normal":"")+(p?"_color":"")+(m?"_texCoord0":"")+(h?"_tangent":""),y=null!=t.attributes.texCoord0,x=null!=t.attributes.normal,w=function(e){switch(e){case"BLEND":return 0;case"MASK":return 2;case"OPAQUE":case null:case void 0:return 1}}(f.alphaMode);if(!i.has(g)){if(y){const t=(t,r=!1,n=!1)=>{if(null!=t&&!a.has(t)){const o=e.textures.get(t);if(o){const e=o.data,s=r&&!(0,v.x3)(e)?u.compressionOptions:void 0;a.set(t,new F.h((0,v.x3)(e)?e.data:e,{...o.parameters,preMultiplyAlpha:!(0,v.x3)(e)&&n,encoding:(0,v.x3)(e)?e.encoding:void 0,compressionOptions:s}))}}},r=1!==w&&!l;t(f.colorTexture,r,1!==w),t(f.normalTexture),t(f.occlusionTexture,!0),t(f.emissiveTexture),t(f.metallicRoughnessTexture,!0)}const r=(0,n.xV)(f.color[0]),d=(0,n.xV)(f.color[1]),p=(0,n.xV)(f.color[2]),m=null!=f.colorTexture&&y?a.get(f.colorTexture):null,h=(0,D.Jr)(f),b=null!=f.normalTextureTransform?.scale?f.normalTextureTransform?.scale:c.Un;i.set(g,new V.$U({...o,customDepthTest:1,textureAlphaMode:w,textureAlphaCutoff:f.alphaCutoff,diffuse:[r,d,p],ambient:[r,d,p],opacity:"OPAQUE"===f.alphaMode?1:f.opacity,doubleSided:f.doubleSided,doubleSidedType:"winding-order",cullFace:f.doubleSided?0:2,hasVertexColors:!!t.attributes.color,hasVertexTangents:!!t.attributes.tangent,normalType:x?0:2,castShadows:!0,receiveShadows:f.receiveShadows,receiveAmbientOcclusion:f.receiveAmbientOcclusion,textureId:null!=m?m.id:void 0,colorMixMode:f.colorMixMode,normalTextureId:null!=f.normalTexture&&y?a.get(f.normalTexture).id:void 0,textureAlphaPremultiplied:null!=m&&!!m.parameters.preMultiplyAlpha,occlusionTextureId:null!=f.occlusionTexture&&y?a.get(f.occlusionTexture).id:void 0,emissiveTextureId:null!=f.emissiveTexture&&y?a.get(f.emissiveTexture).id:void 0,metallicRoughnessTextureId:null!=f.metallicRoughnessTexture&&y?a.get(f.metallicRoughnessTexture).id:void 0,emissiveBaseColor:[f.emissiveFactor[0],f.emissiveFactor[1],f.emissiveFactor[2]],mrrFactors:h?D.Bt:[f.metallicFactor,f.roughnessFactor,o.mrrFactors[2]],isSchematic:h,colorTextureTransformMatrix:M(f.colorTextureTransform),normalTextureTransformMatrix:M(f.normalTextureTransform),scale:[b[0],b[1]],occlusionTextureTransformMatrix:M(f.occlusionTextureTransform),emissiveTextureTransformMatrix:M(f.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:M(f.metallicRoughnessTextureTransform),...s},u))}const b=i.get(g);if(r.stageResources.materials.push(b),y){const e=e=>{null!=e&&r.stageResources.textures.push(a.get(e))};e(f.colorTexture),e(f.normalTexture),e(f.occlusionTexture),e(f.emissiveTexture),e(f.metallicRoughnessTexture)}return b}(l,e,I,t,r,d,w,o,u),{geometry:f,vertexCount:T}=function(e,t){const r=e.attributes.position.count,n=(0,b.x)(e.indices||r,e.primitiveType),o=(0,m.oe)(3*r),{typedBuffer:a,typedBufferStride:u}=e.attributes.position;(0,g.t)(o,a,e.transform,3,u);const l=[["position",new j.n(o,n,3,!0)]];if(null!=e.attributes.normal){const t=(0,m.oe)(3*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.normal;(0,i.Ge)(Y,e.transform),(0,g.b)(t,o,Y,3,a),(0,s.or)(Y)&&(0,g.n)(t,t),l.push(["normal",new j.n(t,n,3,!0)])}if(null!=e.attributes.tangent){const t=(0,m.oe)(4*r),{typedBuffer:o,typedBufferStride:a}=e.attributes.tangent;(0,i.z0)(Y,e.transform),(0,y.t)(t,o,Y,4,a),(0,s.or)(Y)&&(0,g.n)(t,t,4),l.push(["tangent",new j.n(t,n,4,!0)])}if(null!=e.attributes.texCoord0){const t=(0,m.oe)(2*r),{typedBuffer:o,typedBufferStride:s}=e.attributes.texCoord0;(0,x.a)(t,o,2,s),l.push(["uv0",new j.n(t,n,2,!0)])}const c=e.attributes.color;if(null!=c){const t=new Uint8Array(4*r);4===c.elementCount?c instanceof h.Eq?(0,y.b)(t,c,1,255):(c instanceof h.XP||c instanceof h.Uz)&&(0,y.b)(t,c,1/255,255):(t.fill(255),c instanceof h.xs?(0,g.f)(t,c.typedBuffer,1,255,4,c.typedBufferStride):(e.attributes.color instanceof h.eI||e.attributes.color instanceof h.nS)&&(0,g.f)(t,c.typedBuffer,1/255,255,4,e.attributes.color.typedBufferStride)),l.push(["color",new j.n(t,n,4,!0)])}return{geometry:new z.V(t,l),vertexCount:r}}(e,a??new V.$U({},o)),B=f.boundingInfo;null!=B&&0===R&&((0,p.iT)(A,B.bbMin),(0,p.iT)(A,B.bbMax)),null!=a&&(I.stageResources.geometries.push(f),I.numberOfVertices+=T)}),S||f.push(I)}),{engineResources:f,referenceBoundingBox:A}}(T,Q,K,t,a.specifiedLodIndex,_);return{lods:H,referenceBoundingBox:Z,isEsriSymbolResource:T.meta.isEsriSymbolResource,isWosr:!1}}const Y=(0,a.vt)()},69052:(e,t,r)=>{r.d(t,{hr:()=>o,ie:()=>u,uC:()=>a});var n=r(34727);class o{constructor(e,t){this.min=e,this.max=t,this.range=t-e}normalize(e,t=0,r=!1){return s(this.range,this.min,this.max,e,t,r)}clamp(e,t=0){return(0,n.qE)(e-t,this.min,this.max)+t}monotonic(e,t,r){return e<t?t:t+i(this.range,e-t,r)}minimalMonotonic(e,t,r){return s(this.range,e,e+this.range,t,r)}center(e,t,r){return t=this.monotonic(e,t,r),this.normalize((e+t)/2,r)}diff(e,t,r){return this.monotonic(e,t,r)-e}shortestSignedDiff(e,t){e=this.normalize(e);const r=(t=this.normalize(t))-e,n=t<e?this.minimalMonotonic(e,t)-e:t-this.minimalMonotonic(t,e);return Math.abs(r)<Math.abs(n)?r:n}contains(e,t,r){return t=this.minimalMonotonic(e,t),(r=this.minimalMonotonic(e,r))>e&&r<t}}function s(e,t,r,n,o=0,s=!1){return(n-=o)<t?n+=i(e,t-n):n>r&&(n-=i(e,n-r)),s&&n===r&&(n=t),n+o}function i(e,t,r=0){return Math.ceil((t-r)/e)*e+r}const a=new o(0,2*Math.PI),u=(new o(-Math.PI,Math.PI),new o(0,360))},69397:(e,t,r)=>{r.d(t,{$B:()=>o,Qf:()=>l,Qh:()=>a,RS:()=>s,ez:()=>d,lM:()=>i,qK:()=>f});var n=r(34275);function o(e){return 32+e.length}const s=16;function i(e){if(!e)return 0;let t=f;for(const r in e)e.hasOwnProperty(r)&&(t+=u(e[r],!1));return t}function a(e){if(!e)return 0;if("number"==typeof e[0])return l(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return c(e,8);let r=d;for(let n=0;n<t;n++)r+=u(e[n]);return r}(e);let t=f;for(const r in e)e.hasOwnProperty(r)&&(t+=u(e[r]));return t}function u(e,t=!0){switch(typeof e){case"object":return t?a(e):f;case"string":return o(e);case"number":return s;case"boolean":return 4;default:return 8}}function l(...e){return e.reduce((e,t)=>e+(t?(0,n.iu)(t)?t.byteLength+p:Array.isArray(t)?c(t,s):0:0),0)}function c(e,t){return d+e.length*t}const f=32,d=16,p=145},73354:(e,t,r)=>{r.d(t,{a:()=>f,b:()=>a,c:()=>i,d:()=>o,e:()=>d,f:()=>c,l:()=>l,n:()=>p,t:()=>s});var n=r(40876);function o(e,t,r){s(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function s(e,t,r,n=3,o=n){if(e.length/n!==Math.ceil(t.length/o))return e;const s=e.length/n,i=r[0],a=r[1],u=r[2],l=r[4],c=r[5],f=r[6],d=r[8],p=r[9],m=r[10],h=r[12],g=r[13],y=r[14];let x=0,w=0;for(let r=0;r<s;r++){const r=t[x],s=t[x+1],b=t[x+2];e[w]=i*r+l*s+d*b+h,e[w+1]=a*r+c*s+p*b+g,e[w+2]=u*r+f*s+m*b+y,x+=o,w+=n}return e}function i(e,t,r){a(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)}function a(e,t,r,n=3,o=n){if(e.length/n!==Math.ceil(t.length/o))return;const s=e.length/n,i=r[0],a=r[1],u=r[2],l=r[3],c=r[4],f=r[5],d=r[6],p=r[7],m=r[8];let h=0,g=0;for(let r=0;r<s;r++){const r=t[h],s=t[h+1],y=t[h+2];e[g]=i*r+l*s+d*y,e[g+1]=a*r+c*s+p*y,e[g+2]=u*r+f*s+m*y,h+=o,g+=n}}function u(e,t,r,n=3,o=n){const s=Math.min(e.length/n,t.length/o);let i=0,a=0;for(let u=0;u<s;u++)e[a]=r*t[i],e[a+1]=r*t[i+1],e[a+2]=r*t[i+2],i+=o,a+=n;return e}function l(e,t,r,n){c(e.typedBuffer,t.typedBuffer,r,n,e.typedBufferStride,t.typedBufferStride)}function c(e,t,r,o,s=3,i=s){const a=Math.min(e.length/s,t.length/i);let u=0,l=0;const c=1/n.Tf;for(let n=0;n<a;n++)e[l]=o*(r*t[u])**c,e[l+1]=o*(r*t[u+1])**c,e[l+2]=o*(r*t[u+2])**c,u+=i,l+=s}function f(e,t,r,n=3,o=n){const s=e.length/n;if(s!==Math.ceil(t.length/o))return e;let i=0,a=0;for(let u=0;u<s;u++)e[a]=t[i]+r[0],e[a+1]=t[i+1]+r[1],e[a+2]=t[i+2]+r[2],i+=o,a+=n;return e}function d(e,t){p(e.typedBuffer,t.typedBuffer,e.typedBufferStride,t.typedBufferStride)}function p(e,t,r=3,n=r){const o=Math.min(e.length/r,t.length/n);let s=0,i=0;for(let a=0;a<o;a++){const o=t[s],a=t[s+1],u=t[s+2],l=o*o+a*a+u*u;if(l>0){const t=1/Math.sqrt(l);e[i]=t*o,e[i+1]=t*a,e[i+2]=t*u}s+=n,i+=r}}r(44208),r(53966),Object.freeze(Object.defineProperty({__proto__:null,linearToSRGB:c,linearToSRGBView:l,normalize:p,normalizeView:d,scale:u,scaleView:function(e,t,r){u(e.typedBuffer,t.typedBuffer,r,e.typedBufferStride,t.typedBufferStride)},shiftRight:function(e,t,r){const n=Math.min(e.count,t.count),o=e.typedBuffer,s=e.typedBufferStride,i=t.typedBuffer,a=t.typedBufferStride;let u=0,l=0;for(let e=0;e<n;e++)o[l]=i[u]>>r,o[l+1]=i[u+1]>>r,o[l+2]=i[u+2]>>r,u+=a,l+=s},transformMat3:a,transformMat3View:i,transformMat4:s,transformMat4View:o,translate:f},Symbol.toStringTag,{value:"Module"}))},80754:(e,t,r)=>{r.d(t,{j7:()=>i,kS:()=>u,kd:()=>a,r8:()=>l});var n=r(82799),o=r(16930),s=r(65864);const i={102100:{maxX:20037508.342788905,minX:-20037508.342788905,plus180Line:new n.A({paths:[[[20037508.342788905,-20037508.342788905],[20037508.342788905,20037508.342788905]]],spatialReference:o.A.WebMercator}),minus180Line:new n.A({paths:[[[-20037508.342788905,-20037508.342788905],[-20037508.342788905,20037508.342788905]]],spatialReference:o.A.WebMercator})},4326:{maxX:180,minX:-180,plus180Line:new n.A({paths:[[[180,-180],[180,180]]],spatialReference:o.A.WGS84}),minus180Line:new n.A({paths:[[[-180,-180],[-180,180]]],spatialReference:o.A.WGS84})}};function a(e,t){return Math.ceil((e-t)/(2*t))}function u(e,t){const r=l(e);for(const e of r)for(const r of e)r[0]+=t;return e}function l(e){return(0,s.Bi)(e)?e.rings:e.paths}},84498:(e,t,r)=>{r.d(t,{x:()=>i});var n=r(34275),o=r(97146),s=r(63907);function i(e,t){switch(t){case s.WR.TRIANGLES:return function(e){return"number"==typeof e?(0,o.tM)(e):(0,n.mg)(e)?new Uint16Array(e):e}(e);case s.WR.TRIANGLE_STRIP:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return[];const r=t-2,n=(0,o.my)(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;t+=1)t%2==0?(n[e++]=t,n[e++]=t+1,n[e++]=t+2):(n[e++]=t+1,n[e++]=t,n[e++]=t+2)}else{let t=0;for(let o=0;o<r;o+=1)o%2==0?(n[t++]=e[o],n[t++]=e[o+1],n[t++]=e[o+2]):(n[t++]=e[o+1],n[t++]=e[o],n[t++]=e[o+2])}return n}(e);case s.WR.TRIANGLE_FAN:return function(e){const t="number"==typeof e?e:e.length;if(t<3)return new Uint16Array(0);const r=t-2,n=r<=65536?new Uint16Array(3*r):new Uint32Array(3*r);if("number"==typeof e){let e=0;for(let t=0;t<r;++t)n[e++]=0,n[e++]=t+1,n[e++]=t+2;return n}const o=e[0];let s=e[1],i=0;for(let t=0;t<r;++t){const r=e[t+2];n[i++]=o,n[i++]=s,n[i++]=r,s=r}return n}(e)}}},88340:(e,t,r)=>{function n(){return new Float32Array(2)}function o(e,t){const r=new Float32Array(2);return r[0]=e,r[1]=t,r}function s(){return n()}function i(){return o(1,1)}function a(){return o(1,0)}function u(){return o(0,1)}r.d(t,{Un:()=>c,fA:()=>o,uY:()=>l,vt:()=>n});const l=s(),c=i(),f=a(),d=u();Object.freeze(Object.defineProperty({__proto__:null,ONES:c,UNIT_X:f,UNIT_Y:d,ZEROS:l,clone:function(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t},create:n,fromValues:o,ones:i,unitX:a,unitY:u,zeros:s},Symbol.toStringTag,{value:"Module"}))},92300:(e,t,r)=>{r.d(t,{V:()=>s,X:()=>o});var n=r(65864);function o(e){return{geometryType:(0,n.$B)(e[0]),geometries:e.map(e=>e.toJSON())}}function s(e,t,r){const o=(0,n.xD)(t);return e.map(e=>{const t=o.fromJSON(e);return t.spatialReference=r,t})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[9718],{5359:(e,t,i)=>{i.d(t,{H:()=>s,Z:()=>r});const s=Symbol("isImageryTileGraphicOrigin");function r(e){return!!e&&s in e}},18768:(e,t,i)=>{i.d(t,{b:()=>o});var s=i(31635),r=i(53966),a=i(91429),n=i(60694);const o=e=>{const t=e;let i=class extends t{get title(){if(this._get("title")&&"defaults"!==this.originOf("title"))return this._get("title");if(this.url){const e=(0,n.qg)(this.url);if(e?.title)return e.title}return this._get("title")||""}set title(e){this._set("title",e)}set url(e){this._set("url",(0,n.Jf)(e,r.A.getLogger(this)))}};return(0,s.Cg)([(0,a.MZ)()],i.prototype,"title",null),(0,s.Cg)([(0,a.MZ)({type:String})],i.prototype,"url",null),i=(0,s.Cg)([(0,a.$K)("esri.layers.mixins.ArcGISService")],i),i}},19718:(e,t,i)=>{i.r(t),i.d(t,{default:()=>Xe});var s,r=i(31635),a=i(37838),n=i(69540),o=i(49186),l=i(53966),c=i(25728),u=i(74887),f=i(36708),h=i(91429),p=i(56507),d=i(89808),m=i(99959),g=i(5359);class y extends m.A{get[(s=g.H,d.Q)](){return this.layer}constructor(e){super(),this[s]=!0,this.type="imagery-tile",this.layer=e}get id(){return this.layer.id}}var w=i(4146),v=i(18768),x=i(63074),b=i(69208),I=i(89015),C=i(16131),S=i(8303),A=i(63660),T=i(56551),R=i(54310),M=i(25036),O=i(82935),_=i(10873),F=i(20437),P=i(74797),k=i(22796),D=i(87045),N=i(76353),L=i(84169),E=i(4916),B=i(68197),z=i(5443),J=i(16930),U=i(73444),$=i(14140),j=i(16019);function q(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function Z(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function H(e){const{axes:t}=e.domain,i=Object.keys(t),s=[],r=[];let a=-1,n=-1,o=[];for(let e=0;e<i.length;e++){const l=i[e];q(l)?a=e:Z(l)&&(n=e);const c=t[l],u=[];if("values"in c){c.values.forEach(e=>u.push("string"==typeof e?new Date(e).getTime():e));const e=u[1]-u[0];s.push([u[0]-.5*e,u[u.length-1]+.5*e]),r.push(e)}else{const{start:e,stop:t,num:i}=c,a=(t-e)/(i-1);s.push([e-.5*a,t+.5*a]),r.push(a);for(let t=0;t<i;t++)u.push(e+a*t)}o.push({name:l,values:u,extent:[u[0],u[u.length-1]]})}a>-1&&-1===n?n=0===a?1:0:n>-1&&-1===a?a=0===n?1:0:-1===n&&-1===a&&(a=0,n=1),o=o.filter((e,t)=>!(t===a||t===n));const{referencing:l}=e.domain,c=l.find(e=>e.coordinates.includes(i[a])).system.id,u=c?.slice(c.lastIndexOf("/")+1),f=null==u||"CRS84"===u?4326:Number(u),h=new J.A({wkid:f}),[p,d]=s[a],[m,g]=s[n],y=new z.A({xmin:p,xmax:d,ymin:m,ymax:g,spatialReference:h});return{width:Math.round(y.width/r[a]),height:Math.round(y.height/r[n]),extent:y,dimensions:o}}function V(e){const t=(0,U.lR)();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function G(){return Math.round(255*Math.random())}function W(e){const t={},{parameters:i}=e;if(!i)return t;for(const[e,s]of Object.entries(i)){const{type:i,description:r,unit:a,categoryEncoding:n,observedProperty:o}=s;if("Parameter"===i&&(t[e]={},r&&(t[e].description=V(r)),a&&(t[e].unit=a.label?V(a.label):null,t[e].symbol=a.symbol?.value),n)){const i=Object.entries(n).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1}));let s=!1;o?.categories?.length&&(o.categories.forEach(e=>{if(!e.id)return;const t=e.id.slice(e.id.lastIndexOf("/")+1),r=i.find(e=>e.ClassName===t);if(!r)return;const a=e.label?V(e.label):null;if(r.Label=a,e.preferredColor){const t=B.A.fromHex(e.preferredColor);t&&(s=!0,r.Red=t.r,r.Green=t.g,r.Blue=t.b)}}),s&&i.forEach(e=>{null==e.Red&&(e.Red=G(),e.Green=G(),e.Blue=G())}));const r={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:i.map(e=>({attributes:e}))};s&&r.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),t[e].attributeTable=r}}return t}function X(e){let t=Number.MAX_VALUE,i=-Number.MAX_VALUE;for(let s=0;s<e.length;s++){const r=e[s];null!=r&&(r<t&&(t=r),r>i&&(i=r))}return(0,j.X1)(t,i)}function K(e,t,i){const s=e.map((e,i)=>({name:e,count:t[i]})).sort((e,t)=>e.name>t.name?-1:1),r=(a=1,e=>a*=e.count);var a;const n=[...s.slice(1),{name:"",count:1}].reverse().map(r).reverse();let o=0;for(let r=e.length-1;r>=0;r--)o+=n[s.findIndex(({name:t})=>t===e[r])]*(i%t[r]),i=Math.floor(i/t[r]);return o}var Y=i(45617),Q=i(87186),ee=i(77301),te=i(28435),ie=i(6952);let se=class extends E.A{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(e,t,i,s={}){if(!this._pixelBlockTiles){const{rasterInfo:r}=this,[a,n]=r.storageInfo.tileInfo.size,{sliceId:o}=s,{pixelBlocks:l}=this.source,c={pixelBlock:null==o?l[0]:l[o],useBilinear:"thematic"!==r.dataType,tileSize:{width:a,height:n},level:e,row:t,col:i},u=this.rasterJobHandler?this.rasterJobHandler.clipTile(c,s):(0,te.J$)(c);return Promise.resolve(u)}const r=this._pixelBlockTiles.get(`${e}/${t}/${i}`);return Promise.resolve(r)}async _open(e){const t=this.source,{pixelBlocks:i,attributeTable:s,statistics:r,histograms:a,name:n,nativeExtent:o,transform:l,colormap:c}=t,u=i[0],{width:f,height:h,pixelType:p}=u,d=t.extent??new z.A({xmin:-.5,ymin:.5,xmax:f-.5,ymax:h-.5,spatialReference:new J.A({wkid:3857})}),m=t.isPseudoSpatialReference??!t.extent,g={x:d.width/f,y:d.height/h},y={...t.keyProperties};t.dataType&&(y.DataType=t.dataType),t.bandInfos&&(y.BandProperties=t.bandInfos.map(e=>e.toJSON())),s&&(y.DataType="Thematic");const w=new Q.A({width:f,height:h,pixelType:p,extent:d,nativeExtent:o,attributeTable:s,colormap:c,transform:l,pixelSize:g,spatialReference:d.spatialReference,bandCount:u.pixels.length,keyProperties:y,multidimensionalInfo:t.multidimensionalInfo,statistics:r,isPseudoSpatialReference:m,histograms:a});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(w),this.createRemoteDatasetStorageInfo(w,512,512),this._set("rasterInfo",w),this.updateTileInfo(),w.multidimensionalInfo?await this._buildMDimStats(t.pixelBlocks,w.multidimensionalInfo):await this._buildInMemoryRaster(u,{width:512,height:512},e),w.multidimensionalInfo||(this.source=null),this.datasetName=n}async _buildInMemoryRaster(e,t,i){const{rasterInfo:s}=this,r=s.storageInfo.maximumPyramidLevel??0,a="thematic"!==s.dataType,n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:r,useBilinear:a},i):Promise.resolve((0,te.lD)(e,t,r,a)),l=null!=s.statistics,c=null!=s.histograms,f=this.ioConfig.skipStatistics||l?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},i):Promise.resolve((0,ie.f4)(e)),h=await(0,u.Lx)([n,f]);if(!h[0].value&&h[1].value)throw new o.A("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=h[0].value,l||(s.statistics=h[1].value?.statistics),c||(s.histograms=h[1].value?.histograms)}async _buildMDimStats(e,t,i){for(let s=0;s<t.variables.length;s++){const r=t.variables[s];if(r.statistics)continue;const a=r.dimensions.map(e=>new Y.A({variableName:r.name,dimensionName:e.name,values:[e.values?.[0]??e.extent?.[0]],isSlice:!0})),n=(0,ee.NG)(a,t),o=null==n?null:e[n];if(null==o)continue;const l=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:o},i):(0,ie.eH)(o);r.statistics=l.statistics,r.histograms||(r.histograms=l.histograms)}}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],se.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,h.MZ)()],se.prototype,"source",void 0),(0,r.Cg)([(0,h.MZ)()],se.prototype,"url",null),se=(0,r.Cg)([(0,h.$K)("esri.layers.support.rasterDatasets.InMemoryRaster")],se);const re=se;var ae=i(22671);let ne=class extends E.A{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _open(e){const{extent:t,pixelBlocks:i,multidimensionalInfo:s,attributeTable:r,bandNames:a}=await this._fetchData(e),{statistics:n,histograms:o}=(0,ie.eH)(i[0]),l=a?.map(e=>({BandName:e})),c={DataType:r?"Thematic":s?"Scientific":"Generic",BandProperties:l},u=new re({source:{extent:t,pixelBlocks:i,attributeTable:r?ae.A.fromJSON(r):null,multidimensionalInfo:s,statistics:n,histograms:o,keyProperties:c,isPseudoSpatialReference:!1}});await u.open(),this._inMemoryRaster=u;const f=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",f.slice(0,f.indexOf("."))),this._set("rasterInfo",u.rasterInfo)}async _fetchData(e){const t=this.source??(await this.request(this.url,{signal:e?.signal})).data,i="imagery-tile-layer:open-coverage-json";if("coverage"!==t.type?.toLowerCase()||"grid"!==t.domain?.domainType?.toLowerCase())throw new o.A(i,"Only coverage with Grid domain type is supported");if(!t.ranges)throw new o.A(i,"Missing ranges in the grid coverage data");if(!t.domain.referencing?.length)throw new o.A(i,"Missing domain referencing in the grid coverage data");const s=Object.values(t.ranges);for(let e=0;e<s.length;e++){const{axisNames:t,shape:r,type:a,values:n}=s[e];if(!("ndarray"===a.toLowerCase()&&n?.length&&t?.length&&r?.length))throw new o.A(i,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!q(t[t.length-1])||!Z(t[t.length-2]))throw new o.A(i,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return function(e){const{width:t,height:i,extent:s,dimensions:r}=H(e),{ranges:a}=e,n=Object.keys(a).sort((e,t)=>e<t?-1:1),o=[];for(let e=0;e<n.length;e++){const t=n[e];r?.length&&o.push({name:t,dimensions:r})}const l=W(e);o.forEach(e=>l[e.name]&&Object.assign(e,l[e.name]));const c=o.length?{variables:o}:void 0,u=[];for(let e=0;e<n.length;e++){const s=n[e],{values:o,dataType:l,axisNames:c,shape:f}=a[s],h=f.length>2?e*f.slice(0,-2).reduce((e,t)=>e*t):0,p=c.slice(0,-2),d=f.slice(0,-2),m="float"===l?"f32":X(o),g=t*i,y=o.length/g;for(let s=0;s<y;s++){const a=$.A.createEmptyBand(m,g),n=new Uint8Array(g).fill(255);let l=!1;const c=s*g;for(let e=0;e<g;e++){const t=o[c+e];null==t?(n[e]=0,l=!0):a[e]=t}if(0===e||r?.length){const e=new $.A({width:t,height:i,mask:l?n:null,pixels:[a],pixelType:m});e.updateStatistics(),r?.length?u[K(p,d,s)+h]=e:u.push(e)}else{const e=u[s];e.pixels.push(a),l?e.mask&&(e.mask=$.A.combineBandMasks([e.mask,n])):e.mask=l?n:null}}}const f=Object.values(l).find(e=>e.attributeTable)?.attributeTable;return{extent:s,pixelBlocks:u,multidimensionalInfo:c,attributeTable:f,bandNames:c?void 0:n}}(t)}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],ne.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,h.MZ)({constructOnly:!0})],ne.prototype,"source",void 0),ne=(0,r.Cg)([(0,h.$K)("esri.layers.support.rasterDatasets.CovJSONRaster")],ne);const oe=ne;var le=i(44208),ce=i(4576),ue=i(21325),fe=i(50103),he=i(21312);function pe(e,t){if(!e||!t)return null;const i=[];for(let s=0;s<e.length;s++)i.push(e[s]),i.push(t[s]);return i}function de(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&0!==t)return new J.A({wkid:t});if(e=String(e).trim(),(0,ue.jp)(e))return new J.A({wkt2:e});const i=e.toUpperCase();if(i.startsWith("COMPD_CS")){if(!i.includes("VERTCS")||!i.includes("GEOGCS")&&!i.startsWith("PROJCS"))return null;const s=i.indexOf("VERTCS"),r=i.indexOf("PROJCS"),a=r>-1?r:i.indexOf("GEOGCS");if(-1===a)return null;const n=e.slice(a,e.lastIndexOf("]",s)+1).trim(),o=e.slice(s,e.lastIndexOf("]")).trim();t=me(n);const l=new J.A(t?{wkid:t}:{wkt:n}),c=me(o);return c&&(l.vcsWkid=c),l}return i.startsWith("GEOGCS")||i.startsWith("PROJCS")?(t=me(e),new J.A(0!==t?{wkid:t}:{wkt:e})):null}function me(e){const t=e.replaceAll("]","[").replaceAll('"',"").split("[").map(e=>e.trim()).filter(e=>""!==e),i=t[t.length-1].split(","),s=i[0]?.toLowerCase();if(("epsg"===s||"esri"===s)&&e.endsWith('"]]')){const e=Number(i[1]);if(!isNaN(e)&&0!==e)return e}return 0}function ge(e){if("pamdataset"!==e?.documentElement.tagName?.toLowerCase())return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(e=>{if(1===e.nodeType)if((0,fe.g7)(e,"SRS")){if(!t.spatialReference){const i=(0,fe.mX)(e);t.spatialReference=de(i)}}else if((0,fe.g7)(e,"Metadata"))if("xml:ESRI"===e.getAttribute("domain")){const{spatialReference:i,transform:s}=function(e){const t=(0,fe.V6)(e,"GeodataXform"),i=de((0,fe.v7)(t,"SpatialReference/WKID")||(0,fe.mX)(t,"SpatialReference/WKT"));if("typens:PolynomialXform"!==t.getAttribute("xsi:type"))return{spatialReference:i,transform:null};const s=(0,fe.v7)(t,"PolynomialOrder")??1,r=(0,fe.Ui)(t,"CoeffX/Double"),a=(0,fe.Ui)(t,"CoeffY/Double"),n=(0,fe.Ui)(t,"InverseCoeffX/Double"),o=(0,fe.Ui)(t,"InverseCoeffY/Double"),l=pe(r,a),c=pe(n,o);return{spatialReference:i,transform:l&&c&&l.length&&c.length?new he.A({spatialReference:i,polynomialOrder:s,forwardCoefficients:l,inverseCoefficients:c}):null}}(e);t.transform=s,t.spatialReference||(t.spatialReference=i)}else(0,fe.IC)(e,"MDI").forEach(e=>t.metadata[e.getAttribute("key")]=(0,fe.mX)(e));else if((0,fe.g7)(e,"PAMRasterBand")){const i=function(e){const t=(0,fe.v7)(e,"NoDataValue"),i=(0,fe.V6)(e,"Histograms/HistItem"),s=(0,fe.v7)(i,"HistMin"),r=(0,fe.v7)(i,"HistMax"),a=(0,fe.v7)(i,"BucketCount"),n=(0,fe.mX)(i,"HistCounts")?.split("|").map(e=>Number(e));let o,l,c,u;(0,fe.IC)(e,"Metadata/MDI").forEach(e=>{const t=Number(e.textContent??e.nodeValue);switch(e.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":o=t;break;case"STATISTICS_MAXIMUM":l=t;break;case"STATISTICS_MEAN":c=t;break;case"STATISTICS_STDDEV":u=t}});const f=(0,fe.v7)(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:n?.length&&null!=s&&null!=r?{min:s,max:r,size:a||n.length,counts:n}:null,sourceBandIndex:f,statistics:null!=o&&null!=l?{min:o,max:l,avg:c,stddev:u}:null}}(e);null!=i.sourceBandIndex&&null==t.rasterBands[i.sourceBandIndex]?t.rasterBands[i.sourceBandIndex]=i:t.rasterBands.push(i)}});const i=t.rasterBands;if(i.length){const e=!!i[0].statistics;t.statistics=e?i.map(e=>e.statistics).filter(ce.Ru):null;const s=!!i[0].histogram;t.histograms=s?i.map(e=>e.histogram).filter(ce.Ru):null}return t}var ye=i(77649);let we=class extends E.A{fetchRawTile(e,t,i,s={}){return this._inMemoryRaster.fetchRawTile(e,t,i,s)}async _open(e){const t=await this._fetchData(e);let{spatialReference:i,statistics:s,histograms:r,transform:a}=await this._fetchAuxiliaryData(e);const n=!i;n&&(i=new J.A({wkid:3857})),r?.length&&null==s&&(s=(0,ie.Pg)(r));const{width:o,height:l}=t;let c=new z.A({xmin:-.5,ymin:.5-l,xmax:o-.5,ymax:.5,spatialReference:i});const u=a?a.forwardTransform(c):c;let f=!0;if(a){const e=a.forwardCoefficients;f=e&&0===e[1]&&0===e[2],f&&(a=null,c=u)}const h=new re({source:{extent:u,nativeExtent:c,transform:a,pixelBlocks:[t],statistics:s,histograms:r,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:n},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(h.ioConfig.skipMapInfo=!0),await h.open(),h.source=null,this._set("rasterInfo",h.rasterInfo),this._inMemoryRaster=h}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e?.signal}),i=(0,ye.g)(t).toUpperCase();if("JPG"!==i&&"PNG"!==i&&"GIF"!==i&&"BMP"!==i)throw new o.A("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",i);const s=i.toLowerCase(),r="gif"===s||"bmp"===s||!(0,le.A)("ios"),a=await this.decodePixelBlock(t,{format:s,useCanvas:r,hasNoZlibMask:!0});if(null==a)throw new o.A("image-aux-raster:open","the data cannot be decoded");return a}async _fetchAuxiliaryData(e){const t=e?.signal,{skipExtensions:i=[],skipMapInfo:s}=this.ioConfig,r=s||i.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),a=this.datasetFormat,n="JPG"===a?"jgw":"PNG"===a?"pgw":"BMP"===a?"bpw":null,o=n&&i.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),l=await(0,u.Lx)([r,o]);if(t?.aborted)throw(0,u.NK)();const c=ge(l[0].value?.data);if(!c.transform){const e=l[1].value?l[1].value.data.split("\n").slice(0,6).map(e=>Number(e)):null;c.transform=6===e?.length?new he.A({forwardCoefficients:[e[4],e[5],e[0],-e[1],e[2],-e[3]]}):null}return c}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],we.prototype,"datasetFormat",void 0),we=(0,r.Cg)([(0,h.$K)("esri.layers.support.rasterDatasets.ImageAuxRaster")],we);const ve=we;var xe=i(97768),be=i(84952),Ie=i(86738),Ce=i(20223),Se=i(25943),Ae=i(73037),Te=i(82371);let Re=class extends E.A{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,s={}){const{storageInfo:r,extent:a}=this.rasterInfo,{transposeInfo:n}=r,o=null!=n&&!!s.transposedVariableName;if(this._slices&&!o&&null==s.sliceId)return null;const l=o?0:r.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${l}/${t}/${i}`,u=this._slices?o?{variable:s.transposedVariableName}:{sliceId:s.sliceId||0}:null;let f,h;if(r.isBsqTile){const e=(s.bandIds?.length?s.bandIds:[0,1,2]).map(e=>this.request(c,{query:{...u,bandId:e},responseType:"array-buffer",signal:s.signal})),t=await Promise.all(e),i=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),r=new Uint8Array(i);h=[];let a=0;for(const{data:e}of t)h.push(a),r.set(new Uint8Array(e),a),a+=e.byteLength;f=r.buffer}else f=(await this.request(c,{query:u,responseType:"array-buffer",signal:s.signal})).data;if(!f)return null;const p=o?n.tileSize:r.tileInfo.size,d=await this.decodePixelBlock(f,{width:p[0],height:p[1],planes:h?.length,offsets:h,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:o,noDataValue:this.rasterInfo.noDataValue});if(null==d)return null;const m=r.blockBoundary[e];if("jpg"!==r.compression||i>m.minCol&&i<m.maxCol&&t>m.minRow&&t<m.maxRow)return d;const{origin:g,blockWidth:y,blockHeight:w}=r,{x:v,y:x}=this.getPyramidPixelSize(e),b=Math.round((a.xmin-g.x)/v)%y,I=Math.round((a.xmax-g.x)/v)%y||y,C=Math.round((g.y-a.ymax)/x)%w,S=Math.round((g.y-a.ymin)/x)%w||w,A=i===m.minCol?b:0,T=t===m.minRow?C:0,R=i===m.maxCol?I:y,M=t===m.maxRow?S:w;return(0,te.z$)(d,{x:A,y:T},{width:R-A,height:M-T}),d}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let e=0;e<this._slices.length;e++){const i=this._slices[e].multidimensionalDefinition;if(i.length===t.length&&!i.some(e=>{const i=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);return!i||(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])}))return e}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),s=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),r=await Promise.all([i,s]);return r[0]&&r[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),r[1]?.[0]?.counts?.length||(r[1]=null),{statistics:r[0]||null,histograms:r[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let s=0;const{maximumPyramidLevel:r}=this.rasterInfo.storageInfo;let a=r-s+this._levelOffset;const n=i.srcLocation;for(;a>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(a,i.row,i.col,t))break}catch{}if(a--,s++,i=this.identifyPixelLocation(n,s,t.datumTransformation),null===i)return null}return-1===a||null==i?null:s}async _open(e){const t=e?.signal,i=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});i.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const s=i.data;if(this.sourceJSON=s,!s)throw new o.A("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!s.tileInfo)throw new o.A("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo(),this.tileType=s.cacheType,null==this.tileType&&(["jpg","jpeg","png","png8","png24","png32","mixed"].includes(s.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===s.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=s.name?.slice(s.name.indexOf("/")+1)??"";const r=await this._fetchRasterInfo({signal:t});if(null==r)throw new o.A("image-server-raster:open","cannot initialize image service");(0,Te.E9)(r,s);const a="Map"===this.tileType?function(e,t){if(!e)return null;const{minScale:i,maxScale:s,minLOD:r,maxLOD:a}=t;if(null!=r&&null!=a)return D.A.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=r&&e<=a)});if(0!==i&&0!==s){const t=e=>Math.round(1e4*e)/1e4,r=i?t(i):1/0,a=s?t(s):-1/0;return D.A.fromJSON({...e,lods:e.lods.filter(e=>{const i=t(e.scale);return i<=r&&i>=a})})}return D.A.fromJSON(e)}(s.tileInfo,s):D.A.fromJSON(s.tileInfo);(0,xe.Lw)(a);const[n,l]=this._computeMinMaxLOD(r,a),{extent:c,pixelSize:u}=r,f=.5/r.width*u.x,h=Math.max(u.x,u.y),{lods:p}=a;("Map"!==this.tileType&&0!==s.maxScale||Math.abs(u.x-u.y)>f||!p.some(e=>Math.abs(e.resolution-h)<f))&&(u.x=u.y=n.resolution,r.width=Math.ceil((c.xmax-c.xmin)/u.x-.1),r.height=Math.ceil((c.ymax-c.ymin)/u.y-.1));const d=n.level-l.level,[m,g]=a.size,y=[],w=[];p.forEach((e,t)=>{e.level>=l.level&&e.level<=n.level&&y.push({x:e.resolution,y:e.resolution}),t<p.length-1&&w.push(Math.round(10*e.resolution/p[t+1].resolution)/10)}),y.sort((e,t)=>e.x-t.x);const v=this.computeBlockBoundary(c,m,g,a.origin,y,d),x=y.length>1?y.slice(1):null;let b;s.transposeInfo&&(b={tileSize:[s.transposeInfo.rows,s.transposeInfo.cols],packetSize:r.keyProperties?._yxs.PacketSize??0});const I=w.length<=1||w.length>=3&&w.slice(0,-1).every(e=>e===w[0])?w[0]??2:Math.round(10/(l.resolution/n.resolution)**(-1/d))/10;if(r.storageInfo=new Ce.A({blockWidth:a.size[0],blockHeight:a.size[1],pyramidBlockWidth:a.size[0],pyramidBlockHeight:a.size[1],pyramidResolutions:x,pyramidScalingFactor:I,compression:a.format,origin:a.origin,firstPyramidLevel:1,maximumPyramidLevel:d,tileInfo:a,isBsqTile:!!s.bsq,transposeInfo:b,blockBoundary:v}),function(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new Ae.A,e.extent=e.transform.forwardTransform(t))}(r),this._set("rasterInfo",r),s.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:r.storageInfo.tileInfo,parsedUrl:(0,be.An)(this.url),url:this.url,tileServers:[]};this._tilemapCache=new Se.d({layer:e})}}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),s=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),r=J.A.fromJSON(t.spatialReference||e.spatialReference),a=new Ie.A({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:r});return new Q.A({width:i,height:s,bandCount:3,extent:z.A.fromJSON(e),spatialReference:r,pixelSize:a,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,s=(0,Te.Tw)(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),r=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then(e=>e.data?.slices).catch(()=>null):null,a=await Promise.all([s,r]);return this._slices=a[1],a[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,s=.5/e.width*i.x,{lods:r}=t,a=t.lodAt(Math.max.apply(null,r.map(e=>e.level))),n=t.lodAt(Math.min.apply(null,r.map(e=>e.level))),{tileType:o}=this;if("Map"===o)return this._levelOffset=r[0].level,[a,n];if("Raster"===o)return[r.find(e=>e.resolution===i.x)??a,n];const{minScale:l,maxScale:c}=this.sourceJSON;let u=a;c>0&&(u=r.find(e=>Math.abs(e.scale-c)<s),u||(u=r.filter(e=>e.scale>c).sort((e,t)=>e.scale>t.scale?1:-1)[0]??a));let f=n;return l>0&&(f=r.find(e=>Math.abs(e.scale-l)<s)??n,this._levelOffset=f.level-n.level),[u,f]}};(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Re.prototype,"datasetFormat",void 0),(0,r.Cg)([(0,h.MZ)()],Re.prototype,"tileType",void 0),Re=(0,r.Cg)([(0,h.$K)("esri.layers.support.rasterDatasets.ImageServerRaster")],Re);const Me=Re;var Oe=i(47124);const _e=new Map;_e.set("Int8","s8"),_e.set("UInt8","u8"),_e.set("Int16","s16"),_e.set("UInt16","u16"),_e.set("Int32","s32"),_e.set("UInt32","u32"),_e.set("Float32","f32"),_e.set("Float64","f32"),_e.set("Double64","f32");const Fe=new Map;Fe.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),Fe.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),Fe.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),Fe.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),Fe.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let Pe=class extends E.A{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(e,t,i,s={}){const{blockWidth:r,blockHeight:a,blockBoundary:n}=this.rasterInfo.storageInfo,o=n[e];if(!o||o.maxRow<t||o.maxCol<i||o.minRow>t||o.minCol>i)return null;const{bandCount:l,pixelType:c}=this.rasterInfo,{ranges:u,actualTileWidth:f,actualTileHeight:h}=this._getTileLocation(e,t,i);if(!u||0===u.length)return null;if(0===u[0].from&&0===u[0].to){const e=new Uint8Array(r*a);return new $.A({width:r,height:a,pixels:void 0,mask:e,validPixelCount:0})}const{bandIds:p}=this.ioConfig,d=this._getBandSegmentCount(),m=[];let g=0;for(g=0;g<d;g++)p&&!p.includes(g)||m.push(this.request(this._files.data,{range:{from:u[g].from,to:u[g].to},responseType:"array-buffer",signal:s.signal}));const y=await Promise.all(m),w=y.map(e=>e.data.byteLength).reduce((e,t)=>e+t),v=new Uint8Array(w),x=[];let b=0;for(g=0;g<d;g++)x.push(b),v.set(new Uint8Array(y[g].data),b),b+=y[g].data.byteLength;const I=Fe.get(this.rasterInfo.storageInfo.compression).decoderFormat,C=await this.decodePixelBlock(v.buffer,{width:r,height:a,format:I,planes:p?.length||l,offsets:x,pixelType:c}).catch(()=>null);if(null==C)return null;let{noDataValue:S}=this.rasterInfo;if(null!=S&&"lerc"!==I&&!C.mask&&(S=S[0],null!=S)){const e=C.width*C.height,t=new Uint8Array(e);if(Math.abs(S)>1e24)for(g=0;g<e;g++)Math.abs((C.pixels[0][g]-S)/S)>1e-6&&(t[g]=1);else for(g=0;g<e;g++)C.pixels[0][g]!==S&&(t[g]=1);C.mask=t}let A=0,T=0;if(f!==r||h!==a){let e=C.mask;if(e)for(g=0;g<a;g++)if(T=g*r,g<h)for(A=f;A<r;A++)e[T+A]=0;else for(A=0;A<r;A++)e[T+A]=0;else for(e=new Uint8Array(r*a),C.mask=e,g=0;g<h;g++)for(T=g*r,A=0;A<f;A++)e[T+A]=1}return C}async _open(e){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const t=e?e.signal:null,i=await this.request(this.url,{responseType:"xml",signal:t}),{rasterInfo:s,files:r}=this._parseHeader(i.data),{skipMapInfo:a,skipExtensions:n=[]}=this.ioConfig;if(!n.includes("aux.xml")&&!a){const t=await this._fetchAuxiliaryData(e);null!=t&&(s.statistics=t.statistics??s.statistics,s.histograms=t.histograms,t.histograms&&null==s.statistics&&(s.statistics=(0,ie.Pg)(t.histograms)))}a&&this.updateImageSpaceRasterInfo(s),this._set("rasterInfo",s),this._files=r;const o=await this.request(r.index,{responseType:"array-buffer",signal:t});this._storageIndex=function(e){if(e.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let t,i,s,r,a,n;if(Oe.Z){for(i=new Uint8Array(e),r=new ArrayBuffer(e.byteLength),s=new Uint8Array(r),a=0;a<e.byteLength/4;a++)for(n=0;n<4;n++)s[4*a+n]=i[4*a+3-n];t=new Uint32Array(r)}else t=new Uint32Array(e);return t}(o.data);const{blockWidth:l,blockHeight:c}=this.rasterInfo.storageInfo,u=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:f,height:h}=this.rasterInfo,p=[],d=this._getBandSegmentCount();let m=0,g=-1;for(;m<this._storageIndex.length;){g++;const e=Math.ceil(f/l/u**g)-1,t=Math.ceil(h/c/u**g)-1;m+=(e+1)*(t+1)*d*4,p.push({maxRow:t,maxCol:e,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,g>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=g),this.updateTileInfo()}_getBandSegmentCount(){return Fe.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(e,t,i){const{blockWidth:s,blockHeight:r,pyramidScalingFactor:a}=this.rasterInfo.storageInfo,{width:n,height:o}=this.rasterInfo,l=this._getBandSegmentCount();let c,u,f,h=0,p=0;for(f=0;f<e;f++)p=a**f,c=Math.ceil(n/s/p),u=Math.ceil(o/r/p),h+=c*u;p=a**e,c=Math.ceil(n/s/p),u=Math.ceil(o/r/p),h+=t*c+i,h*=4*l;const d=this._storageIndex.subarray(h,h+4*l);let m=0,g=0;const y=[];for(let e=0;e<l;e++)m=d[4*e]*2**32+d[4*e+1],g=m+d[4*e+2]*2**32+d[4*e+3]-1,y.push({from:m,to:g});return{ranges:y,actualTileWidth:i<c-1?s:Math.ceil(n/p)-s*(c-1),actualTileHeight:t<u-1?r:Math.ceil(o/p)-r*(u-1)}}_parseHeader(e){const t=(0,fe.V6)(e,"MRF_META/Raster");if(!t)throw new o.A("mrf:open","not a valid MRF format");const i=(0,fe.V6)(t,"Size"),s=parseInt(i.getAttribute("x"),10),r=parseInt(i.getAttribute("y"),10),a=parseInt(i.getAttribute("c"),10),n=((0,fe.mX)(t,"Compression")||"none").toLowerCase();if(!Fe.has(n))throw new o.A("mrf:open","currently does not support compression "+n);const l=(0,fe.mX)(t,"DataType")||"UInt8",c=_e.get(l);if(null==c)throw new o.A("mrf:open","currently does not support pixel type "+l);const u=(0,fe.V6)(t,"PageSize"),f=parseInt(u.getAttribute("x"),10),h=parseInt(u.getAttribute("y"),10),p=(0,fe.V6)(t,"DataValues");let d,m;if(p&&(m=p.getAttribute("NoData"),null!=m&&(d=m.trim().split(" ").map(e=>parseFloat(e)))),(0,fe.V6)(e,"MRF_META/CachedSource"))throw new o.A("mrf:open","currently does not support MRF referencing other data files");const g=(0,fe.V6)(e,"MRF_META/GeoTags"),y=(0,fe.V6)(g,"BoundingBox");let w,v=!1;if(null!=y){const e=parseFloat(y.getAttribute("minx")),t=parseFloat(y.getAttribute("miny")),i=parseFloat(y.getAttribute("maxx")),s=parseFloat(y.getAttribute("maxy")),r=(0,fe.mX)(g,"Projection")||"";let a=J.A.WGS84;if("LOCAL_CS[]"!==r)if(r.toLowerCase().startsWith("epsg:")){const e=Number(r.slice(5));isNaN(e)||0===e||(a=new J.A({wkid:e}))}else a=de(r)??J.A.WGS84;else v=!0,a=new J.A({wkid:3857});w=new z.A(e,t,i,s),w.spatialReference=a}else v=!0,w=new z.A({xmin:-.5,ymin:.5-r,xmax:s-.5,ymax:.5,spatialReference:new J.A({wkid:3857})});const x=(0,fe.V6)(e,"MRF_META/Rsets"),b=parseInt(x?.getAttribute("scale")||"2",10),I=w.spatialReference,C=new Ce.A({origin:new Ie.A({x:w.xmin,y:w.ymax,spatialReference:I}),blockWidth:f,blockHeight:h,pyramidBlockWidth:f,pyramidBlockHeight:h,compression:n,pyramidScalingFactor:b}),S=new Ie.A({x:w.width/s,y:w.height/r,spatialReference:I}),A=new Q.A({width:s,height:r,extent:w,isPseudoSpatialReference:v,spatialReference:I,bandCount:a,pixelType:c,pixelSize:S,noDataValue:d,storageInfo:C}),T=(0,fe.mX)(e,"datafile"),R=(0,fe.mX)(e,"IndexFile");return{rasterInfo:A,files:{mrf:this.url,index:R||this.url.replace(".mrf",".idx"),data:T||this.url.replace(".mrf",Fe.get(n).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ge(t)}catch{return null}}};(0,r.Cg)([(0,h.MZ)()],Pe.prototype,"_files",void 0),(0,r.Cg)([(0,h.MZ)()],Pe.prototype,"_storageIndex",void 0),(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Pe.prototype,"datasetFormat",void 0),Pe=(0,r.Cg)([(0,h.$K)("esri.layers.support.rasterDatasets.MRFRaster")],Pe);const ke=Pe;var De=i(15265);function Ne(e){const t=e.fields,i=e.records,s=t.some(e=>"oid"===e.name.toLowerCase())?"OBJECTID":"OID",r=[{name:s,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(e=>({name:e.name,type:"esriFieldType"+e.typeName,alias:e.name}))),a=r.map(e=>e.name),n=[];let o=0,l=0;return i.forEach(e=>{const t={};for(t[s]=o++,l=1;l<a.length;l++)t[a[l]]=e[l-1];n.push({attributes:t})}),{displayFieldName:"",fields:r,features:n}}class Le{static get supportedVersions(){return[5]}static parse(e){const t=new DataView(e),i=3&t.getUint8(0);if(3!==i)return{header:{version:i},recordSet:null};const s=t.getUint32(4,!0),r=t.getUint16(8,!0),a=t.getUint16(10,!0),n={version:i,recordCount:s,headerByteCount:r,recordByteCount:a};let o=32;const l=[],c=[];let u;if(3===i){for(;13!==t.getUint8(o);)u=String.fromCharCode(t.getUint8(o+11)).trim(),l.push({name:(0,De.w)(new Uint8Array(e,o,11)),type:u,typeName:["String","Date","Double","Boolean","String","Integer"][["C","D","F","L","M","N"].indexOf(u)],length:t.getUint8(o+16)}),o+=32;if(o+=1,l.length>0)for(;c.length<s&&e.byteLength-o>a;){const i=[];32===t.getUint8(o)?(o+=1,l.forEach(t=>{if("C"===t.type)i.push((0,De.w)(new Uint8Array(e,o,t.length)).trim());else if("N"===t.type)i.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim(),10));else if("F"===t.type)i.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim()));else if("D"===t.type){const s=String.fromCharCode.apply(null,new Uint8Array(e,o,t.length)).trim();i.push(new Date(parseInt(s.slice(0,4),10),parseInt(s.slice(4,6),10)-1,parseInt(s.slice(6,8),10)))}o+=t.length}),c.push(i)):o+=a}}return{header:n,fields:l,records:c,recordSet:Ne({fields:l,records:c})}}}var Ee=i(45664),Be=i(12196);const ze=(e,t)=>e.get(t)?.values,Je=(e,t)=>e.get(t)?.values?.[0];let Ue=class extends E.A{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,s={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const r=await this._fetchRawTiffTile(e,t,i,!1,s);if(null!=r&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,i,!0,s);null!=a&&a.pixels[0]instanceof Uint8Array&&(r.mask=a.pixels[0])}return r}async _open(e){const t=e?e.signal:null,{data:i}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!i)throw new o.A("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:s,firstIFDPos:r,isBigTiff:a}=(0,Ee.uT)(i),n=[],c={fileChunk:i,posIFD:r,fileOffset:0};await this._readIFDs(n,c,s,a?8:4,t);const{imageInfo:u,rasterInfo:f}=function(e){const t=(0,Ee.uc)(e),{width:i,height:s,tileWidth:r,tileHeight:a,planes:n,pixelType:o,compression:l,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidBlockWidth:f,pyramidBlockHeight:h,pyramidResolutions:p,tileBoundary:d,affine:m,metadata:g}=t;let y=de(t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid),w=!!t.isPseudoGeographic;null==y&&(w=!0,y=new J.A({wkid:3857}));const v=new z.A({...t.extent,spatialReference:y}),x=new Ie.A(v?{x:v.xmin,y:v.ymax,spatialReference:y}:{x:0,y:0}),b=new Ce.A({blockWidth:r,blockHeight:a,pyramidBlockWidth:f,pyramidBlockHeight:h,compression:l,origin:x,firstPyramidLevel:c,maximumPyramidLevel:u,pyramidResolutions:p,blockBoundary:d}),I=new Ie.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/s,spatialReference:y}),C=g?{BandProperties:g.bandProperties,DataType:g.dataType}:{};let S=null;const A=Je(e[0],"PHOTOMETRICINTERPRETATION"),T=ze(e[0],"COLORMAP");if(A<=3&&T?.length>3&&T.length%3==0){S=[];const e=T.length/3;for(let t=0;t<e;t++)S.push([t,T[t]>>>8,T[t+e]>>>8,T[t+2*e]>>>8])}const R=new Q.A({width:i,height:s,bandCount:n,pixelType:o,pixelSize:I,storageInfo:b,spatialReference:y,isPseudoSpatialReference:w,keyProperties:C,extent:v,colormap:S,statistics:g?g.statistics:null});if(m?.length&&(R.nativeExtent=new z.A({xmin:-.5,ymin:.5-s,xmax:i-.5,ymax:.5,spatialReference:y}),R.transform=new he.A({polynomialOrder:1,forwardCoefficients:[m[2]+m[0]/2,m[5]-m[3]/2,m[0],m[3],-m[1],-m[4]]}),R.extent=R.transform.forwardTransform(R.nativeExtent),R.pixelSize=new Ie.A({x:(v.xmax-v.xmin)/i,y:(v.ymax-v.ymin)/s,spatialReference:y}),b.origin.x=-.5,b.origin.y=.5),p){const{x:e,y:t}=R.pixelSize;p.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:R}}(n),h=(0,Ee.zS)(n),p=(0,Ee.r9)(n);if(this._headerInfo={littleEndian:s,isBigTiff:a,ifds:n,pyramidIFDs:h,maskIFDs:p,...u},this._set("rasterInfo",f),!u.isSupported)throw new o.A("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new o.A("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");f.isPseudoSpatialReference&&l.A.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const d=n[0].get("PREDICTOR")?.values?.[0],m=n[0].get("SAMPLEFORMAT")?.values?.[0];if(3===m&&2===d)throw new o.A("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:g,skipExtensions:y=[]}=this.ioConfig;if(!y.includes("aux.xml")&&!g){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&function(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=(0,ie.Pg)(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new Ie.A({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}(t,f)}y.includes("vat.dbf")||1!==f.bandCount||"u8"!==f.pixelType||g||(f.attributeTable=await this._fetchAuxiliaryTable(e),null!=f.attributeTable&&(f.keyProperties.DataType="thematic")),g&&this.updateImageSpaceRasterInfo(f),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:s,posIFD:r}=e;return(r+8>=i.byteLength||r<0)&&(s=r+s,i=(await this.request(this.url,{range:{from:s,to:s+this._bufferSize},responseType:"array-buffer",signal:t})).data,r=0),{fileChunk:i,fileOffset:s,posIFD:r}}async _readIFDs(e,t,i,s=4,r){if(!t.posIFD)return null;t=await this._validateOrFetchHeaderBuffer(t,r);const a=await this._readIFD(t,i,Be.NB,s,r);if(!a?.ifd)throw new o.A("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(a.ifd),!a.nextIFD)return null;t.posIFD=a.nextIFD-t.fileOffset,await this._readIFDs(e,t,i,s,r)}async _readIFD(e,t,i=Be.NB,s=4,r){let{fileChunk:a,posIFD:n,fileOffset:o}=e;if(!e.fileChunk)return null;const l=(0,Ee.JM)(a,t,n,o,i,s);if(l.success){const e=[];if(l.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,l.nextIFD,r),l.ifd?.has("GEOKEYDIRECTORY")){const e=l.ifd.get("GEOKEYDIRECTORY"),i=e?.values;if(i&&i.length>4){const s=i[0]+"."+i[1]+"."+i[2];n=e.valueOffset+6-o;const l=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:n,fileOffset:o},r),c=await this._readIFD(l,t,Be.YC,2,r);e.data=c?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}return l}return l.requiredBufferSize?(a=(await this.request(this.url,{range:{from:o,to:o+n+l.requiredBufferSize+8},responseType:"array-buffer",signal:r})).data,a.byteLength<n+l.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=o,this._readIFD(e,t,i,s,r))):null}async _fillOffsets(e,t,i,s){const r=e.filter(e=>null!=e.offlineOffsetSize);if(0===r.length)return;const a=r.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,a.map(e=>e[0])),o=Math.max.apply(null,a.map(e=>e[0]+e[1]));let l=1===a.length||o-n<=this._bufferSize;if(!l&&a.length>1&&(a.sort((e,t)=>e[0]-t[0]),l=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===o),l){const e=await this._fetchOffsets(n,Math.max(o,n+this._bufferSize),s);return void r.forEach(i=>(0,Ee.Cr)(e,t,i,n))}const c=r.map(async e=>{const i=e.offlineOffsetSize,r=await this._fetchOffsets(i[0],i[1]+i[0],s);(0,Ee.Cr)(r,t,e,i[0])});await Promise.all(c)}async _fetchOffsets(e,t,i){const s=[],r=this._chunkSize,a=Math.ceil((t-e)/r);let n=e;for(let e=0;e<a;e++)s.push(this.request(this.url,{range:{from:n,to:e===a-1?t:n+r-1},responseType:"array-buffer",signal:i})),n+=r;const o=await Promise.all(s);if(1===a)return o[0].data;const l=new Uint8Array(t-e+1);for(let e=0;e<a;e++)l.set(new Uint8Array(o[e].data),e*r);return l.buffer}async _fetchRawTiffTile(e,t,i,s,r={}){const a=this._getTileLocation(e,t,i,s);if(!a)return null;const{ranges:n,actualTileWidth:o,actualTileHeight:l,ifd:c}=a,u=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:r.signal})),f=await Promise.all(u),h=f.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===f.length?f[0].data:new ArrayBuffer(h),d=[0],m=[0];if(f.length>1){const e=new Uint8Array(p);for(let t=0,i=0;t<f.length;t++){const s=f[t].data;e.set(new Uint8Array(s),i),d[t]=i,i+=s.byteLength,m[t]=s.byteLength}}const{blockWidth:g,blockHeight:y}=this.getBlockWidthHeight(e),w=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:c,offsets:d,sizes:m},width:g,height:y,planes:null,pixelType:null});if(null==w)return null;let v,x,b;if(o!==g||l!==y){let e=w.mask;if(e)for(v=0;v<y;v++)if(b=v*g,v<l)for(x=o;x<g;x++)e[b+x]=0;else for(x=0;x<g;x++)e[b+x]=0;else for(e=new Uint8Array(g*y),w.mask=e,v=0;v<l;v++)for(b=v*g,x=0;x<o;x++)e[b+x]=1}return w}_getTileLocation(e,t,i,s=!1){const{firstPyramidLevel:r,blockBoundary:a}=this.rasterInfo.storageInfo,n=0===e?0:e-(r-1),{_headerInfo:o}=this;if(!o)return null;const l=s?o.maskIFDs[n]:0===n?o?.ifds[0]:o?.pyramidIFDs[n-1];if(!l)return null;const c=(0,Ee.XO)(l,o),u=ze(l,"TILEOFFSETS");if(void 0===u)return null;const f=ze(l,"TILEBYTECOUNTS"),{minRow:h,minCol:p,maxRow:d,maxCol:m}=a[n];if(t>d||i>m||t<h||i<p)return null;const g=Je(l,"IMAGEWIDTH"),y=Je(l,"IMAGELENGTH"),w=Je(l,"TILEWIDTH"),v=Je(l,"TILELENGTH"),x=[];if(c){const{bandCount:e}=this.rasterInfo;for(let s=0;s<e;s++){const e=s*(d+1)*(m+1)+t*(m+1)+i;x[s]={from:u[e],to:u[e]+f[e]-1}}}else{const e=t*(m+1)+i;x.push({from:u[e],to:u[e]+f[e]-1})}for(let e=0;e<x.length;e++)if(null==x[e].from||!x[e].to||x[e].to<0)return null;return{ranges:x,ifd:l,actualTileWidth:i===m&&g%w||w,actualTileHeight:t===d&&y%v||v}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return ge(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=Le.parse(t);return i?.recordSet?ae.A.fromJSON(i.recordSet):null}catch{return null}}};(0,r.Cg)([(0,h.MZ)()],Ue.prototype,"_files",void 0),(0,r.Cg)([(0,h.MZ)()],Ue.prototype,"_headerInfo",void 0),(0,r.Cg)([(0,h.MZ)()],Ue.prototype,"_bufferSize",void 0),(0,r.Cg)([(0,h.MZ)()],Ue.prototype,"_chunkSize",void 0),(0,r.Cg)([(0,h.MZ)({type:String,json:{write:!0}})],Ue.prototype,"datasetFormat",void 0),Ue=(0,r.Cg)([(0,h.$K)("esri.layers.support.rasterDatasets.TIFFRaster")],Ue);const $e=Ue,je=new Map;je.set("MRF",{desc:"Meta Raster Format",constructor:ke}),je.set("TIFF",{desc:"GeoTIFF",constructor:$e}),je.set("RasterTileServer",{desc:"Raster Tile Server",constructor:Me}),je.set("JPG",{desc:"JPG Raster Format",constructor:ve}),je.set("PNG",{desc:"PNG Raster Format",constructor:ve}),je.set("GIF",{desc:"GIF Raster Format",constructor:ve}),je.set("BMP",{desc:"BMP Raster Format",constructor:ve}),je.set("CovJSON",{desc:"COVJSON Raster Format",constructor:oe}),je.set("MEMORY",{desc:"In Memory Raster Format",constructor:re});class qe{static get supportedFormats(){const e=new Set;return je.forEach((t,i)=>e.add(i)),e}static async open(e){const{url:t,ioConfig:i,source:s,sourceJSON:r}=e;let a=e.datasetFormat??i?.datasetFormat;null==a&&(t.includes(".")?a=t.slice(t.lastIndexOf(".")+1).toUpperCase():"coverage"===s?.type?.toLowerCase()?a="CovJSON":s?.extent&&s.pixelblocks&&(a="MEMORY")),"OVR"===a||"TIF"===a?a="TIFF":"JPG"===a||"JPEG"===a||"JFIF"===a?a="JPG":"COVJSON"===a&&(a="CovJSON"),t.toLowerCase().includes("/imageserver")&&!t.toLowerCase().includes("/wcsserver")&&(a="RasterTileServer");const n={url:t,source:s,sourceJSON:r,datasetFormat:a,ioConfig:i??{bandIds:null,sampling:null}};if(Object.keys(n).forEach(e=>{null==n[e]&&delete n[e]}),a){if(!this.supportedFormats.has(a))throw new o.A("rasterfactory:open","not a supported format "+a);if("CRF"===a)throw new o.A("rasterfactory:open",`cannot open raster: ${t}`);const i=new(0,je.get(a).constructor)(n);return await i.open({signal:e.signal}),i}const l=Array.from(je.keys()).filter(e=>"CovJSON"!==e&&"Memory"!==e);let c=0;const u=()=>{if(a=l[c++],!a)return null;if("CRF"===a)return null;const t=new(0,je.get(a).constructor)(n);return t.open({signal:e.signal}).then(()=>t).catch(()=>u())};return u()}static register(e,t,i){je.has(e.toUpperCase())||je.set(e.toUpperCase(),{desc:t,constructor:i})}}var Ze=i(6049),He=i(56776),Ve=i(30291),Ge=i(88625);let We=class extends((0,x.dM)((0,M.j)((0,C.q)((0,S.A)((0,T.H)((0,b.d)((0,I.o)((0,A.G)((0,O.e)((0,v.b)((0,R.J)((0,c.P)((0,n.OU)(w.A)))))))))))))){constructor(...e){super(...e),this._primaryRasters=[],this.graphicOrigin=new y(this),this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.fields=null,this.source=void 0,this._debouncedSaveOperations=(0,u.sg)(async(e,t,s)=>{const{save:r,saveAs:a}=await i.e(9838).then(i.bind(i,59838));switch(e){case 0:return r(this,t);case 1:return a(this,s,t)}})}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(u.QP).then(()=>this._openRaster(t))),Promise.resolve(this)}set elevationInfo(e){"relative-to-scene"!==e?.mode&&this._set("elevationInfo",e),this._validateElevationInfo(e)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){const e=[(0,P.rZ)("Pixel Value"),(0,P.dy)("Raw Pixel Value")],t=this.raster?.rasterInfo??this.serviceRasterInfo,i=t?.attributeTable;if(i){const t=(0,P.jC)(i);e.push(...t)}const s=t?.dataType,r=t?.multidimensionalInfo;if(("vector-magdir"===s||"vector-uv"===s)&&null!=r){const t=r.variables[0].unit?.trim(),i=(0,P.DV)(t),s=(0,P.y6)();e.push(i,s)}if(r){const t=(0,P.AL)(r);e.push(...t)}return e}get renderer(){return super.renderer}set renderer(e){super.renderer=e}createPopupTemplate(e){const{rasterFields:t}=this,i=e?.visibleFieldNames??new Set(t.map(({name:e})=>e).filter(e=>e!==P.F_.rawServicePixelValue)),s=(0,Ve.tn)({fields:t,title:this.title},{...e,visibleFieldNames:i}),{rasterInfo:r}=this.raster;return s?.fieldInfos&&r&&(0,P.h4)(s.fieldInfos,r),s}async generateRasterInfo(e,t){const i=(0,p.PZ)(k.A,e);if(await this.load(),!i||"none"===i.functionName?.toLowerCase())return this.serviceRasterInfo;try{const{rasterInfo:e}=await this._openFunctionRaster(i,t);return e}catch(e){if(e instanceof o.A)throw e;throw new o.A("imagery-tile-layer","the given raster function is not supported")}}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}supportsWrite(){const e=this._primaryRasters[0]??this.raster;return!!(this.loaded?"RasterTileServer"===e.datasetFormat&&("Raster"===e.tileType||"Map"===e.tileType):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))}write(e,t){if(this.supportsWrite())return super.write(e,t);if(t?.messages){const e=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new o.A("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${e}'`,{layer:this}))}return null}async _openRaster(e){let t=!1;if(this.raster)await this._openFromRaster(this.raster,e),t=(0,N.qg)(this.raster),!t&&this.rasterFunction&&(this._primaryRasters=[this.raster],await this._initializeWithFunctionRaster(this.rasterFunction));else{const{url:t,rasterFunction:i,source:s}=this;if(!t&&!s)throw new o.A("imagery-tile-layer:open","missing url or source parameter");s?await this._openFromSource(s,e):i?await this._openFromUrlWithRasterFunction(t,i,e):await this._openFromUrl(t,e)}const i=this.raster.rasterInfo;if(!i)throw new o.A("imagery-tile-layer:load","cannot load resources on "+this.url);if(this._set("serviceRasterInfo",t?i:this._primaryRasters[0].rasterInfo),this._set("spatialReference",i.spatialReference),this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,null!=this.sourceJSON){const e="Map"===this.raster.tileType&&null!=this.sourceJSON.minLOD&&null!=this.sourceJSON.maxLOD?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(e,{origin:"service"})}else this.read({tileInfo:this.serviceRasterInfo?.storageInfo.tileInfo.toJSON()},{origin:"service"});this.title||(this.title=this.raster.datasetName),"Map"===this.raster.tileType&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles((0,f.wB)(()=>this.customParameters,e=>{this.raster&&(this.raster.ioConfig.customFetchParameters=e)}))}async _openFromRaster(e,t){e.rasterInfo||await e.open({signal:t}),this._primaryRasters=(0,N.pb)(e),this.url||(this.url=this._primaryRasters[0].url)}async _openFromUrlWithRasterFunction(e,t,i){const s=[e];t&&(0,Ze.UD)(t.toJSON(),s);const r=await Promise.all(s.map(e=>qe.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:i}))),a=r.findIndex(e=>null==e);if(a>-1)throw new o.A("imagery-tile-layer:open",`cannot open raster: ${s[a]}`);return this._primaryRasters=r,this._initializeWithFunctionRaster(t)}async _openFromUrl(e,t){const i=await qe.open({url:e,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==i)throw new o.A("imagery-tile-layer:open",`cannot open raster: ${e}`);this._primaryRasters=[i],this.raster=i}async _openFromSource(e,t){const i="the tiled imagery data source is not supported",s="coverage"===e.type?.toLowerCase()?"CovJSON":e.extent&&e.pixelBlock?"MEMORY":null;if(!s)throw new o.A("imagery-tile-layer:open",i);"MEMORY"===s&&(e={...e,pixelBlock:void 0,pixelBlocks:[e.pixelBlock]});const r=await qe.open({url:"",source:e,datasetFormat:s,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:t});if(null==r)throw new o.A("imagery-tile-layer:open",i);this._primaryRasters=[r],this.rasterFunction?await this._initializeWithFunctionRaster(this.rasterFunction):this.raster=r}async _openFunctionRaster(e,t){const i={raster:this._primaryRasters[0]};this._primaryRasters.length>1&&this._primaryRasters.forEach(e=>i[e.url]=e);const s=(0,Ze.vt)(e.functionDefinition?.toJSON()??e.toJSON(),i),r=new L.A({rasterFunction:s});return await r.open(t),r}async _initializeWithFunctionRaster(e,t){try{this.raster=await this._openFunctionRaster(e,t)}catch(e){e instanceof o.A&&l.A.getLogger(this).error("imagery-tile-layer:open",e.message),l.A.getLogger(this).warn("imagery-tile-layer:open","the raster function cannot be applied and is removed"),this._set("rasterFunction",null),this.raster=this._primaryRasters[0]}}_validateElevationInfo(e){(0,He.XF)(l.A.getLogger(this),(0,He.$7)("ImageryTile layers","relative-to-scene",e)),(0,He.XF)(l.A.getLogger(this),(0,He.tW)("ImageryTile layers",e))}};(0,r.Cg)([(0,h.MZ)({clonable:!1})],We.prototype,"_primaryRasters",void 0),(0,r.Cg)([(0,h.MZ)({type:Ge.A,value:null,json:{name:"layerDefinition.elevationInfo",write:!0,origins:{"portal-item":{read:!1,write:!1},"web-map":{read:!1,write:!1}}}})],We.prototype,"elevationInfo",null),(0,r.Cg)([(0,h.MZ)({type:D.A})],We.prototype,"tileInfo",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,clonable:!1})],We.prototype,"graphicOrigin",void 0),(0,r.Cg)([(0,h.MZ)(_.fV)],We.prototype,"legendEnabled",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],We.prototype,"isReference",void 0),(0,r.Cg)([(0,h.MZ)({type:["show","hide"]})],We.prototype,"listMode",void 0),(0,r.Cg)([(0,h.MZ)({json:{read:!0,write:!0}})],We.prototype,"blendMode",void 0),(0,r.Cg)([(0,h.MZ)({type:k.A,json:{name:"renderingRule",write:!0}})],We.prototype,"rasterFunction",void 0),(0,r.Cg)([(0,h.MZ)()],We.prototype,"sourceJSON",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],We.prototype,"version",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,json:{read:!1}})],We.prototype,"type",void 0),(0,r.Cg)([(0,h.MZ)({type:["ArcGISTiledImageServiceLayer"]})],We.prototype,"operationalLayerType",void 0),(0,r.Cg)([(0,h.MZ)({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}},writer(e,t,i){t[i]=!e}}}})],We.prototype,"popupEnabled",void 0),(0,r.Cg)([(0,h.MZ)({type:a.A,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||"Raster"===this.raster.tileType}}}}})],We.prototype,"popupTemplate",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0})],We.prototype,"defaultPopupTemplate",null),(0,r.Cg)([(0,h.MZ)(_.PY)],We.prototype,"screenSizePerspectiveEnabled",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,type:[F.A]})],We.prototype,"fields",void 0),(0,r.Cg)([(0,h.MZ)({readOnly:!0,type:[F.A]})],We.prototype,"rasterFields",null),(0,r.Cg)([(0,h.MZ)({constructOnly:!0})],We.prototype,"source",void 0),We=(0,r.Cg)([(0,h.$K)("esri.layers.ImageryTileLayer")],We);const Xe=We},21312:(e,t,i)=>{i.d(t,{A:()=>d});var s,r=i(31635),a=i(91429),n=i(5443),o=i(86738),l=i(82434),c=i(36005),u=i(43937),f=i(93223);function h(e,t,i){const{x:s,y:r}=t;if(i<2)return{x:e[0]+s*e[2]+r*e[4],y:e[1]+s*e[3]+r*e[5]};if(2===i){const t=s*s,i=r*r,a=s*r;return{x:e[0]+s*e[2]+r*e[4]+t*e[6]+a*e[8]+i*e[10],y:e[1]+s*e[3]+r*e[5]+t*e[7]+a*e[9]+i*e[11]}}const a=s*s,n=r*r,o=s*r,l=a*s,c=a*r,u=s*n,f=r*n;return{x:e[0]+s*e[2]+r*e[4]+a*e[6]+o*e[8]+n*e[10]+l*e[12]+c*e[14]+u*e[16]+f*e[18],y:e[1]+s*e[3]+r*e[5]+a*e[7]+o*e[9]+n*e[11]+l*e[13]+c*e[15]+u*e[17]+f*e[19]}}function p(e,t,i){const{xmin:s,ymin:r,xmax:a,ymax:o,spatialReference:l}=t;let c=[];if(i<2)c.push({x:s,y:o}),c.push({x:a,y:o}),c.push({x:s,y:r}),c.push({x:a,y:r});else{let e=10;for(let t=0;t<e;t++)c.push({x:s,y:r+(o-r)*t/(e-1)}),c.push({x:a,y:r+(o-r)*t/(e-1)});e=8;for(let t=1;t<=e;t++)c.push({x:s+(a-s)*t/e,y:r}),c.push({x:s+(a-s)*t/e,y:o})}c=c.map(t=>h(e,t,i));const u=c.map(e=>e.x),f=c.map(e=>e.y);return new n.A({xmin:Math.min.apply(null,u),xmax:Math.max.apply(null,u),ymin:Math.min.apply(null,f),ymax:Math.max.apply(null,f),spatialReference:l})}let d=s=class extends l.A{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(e,t){const{coeffX:i,coeffY:s}=t;if(!i?.length||!s?.length||i.length!==s.length)return null;const r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(s[e]);return r}writeForwardCoefficients(e,t,i){const s=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?s.push(e[t]):r.push(e[t]);t.coeffX=s,t.coeffY=r}get inverseCoefficients(){let e=this._get("inverseCoefficients");const t=this._get("forwardCoefficients");return!e&&t&&this.polynomialOrder<2&&(e=function(e){const[t,i,s,r,a,n]=e,o=s*n-a*r,l=a*r-s*n;return[(a*i-t*n)/o,(s*i-t*r)/l,n/o,r/l,-a/o,-s/l]}(t)),e}set inverseCoefficients(e){this._set("inverseCoefficients",e)}readInverseCoefficients(e,t){const{inverseCoeffX:i,inverseCoeffY:s}=t;if(!i?.length||!s?.length||i.length!==s.length)return null;const r=[];for(let e=0;e<i.length;e++)r.push(i[e]),r.push(s[e]);return r}writeInverseCoefficients(e,t,i){const s=[],r=[];for(let t=0;t<e?.length;t++)t%2==0?s.push(e[t]):r.push(e[t]);t.inverseCoeffX=s,t.inverseCoeffY=r}get affectsPixelSize(){return this.polynomialOrder>0}forwardTransform(e){if("point"===e.type){const t=h(this.forwardCoefficients,e,this.polynomialOrder);return new o.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.forwardCoefficients,e,this.polynomialOrder)}inverseTransform(e){if("point"===e.type){const t=h(this.inverseCoefficients,e,this.polynomialOrder);return new o.A({x:t.x,y:t.y,spatialReference:e.spatialReference})}return p(this.inverseCoefficients,e,this.polynomialOrder)}clone(){return new s({polynomialOrder:this.polynomialOrder,forwardCoefficients:this.forwardCoefficients?[...this.forwardCoefficients]:null,inverseCoefficients:this.inverseCoefficients?[...this.inverseCoefficients]:null})}};(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],d.prototype,"polynomialOrder",void 0),(0,r.Cg)([(0,a.MZ)()],d.prototype,"forwardCoefficients",void 0),(0,r.Cg)([(0,c.w)("forwardCoefficients",["coeffX","coeffY"])],d.prototype,"readForwardCoefficients",null),(0,r.Cg)([(0,u.K)("forwardCoefficients")],d.prototype,"writeForwardCoefficients",null),(0,r.Cg)([(0,a.MZ)({json:{write:!0}})],d.prototype,"inverseCoefficients",null),(0,r.Cg)([(0,c.w)("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],d.prototype,"readInverseCoefficients",null),(0,r.Cg)([(0,u.K)("inverseCoefficients")],d.prototype,"writeInverseCoefficients",null),(0,r.Cg)([(0,a.MZ)()],d.prototype,"affectsPixelSize",null),(0,r.Cg)([(0,f.e)({PolynomialXform:"polynomial"})],d.prototype,"type",void 0),d=s=(0,r.Cg)([(0,a.$K)("esri.layers.support.rasterTransforms.PolynomialTransform")],d)},25943:(e,t,i)=>{i.d(t,{d:()=>C});var s,r=i(31635),a=i(11254),n=i(69622),o=i(49186),l=i(36563),c=(i(44208),i(66344)),u=i(15142),f=i(74887),h=i(36708),p=i(76030),d=i(84952),m=i(91429),g=i(72802),y=i(4718),w=i(69397),v=i(34275);class x{constructor(e){!function(e){if(!e?.location)throw new o.A("tilemap:missing-location","Location missing from tilemap response");if(!1===e.valid)throw new o.A("tilemap:invalid","Tilemap response was marked as invalid");if(!e.data)throw new o.A("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(e.data))throw new o.A("tilemap:data-mismatch","Data must be an array of numbers");if(e.data.length!==e.location.width*e.location.height)throw new o.A("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}(e);const{location:t,data:i}=e;this.location=Object.freeze((0,y.o8)(t));const s=this.location.width,r=this.location.height;let a=!0,n=!0;const l=function(e,t=!1){return e<=v.y9?t?new Array(e).fill(0):new Array(e):new Uint32Array(e)}(Math.ceil(s*r/32));let c=0;for(let e=0;e<i.length;e++){const t=e%32;i[e]?(n=!1,l[c]|=1<<t):a=!1,31===t&&++c}n?(this._availability="unavailable",this.byteSize=40):a?(this._availability="available",this.byteSize=40):(this._availability=l,this.byteSize=40+(0,w.Qf)(l))}getAvailability(e,t){if("unavailable"===this._availability||"available"===this._availability)return this._availability;const i=(e-this.location.top)*this.location.width+(t-this.location.left),s=i%32,r=i>>5,a=this._availability;return r<0||r>a.length?"unknown":a[r]&1<<s?"available":"unavailable"}static fromDefinition(e,t){const i=e.service.request||a.A,{row:s,col:r,width:n,height:l}=e,c={query:{f:"json"}};return t=t?{...c,...t}:c,i(function(e){let t;if(e.service.tileServers?.length){const i=e.service.tileServers;t=`${i&&i.length?i[e.row%i.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}else t=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;const i=e.service.query;return i&&(t=`${t}?${i}`),t}(e),t).then(e=>e.data).catch(e=>{if(422===e?.details?.httpStatus)return{location:{top:s,left:r,width:n,height:l},valid:!0,data:new Array(n*l).fill(0)};throw e}).then(e=>{if(e.location&&(e.location.top!==s||e.location.left!==r||e.location.width!==n||e.location.height!==l))throw new o.A("tilemap:location-mismatch","Tilemap response for different location than requested",{response:e,definition:{top:s,left:r,width:n,height:l}});return x.fromJSON(e)})}static fromJSON(e){return Object.freeze(new x(e))}}function b(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function I(e,t,i){return new o.A("tile-map:tile-unavailable","Tile is not available",{level:e,row:t,col:i})}let C=class extends n.A{static{s=this}constructor(e){super(e),this._pendingTilemapRequests={},this.request=a.A,this.size=32,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new c.q(2097152),this.addHandles((0,h.wB)(()=>{const{layer:e}=this;return[e?.parsedUrl,e?.tileServers,e?.apiKey,e?.customParameters]},()=>this._initializeTilemapDefinition(),h.Vh))}get effectiveMinLOD(){return this.minLOD??this.layer.tileInfo.lods[0].level}get effectiveMaxLOD(){return this.maxLOD??this.layer.tileInfo.lods[this.layer.tileInfo.lods.length-1].level}getAvailability(e,t,i){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return"unavailable";const s=this._tilemapFromCache(e,t,i,this._tmpTilemapDefinition);return s?s.getAvailability(t,i):"unknown"}fetchAvailability(e,t,i,s){return!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD?Promise.reject(I(e,t,i)):this._fetchTilemap(e,t,i,s).catch(e=>e).then(s=>{if(s instanceof x){const r=s.getAvailability(t,i);if("unavailable"===r)throw I(e,t,i);return r}if((0,f.zf)(s))throw s;return"unknown"})}fetchAvailabilityUpsample(e,t,i,s,r){s.level=e,s.row=t,s.col=i;const a=this.layer.tileInfo;a.updateTileInfo(s);const n=this.fetchAvailability(e,t,i,r).catch(e=>{if((0,f.zf)(e))throw e;if(a.upsampleTile(s))return this.fetchAvailabilityUpsample(s.level,s.row,s.col,s,r);throw e});return this._fetchAvailabilityUpsamplePrefetch(e,t,i,r,n),n}async _fetchAvailabilityUpsamplePrefetch(e,t,i,r,a){if(!this._prefetchingEnabled)return;const n=`prefetch-${e}-${t}-${i}`;if(this.hasHandles(n))return;const o=new AbortController;a.then(()=>o.abort(),()=>o.abort());let c=!1;const u=(0,l.hA)(()=>{c||(c=!0,o.abort())});if(this.addHandles(u,n),await(0,p.md)(10,o.signal).catch(()=>{}),c||(c=!0,this.removeHandles(n)),(0,f.G4)(o))return;const h=new g.U(e,t,i),d={...r,signal:o.signal},m=this.layer.tileInfo;for(let e=0;s._prefetches.length<s._maxPrefetch&&m.upsampleTile(h);++e){const e=this.fetchAvailability(h.level,h.row,h.col,d);s._prefetches.push(e);const t=()=>{s._prefetches.removeUnordered(e)};e.then(t,t)}}static{this._maxPrefetch=4}static{this._prefetches=new u.A({initialSize:s._maxPrefetch})}static cleanupTilemapCache(){this._prefetches.prune()}_fetchTilemap(e,t,i,s){if(!this.layer.tileInfo.lodAt(e)||e<this.effectiveMinLOD||e>this.effectiveMaxLOD)return Promise.reject(new o.A("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`));const r=this._tmpTilemapDefinition,a=this._tilemapFromCache(e,t,i,r);if(a)return Promise.resolve(a);const n=s?.signal;return s={...s,signal:null},new Promise((e,t)=>{(0,f.u7)(n,()=>t((0,f.NK)()));const i=b(r);let a=this._pendingTilemapRequests[i];if(!a){a=x.fromDefinition(r,s).then(e=>(this._tilemapCache.put(i,e,e.byteSize),e));const e=()=>{delete this._pendingTilemapRequests[i]};this._pendingTilemapRequests[i]=a,a.then(e,e)}a.then(e,t)})}_initializeTilemapDefinition(){if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:t,customParameters:i}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:(0,d.x0)({...e.query,...i,token:t??e.query?.token}),tileServers:this.layer.tileServers,request:this.request},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,t,i,s){s.level=e,s.row=t-t%this.size,s.col=i-i%this.size;const r=b(s);return this._tilemapCache.get(r)}get test(){}};(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],C.prototype,"layer",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],C.prototype,"minLOD",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],C.prototype,"maxLOD",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],C.prototype,"request",void 0),(0,r.Cg)([(0,m.MZ)({constructOnly:!0})],C.prototype,"size",void 0),C=s=(0,r.Cg)([(0,m.$K)("esri.layers.support.TilemapCache")],C)},56551:(e,t,i)=>{i.d(t,{H:()=>f});var s=i(31635),r=i(91429),a=i(69540),n=i(25482),o=i(56507),l=i(94359),c=i(93223);let u=class extends((0,a.OU)(n.o)){constructor(e){super(e),this.name=void 0,this.method="none",this.value=void 0,this.bandIds=void 0,this.renderer=void 0}};(0,s.Cg)([(0,r.MZ)({type:String,json:{write:{isRequired:!0}}})],u.prototype,"name",void 0),(0,s.Cg)([(0,r.MZ)({type:["raster-function-template","variable","none"],json:{write:{isRequired:!0}}}),(0,c.e)({rasterFunctionTemplate:"raster-function-template",variable:"variable",none:"none"})],u.prototype,"method",void 0),(0,s.Cg)([(0,r.MZ)({type:String,json:{write:{isRequired:!0}}})],u.prototype,"value",void 0),(0,s.Cg)([(0,r.MZ)({type:[o.jz],json:{write:{isRequired:!0}}})],u.prototype,"bandIds",void 0),(0,s.Cg)([(0,r.MZ)({types:l.uy,json:{write:!0,origins:{"web-scene":{types:l.Gj,write:{overridePolicy:e=>({enabled:e&&"vector-field"!==e.type})}}}}})],u.prototype,"renderer",void 0),u=(0,s.Cg)([(0,r.$K)("esri.renderers.support.RasterPresetRenderer")],u);const f=e=>{const t=e;let i=class extends t{constructor(){super(...arguments),this.activePresetRendererName=null,this.presetRenderers=null}};return(0,s.Cg)([(0,r.MZ)({type:String,json:{name:"layerDefinition.activePresetRendererName",write:{allowNull:!0}}})],i.prototype,"activePresetRendererName",void 0),(0,s.Cg)([(0,r.MZ)({type:[u],json:{name:"layerDefinition.presetRenderers",write:!0}})],i.prototype,"presetRenderers",void 0),i=(0,s.Cg)([(0,r.$K)("esri.layers.mixins.RasterPresetRendererMixin")],i),i}},69397:(e,t,i)=>{i.d(t,{$B:()=>r,Qf:()=>c,Qh:()=>o,RS:()=>a,ez:()=>h,lM:()=>n,qK:()=>f});var s=i(34275);function r(e){return 32+e.length}const a=16;function n(e){if(!e)return 0;let t=f;for(const i in e)e.hasOwnProperty(i)&&(t+=l(e[i],!1));return t}function o(e){if(!e)return 0;if("number"==typeof e[0])return c(e);if(Array.isArray(e))return function(e){const t=e.length;if(0===t||"number"==typeof e[0])return u(e,8);let i=h;for(let s=0;s<t;s++)i+=l(e[s]);return i}(e);let t=f;for(const i in e)e.hasOwnProperty(i)&&(t+=l(e[i]));return t}function l(e,t=!0){switch(typeof e){case"object":return t?o(e):f;case"string":return r(e);case"number":return a;case"boolean":return 4;default:return 8}}function c(...e){return e.reduce((e,t)=>e+(t?(0,s.iu)(t)?t.byteLength+p:Array.isArray(t)?u(t,a):0:0),0)}function u(e,t){return h+e.length*t}const f=32,h=16,p=145},73037:(e,t,i)=>{i.d(t,{A:()=>l});var s,r=i(31635),a=i(91429),n=i(82434),o=i(93223);let l=s=class extends n.A{constructor(){super(...arguments),this.type="gcs-shift",this.tolerance=1e-8}forwardTransform(e){return"point"===(e=e.clone()).type?(e.x>180+this.tolerance&&(e.x-=360),e):(e.xmin>=180-this.tolerance?(e.xmax-=360,e.xmin-=360):e.xmax>180+this.tolerance&&(e.xmin=-180,e.xmax=180),e)}inverseTransform(e){return"point"===(e=e.clone()).type?(e.x<-this.tolerance&&(e.x+=360),e):(e.xmin<-this.tolerance&&(e.xmin+=360,e.xmax+=360),e)}clone(){return new s({tolerance:this.tolerance})}};(0,r.Cg)([(0,o.e)({GCSShiftXform:"gcs-shift"})],l.prototype,"type",void 0),(0,r.Cg)([(0,a.MZ)()],l.prototype,"tolerance",void 0),l=s=(0,r.Cg)([(0,a.$K)("esri.layers.support.rasterTransforms.GCSShiftTransform")],l)},82371:(e,t,i)=>{i.d(t,{E9:()=>d,Tw:()=>h,X6:()=>p});var s=i(11254),r=i(5443),a=i(86738),n=i(16930),o=i(87186),l=i(20223),c=i(2272),u=i(22671);async function f(e,t,i){const f=(0,c.Dl)(e),{rasterFunction:h,sourceJSON:p}=t||{},d=h?JSON.stringify(h.rasterFunctionDefinition||h):null,m=(0,c.lF)({...f.query,renderingRule:d,f:"json"}),g=(0,c.jV)(m,i);e=f.path;const y=p||await(0,s.A)(e,g).then(e=>e.data),w=y.hasRasterAttributeTable?(0,s.A)(`${e}/rasterAttributeTable`,g):null,v=y.hasColormap?(0,s.A)(`${e}/colormap`,g):null,x=y.hasHistograms?(0,s.A)(`${e}/histograms`,g):null,b=y.currentVersion>=10.3?(0,s.A)(`${e}/keyProperties`,g):null,I=y.hasMultidimensions?(0,s.A)(`${e}/multidimensionalInfo`,g):null,C=await Promise.allSettled([w,v,x,b,I]);let S=null;if(y.minValues&&y.minValues.length===y.bandCount){S=[];for(let e=0;e<y.minValues.length;e++)S.push({min:y.minValues[e],max:y.maxValues[e],avg:y.meanValues[e],stddev:y.stdvValues[e]})}const A=r.A.fromJSON(y.extent),T=Math.ceil(A.width/y.pixelSizeX-.1),R=Math.ceil(A.height/y.pixelSizeY-.1),M=n.A.fromJSON(y.spatialReference||y.extent.spatialReference),O="fulfilled"===C[0].status?C[0].value?.data:null,_=O?.features?.length?u.A.fromJSON(O):null,F="fulfilled"===C[1].status?C[1].value?.data.colormap:null,P=F?.length?F:null,k="fulfilled"===C[2].status?C[2].value?.data.histograms:null,D=k?.[0]?.counts?.length?k:null,N="fulfilled"===C[3].status?C[3].value?.data??{}:{},L="fulfilled"===C[4].status?C[4].value?.data.multidimensionalInfo:null,E=L?.variables?.length?L:null;E&&E.variables.forEach(e=>{e.statistics?.length&&e.statistics.forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),e.dimensions?.forEach(e=>{"StdTime"!==e.name||e.recurring||e.unit||(e.unit="ISO8601")})});const{defaultVariable:B,serviceDataType:z}=y;B&&B!==N.DefaultVariable&&(N.DefaultVariable=B),z?.includes("esriImageServiceDataTypeVector")&&!z.includes(N.DataType)&&(N.DataType=z.replace("esriImageServiceDataType",""));let J=y.noDataValue;y.noDataValues?.length&&y.noDataValues.some(e=>e!==J)&&(J=y.noDataValues);const U=y.transposeInfo?new l.A({blockWidth:256,blockHeight:256,pyramidBlockWidth:256,pyramidBlockHeight:256,pyramidScalingFactor:2,compression:"lerc",origin:new a.A({x:y.extent.xmin,y:y.extent.ymax,spatialReference:M}),firstPyramidLevel:1,maximumPyramidLevel:Math.max(0,Math.round(Math.log(Math.max(T,R))/Math.LN2-8)),transposeInfo:y.transposeInfo}):void 0;return new o.A({width:T,height:R,bandCount:y.bandCount,extent:r.A.fromJSON(y.extent),spatialReference:M,pixelSize:new a.A({x:y.pixelSizeX,y:y.pixelSizeY,spatialReference:M}),pixelType:y.pixelType.toLowerCase(),statistics:S,attributeTable:_,colormap:P,histograms:D,keyProperties:N,noDataValue:J,multidimensionalInfo:E,storageInfo:U})}function h(e,t,i){return f(e,{sourceJSON:t},i)}function p(e,t,i){return f(e,{rasterFunction:t},i)}function d(e,t){e.attributeTable||(t.hasRasterAttributeTable=!1),e.histograms||(t.hasHistograms=!1),e.colormap||(t.hasColormap=!1),e.multidimensionalInfo||(t.hasMultidimensions=!1)}},82434:(e,t,i)=>{i.d(t,{A:()=>n});var s=i(31635),r=i(25482),a=i(91429);let n=class extends r.o{get affectsPixelSize(){return!1}forwardTransform(e){return e}inverseTransform(e){return e}};(0,s.Cg)([(0,a.MZ)()],n.prototype,"affectsPixelSize",null),(0,s.Cg)([(0,a.MZ)({json:{write:!0}})],n.prototype,"spatialReference",void 0),n=(0,s.Cg)([(0,a.$K)("esri.layers.support.rasterTransforms.BaseRasterTransform")],n)}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[5710],{4513:(e,a,t)=>{t.d(a,{S:()=>n});const n={BingMapsLayer:async()=>(await Promise.all([t.e(3508),t.e(6554),t.e(9036)]).then(t.bind(t,17029))).default,BuildingSceneLayer:async()=>(await Promise.all([t.e(7330),t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(9953),t.e(1956),t.e(8399),t.e(1017),t.e(957),t.e(9708),t.e(8654),t.e(6647),t.e(6673),t.e(7005),t.e(8570),t.e(6011),t.e(8993),t.e(1437)]).then(t.bind(t,82411))).default,CSVLayer:async()=>(await Promise.all([t.e(7330),t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(9953),t.e(1956),t.e(8399),t.e(1017),t.e(957),t.e(9708),t.e(8654),t.e(6647),t.e(1197)]).then(t.bind(t,68695))).default,CatalogLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(1956),t.e(8399),t.e(708),t.e(957),t.e(9708),t.e(6647),t.e(893),t.e(8628),t.e(2593),t.e(9279),t.e(1874)]).then(t.bind(t,83508))).default,DimensionLayer:async()=>(await Promise.all([t.e(3508),t.e(3813)]).then(t.bind(t,71493))).default,ElevationLayer:async()=>(await Promise.all([t.e(3508),t.e(9953),t.e(4802),t.e(8207)]).then(t.bind(t,68611))).default,FeatureLayer:async()=>(await Promise.all([t.e(7330),t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(9953),t.e(1956),t.e(8399),t.e(1017),t.e(957),t.e(9708),t.e(8654),t.e(6647),t.e(9247)]).then(t.bind(t,68654))).default,GaussianSplatLayer:async()=>(await Promise.all([t.e(3508),t.e(6673),t.e(6730)]).then(t.bind(t,36475))).default,GeoJSONLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(9953),t.e(1956),t.e(8399),t.e(1017),t.e(8766)]).then(t.bind(t,15481))).default,GeoRSSLayer:async()=>(await Promise.all([t.e(3508),t.e(6554),t.e(5890)]).then(t.bind(t,85582))).default,GroupLayer:async()=>(await Promise.all([t.e(3508),t.e(5613),t.e(3562)]).then(t.bind(t,85989))).default,ImageryLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(9953),t.e(1956),t.e(893),t.e(6673),t.e(3356),t.e(6699),t.e(4971)]).then(t.bind(t,84123))).default,ImageryTileLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(9953),t.e(6673),t.e(3356),t.e(6049),t.e(6699),t.e(7677),t.e(9718)]).then(t.bind(t,19718))).default,IntegratedMesh3DTilesLayer:async()=>(await Promise.all([t.e(3508),t.e(6673),t.e(5942),t.e(1312)]).then(t.bind(t,61528))).default,IntegratedMeshLayer:async()=>(await Promise.all([t.e(3508),t.e(6673),t.e(6011),t.e(5942),t.e(7464)]).then(t.bind(t,74660))).default,KMLLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(1863)]).then(t.bind(t,162))).default,KnowledgeGraphLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(9953),t.e(1956),t.e(8399),t.e(708),t.e(1017),t.e(9708),t.e(8368),t.e(4649),t.e(217),t.e(8441),t.e(3463),t.e(8948),t.e(8692)]).then(t.bind(t,28692))).default,LineOfSightLayer:async()=>(await Promise.all([t.e(3508),t.e(6673),t.e(1224),t.e(9695)]).then(t.bind(t,49695))).default,LinkChartLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(9953),t.e(1956),t.e(8399),t.e(708),t.e(1017),t.e(9708),t.e(8368),t.e(4649),t.e(217),t.e(8441),t.e(3463),t.e(8948),t.e(1728)]).then(t.bind(t,71728))).default,MapImageLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(1956),t.e(8399),t.e(708),t.e(957),t.e(893),t.e(7048),t.e(7656),t.e(8999)]).then(t.bind(t,7656))).default,MapNotesLayer:async()=>(await Promise.all([t.e(7330),t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(9953),t.e(1956),t.e(8399),t.e(1017),t.e(957),t.e(9708),t.e(8654),t.e(6647),t.e(3463),t.e(744)]).then(t.bind(t,96299))).default,MediaLayer:async()=>(await Promise.all([t.e(7330),t.e(3508),t.e(3444),t.e(9203)]).then(t.bind(t,29203))).default,OGCFeatureLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(1956),t.e(8399),t.e(708),t.e(1017),t.e(8570),t.e(5977)]).then(t.bind(t,65977))).default,OpenStreetMapLayer:async()=>(await Promise.all([t.e(3508),t.e(6554),t.e(9573),t.e(2712)]).then(t.bind(t,40349))).default,OrientedImageryLayer:async()=>(await Promise.all([t.e(7330),t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(9953),t.e(1956),t.e(8399),t.e(1017),t.e(957),t.e(9708),t.e(8654),t.e(6647),t.e(9361),t.e(9644)]).then(t.bind(t,9352))).default,ParquetLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(9953),t.e(1956),t.e(8399),t.e(1017),t.e(581),t.e(940)]).then(t.bind(t,99680))).default,PointCloudLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6673),t.e(7885)]).then(t.bind(t,77885))).default,RouteLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(217),t.e(9785)]).then(t.bind(t,34507))).default,SceneLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(1956),t.e(8399),t.e(6673),t.e(7005),t.e(8570),t.e(6011),t.e(8993),t.e(1713)]).then(t.bind(t,36969))).default,StreamLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(1956),t.e(8399),t.e(1017),t.e(73)]).then(t.bind(t,79457))).default,SubtypeGroupLayer:async()=>(await Promise.all([t.e(7330),t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1956),t.e(8399),t.e(957),t.e(9708),t.e(6647),t.e(9645)]).then(t.bind(t,97483))).default,TileLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(1956),t.e(8399),t.e(708),t.e(957),t.e(893),t.e(4802),t.e(7048),t.e(573)]).then(t.bind(t,71756))).default,UnknownLayer:async()=>(await t.e(146).then(t.bind(t,146))).default,UnsupportedLayer:async()=>(await t.e(5165).then(t.bind(t,45165))).default,VectorTileLayer:async()=>(await Promise.all([t.e(3508),t.e(6554),t.e(4802),t.e(5897),t.e(1776)]).then(t.bind(t,48757))).default,VideoLayer:async()=>(await Promise.all([t.e(3508),t.e(3910),t.e(5323),t.e(8303),t.e(957),t.e(3444),t.e(2274)]).then(t.bind(t,86875))).default,ViewshedLayer:async()=>(await Promise.all([t.e(3508),t.e(1224),t.e(6650)]).then(t.bind(t,96650))).default,VoxelLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(1005)]).then(t.bind(t,21005))).default,WCSLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(9953),t.e(3356),t.e(6049),t.e(6699),t.e(7677),t.e(5369)]).then(t.bind(t,88854))).default,WFSLayer:async()=>(await Promise.all([t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(8303),t.e(4903),t.e(1214),t.e(9953),t.e(1956),t.e(8399),t.e(708),t.e(1017),t.e(9110)]).then(t.bind(t,21901))).default,WMSLayer:async()=>(await Promise.all([t.e(7330),t.e(3508),t.e(2869),t.e(6554),t.e(3910),t.e(5323),t.e(5181)]).then(t.bind(t,51904))).default,WMTSLayer:async()=>(await Promise.all([t.e(3508),t.e(6554),t.e(4802),t.e(9573),t.e(309)]).then(t.bind(t,20309))).default,WebTileLayer:async()=>(await Promise.all([t.e(3508),t.e(6554),t.e(9573),t.e(2848)]).then(t.bind(t,47314))).default}},7861:(e,a,t)=>{t.d(a,{L:()=>r});var n=t(11254);async function r(e,a){return(await(0,n.A)(e,{responseType:"json",query:{f:"json",...a?.customParameters,token:a?.apiKey}})).data}},23154:(e,a,t)=>{t.d(a,{K:()=>f,Q:()=>l});var n=t(77548),r=t(7861);const i=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function l(e,a){const{loadContext:t,...i}=a||{},l=t?await t.fetchServiceMetadata(e,i):await(0,r.L)(e,i),s=(0,n.G$)();d(l),y(l);const o={serviceJSON:l,preferredHost:s};if((l.currentVersion??0)<10.5)return o;const c=`${(0,n.$x)()??e}/layers`,u=t?await t.fetchServiceMetadata(c,i):await(0,r.L)(c,i);return d(u),y(u),o.layersJSON={layers:u.layers,tables:u.tables},o}function s(e){const{type:a}=e;return!!a&&i.has(a)}function o(e){return"Table"===e.type}function y(e){e.layers=e.layers?.filter(s),e.tables=e.tables?.filter(o)}function c(e){e.type||="Feature Layer"}function u(e){e.type||="Table"}function d(e){e.layers?.forEach(c),e.tables?.forEach(u)}function f(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}},92009:(e,a,t)=>{t.d(a,{L:()=>c});var n=t(70333),r=t(11254),i=t(49186),l=t(74887),s=t(60694),o=t(20655),y=t(80812);async function c(e,a){const t=(0,s.qg)(e);if(!t)throw new i.A("invalid-url","Invalid scene service url");const c={...a,sceneServerUrl:t.url.path,layerId:t.sublayer??void 0};if(c.sceneLayerItem??=await async function(e){const a=(await u(e)).serviceItemId;if(!a)return null;const t=new y.default({id:a,apiKey:e.apiKey}),i=await async function(e){const a=n.id?.findServerInfo(e.sceneServerUrl);if(a?.owningSystemUrl)return a.owningSystemUrl;const t=e.sceneServerUrl.replace(/(.*\/rest)\/.*/i,"$1")+"/info";try{const a=(await(0,r.A)(t,{query:{f:"json"},responseType:"json",signal:e.signal})).data.owningSystemUrl;if(a)return a}catch(e){(0,l.QP)(e)}return null}(e);null!=i&&(t.portal=new o.A({url:i}));try{return await t.load({signal:e.signal})}catch(e){return(0,l.QP)(e),null}}(c),null==c.sceneLayerItem)return d(c.sceneServerUrl.replace("/SceneServer","/FeatureServer"),c);const f=await async function({sceneLayerItem:e,signal:a}){if(!e)return null;try{const t=(await e.fetchRelatedItems({relationshipType:"Service2Service",direction:"reverse"},{signal:a})).find(e=>"Feature Service"===e.type)||null;if(!t)return null;const n=new y.default({portal:t.portal,id:t.id});return await n.load(),n}catch(e){return(0,l.QP)(e),null}}(c);if(!f?.url)throw new i.A("related-service-not-found","Could not find feature service through portal item relationship");c.featureServiceItem=f;const w=await d(f.url,c);return w.portalItem=f,w}async function u(e){if(e.rootDocument)return e.rootDocument;const a={query:{f:"json",...e.customParameters,token:e.apiKey},responseType:"json",signal:e.signal};try{const t=await(0,r.A)(e.sceneServerUrl,a);e.rootDocument=t.data}catch{e.rootDocument={}}return e.rootDocument}async function d(e,a){const t=(0,s.qg)(e);if(!t)throw new i.A("invalid-feature-service-url","Invalid feature service url");const n=t.url.path,l=a.layerId;if(null==l)return{serverUrl:n};const o=u(a),y=a.featureServiceItem?await a.featureServiceItem.fetchData("json"):null,c=(y?.layers?.[0]||y?.tables?.[0])?.customParameters,d=e=>{const t={query:{f:"json",...c},responseType:"json",authMode:e,signal:a.signal};return(0,r.A)(n,t)},f=d("anonymous").catch(()=>d("no-prompt")),[w,h]=await Promise.all([f,o]),m=h?.layers,L=w.data&&w.data.layers;if(!Array.isArray(L))throw new Error("expected layers array");if(Array.isArray(m)){for(let e=0;e<Math.min(m.length,L.length);e++)if(m[e].id===l)return{serverUrl:n,layerId:L[e].id}}else if(null!=l&&l<L.length)return{serverUrl:n,layerId:L[l].id};throw new Error("could not find matching associated sublayer")}}}]);
|
|
@@ -1,5 +0,0 @@
|
|
|
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 e}from"tslib";import t from"../../../request.js";import i from"../../../core/Error.js";import{JSONSupport as o}from"../../../core/JSONSupport.js";import r from"../../../core/Logger.js";import{onAbort as n}from"../../../core/promiseUtils.js";import{QueueProcessor as s}from"../../../core/QueueProcessor.js";import{property as l,subclass as a}from"../../../core/accessorSupport/decorators.js";import{ensureClass as c}from"../../../core/accessorSupport/ensureType.js";import f from"../../../geometry/Extent.js";import u from"../../../geometry/Point.js";import m from"../../../geometry/SpatialReference.js";import{sanitizeUrl as h}from"../arcgisLayerUrl.js";import{url as p}from"../commonProperties.js";import d from"../DimensionalDefinition.js";import x from"../LOD.js";import y from"../RasterStorageInfo.js";import g from"../TileInfo.js";import{isFunctionRaster as I,getPixelSpaceCoverage as R}from"./datasetUtils.js";import{isMultiSliceOrRangeDefinition as w,getSliceIndex as S,createSlices as b,getSliceIds as k}from"./multidimensionalUtils.js";import{getRasterId as T,getBlock as v,putBlock as P,deleteBlock as B,decreaseRefCount as _}from"./RawBlockCache.js";import{convertNoDataToMask as M}from"../rasterFormats/pixelRangeUtils.js";import{decode as W}from"../rasterFormats/RasterCodec.js";import{mosaic as C,approximateTransform as H,getLocalArithmeticNorthRotations as z,compositeBands as L}from"../rasterFunctions/pixelUtils.js";import{getWorldWidth as E,load as j,projectPoint as D,snapPyramid as O,shiftExtent as F,getWorldWrapCount as A,projectExtent as q,getProjectionOffsetGrid as G,getRasterDatasetAlignmentInfo as J,projectResolution as N}from"../rasterFunctions/rasterProjectionHelper.js";import{convertToLocalDirections as V,uvComponentToVector as U}from"../rasterFunctions/vectorFieldUtils.js";const Q=8,$=256;let X=0,K=class extends o{constructor(){super(...arguments),this._tileFetchQueue=new s({concurrency:32,process:(e,t)=>this.fetchRawTile(e.pyramidLevel,e.row,e.col,{...e.options,signal:t})}),this.datasetName=null,this.datasetFormat=null,this.hasUniqueSourceStorageInfo=!0,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}normalizeCtorArgs(e){return e?.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:g.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=E(e.spatialReference);return null!=t&&e.extent.width>=t/2}get _hasNoneOrGCSShiftTransform(){const{transform:e}=this.rasterInfo;return null==e||"gcs-shift"===e.type}set rasterJobHandler(e){this._set("rasterJobHandler",e),I(this)&&this.primaryRasters?.rasters?.forEach(t=>t.rasterJobHandler=e)}get rasterId(){return this.url||"rasterId-"+X++}set url(e){this._set("url",h(e,r.getLogger(this)))}async open(e){return this._openPromise??=j().then(()=>this._open(e)),this._openPromise}async fetchTile(e,t,o,r={}){const n=r.tileInfo||this.rasterInfo.storageInfo.tileInfo,s=this.getTileExtentFromTileInfo(e,t,o,n);if(!s)throw new i("imagery-tile:out-of-bounds","Level for fetch tile out of range");return r={noClip:!0,...r},this.fetchPixels(s,n.size[0],n.size[1],r)}async identify(e,t={}){e=c(u,e).clone().normalize();const{multidimensionalDefinition:i,timeExtent:o}=t,{rasterInfo:r}=this,{hasMultidimensionalTranspose:n,multidimensionalInfo:s}=r;let{transposedVariableName:l}=t;const a=null!=s&&n&&(null!=o||w(i));if(a&&!l){l=null!=i&&i.length>0?i[0].variableName??void 0:s.variables[0].name,t={...t,transposedVariableName:l}}t=this._getRequestOptionsWithSliceId(t);const{spatialReference:m,extent:h}=r,{datumTransformation:p}=t;let d=D(e,m,p);if(!h.intersects(d))return{location:d,value:null};if(null!=r.transform){const e=r.transform.inverseTransform(d);if(!r.nativeExtent.intersects(e))return{location:e,value:null};d=e}let x=0;const y=null!=l&&null!=s&&r.hasMultidimensionalTranspose;if(I(this)){const e=this.primaryRasters.rasters[0];if(y)return e.identify(d,t);const{pixelSize:o}=r,n=3,s=o.x*n/2,l=o.y*n/2,a=new f({xmin:d.x-s,xmax:d.x+s,ymin:d.y-l,ymax:d.y+l,spatialReference:m}),c={interpolation:"nearest",multidimensionalDefinition:i,sliceId:t.sliceId,bandIds:t.bandIds},{pixelBlock:u}=await e.fetchPixels(a,n,n,c),{pixelBlock:h}=await this.fetchPixels(a,n,n,c);if(null==u)return{location:d,value:null};const p=Math.floor(n*n*.5),x=!u.mask||u.mask[p]?u.pixels.map(e=>e[p]):null;let g;return null!=h&&(g=!h.mask||h.mask[p]?h.pixels.map(e=>e[p]):void 0),{location:d,value:x,processedValue:g,pyramidLevel:0}}if(!y)if(t.srcResolution){x=O(t.srcResolution,r,this.ioConfig.sampling).pyramidLevel}else if(x=await this.computeBestPyramidLevelForLocation(e,t),null==x)return{location:d,value:null};const g=this.identifyPixelLocation(d,x,null,y);if(null===g)return{location:d,value:null};const{row:R,col:S,rowOffset:b,colOffset:k,blockWidth:T}=g,v=await this._fetchRawTile(x,R,S,t);if(!v?.pixels?.length)return{location:d,value:null};const P=b*T+k;return this._processIdentifyResult(v,{srcLocation:d,position:P,pyramidLevel:x,useTransposedTile:!!y,requestSomeSlices:a,identifyOptions:t})}async fetchPixels(e,t,i,o={}){e=F(e),o=this._getRequestOptionsWithSliceId(o);const{_hasNoneOrGCSShiftTransform:r}=this;if(o.requestRawData&&r)return this._fetchPixels(e,t,i,o);const n=E(e.spatialReference),s=A(e);if(null==n||0===s||1===s&&this._isGlobalWrappableSource&&r)return this._fetchPixels(e,t,i,o);if(s>=3)return{extent:e,pixelBlock:null};const l=[],{xmin:a,xmax:c}=e,u=Math.round(n/(c-a)*t),m=u-Math.round((n/2-a)/(c-a)*t);let h=0;const p=[];for(let g=0;g<=s;g++){const r=new f({xmin:0===g?a:-n/2,xmax:g===s?c-n*g:n/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),d=0===g?u-m:g===s?t-h:u;h+=d,p.push(d);const x=o.disableWrapAround&&g>0?null:this._fetchPixels(r,d,i,o);l.push(x)}const d=(await Promise.all(l)).map(e=>e?.pixelBlock);let x=null;const y={width:t,height:i};if(this.rasterJobHandler){x=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:p},o)).pixelBlock}else x=C(d,y,{blockWidths:p});return{extent:e,srcExtent:q(e,this.rasterInfo.spatialReference,o.datumTransformation),pixelBlock:x}}async fetchRawPixels(e,t,i,o={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const r=await this._fetchRawTiles(e,t,i,o),{nativeExtent:n,nativePixelSize:s,storageInfo:l}=this.rasterInfo,a=2**e,c=s.x*a,u=s.y*a,m=new f({xmin:n.xmin+c*t.x,xmax:n.xmin+c*(t.x+i.width-1),ymin:n.ymax-u*(t.y+i.height-1),ymax:n.ymax-u*t.y,spatialReference:n.spatialReference});if(!r)return{extent:m,srcExtent:m,pixelBlock:null};const{pixelBlocks:h,mosaicSize:p}=r;if(1===h.length&&null!=h[0]&&h[0].width===i.width&&h[0].height===i.height)return{extent:m,srcExtent:m,pixelBlock:r.pixelBlocks[0]};const d=e>0?l.pyramidBlockWidth:l.blockWidth,x=e>0?l.pyramidBlockHeight:l.blockHeight,y={x:t.x%d,y:t.y%x};let g;if(this.rasterJobHandler){g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:h,srcMosaicSize:p,destDimension:i,clipOffset:y,clipSize:i,coefs:null,sampleSpacing:null,interpolation:o.interpolation,alignmentInfo:null,blockWidths:null},o)).pixelBlock}else g=C(h,p,{clipOffset:y,clipSize:i});return{extent:m,srcExtent:m,pixelBlock:g}}fetchRawTile(e,t,o,r){throw new i("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return q(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?W(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,i,o=0){const{customFetchParameters:r}=this.ioConfig,{range:n,query:s,headers:l}=i;o=o??i.retryCount??this.ioConfig.retryCount;const a=n?{Range:`bytes=${n.from}-${n.to}`}:null;try{return await t(e,{...i,query:{...s,...r},headers:{...l,...a}})}catch(c){if(o>0)return o--,this.request(e,i,o);throw c}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return null==t||null==e||0===e.length?null:S(e,t)}getTileExtentFromTileInfo(e,t,i,o){const r=o.lodAt(e);return r?this.getTileExtent({x:r.resolution,y:r.resolution},t,i,o.origin,o.spatialReference,o.size):null}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:i,pixelSize:o}=this.rasterInfo,{pyramidResolutions:r}=e;if(!e.tileInfo){const n=[],s=e.maximumPyramidLevel||0;let l=(o.x+o.y)/2,a=1/.0254*96*l;for(let e=0;e<=s&&(n.unshift(new x({level:s-e,resolution:l,scale:a})),e!==s);e++)if(r){const t=(r[e].x+r[e].y)/2;a*=t/l,l=t}else l*=2,a*=2;const c=new u({x:i.xmin,y:i.ymax,spatialReference:t});e.tileInfo=new g({origin:c,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:n}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,i=512,o){const{width:r,height:n,nativeExtent:s,pixelSize:l,spatialReference:a}=e,c=new u({x:s.xmin,y:s.ymax,spatialReference:a});null==o&&(o=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8)));const f=this.computeBlockBoundary(s,512,512,{x:s.xmin,y:s.ymax},[l],o);e.storageInfo=new y({blockWidth:t,blockHeight:i,pyramidBlockWidth:t,pyramidBlockHeight:i,origin:c,firstPyramidLevel:1,maximumPyramidLevel:o,blockBoundary:f})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,i,o,r,n=0,s=2){if(1===r.length&&n>0){r=[...r];let{x:e,y:t}=r[0];for(let i=0;i<n;i++)e*=s,t*=s,r.push({x:e,y:t})}const l=[],{x:a,y:c}=o;for(let f=0;f<r.length;f++){const{x:o,y:n}=r[f];l.push({minCol:Math.floor((e.xmin-a+.1*o)/t/o),maxCol:Math.floor((e.xmax-a-.1*o)/t/o),minRow:Math.floor((c-e.ymax+.1*n)/i/n),maxRow:Math.floor((c-e.ymin-.1*n)/i/n)})}return l}getPyramidPixelSize(e){const{nativePixelSize:t}=this.rasterInfo,{pyramidResolutions:i,pyramidScalingFactor:o}=this.rasterInfo.storageInfo;if(0===e)return t;if(null!=i&&i.length)return i[e-1];const r=o**e;return{x:t.x*r,y:t.y*r}}identifyPixelLocation(e,t,i,o){const{spatialReference:r,nativeExtent:n,storageInfo:s}=this.rasterInfo,{maximumPyramidLevel:l,origin:a,transposeInfo:c}=s,f=o&&null!=c?c.tileSize[0]:s.blockWidth,u=o&&null!=c?c.tileSize[1]:s.blockHeight,m=D(e,r,i);if(!n.intersects(m))return null;if(t<0||t>l)return null;const h=this.getPyramidPixelSize(t),{x:p,y:d}=h,x=(a.y-m.y)/d/u,y=(m.x-a.x)/p/f,g=Math.min(u-1,Math.floor((x-Math.floor(x))*u)),I=Math.min(f-1,Math.floor((y-Math.floor(y))*f));return{pyramidLevel:t,row:Math.floor(x),col:Math.floor(y),rowOffset:g,colOffset:I,blockWidth:f,srcLocation:m}}getTileExtent(e,t,i,o,r,n){const[s,l]=n,a=o.x+i*s*e.x,c=a+s*e.x,u=o.y-t*l*e.y,m=u-l*e.y;return new f({xmin:a,xmax:c,ymin:m,ymax:u,spatialReference:r})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,i){const o=this.rasterInfo.storageInfo.blockBoundary[e];return!o||o.maxRow<t||o.maxCol<i||o.minRow>t||o.minCol>i}updateImageSpaceRasterInfo(e){const{pixelSize:t}=e,{width:i,height:o}=e,r=m.WebMercator;e.spatialReference=r,e.extent=e.nativeExtent=new f({xmin:-.5,ymax:.5,xmax:i-.5,ymin:.5-o,spatialReference:r}),e.isPseudoSpatialReference=!0,e.transform=null,e.pixelSize=new u({x:1,y:1,spatialReference:r});const{extent:n,storageInfo:s}=e;if(s){s.origin=new u({x:n.xmin,y:n.ymax,spatialReference:r});const{pyramidResolutions:i,tileInfo:o}=s;if(i&&i.forEach(e=>{e.x/=t.x,e.y/=t.y}),o){o.origin=s.origin;const t=(e.nativePixelSize.x+e.nativePixelSize.y)/2;o.lods.forEach((e,i)=>{e.resolution=t*2**i,e.scale=96*e.resolution/.0254})}}}async _fetchPixels(e,t,i,o={}){let r=A(e);if(r>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,i,o),{pyramidLevel:s,srcResolution:l,srcExtent:a,srcWidth:c,srcHeight:f,ul:m}=n;if(0===c||0===f)return{extent:e,srcExtent:a,pixelBlock:null};const{rasterInfo:h}=this,p=h.transform,d="gcs-shift"===p?.type,x=null!=E(e.spatialReference);!d&&x||(r=A(n.srcExtent,d));const y=await this._fetchRawTiles(s,m,{width:c,height:f,wrapCount:r},o);if(!y)return{extent:e,srcExtent:a,pixelBlock:null};const g=h.storageInfo,I=s>0?g.pyramidBlockWidth:g.blockWidth,R=s>0?g.pyramidBlockHeight:g.blockHeight;let{x:w,y:S}=h.pixelSize;if(s>0){const{pyramidResolutions:e,pyramidScalingFactor:t}=g;if(null!=e&&e[s-1])({x:w,y:S}=e[s-1]);else{const e=t**s;w*=e,S*=e}}const b=h.spatialReference,k=new u({x:w,y:S,spatialReference:b}),T=I===c&&R===f&&m.x%I===0&&m.y%R===0,v=new u({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference}),P=!e.spatialReference.equals(b),B=b.isGeographic?1e-9:1e-4,{datumTransformation:_}=o;if(!P&&T&&1===y.pixelBlocks.length&&I===t&&R===i&&Y(l,v,B))return{extent:e,srcExtent:a,srcTilePixelSize:k,pixelBlock:y.pixelBlocks[0]};const M=x&&null!=E(a.spatialReference)&&this._hasNoneOrGCSShiftTransform,W=o.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");W&&!this.rasterJobHandler&&await j();const L=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:v.toJSON(),datumTransformation:_,rasterTransform:p,hasWrapAround:r>0||M,isAdaptive:!1!==this.ioConfig.optimizeProjectionAccuracy,includeGCSGrid:W},o):G({projectedExtent:e,srcBufferExtent:y.extent,pixelSize:v,datumTransformation:_,rasterTransform:p,hasWrapAround:r>0||M,isAdaptive:!1,includeGCSGrid:W});let D;const O=!o.requestRawData,F={rows:L.spacing[0],cols:L.spacing[1]},q=this._hasNoneOrGCSShiftTransform?this._getRasterTileAlignmentInfo(s,y.extent.xmin):void 0,{pixelBlocks:J,mosaicSize:N,isPartiallyFilled:U}=y;let Q=null;if(this.rasterJobHandler){const e=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:J,srcMosaicSize:N,destDimension:O?{width:t,height:i}:null,coefs:O?L.coefficients:null,sampleSpacing:O?F:null,projectDirections:W,gcsGrid:W?L.gcsGrid:null,isUV:"vector-uv"===this.rasterInfo.dataType,interpolation:o.interpolation,alignmentInfo:q,blockWidths:null},o);({pixelBlock:D,localNorthDirections:Q}=e)}else{const e=C(J,N,{alignmentInfo:q});D=O?H(e,{width:t,height:i},L.coefficients,F,o.interpolation):e,W&&L.gcsGrid&&(Q=z({width:t,height:i},L.gcsGrid),D=V(D,this.rasterInfo.dataType,Q))}return o.requestRawData||W?{extent:e,srcExtent:a,srcTilePixelSize:k,pixelBlock:D,transformGrid:L,localNorthDirections:Q,isPartiallyFilled:U}:{extent:e,srcExtent:a,srcTilePixelSize:k,pixelBlock:D}}async _fetchRawTiles(e,t,i,o){const{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:s,blockHeight:l}=this.getBlockWidthHeight(e);let{x:a,y:c}=t,{width:u,height:m,wrapCount:h}=i;const p=this._getRasterTileAlignmentInfo(e,0);o.buffer&&(a-=o.buffer.cols,c-=o.buffer.rows,u+=2*o.buffer.cols,m+=2*o.buffer.rows);let d=0,x=0,y=0;if(h&&null!=p){({worldColumnCountFromOrigin:x,originColumnOffset:y,rightPadding:d}=p);x*p.blockWidth-d>=a+u&&(d=0)}const g=Math.floor(a/s),I=Math.floor(c/l),R=Math.floor((a+u+d-1)/s),w=Math.floor((c+m+d-1)/l),S=n[e];if(!S)return null;const{minRow:b,minCol:k,maxCol:T,maxRow:v}=S;if(0===h&&(w<b||R<k||I>v||g>T))return null;const P=new Array;let B=!1;const _=null==this.ioConfig.allowPartialFill?o.allowPartialFill:this.ioConfig.allowPartialFill;for(let f=I;f<=w;f++)for(let t=g;t<=R;t++){let i=t;if(!o.disableWrapAround&&h&&null!=p&&x<=t&&(i=t-x-y),f>=b&&i>=k&&v>=f&&T>=i){const t=this._fetchRawTile(e,f,i,o);_?P.push(new Promise(e=>{t.then(t=>e(t)).catch(()=>{B=!0,e(null)})})):P.push(t)}else P.push(Promise.resolve(null))}if(0===P.length)return null;const M=await Promise.all(P),W={height:(w-I+1)*l,width:(R-g+1)*s},{spatialReference:C}=this.rasterInfo,H=this.getPyramidPixelSize(e),{x:z,y:L}=H;return{extent:new f({xmin:r.x+g*s*z,xmax:r.x+(R+1)*s*z,ymin:r.y-(w+1)*l*L,ymax:r.y-I*l*L,spatialReference:C}),pixelBlocks:M,mosaicSize:W,isPartiallyFilled:B}}_fetchRawTile(e,t,i,o){const{storageInfo:r}=this.rasterInfo,s=null!=r.transposeInfo&&!!o.transposedVariableName;if(!s){const o=r.blockBoundary[e];if(!o)return Promise.resolve(null);const{minRow:n,minCol:s,maxCol:l,maxRow:a}=o;if(t<n||i<s||t>a||i>l)return Promise.resolve(null)}const l=s?o.transposeVariableName:o.sliceId,a=r.isBsqTile?o.bandIds:null,c=T(this.rasterId,l,a),f=`${e}/${t}/${i}`;let u=v(c,o.registryId,f);if(null==u){const n=new AbortController,s=o.bandIds?.slice();if(s?.length&&r.isBsqTile){const r=new Set(s),l=[],a=Array.from(r);for(const s of a)l.push(this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:{...o,bandIds:[s]}},{signal:n.signal}));u=Promise.all(l).then(e=>{if(e.some(e=>null==e))return null;if(a.length!==s.length){const t=[];for(const i of s){let o=e[a.indexOf(i)];t.includes(o)&&(o=o.clone()),t.push(o)}e=t}return this.rasterJobHandler?this.rasterJobHandler.compositeBands({pixelBlocks:e},{signal:n.signal,transferPixelsToWorker:!0}):L(e)})}else u=this._tileFetchQueue.push({pyramidLevel:e,row:t,col:i,options:o},{signal:n.signal});P(c,o.registryId,f,u,n),u.catch(()=>B(c,o.registryId,f))}return o.signal&&n(o,()=>{_(c,o.registryId,f)}),u}_computeMagDirValues(e){const{bandCount:t,dataType:i}=this.rasterInfo;if(!(2===t&&"vector-magdir"===i||"vector-uv"===i)||2!==e?.length||!e[0]?.length)return null;const o=e[0].length;if("vector-magdir"===i){const t=e[1].map(e=>(e+360)%360);return[e[0],t]}const[r,n]=e,s=[],l=[];for(let a=0;a<o;a++){const[e,t]=U([r[a],n[a]]);s.push(e),l.push(t)}return[s,l]}_getRasterTileAlignmentInfo(e,t){return null==this._rasterTileAlignmentInfo&&(this._rasterTileAlignmentInfo=J(this.rasterInfo)),null==this._rasterTileAlignmentInfo.pyramidsInfo?null:{startX:t,halfWorldWidth:this._rasterTileAlignmentInfo.halfWorldWidth,hasGCSSShiftTransform:this._rasterTileAlignmentInfo.hasGCSSShiftTransform,...this._rasterTileAlignmentInfo.pyramidsInfo[e]}}_getSourceDataInfo(e,t,i,o={}){const r={datumTransformation:o.datumTransformation,pyramidLevel:0,pyramidResolution:null,srcExtent:null,srcHeight:0,srcResolution:null,srcWidth:0,ul:{x:0,y:0}};o.srcResolution&&(r.srcResolution=o.srcResolution,this._updateSourceDataInfo(e,r));const n=this.rasterInfo.storageInfo.maximumPyramidLevel||0,{srcWidth:s,srcHeight:l,pyramidLevel:a}=r,c=s/t,f=l/i,m=a<n&&c*f>=16,h=a===n&&this._requireTooManySrcTiles(s,l,t,i);if(m||h||(0===s||0===l)){const s=new u({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/i,spatialReference:e.spatialReference});let l=N(s,this.rasterInfo.spatialReference,e,r.datumTransformation);const h=!l||o.srcResolution&&l.x+l.y<o.srcResolution.x+o.srcResolution.y;if(m&&o.srcResolution&&h){const e=Math.round(Math.log(Math.max(c,f))/Math.LN2)-1;if(n-a+3>=e){const t=2**e;l={x:o.srcResolution.x*t,y:o.srcResolution.y*t}}}l&&(r.srcResolution=l,this._updateSourceDataInfo(e,r))}return this._requireTooManySrcTiles(r.srcWidth,r.srcHeight,t,i)&&(r.srcWidth=0,r.srcHeight=0),r}_requireTooManySrcTiles(e,t,i,o){const{tileInfo:r}=this.rasterInfo.storageInfo,n=Math.ceil(e/r.size[0])*Math.ceil(t/r.size[1]),s=e/i,l=t/o,a=Math.max(1,(i+o)/1024);return n>=$*a||s>Q||l>Q}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const{rasterInfo:i}=this,o=i.spatialReference,{srcResolution:r,datumTransformation:n}=t,{pyramidLevel:s,pyramidResolution:l,excessiveReading:a}=O(r,i,this.ioConfig.sampling);if(a)return;let c=t.srcExtent||q(e,o,n);if(null==c)return;const f=i.transform;f&&(c=f.inverseTransform(c)),t.srcExtent=c;const{origin:u}=i.storageInfo,{width:m,height:h,ul:p}=R(c,u,l,s);t.pyramidLevel=s,t.pyramidResolution=l,t.srcWidth=m,t.srcHeight=h,t.ul=p}_getRequestOptionsWithSliceId(e){return null!=this.rasterInfo.multidimensionalInfo&&null==e.sliceId&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:i,position:o,pyramidLevel:r,useTransposedTile:n}=t,s=e.pixels[0].length/e.width/e.height;if(!(!e.mask||e.mask[o]))return{location:i,value:null};const{multidimensionalInfo:l}=this.rasterInfo;if(null==l||!n){const t=e.pixels.map(e=>e[o]),n={location:i,value:t,pyramidLevel:r},s=this._computeMagDirValues(t.map(e=>[e]));return s?.length&&(n.magdirValue=s.map(e=>e[0])),n}let a=e.pixels.map(e=>e.slice(o*s,o*s+s)),c=this._computeMagDirValues(a);const{requestSomeSlices:f,identifyOptions:u}=t;let m=b(l,u.transposedVariableName);if(f){const e=k(m,u.multidimensionalDefinition,u.timeExtent);a=a.map(t=>e.map(e=>t[e])),c=c?.map(t=>e.map(e=>t[e])),m=e.map(e=>m[e])}const h=e.noDataValues||this.rasterInfo.noDataValue,p={pixels:a,pixelType:e.pixelType};let x;null!=h&&(M(p,h),x=p.mask);return{location:i,value:null,dataSeries:m.map((e,t)=>{const i={value:0===x?.[t]?null:a.map(e=>e[t]),multidimensionalDefinition:e.multidimensionalDefinition.map(e=>new d({...e,isSlice:!0}))};return c?.length&&(i.magdirValue=[c[0][t],c[1][t]]),i}),pyramidLevel:r}}};function Y(e,t,i){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}e([l()],K.prototype,"_rasterTileAlignmentInfo",void 0),e([l()],K.prototype,"_tileFetchQueue",void 0),e([l({readOnly:!0})],K.prototype,"_isGlobalWrappableSource",null),e([l({readOnly:!0})],K.prototype,"_hasNoneOrGCSShiftTransform",null),e([l()],K.prototype,"_openPromise",void 0),e([l()],K.prototype,"rasterJobHandler",null),e([l({readOnly:!0})],K.prototype,"rasterId",null),e([l(p)],K.prototype,"url",null),e([l({type:String,json:{write:!0}})],K.prototype,"datasetName",void 0),e([l({type:String,json:{write:!0}})],K.prototype,"datasetFormat",void 0),e([l()],K.prototype,"hasUniqueSourceStorageInfo",void 0),e([l()],K.prototype,"rasterInfo",void 0),e([l()],K.prototype,"ioConfig",void 0),e([l()],K.prototype,"sourceJSON",void 0),K=e([a("esri.layers.support.rasterDatasets.BaseRaster")],K);export{K as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
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 e}from"tslib";import t from"../../../core/Error.js";import{property as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import a from"./BaseRaster.js";import{isXAxis as o,isYAxis as i,parseGridCoverage as n}from"./covJSONParser.js";import l from"./InMemoryRaster.js";import{computeStatisticsHistograms as c}from"../rasterFunctions/stretchUtils.js";import p from"../../../rest/support/FeatureSet.js";let m=class extends a{constructor(){super(...arguments),this.datasetFormat="CovJSON"}fetchRawTile(e,t,r,s={}){return this._inMemoryRaster.fetchRawTile(e,t,r,s)}async _open(e){const{extent:t,pixelBlocks:r,multidimensionalInfo:s,attributeTable:a,bandNames:o}=await this._fetchData(e),{statistics:i,histograms:n}=c(r[0]),m=o?.map(e=>({BandName:e})),h={DataType:a?"Thematic":s?"Scientific":"Generic",BandProperties:m},d=new l({source:{extent:t,pixelBlocks:r,attributeTable:a?p.fromJSON(a):null,multidimensionalInfo:s,statistics:i,histograms:n,keyProperties:h,isPseudoSpatialReference:!1}});await d.open(),this._inMemoryRaster=d;const u=this.source?"":this.url.slice(this.url.lastIndexOf("/")+1);this._set("datasetName",u.slice(0,u.indexOf("."))),this._set("rasterInfo",d.rasterInfo)}async _fetchData(e){const r=this.source??(await this.request(this.url,{signal:e?.signal})).data,s="imagery-tile-layer:open-coverage-json";if("coverage"!==r.type?.toLowerCase()||"grid"!==r.domain?.domainType?.toLowerCase())throw new t(s,"Only coverage with Grid domain type is supported");if(!r.ranges)throw new t(s,"Missing ranges in the grid coverage data");if(!r.domain.referencing?.length)throw new t(s,"Missing domain referencing in the grid coverage data");const a=Object.values(r.ranges);for(let n=0;n<a.length;n++){const{axisNames:e,shape:r,type:l,values:c}=a[n];if(!("ndarray"===l.toLowerCase()&&c?.length&&e?.length&&r?.length))throw new t(s,"Only ranges with valid NdArray, axisNames, shape, and inline values are supported");if(!(o(e[e.length-1])&&i(e[e.length-2])))throw new t(s,"Only row-major ordered pixel values are supported. X axis must be the last axis.")}return n(r)}};e([r({type:String,json:{write:!0}})],m.prototype,"datasetFormat",void 0),e([r({constructOnly:!0})],m.prototype,"source",void 0),m=e([s("esri.layers.support.rasterDatasets.CovJSONRaster")],m);const h=m;export{h as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
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 e from"../../../core/Error.js";import{property as r,subclass as i}from"../../../core/accessorSupport/decorators.js";import s from"../../../geometry/Polygon.js";import a from"./BaseRaster.js";import{clip as o}from"../rasterFunctions/clipUtils.js";import{approximateTransform as n}from"../rasterFunctions/pixelUtils.js";import{projectPolygon as l}from"../rasterFunctions/rasterProjectionHelper.js";import c from"../../../rest/support/FeatureSet.js";const p=40;let m=class extends a{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._clippingGeometry=new Map}async fetchPixels(t,e,r,i={}){const{rasters:s,rasterIds:a}=this.primaryRasters;let l=!1;const{interpolation:c}=i,p=this.rasterFunction.flatWebGLFunctionChain?.hasFocalFunction;!i.requestRawData&&p&&(l=1===s.length&&!i.skipRasterFunction,i={...i,interpolation:"bilinear",requestRawData:l}),i.requestRawData&&s.length>1&&!this.hasUniqueSourceStorageInfo&&(l=!1,i={...i,requestRawData:!1});const m=s.map(s=>s.fetchPixels(t,e,r,i)),u=await Promise.all(m),h=u.map(t=>t.pixelBlock),f=l||i.requestRawData?u.map(t=>t.srcTilePixelSize):null;if(i.skipRasterFunction||h.every(t=>null==t))return u[0];const d=u.find(t=>null!=t.pixelBlock)?.extent??t;let y=this.rasterJobHandler?await this.rasterJobHandler.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:a}):this.rasterFunction.process({extent:d,primaryPixelBlocks:h,primaryPixelSizes:f,primaryRasterIds:a});const{transformGrid:g}=u[0];if(!l||null==y||null==g){const t=i.noClip?null:this.getClippingGeometry(d.spatialReference);return!i.noClip&&null!=y&&t&&(y=await o(y,d,t)),{...u[0],pixelBlock:y}}const x={rows:g.spacing[0],cols:g.spacing[1]};let R;if(this.rasterJobHandler){R=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:[y],srcMosaicSize:{width:y.width,height:y.height},destDimension:{width:e,height:r},coefs:g.coefficients,sampleSpacing:x,projectDirections:!1,gcsGrid:null,isUV:!1,interpolation:c,alignmentInfo:void 0,blockWidths:null},i)).pixelBlock}else R=n(y,{width:e,height:r},g.coefficients,x,c);const w=i.noClip?null:this.getClippingGeometry(t.spatialReference);return i.noClip||null==R||null==w||(R=await o(R,t,w)),{extent:t,srcExtent:u[0].srcExtent,pixelBlock:R}}getClippingGeometry(t){const e=this._clippingGeometry.get("0");if(!t||!e)return e;const r=h(t);let i=this._clippingGeometry.get(r);return null!=i||(i=t.equals(e.spatialReference)?e:l(e,t),this._clippingGeometry.set(r,i)),i}async _open(t){const{rasterFunction:r}=this;r.isRoot=!0,this.primaryRasters?.rasters?.length?r.sourceRasters=this.primaryRasters.rasters:(this.primaryRasters=r.getPrimaryRasters(),this.rasterJobHandler&&this.primaryRasters.rasters?.forEach(t=>t.rasterJobHandler=this.rasterJobHandler));const{rasters:i,rasterIds:s}=this.primaryRasters,a=i.map(e=>e.rasterInfo?void 0:e.open(t));await Promise.all(a);const o=i.map(({rasterInfo:t})=>t),n=r.bind({rasterInfos:o,rasterIds:s});if(r.rawSourceRasterInfos=o,!n.success||0===o.length)throw new e("raster-function:open",`cannot bind the function: ${n.error??""}`);const l="Table"===r.functionName?r:r.functionArguments?.raster;"Table"===l?.functionName&&(r.rasterInfo.attributeTable=c.fromJSON(l.functionArguments.attributeTableAsRecordSet)),await this.syncJobHandler();const p=o[0];this.hasUniqueSourceStorageInfo=1===o.length||o.slice(1).every(t=>u(t,p)),this.set("sourceJSON",i[0].sourceJSON),this.set("rasterInfo",r.rasterInfo),await this._updateClipGeometry()}async syncJobHandler(){return this.rasterJobHandler?.updateRasterFunction(this.rasterFunction)}async _updateClipGeometry(){const t=this.rasterFunction.getClippingGeometries()[0];let e=t?.clippingGeometry;if(e&&"inside"===t.clippingType){const{extent:t}=this.rasterInfo,r=await import("../../../geometry/operators/densifyOperator.js"),i=await import("../../../geometry/operators/differenceOperator.js");let a=r.execute(s.fromExtent(t),2*(t.width+t.height)/p);a=l(a,e.spatialReference),e=i.execute(a,e)}this._clippingGeometry.clear(),e&&this._clippingGeometry.set("0",e)}};function u(t,e){const{storageInfo:r,pixelSize:i,spatialReference:s,extent:a}=t,{storageInfo:o,pixelSize:n,spatialReference:l,extent:c}=e;return i.x===n.x&&i.y===n.y&&s.equals(l)&&a.equals(c)&&r.blockHeight===o.blockHeight&&r.blockWidth===o.blockWidth&&r.maximumPyramidLevel===o.maximumPyramidLevel&&r.firstPyramidLevel===o.firstPyramidLevel&&r.pyramidBlockWidth===o.pyramidBlockWidth&&r.pyramidBlockHeight===o.pyramidBlockHeight&&r.pyramidScalingFactor===o.pyramidScalingFactor}function h(t){return String(t.wkid??t.wkt??t.wkt2)}t([r({type:String,json:{write:!0}})],m.prototype,"datasetFormat",void 0),t([r()],m.prototype,"tileType",void 0),t([r()],m.prototype,"rasterFunction",void 0),t([r()],m.prototype,"primaryRasters",void 0),m=t([i("esri.layers.support.rasterDatasets.FunctionRaster")],m);export{m as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
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 e from"../../../core/Error.js";import has from"../../../core/has.js";import{eachAlways as s,createAbortError as r}from"../../../core/promiseUtils.js";import{property as a,subclass as o}from"../../../core/accessorSupport/decorators.js";import i from"../../../geometry/Extent.js";import n from"../../../geometry/SpatialReference.js";import l from"./BaseRaster.js";import m from"./InMemoryRaster.js";import{parsePAMInfo as f}from"./pamParser.js";import{getFormat as p}from"../rasterFormats/RasterCodec.js";import{estimateStatisticsFromHistograms as c}from"../rasterFunctions/stretchUtils.js";import u from"../rasterTransforms/PolynomialTransform.js";let h=class extends l{fetchRawTile(t,e,s,r={}){return this._inMemoryRaster.fetchRawTile(t,e,s,r)}async _open(t){const e=await this._fetchData(t);let{spatialReference:s,statistics:r,histograms:a,transform:o}=await this._fetchAuxiliaryData(t);const l=!s;l&&(s=new n({wkid:3857})),a?.length&&null==r&&(r=c(a));const{width:f,height:p}=e;let u=new i({xmin:-.5,ymin:.5-p,xmax:f-.5,ymax:.5,spatialReference:s});const h=o?o.forwardTransform(u):u;let d=!0;if(o){const t=o.forwardCoefficients;d=t&&0===t[1]&&0===t[2],d&&(o=null,u=h)}const w=new m({source:{extent:h,nativeExtent:u,transform:o,pixelBlocks:[e],statistics:r,histograms:a,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:l},ioConfig:{sampling:"closest",skipStatistics:!0}});this.ioConfig.skipMapInfo&&(w.ioConfig.skipMapInfo=!0),await w.open(),w.source=null,this._set("rasterInfo",w.rasterInfo),this._inMemoryRaster=w}async _fetchData(t){const{data:s}=await this.request(this.url,{responseType:"array-buffer",signal:t?.signal}),r=p(s).toUpperCase();if("JPG"!==r&&"PNG"!==r&&"GIF"!==r&&"BMP"!==r)throw new e("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",r);const a=r.toLowerCase(),o="gif"===a||"bmp"===a||!has("ios"),i=await this.decodePixelBlock(s,{format:a,useCanvas:o,hasNoZlibMask:!0});if(null==i)throw new e("image-aux-raster:open","the data cannot be decoded");return i}async _fetchAuxiliaryData(t){const e=t?.signal,{skipExtensions:a=[],skipMapInfo:o}=this.ioConfig,i=o||a.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:e}),n=this.datasetFormat,l="JPG"===n?"jgw":"PNG"===n?"pgw":"BMP"===n?"bpw":null,m=l&&a.includes(l)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+l,{responseType:"text",signal:e}),p=await s([i,m]);if(e?.aborted)throw r();const c=f(p[0].value?.data);if(!c.transform){const t=p[1].value?p[1].value.data.split("\n").slice(0,6).map(t=>Number(t)):null;c.transform=6===t?.length?new u({forwardCoefficients:[t[4],t[5],t[0],-t[1],t[2],-t[3]]}):null}return c}};t([a({type:String,json:{write:!0}})],h.prototype,"datasetFormat",void 0),h=t([o("esri.layers.support.rasterDatasets.ImageAuxRaster")],h);const d=h;export{d as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
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 e}from"tslib";import t from"../../../core/Error.js";import{assertIsSome as i}from"../../../core/maybe.js";import{urlToObject as s}from"../../../core/urlUtils.js";import{property as a,subclass as r}from"../../../core/accessorSupport/decorators.js";import l from"../../../geometry/Extent.js";import n from"../../../geometry/Point.js";import o from"../../../geometry/SpatialReference.js";import c from"../RasterInfo.js";import m from"../RasterStorageInfo.js";import u from"../TileInfo.js";import{TilemapCache as h}from"../TilemapCache.js";import f from"./BaseRaster.js";import{setValidBoundary as p}from"../rasterFunctions/pixelUtils.js";import d from"../rasterTransforms/GCSShiftTransform.js";import{patchServiceInfo as y,fetchServiceRasterInfo as x}from"../../../rest/imageService/fetchRasterInfo.js";let g=class extends f{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async fetchRawTile(e,t,i,s={}){const{storageInfo:a,extent:r}=this.rasterInfo,{transposeInfo:l}=a,n=null!=l&&!!s.transposedVariableName;if(this._slices&&!n&&null==s.sliceId)return null;const o=n?0:a.maximumPyramidLevel-e+this._levelOffset,c=`${this.url}/tile/${o}/${t}/${i}`,m=this._slices?n?{variable:s.transposedVariableName}:{sliceId:s.sliceId||0}:null;let u,h;if(a.isBsqTile){const e=(s.bandIds?.length?s.bandIds:[0,1,2]).map(e=>this.request(c,{query:{...m,bandId:e},responseType:"array-buffer",signal:s.signal})),t=await Promise.all(e),i=t.map(e=>e.data.byteLength).reduce((e,t)=>e+t),a=new Uint8Array(i);h=[];let r=0;for(const{data:s}of t)h.push(r),a.set(new Uint8Array(s),r),r+=s.byteLength;u=a.buffer}else{u=(await this.request(c,{query:m,responseType:"array-buffer",signal:s.signal})).data}if(!u)return null;const f=n?l.tileSize:a.tileInfo.size,d=await this.decodePixelBlock(u,{width:f[0],height:f[1],planes:h?.length,offsets:h,pixelType:null,isPoint:"Elevation"===this.tileType,returnInterleaved:n,noDataValue:this.rasterInfo.noDataValue});if(null==d)return null;const y=a.blockBoundary[e];if("jpg"!==a.compression||i>y.minCol&&i<y.maxCol&&t>y.minRow&&t<y.maxRow)return d;const{origin:x,blockWidth:g,blockHeight:v}=a,{x:S,y:I}=this.getPyramidPixelSize(e),w=Math.round((r.xmin-x.x)/S)%g,b=Math.round((r.xmax-x.x)/S)%g||g,T=Math.round((x.y-r.ymax)/I)%v,M=Math.round((x.y-r.ymin)/I)%v||v,_=i===y.minCol?w:0,j=t===y.minRow?T:0,O=i===y.maxCol?b:g,R=t===y.maxRow?M:v;return p(d,{x:_,y:j},{width:O-_,height:R-j}),d}getSliceIndex(e){if(!this._slices||null==e||0===e.length)return null;const t=e;for(let i=0;i<this._slices.length;i++){const e=this._slices[i].multidimensionalDefinition;if(e.length===t.length&&!e.some(e=>{const i=t.find(t=>e.variableName===t.variableName&&t.dimensionName===e.dimensionName);if(!i)return!0;return(Array.isArray(e.values[0])?`${e.values[0][0]}-${e.values[0][1]}`:e.values[0])!==(Array.isArray(i.values[0])?`${i.values[0][0]}-${i.values[0][1]}`:i.values[0])}))return i}return null}async fetchVariableStatisticsHistograms(e,t){const i=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.statistics),s=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(e=>e.data?.histograms),a=await Promise.all([i,s]);return a[0]&&a[0].forEach(e=>{e.avg=e.mean,e.stddev=e.standardDeviation}),a[1]?.[0]?.counts?.length||(a[1]=null),{statistics:a[0]||null,histograms:a[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let i=this.identifyPixelLocation(e,0,t.datumTransformation);if(null===i)return null;let s=0;const{maximumPyramidLevel:a}=this.rasterInfo.storageInfo;let r=a-s+this._levelOffset;const l=i.srcLocation;for(;r>=0;){try{if("available"===await this._tilemapCache.fetchAvailability(r,i.row,i.col,t))break}catch{}if(r--,s++,i=this.identifyPixelLocation(l,s,t.datumTransformation),null===i)return null}return-1===r||null==i?null:s}async _open(e){const a=e?.signal,r=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:a});r.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const l=r.data;if(this.sourceJSON=l,!l)throw new t("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!l.tileInfo)throw new t("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const n=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=l.cacheType,null==this.tileType&&(n.includes(l.tileInfo.format.toLowerCase())?this.tileType="Map":"lerc"===l.tileInfo.format.toLowerCase()?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=l.name?.slice(l.name.indexOf("/")+1)??"";const o=await this._fetchRasterInfo({signal:a});if(null==o)throw new t("image-server-raster:open","cannot initialize image service");y(o,l);const c="Map"===this.tileType?v(l.tileInfo,l):u.fromJSON(l.tileInfo);i(c);const[f,p]=this._computeMinMaxLOD(o,c),{extent:d,pixelSize:x}=o,g=.5/o.width*x.x,I=Math.max(x.x,x.y),{lods:w}=c;("Map"!==this.tileType&&0!==l.maxScale||Math.abs(x.x-x.y)>g||!w.some(e=>Math.abs(e.resolution-I)<g))&&(x.x=x.y=f.resolution,o.width=Math.ceil((d.xmax-d.xmin)/x.x-.1),o.height=Math.ceil((d.ymax-d.ymin)/x.y-.1));const b=f.level-p.level,[T,M]=c.size,_=[],j=[];w.forEach((e,t)=>{e.level>=p.level&&e.level<=f.level&&_.push({x:e.resolution,y:e.resolution}),t<w.length-1&&j.push(Math.round(10*e.resolution/w[t+1].resolution)/10)}),_.sort((e,t)=>e.x-t.x);const O=this.computeBlockBoundary(d,T,M,c.origin,_,b),R=_.length>1?_.slice(1):null;let z;l.transposeInfo&&(z={tileSize:[l.transposeInfo.rows,l.transposeInfo.cols],packetSize:o.keyProperties?._yxs.PacketSize??0});const N=j.length<=1||j.length>=3&&j.slice(0,-1).every(e=>e===j[0])?j[0]??2:Math.round(10/(p.resolution/f.resolution)**(-1/b))/10;if(o.storageInfo=new m({blockWidth:c.size[0],blockHeight:c.size[1],pyramidBlockWidth:c.size[0],pyramidBlockHeight:c.size[1],pyramidResolutions:R,pyramidScalingFactor:N,compression:c.format,origin:c.origin,firstPyramidLevel:1,maximumPyramidLevel:b,tileInfo:c,isBsqTile:!!l.bsq,transposeInfo:z,blockBoundary:O}),S(o),this._set("rasterInfo",o),l.capabilities.toLowerCase().includes("tilemap")){const e={tileInfo:o.storageInfo.tileInfo,parsedUrl:s(this.url),url:this.url,tileServers:[]};this._tilemapCache=new h({layer:e})}}async _fetchRasterInfo(e){const t=this.sourceJSON;if("Map"===this.tileType){const e=t.fullExtent||t.extent,i=Math.ceil((e.xmax-e.xmin)/t.pixelSizeX-.1),s=Math.ceil((e.ymax-e.ymin)/t.pixelSizeY-.1),a=o.fromJSON(t.spatialReference||e.spatialReference),r=new n({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:a});return new c({width:i,height:s,bandCount:3,extent:l.fromJSON(e),spatialReference:a,pixelSize:r,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:i}=e,s=x(this.url,this.sourceJSON,{signal:i,query:this.ioConfig.customFetchParameters}),a=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:i}).then(e=>e.data?.slices).catch(()=>null):null,r=await Promise.all([s,a]);return this._slices=r[1],r[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_computeMinMaxLOD(e,t){const{pixelSize:i}=e,s=.5/e.width*i.x,{lods:a}=t,r=t.lodAt(Math.max.apply(null,a.map(e=>e.level))),l=t.lodAt(Math.min.apply(null,a.map(e=>e.level))),{tileType:n}=this;if("Map"===n)return this._levelOffset=a[0].level,[r,l];if("Raster"===n){return[a.find(e=>e.resolution===i.x)??r,l]}const{minScale:o,maxScale:c}=this.sourceJSON;let m=r;c>0&&(m=a.find(e=>Math.abs(e.scale-c)<s),m||(m=a.filter(e=>e.scale>c).sort((e,t)=>e.scale>t.scale?1:-1)[0]??r));let u=l;return o>0&&(u=a.find(e=>Math.abs(e.scale-o)<s)??l,this._levelOffset=u.level-l.level),[m,u]}};function v(e,t){if(!e)return null;const{minScale:i,maxScale:s,minLOD:a,maxLOD:r}=t;if(null!=a&&null!=r)return u.fromJSON({...e,lods:e.lods.filter(({level:e})=>null!=e&&e>=a&&e<=r)});if(0!==i&&0!==s){const t=e=>Math.round(1e4*e)/1e4,a=i?t(i):1/0,r=s?t(s):-1/0;return u.fromJSON({...e,lods:e.lods.filter(e=>{const i=t(e.scale);return i<=a&&i>=r})})}return u.fromJSON(e)}function S(e){const{extent:t,spatialReference:i}=e;t.xmin>-1&&t.xmax>181&&i?.wkid&&i.isGeographic&&(e.nativeExtent=e.extent,e.transform=new d,e.extent=e.transform.forwardTransform(t))}e([a({type:String,json:{write:!0}})],g.prototype,"datasetFormat",void 0),e([a()],g.prototype,"tileType",void 0),g=e([r("esri.layers.support.rasterDatasets.ImageServerRaster")],g);const I=g;export{I as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
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 e from"../../../core/Error.js";import{eachAlways as i}from"../../../core/promiseUtils.js";import{property as s,subclass as a}from"../../../core/accessorSupport/decorators.js";import r from"../../../geometry/Extent.js";import o from"../../../geometry/SpatialReference.js";import l from"../DimensionalDefinition.js";import n from"../RasterInfo.js";import m from"./BaseRaster.js";import{getSliceIndex as p}from"./multidimensionalUtils.js";import{clipTile as c,split as u}from"../rasterFunctions/pixelUtils.js";import{estimateStatisticsHistograms as h,computeStatisticsHistograms as d}from"../rasterFunctions/stretchUtils.js";let f=class extends m{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.source=null}get url(){return""}fetchRawTile(t,e,i,s={}){if(!this._pixelBlockTiles){const{rasterInfo:a}=this,[r,o]=a.storageInfo.tileInfo.size,{sliceId:l}=s,{pixelBlocks:n}=this.source,m={pixelBlock:null==l?n[0]:n[l],useBilinear:"thematic"!==a.dataType,tileSize:{width:r,height:o},level:t,row:e,col:i},p=this.rasterJobHandler?this.rasterJobHandler.clipTile(m,s):c(m);return Promise.resolve(p)}const a=this._pixelBlockTiles.get(`${t}/${e}/${i}`);return Promise.resolve(a)}async _open(t){const e=this.source,{pixelBlocks:i,attributeTable:s,statistics:a,histograms:l,name:m,nativeExtent:p,transform:c,colormap:u}=e,h=i[0],{width:d,height:f,pixelType:x}=h,y=e.extent??new r({xmin:-.5,ymin:.5,xmax:d-.5,ymax:f-.5,spatialReference:new o({wkid:3857})}),g=e.isPseudoSpatialReference??!e.extent,b={x:y.width/d,y:y.height/f},I={...e.keyProperties};e.dataType&&(I.DataType=e.dataType),e.bandInfos&&(I.BandProperties=e.bandInfos.map(t=>t.toJSON())),s&&(I.DataType="Thematic");const v=new n({width:d,height:f,pixelType:x,extent:y,nativeExtent:p,attributeTable:s,colormap:u,transform:c,pixelSize:b,spatialReference:y.spatialReference,bandCount:h.pixels.length,keyProperties:I,multidimensionalInfo:e.multidimensionalInfo,statistics:a,isPseudoSpatialReference:g,histograms:l});this.ioConfig.skipMapInfo&&this.updateImageSpaceRasterInfo(v),this.createRemoteDatasetStorageInfo(v,512,512),this._set("rasterInfo",v),this.updateTileInfo(),v.multidimensionalInfo?await this._buildMDimStats(e.pixelBlocks,v.multidimensionalInfo):await this._buildInMemoryRaster(h,{width:512,height:512},t),v.multidimensionalInfo||(this.source=null),this.datasetName=m}async _buildInMemoryRaster(t,s,a){const{rasterInfo:r}=this,o=r.storageInfo.maximumPyramidLevel??0,l="thematic"!==r.dataType,n=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:t,tileSize:s,maximumPyramidLevel:o,useBilinear:l},a):Promise.resolve(u(t,s,o,l)),m=null!=r.statistics,p=null!=r.histograms,c=this.ioConfig.skipStatistics||m?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:t},a):Promise.resolve(h(t)),d=await i([n,c]);if(!d[0].value&&d[1].value)throw new e("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=d[0].value,m||(r.statistics=d[1].value?.statistics),p||(r.histograms=d[1].value?.histograms)}async _buildMDimStats(t,e,i){for(let s=0;s<e.variables.length;s++){const a=e.variables[s];if(a.statistics)continue;const r=a.dimensions.map(t=>new l({variableName:a.name,dimensionName:t.name,values:[t.values?.[0]??t.extent?.[0]],isSlice:!0})),o=p(r,e),n=null==o?null:t[o];if(null==n)continue;const m=this.rasterJobHandler?await this.rasterJobHandler.computeStatisticsHistograms({pixelBlock:n},i):d(n);a.statistics=m.statistics,a.histograms||(a.histograms=m.histograms)}}};t([s({type:String,json:{write:!0}})],f.prototype,"datasetFormat",void 0),t([s()],f.prototype,"source",void 0),t([s()],f.prototype,"url",null),f=t([a("esri.layers.support.rasterDatasets.InMemoryRaster")],f);const x=f;export{x as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
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 e from"../../../core/Error.js";import{property as s,subclass as r}from"../../../core/accessorSupport/decorators.js";import i from"../../../geometry/Extent.js";import o from"../../../geometry/Point.js";import a from"../../../geometry/SpatialReference.js";import n from"../PixelBlock.js";import l from"../RasterInfo.js";import f from"../RasterStorageInfo.js";import c from"./BaseRaster.js";import{parseSpatialReference as h,parsePAMInfo as m}from"./pamParser.js";import{getElement as p,getElementValue as u}from"./xmlUtilities.js";import{isPlatformLittleEndian as g}from"../rasterFormats/utils.js";import{estimateStatisticsFromHistograms as d}from"../rasterFunctions/stretchUtils.js";const y=new Map;y.set("Int8","s8"),y.set("UInt8","u8"),y.set("Int16","s16"),y.set("UInt16","u16"),y.set("Int32","s32"),y.set("UInt32","u32"),y.set("Float32","f32"),y.set("Float64","f32"),y.set("Double64","f32");const x=new Map;x.set("none",{blobExtension:".til",isOneSegment:!0,decoderFormat:"bip"}),x.set("lerc",{blobExtension:".lrc",isOneSegment:!1,decoderFormat:"lerc"}),x.set("deflate",{blobExtension:".pzp",isOneSegment:!0,decoderFormat:"deflate"}),x.set("jpeg",{blobExtension:".pjg",isOneSegment:!0,decoderFormat:"jpg"}),x.set("qb3",{blobExtension:".pq3",isOneSegment:!0,decoderFormat:"qb3"});let b=class extends c{constructor(){super(...arguments),this._files=null,this._storageIndex=null,this.datasetFormat="MRF"}async fetchRawTile(t,e,s,r={}){const{blockWidth:i,blockHeight:o,blockBoundary:a}=this.rasterInfo.storageInfo,l=a[t];if(!l||l.maxRow<e||l.maxCol<s||l.minRow>e||l.minCol>s)return null;const{bandCount:f,pixelType:c}=this.rasterInfo,{ranges:h,actualTileWidth:m,actualTileHeight:p}=this._getTileLocation(t,e,s);if(!h||0===h.length)return null;if(0===h[0].from&&0===h[0].to){const t=new Uint8Array(i*o);return new n({width:i,height:o,pixels:void 0,mask:t,validPixelCount:0})}const{bandIds:u}=this.ioConfig,g=this._getBandSegmentCount(),d=[];let y=0;for(y=0;y<g;y++)u&&!u.includes(y)||d.push(this.request(this._files.data,{range:{from:h[y].from,to:h[y].to},responseType:"array-buffer",signal:r.signal}));const b=await Promise.all(d),w=b.map(t=>t.data.byteLength).reduce((t,e)=>t+e),I=new Uint8Array(w),F=[];let A=0;for(y=0;y<g;y++)F.push(A),I.set(new Uint8Array(b[y].data),A),A+=b[y].data.byteLength;const R=x.get(this.rasterInfo.storageInfo.compression).decoderFormat,S=await this.decodePixelBlock(I.buffer,{width:i,height:o,format:R,planes:u?.length||f,offsets:F,pixelType:c}).catch(()=>null);if(null==S)return null;let{noDataValue:_}=this.rasterInfo;if(null!=_&&"lerc"!==R&&!S.mask&&(_=_[0],null!=_)){const t=S.width*S.height,e=new Uint8Array(t);if(Math.abs(_)>1e24)for(y=0;y<t;y++)Math.abs((S.pixels[0][y]-_)/_)>1e-6&&(e[y]=1);else for(y=0;y<t;y++)S.pixels[0][y]!==_&&(e[y]=1);S.mask=e}let M=0,k=0;if(m!==i||p!==o){let t=S.mask;if(t)for(y=0;y<o;y++)if(k=y*i,y<p)for(M=m;M<i;M++)t[k+M]=0;else for(M=0;M<i;M++)t[k+M]=0;else for(t=new Uint8Array(i*o),S.mask=t,y=0;y<p;y++)for(k=y*i,M=0;M<m;M++)t[k+M]=1}return S}async _open(t){this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const e=t?t.signal:null,s=await this.request(this.url,{responseType:"xml",signal:e}),{rasterInfo:r,files:i}=this._parseHeader(s.data),{skipMapInfo:o,skipExtensions:a=[]}=this.ioConfig;if(!a.includes("aux.xml")&&!o){const e=await this._fetchAuxiliaryData(t);null!=e&&(r.statistics=e.statistics??r.statistics,r.histograms=e.histograms,e.histograms&&null==r.statistics&&(r.statistics=d(e.histograms)))}o&&this.updateImageSpaceRasterInfo(r),this._set("rasterInfo",r),this._files=i;const n=await this.request(i.index,{responseType:"array-buffer",signal:e});this._storageIndex=w(n.data);const{blockWidth:l,blockHeight:f}=this.rasterInfo.storageInfo,c=this.rasterInfo.storageInfo.pyramidScalingFactor,{width:h,height:m}=this.rasterInfo,p=[],u=this._getBandSegmentCount();let g=0,y=-1;for(;g<this._storageIndex.length;){y++;const t=Math.ceil(h/l/c**y)-1,e=Math.ceil(m/f/c**y)-1;g+=(t+1)*(e+1)*u*4,p.push({maxRow:e,maxCol:t,minCol:0,minRow:0})}this.rasterInfo.storageInfo.blockBoundary=p,y>0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=y),this.updateTileInfo()}_getBandSegmentCount(){return x.get(this.rasterInfo.storageInfo.compression).isOneSegment?1:this.rasterInfo.bandCount}_getTileLocation(t,e,s){const{blockWidth:r,blockHeight:i,pyramidScalingFactor:o}=this.rasterInfo.storageInfo,{width:a,height:n}=this.rasterInfo,l=this._getBandSegmentCount();let f,c,h,m=0,p=0;for(h=0;h<t;h++)p=o**h,f=Math.ceil(a/r/p),c=Math.ceil(n/i/p),m+=f*c;p=o**t,f=Math.ceil(a/r/p),c=Math.ceil(n/i/p),m+=e*f+s,m*=4*l;const u=this._storageIndex.subarray(m,m+4*l);let g=0,d=0;const y=[];for(let x=0;x<l;x++)g=u[4*x]*2**32+u[4*x+1],d=g+u[4*x+2]*2**32+u[4*x+3]-1,y.push({from:g,to:d});return{ranges:y,actualTileWidth:s<f-1?r:Math.ceil(a/p)-r*(f-1),actualTileHeight:e<c-1?i:Math.ceil(n/p)-i*(c-1)}}_parseHeader(t){const s=p(t,"MRF_META/Raster");if(!s)throw new e("mrf:open","not a valid MRF format");const r=p(s,"Size"),n=parseInt(r.getAttribute("x"),10),c=parseInt(r.getAttribute("y"),10),m=parseInt(r.getAttribute("c"),10),g=(u(s,"Compression")||"none").toLowerCase();if(!x.has(g))throw new e("mrf:open","currently does not support compression "+g);const d=u(s,"DataType")||"UInt8",b=y.get(d);if(null==b)throw new e("mrf:open","currently does not support pixel type "+d);const w=p(s,"PageSize"),I=parseInt(w.getAttribute("x"),10),F=parseInt(w.getAttribute("y"),10),A=p(s,"DataValues");let R,S;A&&(S=A.getAttribute("NoData"),null!=S&&(R=S.trim().split(" ").map(t=>parseFloat(t))));if(p(t,"MRF_META/CachedSource"))throw new e("mrf:open","currently does not support MRF referencing other data files");const _=p(t,"MRF_META/GeoTags"),M=p(_,"BoundingBox");let k,T=!1;if(null!=M){const t=parseFloat(M.getAttribute("minx")),e=parseFloat(M.getAttribute("miny")),s=parseFloat(M.getAttribute("maxx")),r=parseFloat(M.getAttribute("maxy")),o=u(_,"Projection")||"";let n=a.WGS84;if("LOCAL_CS[]"!==o)if(o.toLowerCase().startsWith("epsg:")){const t=Number(o.slice(5));isNaN(t)||0===t||(n=new a({wkid:t}))}else n=h(o)??a.WGS84;else T=!0,n=new a({wkid:3857});k=new i(t,e,s,r),k.spatialReference=n}else T=!0,k=new i({xmin:-.5,ymin:.5-c,xmax:n-.5,ymax:.5,spatialReference:new a({wkid:3857})});const C=p(t,"MRF_META/Rsets"),j=parseInt(C?.getAttribute("scale")||"2",10),U=k.spatialReference,B=new f({origin:new o({x:k.xmin,y:k.ymax,spatialReference:U}),blockWidth:I,blockHeight:F,pyramidBlockWidth:I,pyramidBlockHeight:F,compression:g,pyramidScalingFactor:j}),E=new o({x:k.width/n,y:k.height/c,spatialReference:U}),L=new l({width:n,height:c,extent:k,isPseudoSpatialReference:T,spatialReference:U,bandCount:m,pixelType:b,pixelSize:E,noDataValue:R,storageInfo:B}),P=u(t,"datafile"),W=u(t,"IndexFile");return{rasterInfo:L,files:{mrf:this.url,index:W||this.url.replace(".mrf",".idx"),data:P||this.url.replace(".mrf",x.get(g).blobExtension)}}}async _fetchAuxiliaryData(t){try{const{data:e}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:t?.signal});return m(e)}catch{return null}}};function w(t){if(t.byteLength%16>0)throw new Error("invalid array buffer must be multiples of 16");let e,s,r,i,o,a;if(g){for(s=new Uint8Array(t),i=new ArrayBuffer(t.byteLength),r=new Uint8Array(i),o=0;o<t.byteLength/4;o++)for(a=0;a<4;a++)r[4*o+a]=s[4*o+3-a];e=new Uint32Array(i)}else e=new Uint32Array(t);return e}t([s()],b.prototype,"_files",void 0),t([s()],b.prototype,"_storageIndex",void 0),t([s({type:String,json:{write:!0}})],b.prototype,"datasetFormat",void 0),b=t([r("esri.layers.support.rasterDatasets.MRFRaster")],b);const I=b;export{I as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
-
*/
|
|
5
|
-
import e from"../../../geometry/Point.js";import n from"./EphemeralBlockCache.js";import{projectExtent as t,projectResolution as o,snapPyramid as l}from"../rasterFunctions/rasterProjectionHelper.js";const r=new Map,c=new n;function i(e,n,t){const o=[];return null!=n&&o.push(`sliceId=${n}`),null!=t&&o.push(`bandIds=${t.join(",")}`),o.length?`${e}?${o.join("&")}`:e}function u(e,n){const t={extent:null,rasterInfo:n,cache:new Map},o=r.get(e);return o?(o.push(t),o.length-1):(r.set(e,[t]),0)}function a(e,n){const t=r.get(e);t&&(t[n]=null,t.some(e=>null!=e)||r.delete(e))}function f(e){r.delete(e)}function s(e,n,t){const o=r.get(e);if(!o)return null==n?c.decreaseRefCount(e,t):0;if(null==n||null==o[n])return c.decreaseRefCount(e,t);const l=o[n]?.cache,i=l?.get(t);if(l&&i){if(i.refCount--,0===i.refCount){l.delete(t);for(let e=0;e<o.length;e++)o[e]?.cache.delete(t);i.controller&&i.controller.abort()}return i.refCount}return 0}function m(e,n,t){const o=r.get(e);if(!o)return null==n?c.getBlock(e,t):null;if(null==n||null==o[n]){for(let e=0;e<o.length;e++){const n=o[e]?.cache.get(t);if(n)return n.refCount++,n.block}return c.getBlock(e,t)}const l=o[n]?.cache.get(t);if(l)return l.refCount++,l.block;for(let r=0;r<o.length;r++){if(r===n||!o[r])continue;const e=o[r]?.cache,l=e?.get(t);if(e&&l)return l.refCount++,e.set(t,l),l.block}return null}function h(e,n,t,o,l=null){const i=r.get(e);if(!i)return void(null==n&&c.putBlock(e,t,o,l));if(null==n||null==i[n])return void c.putBlock(e,t,o,l);const u={refCount:1,block:o,isResolved:!1,isRejected:!1,controller:l};o.then(()=>u.isResolved=!0).catch(()=>u.isRejected=!0),i[n]?.cache.set(t,u)}function x(e,n,t){const o=r.get(e);o?null!=n&&null!=o[n]?o[n]?.cache.delete(t):c.deleteBlock(e,t):null==n&&c.deleteBlock(e,t)}function d(e,n){const t=r.get(e);return t?t[n]??null:null}function g(n,r,c,i,u,a,f=null){const s=d(n,r);if(!s)return;const m=s.extent,{cache:h,rasterInfo:x}=s;if(m&&m.xmin===c.xmin&&m.xmax===c.xmax&&m.ymin===c.ymin&&m.ymax===c.ymax)return;i=i??0;const g=c.clone().normalize(),{spatialReference:p,transform:y}=x,k=new Set;for(let d=0;d<g.length;d++){const n=g[d];if(n.xmax-n.xmin<=i||n.ymax-n.ymin<=i)continue;let r=t(n,p,f);if(null==r)continue;if(null!=y&&(r=y.inverseTransform(r),null==r))continue;const c=new e({x:i,y:i,spatialReference:n.spatialReference});if(null==u&&!(u=o(c,p,n,f)))return;const{pyramidLevel:s,pyramidResolution:m,excessiveReading:h}=l(u,x,a||"closest");if(h)return;const{storageInfo:M}=x,{origin:R}=M,{x:C,y:B}=m,b=Math.max(0,Math.floor((r.xmin-R.x)/C)),j=Math.max(0,Math.floor((R.y-r.ymax)/B)),v=Math.ceil(r.width/C-.1),w=Math.ceil(r.height/B-.1),$=s>0?M.pyramidBlockWidth:M.blockWidth,I=s>0?M.pyramidBlockHeight:M.blockHeight,H=M.blockBoundary[s];if(!H)continue;const E=1,P=Math.max(H.minCol,Math.floor(b/$)-E),W=Math.max(H.minRow,Math.floor(j/I)-E),z=Math.min(H.maxCol,Math.floor((b+v-1)/$)+E),F=Math.min(H.maxRow,Math.floor((j+w-1)/I)+E);for(let e=W;e<=F;e++)for(let n=P;n<=z;n++)k.add(`${s}/${e}/${n}`)}h.forEach((e,n)=>{if(!k.has(n)){const e=h.get(n);(null==e||e.isResolved||e.isRejected)&&h.delete(n)}}),s.extent={xmin:c.xmin,ymin:c.ymin,xmax:c.xmax,ymax:c.ymax}}export{s as decreaseRefCount,x as deleteBlock,f as deleteRaster,m as getBlock,i as getRasterId,h as putBlock,u as register,a as unregister,g as update};
|
|
@@ -1,5 +0,0 @@
|
|
|
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 e}from"tslib";import t from"../../../core/Error.js";import"../../../core/has.js";import i from"../../../core/Logger.js";import{property as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import a from"../../../geometry/Extent.js";import n from"../../../geometry/Point.js";import o from"../../../geometry/SpatialReference.js";import f from"../RasterInfo.js";import l from"../RasterStorageInfo.js";import u from"./BaseRaster.js";import c from"./DBFParser.js";import{parsePAMInfo as h,parseSpatialReference as p}from"./pamParser.js";import{parseSignature as d,getPyramidIFDs as m,getMaskIFDs as y,parseIFD as g,parseFieldValues as x,isBSQConfig as w,getImageInfo as I}from"../rasterFormats/TiffDecoder.js";import{tiffTags as T,geoKeys as R}from"../rasterFormats/tiffTag.js";import{estimateStatisticsFromHistograms as _}from"../rasterFunctions/stretchUtils.js";import O from"../rasterTransforms/PolynomialTransform.js";import F from"../../../rest/support/FeatureSet.js";const S=(e,t)=>e.get(t)?.values,b=(e,t)=>e.get(t)?.values?.[0];let E=class extends u{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this._chunkSize=10485760,this.datasetFormat="TIFF"}async fetchRawTile(e,t,i,r={}){if(!this._headerInfo?.isSupported||this.isBlockOutside(e,t,i))return null;const s=await this._fetchRawTiffTile(e,t,i,!1,r);if(null!=s&&this._headerInfo.hasMaskBand){const a=await this._fetchRawTiffTile(e,t,i,!0,r);null!=a&&a.pixels[0]instanceof Uint8Array&&(s.mask=a.pixels[0])}return s}async _open(e){const r=e?e.signal:null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:r});if(!s)throw new t("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1,this.url.lastIndexOf("."));const{littleEndian:a,firstIFDPos:n,isBigTiff:o}=d(s),f=[],l={fileChunk:s,posIFD:n,fileOffset:0};await this._readIFDs(f,l,a,o?8:4,r);const{imageInfo:u,rasterInfo:c}=k(f),h=m(f),p=y(f);if(this._headerInfo={littleEndian:a,isBigTiff:o,ifds:f,pyramidIFDs:h,maskIFDs:p,...u},this._set("rasterInfo",c),!u.isSupported)throw new t("tiffraster:open","this tiff is not supported: "+u.message);if(!u.tileWidth)throw new t("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");c.isPseudoSpatialReference&&i.getLogger(this).warn("The spatial reference for this tiff is unsupported. Only EPSG spatial reference codes and Esri WKTs are supported.");const g=f[0].get("PREDICTOR")?.values?.[0],x=f[0].get("SAMPLEFORMAT")?.values?.[0];if(3===x&&2===g)throw new t("tiffraster:open","unsupported horizontal difference encoding. Predictor=3 is supported for floating point data");const{skipMapInfo:w,skipExtensions:I=[]}=this.ioConfig;if(!I.includes("aux.xml")&&!w){const t=await this._fetchAuxiliaryMetaData(e);null!=t&&D(t,c)}I.includes("vat.dbf")||1!==c.bandCount||"u8"!==c.pixelType||w||(c.attributeTable=await this._fetchAuxiliaryTable(e),null!=c.attributeTable&&(c.keyProperties.DataType="thematic")),w&&this.updateImageSpaceRasterInfo(c),this.updateTileInfo()}async _validateOrFetchHeaderBuffer(e,t){let{fileChunk:i,fileOffset:r,posIFD:s}=e;if(s+8>=i.byteLength||s<0){r=s+r;i=(await this.request(this.url,{range:{from:r,to:r+this._bufferSize},responseType:"array-buffer",signal:t})).data,s=0}return{fileChunk:i,fileOffset:r,posIFD:s}}async _readIFDs(e,i,r,s=4,a){if(!i.posIFD)return null;i=await this._validateOrFetchHeaderBuffer(i,a);const n=await this._readIFD(i,r,T,s,a);if(!n?.ifd)throw new t("tiffraster:open","cannot parse tiff header. failed to open url "+this.url);if(e.push(n.ifd),!n.nextIFD)return null;i.posIFD=n.nextIFD-i.fileOffset,await this._readIFDs(e,i,r,s,a)}async _readIFD(e,t,i=T,r=4,s){let{fileChunk:a,posIFD:n,fileOffset:o}=e;if(!e.fileChunk)return null;const f=g(a,t,n,o,i,r);if(f.success){const e=[];if(f.ifd?.forEach(t=>{t.values||e.push(t)}),e.length>0&&await this._fillOffsets(e,t,f.nextIFD,s),f.ifd?.has("GEOKEYDIRECTORY")){const e=f.ifd.get("GEOKEYDIRECTORY"),i=e?.values;if(i&&i.length>4){const r=i[0]+"."+i[1]+"."+i[2];n=e.valueOffset+6-o;const f=await this._validateOrFetchHeaderBuffer({fileChunk:a,posIFD:n,fileOffset:o},s),l=await this._readIFD(f,t,R,2,s);e.data=l?.ifd,e.data&&e.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[r]})}}return f}if(f.requiredBufferSize){return a=(await this.request(this.url,{range:{from:o,to:o+n+f.requiredBufferSize+8},responseType:"array-buffer",signal:s})).data,a.byteLength<n+f.requiredBufferSize?null:(e.fileChunk=a,e.fileOffset=o,this._readIFD(e,t,i,r,s))}return null}async _fillOffsets(e,t,i,r){const s=e.filter(e=>null!=e.offlineOffsetSize);if(0===s.length)return;const a=s.map(e=>e.offlineOffsetSize),n=Math.min.apply(null,a.map(e=>e[0])),o=Math.max.apply(null,a.map(e=>e[0]+e[1]));let f=1===a.length||o-n<=this._bufferSize;if(!f&&a.length>1){a.sort((e,t)=>e[0]-t[0]);f=a.reduce((e,t)=>e===t[0]?t[0]+t[1]:0,a[0][0])===o}if(f){const e=await this._fetchOffsets(n,Math.max(o,n+this._bufferSize),r);return void s.forEach(i=>x(e,t,i,n))}const l=s.map(async e=>{const i=e.offlineOffsetSize,s=await this._fetchOffsets(i[0],i[1]+i[0],r);x(s,t,e,i[0])});await Promise.all(l)}async _fetchOffsets(e,t,i){const r=[],s=this._chunkSize,a=Math.ceil((t-e)/s);let n=e;for(let l=0;l<a;l++)r.push(this.request(this.url,{range:{from:n,to:l===a-1?t:n+s-1},responseType:"array-buffer",signal:i})),n+=s;const o=await Promise.all(r);if(1===a)return o[0].data;const f=new Uint8Array(t-e+1);for(let l=0;l<a;l++)f.set(new Uint8Array(o[l].data),l*s);return f.buffer}async _fetchRawTiffTile(e,t,i,r,s={}){const a=this._getTileLocation(e,t,i,r);if(!a)return null;const{ranges:n,actualTileWidth:o,actualTileHeight:f,ifd:l}=a,u=n.map(e=>this.request(this.url,{range:e,responseType:"array-buffer",signal:s.signal})),c=await Promise.all(u),h=c.map(e=>e.data.byteLength).reduce((e,t)=>e+t),p=1===c.length?c[0].data:new ArrayBuffer(h),d=[0],m=[0];if(c.length>1){const e=new Uint8Array(p);for(let t=0,i=0;t<c.length;t++){const r=c[t].data;e.set(new Uint8Array(r),i),d[t]=i,i+=r.byteLength,m[t]=r.byteLength}}const{blockWidth:y,blockHeight:g}=this.getBlockWidthHeight(e),x=await this.decodePixelBlock(p,{format:"tiff",customOptions:{headerInfo:this._headerInfo,ifd:l,offsets:d,sizes:m},width:y,height:g,planes:null,pixelType:null});if(null==x)return null;let w,I,T;if(o!==y||f!==g){let e=x.mask;if(e)for(w=0;w<g;w++)if(T=w*y,w<f)for(I=o;I<y;I++)e[T+I]=0;else for(I=0;I<y;I++)e[T+I]=0;else for(e=new Uint8Array(y*g),x.mask=e,w=0;w<f;w++)for(T=w*y,I=0;I<o;I++)e[T+I]=1}return x}_getTileLocation(e,t,i,r=!1){const{firstPyramidLevel:s,blockBoundary:a}=this.rasterInfo.storageInfo,n=0===e?0:e-(s-1),{_headerInfo:o}=this;if(!o)return null;const f=r?o.maskIFDs[n]:0===n?o?.ifds[0]:o?.pyramidIFDs[n-1];if(!f)return null;const l=w(f,o),u=S(f,"TILEOFFSETS");if(void 0===u)return null;const c=S(f,"TILEBYTECOUNTS"),{minRow:h,minCol:p,maxRow:d,maxCol:m}=a[n];if(t>d||i>m||t<h||i<p)return null;const y=b(f,"IMAGEWIDTH"),g=b(f,"IMAGELENGTH"),x=b(f,"TILEWIDTH"),I=b(f,"TILELENGTH"),T=[];if(l){const{bandCount:e}=this.rasterInfo;for(let r=0;r<e;r++){const e=r*(d+1)*(m+1)+t*(m+1)+i;T[r]={from:u[e],to:u[e]+c[e]-1}}}else{const e=t*(m+1)+i;T.push({from:u[e],to:u[e]+c[e]-1})}for(let w=0;w<T.length;w++)if(null==T[w].from||!T[w].to||T[w].to<0)return null;return{ranges:T,ifd:f,actualTileWidth:i===m&&y%x||x,actualTileHeight:t===d&&g%I||I}}async _fetchAuxiliaryMetaData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e?.signal});return h(t)}catch{return null}}async _fetchAuxiliaryTable(e){try{const{data:t}=await this.request(this.url+".vat.dbf",{responseType:"array-buffer",signal:e?.signal}),i=c.parse(t);return i?.recordSet?F.fromJSON(i.recordSet):null}catch{return null}}};function k(e){const t=I(e),{width:i,height:r,tileWidth:s,tileHeight:u,planes:c,pixelType:h,compression:d,firstPyramidLevel:m,maximumPyramidLevel:y,pyramidBlockWidth:g,pyramidBlockHeight:x,pyramidResolutions:w,tileBoundary:T,affine:R,metadata:_}=t,F=t.extent.spatialReference?.wkt||t.extent.spatialReference?.wkid;let E=p(F),k=!!t.isPseudoGeographic;null==E&&(k=!0,E=new o({wkid:3857}));const D=new a({...t.extent,spatialReference:E}),v=new n(D?{x:D.xmin,y:D.ymax,spatialReference:E}:{x:0,y:0}),P=new l({blockWidth:s,blockHeight:u,pyramidBlockWidth:g,pyramidBlockHeight:x,compression:d,origin:v,firstPyramidLevel:m,maximumPyramidLevel:y,pyramidResolutions:w,blockBoundary:T}),B=new n({x:(D.xmax-D.xmin)/i,y:(D.ymax-D.ymin)/r,spatialReference:E}),z=_?{BandProperties:_.bandProperties,DataType:_.dataType}:{};let C=null;const L=b(e[0],"PHOTOMETRICINTERPRETATION"),j=S(e[0],"COLORMAP");if(L<=3&&j?.length>3&&j.length%3==0){C=[];const e=j.length/3;for(let t=0;t<e;t++)C.push([t,j[t]>>>8,j[t+e]>>>8,j[t+2*e]>>>8])}const A=new f({width:i,height:r,bandCount:c,pixelType:h,pixelSize:B,storageInfo:P,spatialReference:E,isPseudoSpatialReference:k,keyProperties:z,extent:D,colormap:C,statistics:_?_.statistics:null});if(R?.length&&(A.nativeExtent=new a({xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:E}),A.transform=new O({polynomialOrder:1,forwardCoefficients:[R[2]+R[0]/2,R[5]-R[3]/2,R[0],R[3],-R[1],-R[4]]}),A.extent=A.transform.forwardTransform(A.nativeExtent),A.pixelSize=new n({x:(D.xmax-D.xmin)/i,y:(D.ymax-D.ymin)/r,spatialReference:E}),P.origin.x=-.5,P.origin.y=.5),w){const{x:e,y:t}=A.pixelSize;w.forEach(i=>{i.x*=e,i.y*=t})}return{imageInfo:t,rasterInfo:A}}function D(e,t){if(t.statistics=e.statistics??t.statistics,t.histograms=e.histograms,e.histograms&&null==t.statistics&&(t.statistics=_(e.histograms)),e.transform&&null==t.transform){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new n({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.isPseudoSpatialReference&&e.spatialReference&&(t.spatialReference=e.spatialReference,t.extent.spatialReference=t.nativeExtent.spatialReference=t.storageInfo.origin.spatialReference=t.spatialReference)}e([r()],E.prototype,"_files",void 0),e([r()],E.prototype,"_headerInfo",void 0),e([r()],E.prototype,"_bufferSize",void 0),e([r()],E.prototype,"_chunkSize",void 0),e([r({type:String,json:{write:!0}})],E.prototype,"datasetFormat",void 0),E=e([s("esri.layers.support.rasterDatasets.TIFFRaster")],E);const v=E;export{v as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
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 e}from"tslib";import t from"../../../core/Error.js";import i from"../../../core/Logger.js";import{property as n,subclass as s}from"../../../core/accessorSupport/decorators.js";import o from"../../../geometry/Extent.js";import{isAxesOrderReversedForWkid as r}from"../../ogc/crsUtils.js";import{getCapabilities as a,describeCoverage as l}from"../../ogc/wcsUtils.js";import c from"../DimensionalDefinition.js";import d from"./BaseRaster.js";import{convertOleDateTimeToEpoch as f}from"./multidimensionalUtils.js";import{parse as u}from"./multipartParser.js";import{standardizeInterpolations as h}from"./wcsCoverageParser.js";import{getFormat as p}from"../rasterFormats/RasterCodec.js";import{clip as m}from"../rasterFunctions/pixelUtils.js";const g=["nearest neighbor","bilinear","bicubic"],w=["nearest","linear","cubic"],v="response is not a supported multipart/related mediaType with inline tiff, switching to compatibility mode",y="response is not a supported multipart mediaType with inline tiff",x="response is base64 encoded which may impact layer display performance",I="server returns an exception",C=new Set(["1.0.0","1.1.0","1.1.1","1.1.2","2.0.1"]);let b=class extends d{constructor(){super(...arguments),this.datasetFormat="WCSServer",this.tileType="Raster"}get rasterId(){return`${this.url}-${this.coverageId}-${this.version}`}async fetchRawTile(e,i,n,s={}){if(this.isBlockOutside(e,i,n))return null;const{nativePixelSize:o,spatialReference:r}=this.rasterInfo,a=2**e,l=o.x*a,c=o.y*a,{blockWidth:d,blockHeight:f}=this.getBlockWidthHeight(e),{origin:u}=this.rasterInfo.storageInfo.tileInfo,h=this.getTileExtent({x:l,y:c},i,n,u,r,[d,f]),p=this.rasterInfo.extent,g=h.xmax>p.xmax,w=h.ymin<p.ymin,v=g||w;let y=h,x=d,I=f;if(v&&(y=h.clone().intersection(p),null!=y&&(g&&(x=Math.floor((y.xmax-y.xmin)/l),y.xmax=y.xmin+l*x),w&&(I=Math.floor((y.ymax-y.ymin)/c),y.ymin=y.ymax-c*I))),null==y||x<=1||I<=1)return null;const C=await this._getCoverage(y,x,I,a,s);if(!C)return null;const{coverageDescription:b}=this.coverageInfo,{noDataValue:$,multidimensionalInfo:S}=this.rasterInfo,{multidimensionalDefinition:j}=s;let T;if(null!=S&&null!=j&&j.length){const e=j[0].variableName;if("2.0"===b.version){const t=b.rangeType[0].find(t=>t.name===e);T=t?.nilValue}else if("1.1"===b.version){const t=b.range.find(t=>t.identifier===e);T=t?.nullValues}}const L=T??$,P=await this.decodePixelBlock(C,{width:x,height:I,planes:null,pixelType:null,tiffNoDataValue:Array.isArray(L)?L[0]:L,matchAllNoData:!0});if(null==P)return null;if(P&&(P.width!==x||P.height!==I))throw new t("wcsraster-fetch",`the response has unexpected dimension width: ${P.width}, height: {pixelBlock.height}`);return v?m(P,{x:0,y:0},{width:f,height:f}):P}async _open(e){const{customFetchParameters:i}=this.ioConfig,n=e?.signal,s=await a(this.url,{version:i?.version??this.version,customParameters:i,signal:n});if(this.capabilities=s,!this.version){let e=s.version.slice(0,3);"2.0"===e||"1.1"===e||"1.0"===e?this.version=s.version:(e=s.supportedVersions.find(e=>"2.0.1"===e)||s.supportedVersions.find(e=>e.startsWith("2.0"))||s.supportedVersions.find(e=>e.startsWith("1.1"))||s.supportedVersions.find(e=>e.startsWith("1.0"))||"1.0.0",this.version=e)}const{version:o}=this;if(!C.has(o))throw new t("wcsraster-open",`unsupported WCS version ${o}`);const{gridCoverages:r}=s;if(!r.length)throw new t("wcsraster-open","cannot find rectified grid coverages");this.coverageId??=r[0].id;const{coverageId:c}=this,d=r.find(e=>e.id===c);if(null==d)throw new t("wcsraster-open",`the coverageId ${c} does not exist in capabilities`);const f=await l(this.url,{coverageIds:[c],version:o,customParameters:i,signal:n});if(this.coverageInfo=f[0],o.startsWith("2.0")){const{coverageInfo:e}=this;e.lonLatEnvelope=d.lonLatEnvelope,e.supportedInterpolations=h(s.supportedInterpolations),this._patchDimensionValues201(c,n)}this.datasetName=this.coverageInfo.title;const{rasterInfo:u}=this.coverageInfo;if(this.createRemoteDatasetStorageInfo(u,512,512),this._set("rasterInfo",u),null==u.spatialReference)throw new t("wcsraster-open",`coverage without spatial reference is not supported: ${c}`);const{pixelType:p,bandCount:m}=await this._getPixelTypeAndBandCount(n);u.pixelType=p,1===u.bandCount&&m>1&&(u.bandCount=m),this.updateTileInfo()}async _patchDimensionValues201(e,t){const{coverageInfo:i}=this,n=i.rasterInfo.multidimensionalInfo?.variables,s=C.has("1.1.2")?"1.1.2":C.has("1.1.1")?"1.1.1":C.has("1.1.0")?"1.1.0":null,{customFetchParameters:o}=this.ioConfig;if(n&&s)try{const i=this.url.includes("/ImageServer/"),r=e.length>8&&e.startsWith("Coverage")&&i?e.slice(8):e,a=await l(this.url,{coverageIds:[r??e],version:s,customParameters:o,signal:t}).catch(()=>{if(r)return l(this.url,{coverageIds:[e],version:s,customParameters:o,signal:t})}),c=a?.[0].rasterInfo.multidimensionalInfo?.variables;if(c)for(const e of n){const t=c.find(({name:t})=>t===e.name);if(t?.dimensions?.length)for(let n=e.dimensions.length-1;n>=0;n--){const s=e.dimensions[n],o=t.dimensions.find(({name:e})=>e===s.name);o?o.values&&o.extent?.join(",")===s.extent?.join(",")&&(e.dimensions[n]={...s,values:o.values}):i&&e.dimensions.splice(n,1)}}}catch{}}async _getPixelTypeAndBandCount(e){const{pixelSize:n,extent:s,multidimensionalInfo:r}=this.rasterInfo,a=s.center,l=new o({xmin:a.x-n.x,xmax:a.x+n.x,ymin:a.y-n.y,ymax:a.y+n.y,spatialReference:s.spatialReference});let d=[];if(null!=r){const e=r.variables[0];d=[],e.dimensions.forEach(t=>{d.push(new c({variableName:e.name,dimensionName:t.name,values:t.hasRegularIntervals?t.extent?.[0]:t.values?.[0],isSlice:!0}))})}const{coverageDescription:f}=this.coverageInfo,u={interpolation:"nearest",multidimensionalDefinition:d,signal:e},{version:h}=f,{ioConfig:p}=this,m="2.0"===h&&null==p.allowAnyMediaType||"1.1"===h&&null==p.use2GridOffsets;let g;try{g=await this._getCoverage(l,2,2,1,u,!0)}catch(y){if(!m)throw y;if("1.1"===h){if(!y.details?.isResolutionMismatch)throw y;p.use2GridOffsets=!0}}if(!g&&m&&("2.0"===h&&(p.allowAnyMediaType=!0),g=await this._getCoverage(l,2,2,1,u),g&&i.getLogger(this).warn("wcsraster:getcoverage",v)),!g)throw new t("wcsraster-open","unable to determine pixel type");const w=await this.decodePixelBlock(g,{width:2,height:2,planes:null,pixelType:null});if(null==w)throw new t("wcsraster-open","unable to determine pixel type");return{pixelType:w.pixelType,bandCount:w.getPlaneCount()??0}}async _getCoverage(e,n,s,o,r,a=!1){const{coverageDescription:l}=this.coverageInfo,{version:c}=l,d="2.0"===c?this._getCoverage201Parameters(e,n,s,o,r,l):"1.1"===c?this._getCoverage110Parameters(e,n,s,r,l):this._getCoverage100Parameters(e,n,s,r),f="2.0"===c?await this.request(this._constructWCS201Url(d),{signal:r.signal,responseType:"array-buffer"}):await this.request(this.url,{query:d,signal:r.signal,responseType:"array-buffer"});if("1.0"===c)return f.data;if("2.0"===c&&!1!==this.ioConfig.allowAnyMediaType){if("tiff"===p(f.data))return a&&(this.ioConfig.allowAnyMediaType=!0,i.getLogger(this).warn("wcsraster:getcoverage",v)),f.data}const h=u(f);if(h.isMultipart&&h.data){const e=h.data.find(e=>e.isValidImage);return a&&"base64"===e?.contentTransferEncoding&&i.getLogger(this).warn("wcsraster:getcoverage",x),e?.contentData}const m=new Uint8Array(f.data,0,Math.min(f.data.byteLength,2e3)),g=String.fromCharCode.apply(null,m).toLowerCase().includes("exception"),w=g&&String.fromCharCode.apply(null,m).includes("A non-zero RESX/RESY or WIDTH/HEIGHT is required but neither was provided");if(g)throw new t("wcsraster:getcoverage",I,{isResolutionMismatch:w});throw new t("wcsraster:getcoverage",y)}_getInterpolationIndex(e){return e&&this.coverageInfo.supportedInterpolations?.includes(e)?"nearest"===e?0:"bilinear"===e?1:"cubic"===e?2:0:0}_getCoverage100Parameters(e,t,i,n){const s=`${e.xmin},${e.ymin},${e.xmax},${e.ymax}`,o=e.spatialReference.wkid,r=(this.coverageInfo.supportedFormats||[]).find(e=>e.toLowerCase().includes("tiff"))||"GEOTIFF",{bandIds:a,interpolation:l}=n,c=this._getInterpolationIndex(l),d=a?a.map(e=>this.coverageInfo.bandNames[e]):null,f=g[c],{multidimensionalDefinition:u}=n;let h;if(null!=u&&null!=this.rasterInfo.multidimensionalInfo){const e=u.find(e=>"StdTime"===e.dimensionName);let t=e?.values;t&&t.length>0&&(Array.isArray(t[0])&&(t=t[0]),h=t.map(e=>$(e)).join(","))}return{service:"WCS",request:"GetCoverage",version:this.version,coverage:this.coverageId,format:r,crs:`EPSG:${o}`,bbox:s,width:t,height:i,time:h,interpolation:f,band:d?.join(",")}}_getCoverage110Parameters(e,t,i,n,s){const{multidimensionalDefinition:o,bandIds:a,interpolation:l}=n,c=e.spatialReference.wkid,d=`urn:ogc:def:crs:EPSG::${c}`,f=(this.coverageInfo.supportedFormats||[]).find(e=>e.toLowerCase().includes("tiff"))||"image/tiff",u=this._getInterpolationIndex(l),h=w[u],p=null==l||0===this.coverageInfo.supportedInterpolations?.indexOf(l),m=s.domain.spatialDomain,g=m.origin.x<=m.envelope.xmin&&m.origin.y<=m.envelope.ymin,v=e.width/t,y=e.height/i*(g?1:-1),x=g?[e.xmin,e.ymin]:[e.xmin,e.ymax],I=m.useEPSGAxis&&r(c),C=I?`${x[1]},${x[0]}`:`${x[0]},${x[1]}`,b=this.ioConfig.use2GridOffsets,S=I?b?`${y},${v}`:`${y},0,0,${v}`:b?`${v},${y}`:`${v},0,0,${y}`,j=v/2,T=e.xmin+j,L=e.xmax-j,P=Math.abs(y)/2,D=e.ymin+P,R=e.ymax-P,_=I?`${D},${T},${R},${L},${d}`:`${T},${D},${L},${R},${d}`,A=s.range.find(e=>e.axis.some(e=>e.identifier.toLowerCase().includes("band")));let E,W=A&&h&&a?p?`${A.identifier}[${A.axis[0].identifier}[${a.join(",")}]]`:`${A.identifier}:${h}[${A.axis[0].identifier}[${a.join(",")}]]`:null;if(null!=o&&o.length)for(let r=0;r<o.length;r++){let e=o[r].values;const t=o[r].dimensionName?.toLowerCase(),i=o[r].variableName?.toLowerCase(),n=s.range.find(e=>e.identifier.toLowerCase()===i);if(e.length>0)if(Array.isArray(e[0])&&(e=e[0]),"stdtime"===t)E=e.map(e=>$(e)).join(",");else if(n){const i=n.axis.find(e=>e.identifier.toLowerCase()===t);i&&(W=p?n.identifier+"["+i.identifier+"["+e.join(",")+"]]":n.identifier+":"+h+"["+i.identifier+"["+e.join(",")+"]]")}r===o.length-1&&n&&!W&&(W=p?n.identifier:n.identifier+":"+h)}return{service:"WCS",request:"GetCoverage",version:this.version,identifier:this.coverageId,format:f,crs:`EPSG:${c}`,boundingbox:_,gridCS:"urn:ogc:def:cs:OGC:0.0:Grid2dSquareCS",gridType:"urn:ogc:def:method:WCS:1.1:2dGridIn2dCrs",gridOrigin:C,gridOffsets:S,gridBaseCRS:d,timeSequence:E,rangeSubset:W}}_getCoverage201Parameters(e,t,i,n,s,o){const{multidimensionalDefinition:r,interpolation:a}=s,l=this._getInterpolationIndex(a);let c=null;const{supportedInterpolations:d}=this.capabilities;if(d?.length)switch(l){case 0:c=d.find(e=>e.toLowerCase().includes("nearest"));break;case 1:c=d.find(e=>e.toLowerCase().includes("linear"));break;case 2:c=d.find(e=>e.toLowerCase().includes("cubic")||e.toLowerCase().includes("quadratic"))}const f=(this.coverageInfo.supportedFormats||[]).find(e=>e.toLowerCase().includes("tiff"))||"image/tiff",{bandNames:u}=this.coverageInfo,{boundedBy:h,domainSet:p,rangeType:m}=o,g=h.isEastFirst?0:1,w=1-g,{axisLabels:v}=h,y=v[g],x=v[w],I=`http://www.opengis.net/def/crs/EPSG/0/${e.spatialReference.wkid}`,C=I,b=[];b.push(`${y}(${e.xmin},${e.xmax})`),b.push(`${x}(${e.ymin},${e.ymax})`);const S=[];if(v.length>2)for(let R=2;R<v.length;R++){const e=p.origin[R];if(v[R].toLowerCase().includes("time")){let t=e.toString();h.uomLabels?.[R].toLowerCase().includes("ole")&&(S.push(v[R]),t=$(e,!0)),b.push(v[R]+",http://www.opengis.net("+t+")")}else b.push(v[R]+",http://www.opengis.net("+e+")")}let j=null;if(null!=r&&r.length){const e=[];m.forEach(t=>t.forEach(t=>e.push(t.name)));const t=[];for(let i=0;i<r.length;i++){const n=v.find(e=>e===r[i].dimensionName),s=e.find(e=>e===r[i].variableName);if(t.includes(s)||t.push(s),n){let e=r[i].values;if(e.length>0){Array.isArray(e[0])&&(e=e[0]);let t="";t=n.toLowerCase().includes("time")?e.map(e=>$(e)).join(","):e.join(",");const i=b.findIndex(e=>e.startsWith(n+",http://www.opengis.net"));-1===i&&b.push(n+",http://www.opengis.net("+t+")"),-1===i||b[i].includes("("+t+")")||b.splice(i,1,n+",http://www.opengis.net("+t+")")}}}t.length&&(j=t.join(","))}else if(u?.length>=2){j=(s.bandIds?s.bandIds.map(e=>u[e]):u).join(",")}const T=b.join("&subset="),L=!o.domainSet.hasSameAxisLabelsAsBoundedBy&&!1!==this.ioConfig.allowScaleFactor,P=L?null:`${y}(${t}),${x}(${i})`,D=L?1/n:null;return{service:"WCS",request:"GetCoverage",version:this.version,coverageId:this.coverageId,rangesubset:j,interpolation:c,scaleSize:P,scaleFactor:D,subset:T,format:f,mediaType:this.ioConfig.allowAnyMediaType?null:"multipart/related",outputcrs:I,subsettingcrs:C}}_constructWCS201Url(e){const t={...this.ioConfig.customFetchParameters,...e},i=[];Object.keys(t).forEach(e=>{const n=t[e];null!=n&&("subset"===e?"string"==typeof n&&n.split("&subset=").forEach(e=>{e&&i.push(`subset=${encodeURIComponent(e)}`)}):i.push(`${e}=${encodeURIComponent(n)}`))});return`${encodeURI(this.url)}?${i.join("&")}`}};function $(e,t=!1){return(t?new Date(f(e)):new Date(e)).toISOString()}e([n({type:String,json:{write:!0}})],b.prototype,"datasetFormat",void 0),e([n({readOnly:!0})],b.prototype,"tileType",void 0),e([n({type:String,json:{write:!0}})],b.prototype,"version",void 0),e([n({type:String,json:{write:!0}})],b.prototype,"coverageId",void 0),e([n({readOnly:!0})],b.prototype,"rasterId",null),b=e([s("esri.layers.support.rasterDatasets.WCSRaster")],b);export{b as default};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
|
-
*/
|
|
5
|
-
import e from"../../../Color.js";import t from"../../../geometry/Extent.js";import n from"../../../geometry/SpatialReference.js";import{getLocaleLanguage as l}from"../../../intl/locale.js";import s from"../PixelBlock.js";import{getIntegerPixelType as a}from"../rasterFormats/pixelRangeUtils.js";function i(e){return["x","e","east","long","longitude"].includes(e.toLowerCase())}function r(e){return["y","n","west","lat","latitude"].includes(e.toLowerCase())}function o(e){const{axes:l}=e.domain,s=Object.keys(l),a=[],o=[];let u=-1,m=-1,c=[];for(let t=0;t<s.length;t++){const e=s[t];i(e)?u=t:r(e)&&(m=t);const n=l[e],d=[];if("values"in n){n.values.forEach(e=>d.push("string"==typeof e?new Date(e).getTime():e));const e=d[1]-d[0];a.push([d[0]-.5*e,d[d.length-1]+.5*e]),o.push(e)}else{const{start:e,stop:t,num:l}=n,s=(t-e)/(l-1);a.push([e-.5*s,t+.5*s]),o.push(s);for(let n=0;n<l;n++)d.push(e+s*n)}c.push({name:e,values:d,extent:[d[0],d[d.length-1]]})}u>-1&&-1===m?m=0===u?1:0:m>-1&&-1===u?u=0===m?1:0:-1===m&&-1===u&&(u=0,m=1),c=c.filter((e,t)=>!(t===u||t===m));const{referencing:d}=e.domain,f=d.find(e=>e.coordinates.includes(s[u])).system.id,p=f?.slice(f.lastIndexOf("/")+1),h=null==p||"CRS84"===p?4326:Number(p),g=new n({wkid:h}),[b,y]=a[u],[x,j]=a[m],v=new t({xmin:b,xmax:y,ymin:x,ymax:j,spatialReference:g});return{width:Math.round(v.width/o[u]),height:Math.round(v.height/o[m]),extent:v,dimensions:c}}function u(e){const t=l();return t?e[t]??Object.values(e)[0]:Object.values(e)[0]}function m(){return Math.round(255*Math.random())}function c(t){const n={},{parameters:l}=t;if(!l)return n;for(const[s,a]of Object.entries(l)){const{type:t,description:l,unit:i,categoryEncoding:r,observedProperty:o}=a;if("Parameter"===t&&(n[s]={},l&&(n[s].description=u(l)),i&&(n[s].unit=i.label?u(i.label):null,n[s].symbol=i.symbol?.value),r)){const t=Object.entries(r).map((e,t)=>({OID:t,Value:Number(e[1]),ClassName:e[0].slice(e[0].lastIndexOf("/")+1),Count:1}));let l=!1;o?.categories?.length&&(o.categories.forEach(n=>{if(!n.id)return;const s=n.id.slice(n.id.lastIndexOf("/")+1),a=t.find(e=>e.ClassName===s);if(!a)return;const i=n.label?u(n.label):null;if(a.Label=i,n.preferredColor){const t=e.fromHex(n.preferredColor);t&&(l=!0,a.Red=t.r,a.Green=t.g,a.Blue=t.b)}}),l&&t.forEach(e=>{null==e.Red&&(e.Red=m(),e.Green=m(),e.Blue=m())}));const a={objectIdFieldName:"",fields:[{name:"OID",type:"esriFieldTypeOID",alias:"OID",domain:null},{name:"Value",type:"esriFieldTypeInteger",alias:"Value",domain:null},{name:"Count",type:"esriFieldTypeDouble",alias:"Count",domain:null},{name:"ClassName",type:"esriFieldTypeString",alias:"ClassName",domain:null,length:50},{name:"Label",type:"esriFieldTypeString",alias:"Label",domain:null,length:50}],features:t.map(e=>({attributes:e}))};l&&a.fields.push({name:"Red",type:"esriFieldTypeInteger",alias:"Red",domain:null},{name:"Green",type:"esriFieldTypeInteger",alias:"Green",domain:null},{name:"Blue",type:"esriFieldTypeInteger",alias:"Blue",domain:null}),n[s].attributeTable=a}}return n}function d(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE;for(let l=0;l<e.length;l++){const s=e[l];null!=s&&(s<t&&(t=s),s>n&&(n=s))}return a(t,n)}function f(e,t,n){const l=e.map((e,n)=>({name:e,count:t[n]})).sort((e,t)=>e.name>t.name?-1:1),s=(a=1,e=>a*=e.count);var a;const i=[...l.slice(1),{name:"",count:1}].reverse().map(s).reverse();let r=0;for(let o=e.length-1;o>=0;o--){r+=i[l.findIndex(({name:t})=>t===e[o])]*(n%t[o]),n=Math.floor(n/t[o])}return r}function p(e){const{width:t,height:n,extent:l,dimensions:a}=o(e),{ranges:i}=e,r=Object.keys(i).sort((e,t)=>e<t?-1:1),u=[];for(let s=0;s<r.length;s++){const e=r[s];a?.length&&u.push({name:e,dimensions:a})}const m=c(e);u.forEach(e=>m[e.name]&&Object.assign(e,m[e.name]));const p=u.length?{variables:u}:void 0,h=[];for(let o=0;o<r.length;o++){const e=r[o],{values:l,dataType:u,axisNames:m,shape:c}=i[e],p=c.length>2?o*c.slice(0,-2).reduce((e,t)=>e*t):0,g=m.slice(0,-2),b=c.slice(0,-2),y="float"===u?"f32":d(l),x=t*n,j=l.length/x;for(let i=0;i<j;i++){const e=s.createEmptyBand(y,x),r=new Uint8Array(x).fill(255);let u=!1;const m=i*x;for(let t=0;t<x;t++){const n=l[m+t];null==n?(r[t]=0,u=!0):e[t]=n}if(0===o||a?.length){const l=new s({width:t,height:n,mask:u?r:null,pixels:[e],pixelType:y});if(l.updateStatistics(),a?.length){h[f(g,b,i)+p]=l}else h.push(l)}else{const t=h[i];t.pixels.push(e),u?t.mask&&(t.mask=s.combineBandMasks([t.mask,r])):t.mask=u?r:null}}}const g=Object.values(m).find(e=>e.attributeTable)?.attributeTable;return{extent:l,pixelBlocks:h,multidimensionalInfo:p,attributeTable:g,bandNames:p?void 0:r}}export{i as isXAxis,r as isYAxis,p as parseGridCoverage};
|