@arcgis/core 4.32.0-next.20241021 → 4.32.0-next.20241023
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/MapViewer/templateUtils.d.ts +4 -0
- package/applications/MapViewer/templateUtils.js +5 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/0b7ee57bec7ffac312f2.js +1 -0
- package/assets/esri/core/workers/chunks/{1ba1d9c867ec6a492af9.js → 0f3912bca9fe25eea75c.js} +1 -1
- package/assets/esri/core/workers/chunks/{842ebde78db9bfcaf07b.js → 1678d1d0ecb9b2af69a8.js} +1 -1
- package/assets/esri/core/workers/chunks/1d16ca7791f64dd7c7fb.js +1 -0
- package/assets/esri/core/workers/chunks/1d4be734ff961e313257.js +1 -0
- package/assets/esri/core/workers/chunks/{b292758308dfac4ba8ee.js → 2d8aa31dc96bbd014036.js} +1 -1
- package/assets/esri/core/workers/chunks/{53f648321c5fde26bfe4.js → 319e06888467f9f460ab.js} +1 -1
- package/assets/esri/core/workers/chunks/33cae7ece52a77394b05.js +1 -0
- package/assets/esri/core/workers/chunks/{210a954f5299fe105e0b.js → 539060ffb7f230fb1bd0.js} +1 -1
- package/assets/esri/core/workers/chunks/545441dcc8e915e63ff1.js +1 -0
- package/assets/esri/core/workers/chunks/{303f39b9b7bd33109df8.js → 587df97288a83721d251.js} +1 -1
- package/assets/esri/core/workers/chunks/5caa02a7a85d05e253b4.js +1 -0
- package/assets/esri/core/workers/chunks/5cfecb320e1dcd258b2e.js +1 -0
- package/assets/esri/core/workers/chunks/67018ef25736f0722f6e.js +1 -0
- package/assets/esri/core/workers/chunks/89f74819ac1b5884c149.js +1 -0
- package/assets/esri/core/workers/chunks/92b2d81ef16877341f97.js +1 -0
- package/assets/esri/core/workers/chunks/{e6e77cbdeb99d90caad1.js → 97f62fad6d416a666319.js} +1 -1
- package/assets/esri/core/workers/chunks/98c1956b2e27058c8a51.js +1 -0
- package/assets/esri/core/workers/chunks/9c8a910b6261a4d5da77.js +1 -0
- package/assets/esri/core/workers/chunks/ab6eaa3ae2e233f91a5e.js +1 -0
- package/assets/esri/core/workers/chunks/{63719f892a7d1025c7d3.js → b42c1ab7579a3c464f72.js} +1 -1
- package/assets/esri/core/workers/chunks/{03eba36affe6ed1f5a11.js → bc4ef18d0a02354186e3.js} +7 -7
- package/assets/esri/core/workers/chunks/{c71304c88fce556340ef.js → c859f73b57a764e99b02.js} +1 -1
- package/assets/esri/core/workers/chunks/cb3038ec3ef0d86bf2a0.js +1 -0
- package/assets/esri/core/workers/chunks/{ae20ca2008a2ea6a46b2.js → d8f4bd2b4366388f8a28.js} +1 -1
- package/assets/esri/core/workers/chunks/e71fa25ed45bae5a1adb.js +320 -0
- package/assets/esri/core/workers/chunks/{9c9a8a529494c6d1dfa3.js → ec9d5af8887854e821c8.js} +1 -1
- package/assets/esri/libs/parquet/pkg/arcgis_parquet_bg.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +14 -0
- package/assets/esri/themes/base/widgets/_OrientedImageryViewer.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/chunks/Bufferer-BhkgvSV4.js +5 -0
- package/chunks/{Distance2DCalculator-DM4OojiI.js → Distance2DCalculator-BX0Ep7eP.js} +1 -1
- package/chunks/{GeodeticDistanceCalculator-DzvUOSaR.js → GeodeticDistanceCalculator-B5uO-Y_z.js} +1 -1
- package/chunks/OperatorCrosses.js +5 -0
- package/chunks/OperatorCut.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticDensifyByLength.js +1 -1
- package/chunks/OperatorGeodeticDistance.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorIntersects.js +5 -0
- package/chunks/OperatorMultiPartToSinglePart.js +1 -1
- package/chunks/OperatorOverlaps.js +5 -0
- package/chunks/OperatorProximity.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorTouches.js +5 -0
- package/chunks/OperatorWithin.js +5 -0
- package/chunks/QuadraticBezier.js +1 -1
- package/chunks/SSAOBlur.glsl.js +5 -5
- package/chunks/SideCalculator2D-CoWc8Oe3.js +1 -1
- package/chunks/Transformation2D.js +1 -1
- package/core/MemCache.js +1 -1
- package/core/MemCachePool.js +1 -1
- package/core/unitUtils.js +1 -1
- package/geometry/Mesh.js +1 -1
- package/geometry/operators/affineTransformOperator.js +1 -1
- package/geometry/operators/alphaShapeOperator.js +1 -1
- package/geometry/operators/areaOperator.js +1 -1
- package/geometry/operators/autoCompleteOperator.js +1 -1
- package/geometry/operators/boundaryOperator.js +1 -1
- package/geometry/operators/bufferOperator.js +1 -1
- package/geometry/operators/centroidOperator.js +1 -1
- package/geometry/operators/clipOperator.js +1 -1
- package/geometry/operators/containsOperator.js +1 -1
- package/geometry/operators/convexHullOperator.js +1 -1
- package/geometry/operators/crossesOperator.js +1 -1
- package/geometry/operators/cutOperator.js +1 -1
- package/geometry/operators/densifyOperator.js +1 -1
- package/geometry/operators/differenceOperator.js +1 -1
- package/geometry/operators/disjointOperator.js +1 -1
- package/geometry/operators/distanceOperator.js +1 -1
- package/geometry/operators/equalsOperator.js +1 -1
- package/geometry/operators/extendOperator.js +1 -1
- package/geometry/operators/generalizeOperator.js +1 -1
- package/geometry/operators/geodesicBufferOperator.js +1 -1
- package/geometry/operators/geodesicProximityOperator.js +1 -1
- package/geometry/operators/geodeticAreaOperator.js +1 -1
- package/geometry/operators/geodeticDensifyOperator.js +1 -1
- package/geometry/operators/geodeticDistanceOperator.js +1 -1
- package/geometry/operators/geodeticLengthOperator.js +1 -1
- package/geometry/operators/graphicBufferOperator.js +1 -1
- package/geometry/operators/gx/operatorAlphaShape.js +1 -1
- package/geometry/operators/gx/operatorAutoComplete.js +1 -1
- package/geometry/operators/gx/operatorBoundary.js +1 -1
- package/geometry/operators/gx/operatorBuffer.js +1 -1
- package/geometry/operators/gx/operatorConvexHull.js +1 -1
- package/geometry/operators/gx/operatorDifference.js +1 -1
- package/geometry/operators/gx/operatorGeodesicBuffer.js +1 -1
- package/geometry/operators/gx/operatorGeodeticArea.js +1 -1
- package/geometry/operators/gx/operatorGeodeticDensify.js +1 -1
- package/geometry/operators/gx/operatorGeodeticDistance.js +1 -1
- package/geometry/operators/gx/operatorGeodeticLength.js +1 -1
- package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
- package/geometry/operators/gx/operatorIntegrate.js +1 -1
- package/geometry/operators/gx/operatorIntersection.js +1 -1
- package/geometry/operators/gx/operatorLabelPoint.js +1 -1
- package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
- package/geometry/operators/gx/operatorLocateBetween.js +1 -1
- package/geometry/operators/gx/operatorOffset.js +1 -1
- package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
- package/geometry/operators/gx/operatorPolygonSlicer.js +1 -1
- package/geometry/operators/gx/operatorProject.js +1 -1
- package/geometry/operators/gx/operatorProximityGeodesic.js +1 -1
- package/geometry/operators/gx/operatorSimplify.js +1 -1
- package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
- package/geometry/operators/gx/operatorUnion.js +1 -1
- package/geometry/operators/integrateOperator.js +1 -1
- package/geometry/operators/intersectionOperator.js +1 -1
- package/geometry/operators/intersectsOperator.js +1 -1
- package/geometry/operators/isNearOperator.js +1 -1
- package/geometry/operators/json/containsOperator.js +5 -0
- package/geometry/operators/json/crossesOperator.js +5 -0
- package/geometry/operators/json/disjointOperator.js +5 -0
- package/geometry/operators/json/intersectsOperator.js +5 -0
- package/geometry/operators/json/offsetOperator.js +5 -0
- package/geometry/operators/json/overlapsOperator.js +5 -0
- package/geometry/operators/json/touchesOperator.js +5 -0
- package/geometry/operators/json/withinOperator.js +5 -0
- package/geometry/operators/labelPointOperator.js +1 -1
- package/geometry/operators/lengthOperator.js +1 -1
- package/geometry/operators/linesToPolygonsOperator.js +1 -1
- package/geometry/operators/locateBetweenOperator.js +1 -1
- package/geometry/operators/minimumBoundingCircleOperator.js +1 -1
- package/geometry/operators/multiPartToSinglePartOperator.js +1 -1
- package/geometry/operators/offsetOperator.js +1 -1
- package/geometry/operators/overlapsOperator.js +1 -1
- package/geometry/operators/polygonOverlayOperator.js +1 -1
- package/geometry/operators/polygonSlicerOperator.js +1 -1
- package/geometry/operators/projectOperator.js +1 -1
- package/geometry/operators/proximityOperator.js +1 -1
- package/geometry/operators/relateOperator.js +1 -1
- package/geometry/operators/reshapeOperator.js +1 -1
- package/geometry/operators/simplifyOperator.js +1 -1
- package/geometry/operators/singlePartToMultiPartOperator.js +1 -1
- package/geometry/operators/support/apiConverter.js +5 -0
- package/geometry/operators/support/initNoPeFactory.js +5 -0
- package/geometry/operators/support/jsonConverter.js +5 -0
- package/geometry/operators/support/proximityResult.js +1 -1
- package/geometry/operators/symmetricDifferenceOperator.js +1 -1
- package/geometry/operators/touchesOperator.js +1 -1
- package/geometry/operators/unionOperator.js +1 -1
- package/geometry/operators/withinOperator.js +1 -1
- package/geometry/support/MeshVertexAttributes.js +1 -1
- package/interfaces.d.ts +134 -0
- package/layers/LinkChartLayer.js +1 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/graphics/OptimizedGeometry.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/knowledgeGraph/supportUtils.js +1 -1
- package/layers/support/ElevationQueryTileCache.js +1 -1
- package/layers/support/ElevationTileData.js +1 -1
- package/layers/support/mediaUtils.js +1 -1
- package/layers/support/parquetLayerUtils.js +1 -1
- package/layers/support/rasterFunctions/ClipFunction.js +1 -1
- package/layers/support/rasterFunctions/clipUtils.js +1 -1
- package/layers/support/rasterFunctions/localUtils.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/linkChart/LinkChartProperties.js +1 -1
- package/package.json +1 -1
- package/smartMapping/raster/renderers/classBreaks.js +1 -1
- package/smartMapping/raster/renderers/rgb.js +1 -1
- package/smartMapping/raster/renderers/stretch.js +1 -1
- package/smartMapping/raster/support/adapters/ImageryTileLayerAdapter.js +1 -1
- package/smartMapping/raster/support/adapters/RasterLayerAdapter.js +1 -1
- package/smartMapping/renderers/support/rendererUtils.d.ts +4 -0
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
- package/views/2d/engine/vectorTiles/RenderBucket.js +1 -1
- package/views/2d/engine/vectorTiles/TileHandler3D.js +1 -1
- package/views/2d/engine/vectorTiles/VectorTile.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerMeshWriter.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/grid/GridView2D.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/schema/processor/symbols/ComplexSymbolSchema.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/glTF/loader.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/PointCloudLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/ObjectResourceCache.js +1 -1
- package/views/3d/layers/graphics/wosrLoader.js +1 -1
- package/views/3d/layers/i3s/CachedMeshData.js +5 -0
- package/views/3d/layers/i3s/I3SClientNodeLoader.js +1 -1
- package/views/3d/layers/i3s/I3SOverrides.js +1 -1
- package/views/3d/layers/i3s/PointRenderer.js +1 -1
- package/views/3d/layers/support/FeatureTile.js +1 -1
- package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/support/buffer/InterleavedLayout.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TileTexture.js +1 -1
- package/views/3d/webgl/ManagedFBO.js +1 -1
- package/views/3d/webgl/ManagedFBOAttachment.js +1 -1
- package/views/3d/webgl-engine/core/FBOCache.js +1 -1
- package/views/3d/webgl-engine/core/FBOPool.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/materials/ProceduralTextureRepository.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/SSAOBlur.glsl.js +1 -1
- package/views/input/BrowserEventSource.js +1 -1
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/VertexArrayObject.js +1 -1
- package/webdoc/support/webdocSaveUtils.js +1 -1
- package/widgets/Attribution/AttributionViewModel.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView2D.js +1 -1
- package/widgets/ElevationProfile/support/ProfileLine2D.js +5 -0
- package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
- package/widgets/ElevationProfile/support/constants.js +1 -1
- package/widgets/ElevationProfile/support/visualizationUtils.js +5 -0
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/GridViewModel.js +1 -1
- package/widgets/FeatureTable/support/columnUtils.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.js +1 -1
- package/widgets/FeatureTable/support/templateUtils.js +5 -0
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/support/GridControls/GridControlsViewModel.js +1 -1
- package/widgets/support/GridControls.js +1 -1
- package/assets/esri/core/workers/chunks/03d0394fff1463c224f9.js +0 -1
- package/assets/esri/core/workers/chunks/0c40cac18711f79f0a7d.js +0 -1
- package/assets/esri/core/workers/chunks/1a97f98facfc62a9fc69.js +0 -1
- package/assets/esri/core/workers/chunks/1e3ed3ee48c2977cff6f.js +0 -1
- package/assets/esri/core/workers/chunks/1fc064e37d030e449d5e.js +0 -1
- package/assets/esri/core/workers/chunks/4daab36de5efa03a8cbb.js +0 -1
- package/assets/esri/core/workers/chunks/77d129134c2a66cd86d8.js +0 -1
- package/assets/esri/core/workers/chunks/88bd9e023764da377aa7.js +0 -1
- package/assets/esri/core/workers/chunks/92ce57cb12d9a7a3699e.js +0 -1
- package/assets/esri/core/workers/chunks/a5675c989d00b7400f98.js +0 -1
- package/assets/esri/core/workers/chunks/c06c5c815b5e37717fa1.js +0 -1
- package/assets/esri/core/workers/chunks/ca1385e165aae8a32ca2.js +0 -1
- package/assets/esri/core/workers/chunks/ce8c1208916f54af7e68.js +0 -320
- package/assets/esri/core/workers/chunks/df51c93b2dbcc89efc23.js +0 -1
- package/assets/esri/core/workers/chunks/efa3c919261672871f2f.js +0 -1
- package/chunks/Bufferer-fr1_Nc47.js +0 -5
- package/geometry/operators/support/converterAPI.js +0 -5
package/layers/SceneLayer.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import r from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import"../renderers/support/jsonUtils.js";import{webSceneRendererTypes as i}from"../renderers/support/types.js";import{ClonableMixin as s}from"../core/Clonable.js";import o from"../core/Collection.js";import a from"../core/Error.js";import n from"../core/Logger.js";import{MultiOriginJSONMixin as l}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as p,isAbortError as d}from"../core/promiseUtils.js";import{whenOnce as u}from"../core/reactiveUtils.js";import{property as y}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as c}from"../core/accessorSupport/utils.js";import{reader as h}from"../core/accessorSupport/decorators/reader.js";import{subclass as m}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as f}from"../core/accessorSupport/PropertyOrigin.js";import g from"../geometry/Mesh.js";import v from"../geometry/Point.js";import b from"./Layer.js";import{NoModelError as w,MultipleModelsError as I}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as L}from"./mixins/APIKeyMixin.js";import{ArcGISService as j}from"./mixins/ArcGISService.js";import{CustomParametersMixin as F}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as S}from"./mixins/EditBusLayer.js";import{OperationalLayer as _}from"./mixins/OperationalLayer.js";import{PortalLayer as P}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as A}from"./mixins/ScaleRangeLayer.js";import{SceneService as O,SaveOperationType as T}from"./mixins/SceneService.js";import{useViewTimeProperty as E}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as x}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as D}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as R}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as U}from"./support/capabilities.js";import{elevationInfo as q,labelsVisible as C,legendEnabled as G,popupEnabled as N,screenSizePerspectiveEnabled as Q}from"./support/commonProperties.js";import{computeEffectiveEditingEnabled as V,getGlobalIdToObjectIdMap as k}from"./support/featureLayerUtils.js";import{FeatureReduction as M}from"./support/FeatureReduction.js";import K from"./support/FeatureReductionSelection.js";import{defineFieldProperties as $}from"./support/fieldProperties.js";import H from"./support/FieldsIndex.js";import{fixRendererFields as z,unpackFieldNames as W}from"./support/fieldUtils.js";import{I3SNodePageDefinition as B,I3SMaterialDefinition as Z,I3STextureSetDefinition as J,I3SGeometryDefinition as X}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as Y,isFileSupported as ee}from"./support/infoFor3D.js";import te from"./support/LabelClass.js";import{reader as re}from"./support/labelingInfo.js";import ie from"./support/LayerFloorInfo.js";import{layerLookupMap as se}from"./support/lazyLayerLoader.js";import{RangeInfo as oe}from"./support/RangeInfo.js";import ae from"./support/SceneFilter.js";import{cacheIsOutOfSync as ne}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as le}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as pe}from"../renderers/support/styleUtils.js";import de from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as ue,elevationModeUnsupportedMessage as ye,featureExpressionUnsupportedMessage as ce}from"../support/elevationInfoUtils.js";import{createPopupTemplate as he}from"../support/popupUtils.js";import{extractZipFiles as me}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as fe}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as ge,getFetchPopupTemplate as ve}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as be}from"../webdoc/support/opacityUtils.js";const we=new Set(["3DObject","Point"]),Ie=$();let Le=class extends(x(S(O(j(_(P(A(l(F(L(s(b)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new o,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get attributeTableTemplate(){return this.associatedLayer?.attributeTableTemplate??null}get fieldsIndex(){return new H(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:B.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&V(this.associatedLayer)}get geometryType(){return Fe[this.profile]||"mesh"}set renderer(e){z(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:U;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:u},operations:{supportsEditing:y,supportsAdd:c,supportsUpdate:h,supportsDelete:m,supportsQuery:f,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:u,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:f,supportsQueryAttachments:g,supportsEditing:y&&b,supportsAdd:w&&c&&b,supportsDelete:w&&m&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&je[r]?je[r]:(n.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(p),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await pe(this,{origin:"service"},t),z(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){n.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new de;return"mesh"===this.geometryType?this.associatedLayer?.infoFor3D&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=W(this.fieldsIndex,await ge(this,ve(this)));return fe(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new a("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return he(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new a("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(T.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(T.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:o}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==o)throw new a(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new a(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return D(s.url)&&n&&null!=e.deleteFeatures&&null!=o&&(i={...i,globalIdToObjectId:await k(s,e.deleteFeatures,o)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){t??={};const r=e=>{throw n.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new a("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce(((e,t)=>Y(this.infoFor3D,t)?e+1:e),0);0===s&&r(new w),s>1&&r(new I);const o=this.spatialReference,l=t.location??new v({x:0,y:0,z:0,spatialReference:o}),p=l.spatialReference.isGeographic?"local":"georeferenced",d=g.createWithExternalSource(l,i,{vertexSpace:p}),[u]=await this.uploadAssets([d],{...t,useAssetOrigin:!t.location});return u}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await me(e)).filter((e=>ee(t,e)))}validateLayer(e){if(e.layerType&&!we.has(e.layerType))throw new a("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new a("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new a("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new a("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new a("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new a("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some((t=>t.name===e.name)),r=!!this.associatedLayer?.fields?.some((t=>t&&e.name===t.name)),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=c(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(o===f.SERVICE||o===f.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!D(this.associatedLayer?.url)||!ne(this))return;c(this).setAtOrigin("fullExtent",e.clone(),f.SERVICE)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await R(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await se.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){d(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await u((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&ue(n.getLogger(this),ye("Mesh scene layers","relative-to-scene",e)),ue(n.getLogger(this),ce("Scene layers",e))}async fetchStatistics(e,t){return await le({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([y({types:{key:"type",base:M,typeMap:{selection:K}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],Le.prototype,"featureReduction",void 0),e([y({type:[oe],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],Le.prototype,"rangeInfos",void 0),e([y({json:{read:!1}})],Le.prototype,"associatedLayer",void 0),e([y({type:["show","hide"]})],Le.prototype,"listMode",void 0),e([y({type:["ArcGISSceneServiceLayer"]})],Le.prototype,"operationalLayerType",void 0),e([y({json:{read:!1},readOnly:!0})],Le.prototype,"type",void 0),e([y({...Ie.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"fields",void 0),e([y()],Le.prototype,"types",null),e([y()],Le.prototype,"typeIdField",null),e([y()],Le.prototype,"templates",null),e([y()],Le.prototype,"formTemplate",null),e([y()],Le.prototype,"attributeTableTemplate",null),e([y({readOnly:!0,clonable:!1})],Le.prototype,"fieldsIndex",null),e([y({type:ie,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],Le.prototype,"floorInfo",void 0),e([y(Ie.outFields)],Le.prototype,"outFields",void 0),e([y({type:B,readOnly:!0,json:{read:!1}})],Le.prototype,"nodePages",void 0),e([h("service","nodePages",["nodePages","pointNodePages"])],Le.prototype,"readNodePages",null),e([y({type:[Z],readOnly:!0})],Le.prototype,"materialDefinitions",void 0),e([y({type:[J],readOnly:!0})],Le.prototype,"textureSetDefinitions",void 0),e([y({type:[X],readOnly:!0})],Le.prototype,"geometryDefinitions",void 0),e([y({readOnly:!0})],Le.prototype,"serviceUpdateTimeStamp",void 0),e([y({readOnly:!0})],Le.prototype,"attributeStorageInfo",void 0),e([y({readOnly:!0})],Le.prototype,"statisticsInfo",void 0),e([y({type:o.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],Le.prototype,"excludeObjectIds",void 0),e([y({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],Le.prototype,"definitionExpression",void 0),e([y({type:ae,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],Le.prototype,"filter",void 0),e([y({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],Le.prototype,"path",void 0),e([y(q)],Le.prototype,"elevationInfo",null),e([y({readOnly:!0,json:{read:!1}})],Le.prototype,"effectiveCapabilities",null),e([y({readOnly:!0})],Le.prototype,"effectiveEditingEnabled",null),e([y({type:String})],Le.prototype,"geometryType",null),e([y(C)],Le.prototype,"labelsVisible",void 0),e([y({type:[te],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:re},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:re},write:!0}})],Le.prototype,"labelingInfo",void 0),e([y(G)],Le.prototype,"legendEnabled",void 0),e([y({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?be(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],Le.prototype,"opacity",void 0),e([y({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"priority",void 0),e([y({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"semantic",void 0),e([y({types:i,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],Le.prototype,"renderer",null),e([y({json:{read:!1}})],Le.prototype,"cachedDrawingInfo",void 0),e([h("service","cachedDrawingInfo")],Le.prototype,"readCachedDrawingInfo",null),e([y({readOnly:!0,json:{read:!1}})],Le.prototype,"capabilities",null),e([y({type:Boolean,json:{read:!1}})],Le.prototype,"editingEnabled",null),e([y({readOnly:!0,json:{write:!1,read:!1}})],Le.prototype,"infoFor3D",null),e([y({readOnly:!0,json:{write:!1,read:!1}})],Le.prototype,"relationships",null),e([y(N)],Le.prototype,"popupEnabled",void 0),e([y({type:r,json:{name:"popupInfo",write:!0}})],Le.prototype,"popupTemplate",void 0),e([y({readOnly:!0,json:{read:!1}})],Le.prototype,"defaultPopupTemplate",null),e([y({type:String,json:{read:!1}})],Le.prototype,"objectIdField",void 0),e([h("service","objectIdField",["objectIdField","fields"])],Le.prototype,"readObjectIdField",null),e([y({type:String,json:{read:!1}})],Le.prototype,"globalIdField",void 0),e([h("service","globalIdField",["globalIdField","fields"])],Le.prototype,"readGlobalIdField",null),e([y({readOnly:!0,type:String,json:{read:!1}})],Le.prototype,"displayField",null),e([y({type:String,json:{read:!1}})],Le.prototype,"profile",void 0),e([h("service","profile",["store.profile"])],Le.prototype,"readProfile",null),e([y({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],Le.prototype,"normalReferenceFrame",void 0),e([y(Q)],Le.prototype,"screenSizePerspectiveEnabled",void 0),e([y({json:{read:!1,origins:{service:{read:!0}}}})],Le.prototype,"serviceItemId",void 0),e([y(E)],Le.prototype,"useViewTime",null),Le=e([m("esri.layers.SceneLayer")],Le);const je={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Fe={"mesh-pyramids":"mesh",points:"point"},Se=Le;export{Se as default};
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../Graphic.js";import r from"../PopupTemplate.js";import"../renderers/ClassBreaksRenderer.js";import"../renderers/DictionaryRenderer.js";import"../renderers/DotDensityRenderer.js";import"../renderers/HeatmapRenderer.js";import"../renderers/PieChartRenderer.js";import"../renderers/Renderer.js";import"../renderers/SimpleRenderer.js";import"../renderers/UniqueValueRenderer.js";import"../renderers/support/jsonUtils.js";import{webSceneRendererTypes as i}from"../renderers/support/types.js";import{ClonableMixin as s}from"../core/Clonable.js";import o from"../core/Collection.js";import a from"../core/Error.js";import n from"../core/Logger.js";import{destroyMaybe as l}from"../core/maybe.js";import{MultiOriginJSONMixin as p}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as d,isAbortError as u}from"../core/promiseUtils.js";import{whenOnce as y}from"../core/reactiveUtils.js";import{property as c}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/RandomLCG.js";import{getProperties as h}from"../core/accessorSupport/utils.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{subclass as f}from"../core/accessorSupport/decorators/subclass.js";import{OriginId as g}from"../core/accessorSupport/PropertyOrigin.js";import v from"../geometry/Mesh.js";import b from"../geometry/Point.js";import w from"./Layer.js";import{NoModelError as I,MultipleModelsError as L}from"./graphics/sources/support/uploadAssetErrors.js";import{APIKeyMixin as j}from"./mixins/APIKeyMixin.js";import{ArcGISService as F}from"./mixins/ArcGISService.js";import{CustomParametersMixin as S}from"./mixins/CustomParametersMixin.js";import{EditBusLayer as _}from"./mixins/EditBusLayer.js";import{OperationalLayer as P}from"./mixins/OperationalLayer.js";import{PortalLayer as A}from"./mixins/PortalLayer.js";import{ScaleRangeLayer as O}from"./mixins/ScaleRangeLayer.js";import{SceneService as T,SaveOperationType as E}from"./mixins/SceneService.js";import{useViewTimeProperty as x}from"./mixins/TemporalLayer.js";import{TemporalSceneLayer as D}from"./mixins/TemporalSceneLayer.js";import{isHostedAgolService as R}from"./support/arcgisLayerUrl.js";import{findAssociatedFeatureService as U}from"./support/associatedFeatureServiceUtils.js";import{zeroCapabilities as q}from"./support/capabilities.js";import{elevationInfo as C,labelsVisible as G,legendEnabled as N,popupEnabled as Q,screenSizePerspectiveEnabled as V}from"./support/commonProperties.js";import{computeEffectiveEditingEnabled as k,getGlobalIdToObjectIdMap as M}from"./support/featureLayerUtils.js";import{FeatureReduction as K}from"./support/FeatureReduction.js";import $ from"./support/FeatureReductionSelection.js";import{defineFieldProperties as H}from"./support/fieldProperties.js";import z from"./support/FieldsIndex.js";import{fixRendererFields as W,unpackFieldNames as B}from"./support/fieldUtils.js";import{I3SNodePageDefinition as Z,I3SMaterialDefinition as J,I3STextureSetDefinition as X,I3SGeometryDefinition as Y}from"./support/I3SLayerDefinitions.js";import{isFileEditFormat as ee,isFileSupported as te}from"./support/infoFor3D.js";import re from"./support/LabelClass.js";import{reader as ie}from"./support/labelingInfo.js";import se from"./support/LayerFloorInfo.js";import{layerLookupMap as oe}from"./support/lazyLayerLoader.js";import{RangeInfo as ae}from"./support/RangeInfo.js";import ne from"./support/SceneFilter.js";import{cacheIsOutOfSync as le}from"./support/sceneLayerCacheUtils.js";import{fetchStatistics as pe}from"./support/sceneLayerStatistics.js";import{loadStyleRenderer as de}from"../renderers/support/styleUtils.js";import ue from"../rest/support/Query.js";import{logInvalidElevationInfoWarning as ye,elevationModeUnsupportedMessage as ce,featureExpressionUnsupportedMessage as he}from"../support/elevationInfoUtils.js";import{createPopupTemplate as me}from"../support/popupUtils.js";import{extractZipFiles as fe}from"../support/zipUtils.js";import{queryAttributesFromCachedAttributesId as ge}from"../views/3d/layers/i3s/I3SUtil.js";import{getRequiredFields as ve,getFetchPopupTemplate as be}from"../views/layers/support/popupUtils.js";import{transparencyToOpacity as we}from"../webdoc/support/opacityUtils.js";const Ie=new Set(["3DObject","Point"]),Le=H();let je=class extends(D(_(T(F(P(A(O(p(S(j(s(w)))))))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new o,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0,this.serviceItemId=void 0}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}destroy(){this._set("renderer",null),this.associatedLayer=l(this.associatedLayer)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){const r=this.getFeatureType(t?.feature)?.domains?.[e];return r&&"inherited"!==r.type?r:this.getField(e)?.domain??null}getFeatureType(e){return e&&this.associatedLayer?this.associatedLayer.getFeatureType(e):null}get types(){return this.associatedLayer?.types??[]}get typeIdField(){return this.associatedLayer?.typeIdField??null}get templates(){return this.associatedLayer?.templates??null}get formTemplate(){return this.associatedLayer?.formTemplate??null}get attributeTableTemplate(){return this.associatedLayer?.attributeTableTemplate??null}get fieldsIndex(){return new z(this.fields)}readNodePages(e,t,r){return"Point"===t.layerType&&(e=t.pointNodePages),null==e||"object"!=typeof e?null:Z.fromJSON(e,r)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get effectiveCapabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.effectiveCapabilities)}get effectiveEditingEnabled(){return null!=this.associatedLayer&&k(this.associatedLayer)}get geometryType(){return Se[this.profile]||"mesh"}set renderer(e){W(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return null!=e&&"object"==typeof e||(e={}),null==e.color&&(e.color=!1),e}get capabilities(){return this._capabilitiesFromAssociatedFeatureLayer(this.associatedLayer?.capabilities)}_capabilitiesFromAssociatedFeatureLayer(e){e=null!=e?e:q;const{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsRollbackOnFailure:s,supportsUploadWithItemId:o,supportsGeometryUpdate:a,supportsReturnServiceEditsInSourceSpatialReference:n},data:{supportsZ:l,supportsM:p,isVersioned:d,supportsAttachment:u},operations:{supportsEditing:y,supportsAdd:c,supportsUpdate:h,supportsDelete:m,supportsQuery:f,supportsQueryAttachments:g,supportsAsyncConvert3D:v}}=e,b=e.operations.supportsChangeTracking,w=!!this.associatedLayer?.infoFor3D;return{query:t,queryRelated:r,editing:{supportsGlobalId:i,supportsReturnServiceEditsInSourceSpatialReference:n,supportsRollbackOnFailure:s,supportsGeometryUpdate:w&&a,supportsUploadWithItemId:o},data:{supportsAttachment:u,supportsZ:l,supportsM:p,isVersioned:d},operations:{supportsQuery:f,supportsQueryAttachments:g,supportsEditing:y&&b,supportsAdd:w&&c&&b,supportsDelete:w&&m&&b,supportsUpdate:h&&b,supportsAsyncConvert3D:v}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.associatedLayer?.editingEnabled??!1}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return this.associatedLayer?.infoFor3D??null}get relationships(){return this.associatedLayer?.relationships}get defaultPopupTemplate(){return this.associatedLayer||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeOID"===t.type&&(e=t.name),!!e))),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some((t=>("esriFieldTypeGlobalID"===t.type&&(e=t.name),!!e))),e||void 0}get displayField(){return this.associatedLayer?.displayField??null}readProfile(e,t){const r=t.store.profile;return null!=r&&Fe[r]?Fe[r]:(n.getLogger(this).error("Unknown or missing profile",{profile:r,layer:this}),"mesh-pyramids")}get useViewTime(){return this.associatedLayer?.useViewTime??!0}set useViewTime(e){this._override("useViewTime",e)}load(e){return this.addResolvingPromise(this._load(e)),Promise.resolve(this)}async _load(e){const t=null!=e?e.signal:null;await this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(d),await this._fetchService(t),await Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),this._loadFilterGeometries()]),this._validateElevationInfo(),this._applyAssociatedLayerOverrides(),this._populateFieldUsageInfo(),await this.loadTimeInfoFromService(e),await de(this,{origin:"service"},t),W(this.renderer,this.fieldsIndex),await this.finishLoadEditablePortalLayer(e)}async beforeSave(){null!=this.filter&&(this.filter=this.filter.clone(),await this.load())}async _loadFilterGeometries(){if(this.filter)try{await this.filter.loadGeometries(this.spatialReference)}catch(e){n.getLogger(this).error("#_loadFilterGeometries()",this,"Failed to load filter geometries. Geometry filter will not be applied for this layer.",{error:e}),this.filter=null}}createQuery(){const e=new ue;return"mesh"===this.geometryType?this.associatedLayer?.infoFor3D&&(e.returnGeometry=!0):(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e.outFields=["*"],e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryExtent(e||this.createQuery(),t)))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatureCount(e||this.createQuery(),t)))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryFeatures(e||this.createQuery(),t))).then((e=>{if(e?.features)for(const t of e.features)t.layer=this,t.sourceLayer=this;return e}))}async queryRelatedFeatures(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeatures(e,t)}async queryRelatedFeaturesCount(e,t){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});return this.associatedLayer.queryRelatedFeaturesCount(e,t)}async queryCachedAttributes(e,t){const r=B(this.fieldsIndex,await ve(this,be(this)));return ge(this.parsedUrl?.path??"",this.attributeStorageInfo??[],e,t,r,this.apiKey,this.customParameters)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||0===i.length)throw new a("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const s=new t;return s.attributes=i[0],s.layer=this,s.sourceLayer=this,s}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryObjectIds(e||this.createQuery(),t)))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then((r=>r.queryAttachments(e,t)))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(n.getLogger(this).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return me(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return e?.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),!this.associatedLayer)throw new a("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new a("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return null!=this.statisticsInfo&&this.statisticsInfo.some((t=>t.name===e))}async queryCachedStatistics(e,t){return await this.load(t),await this.fetchStatistics(e,t)}async saveAs(e,t){return this._debouncedSaveOperations(E.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(E.SAVE,e)}async applyEdits(e,t){const{applyEdits:r}=await import("./graphics/editingSupport.js");let i=t;await this.load();const s=this.associatedLayer;if(!s)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");await s.load();const{globalIdField:o}=s,n=!!s.infoFor3D,l=i?.globalIdUsed??!0;if(n&&null==o)throw new a(`${this.type}-layer:not-editable`,"Valid globalIdField expected on editable SceneLayer");if(n&&!l)throw new a(`${this.type}-layer:globalid-required`,"globalIdUsed must not be false for SceneLayer editing as globalIds are required.");return R(s.url)&&n&&null!=e.deleteFeatures&&null!=o&&(i={...i,globalIdToObjectId:await M(s,e.deleteFeatures,o)}),r(this,s.source,e,i)}async uploadAssets(e,t){if(await this.load(),null==this.associatedLayer)throw new a(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),this.associatedLayer.uploadAssets(e,t)}on(e,t){return super.on(e,t)}async convertMesh(e,t){t??={};const r=e=>{throw n.getLogger(this).error(".convertMesh()",e.message),e};await this.load(),this.infoFor3D||r(new a("invalid:layer","SceneLayer has no capability for mesh conversion"));const i=await this.extractAndFilterFiles(e),s=i.reduce(((e,t)=>ee(this.infoFor3D,t)?e+1:e),0);0===s&&r(new I),s>1&&r(new L);const o=this.spatialReference,l=t.location??new b({x:0,y:0,z:0,spatialReference:o}),p=l.spatialReference.isGeographic?"local":"georeferenced",d=v.createWithExternalSource(l,i,{vertexSpace:p}),[u]=await this.uploadAssets([d],{...t,useAssetOrigin:!t.location});return u}async extractAndFilterFiles(e){await this.load();const t=this.infoFor3D;if(!t)return e;return(await fe(e)).filter((e=>te(t,e)))}validateLayer(e){if(e.layerType&&!Ie.has(e.layerType))throw new a("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new a("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new a("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(e,t){let r=!1,i=!1;if(null==e)r=!0,i=!0;else{const s=t&&t.isGeographic;switch(e){case"east-north-up":case"earth-centered":r=!0,i=s;break;case"vertex-reference-frame":r=!0,i=!s;break;default:r=!1}}if(!r)throw new a("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!i)throw new a("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if("points"===this.profile)e.push("Point");else{if("mesh-pyramids"!==this.profile)throw new a("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!!this.attributeStorageInfo?.some((t=>t.name===e.name)),r=!!this.associatedLayer?.fields?.some((t=>t&&e.name===t.name)),i={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||r,supportsLayerQuery:r};this._fieldUsageInfo[e.name]=i}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides(),this._applyAssociatedLayerExtentOverride(),this._applyAssociatedLayerPrivileges()}_applyAssociatedLayerFieldsOverrides(){if(!this.associatedLayer?.fields)return;let e=null;for(const t of this.associatedLayer.fields){const r=this.getField(t.name);r?(!r.domain&&t.domain&&(r.domain=t.domain.clone()),r.editable=t.editable,r.nullable=t.nullable,r.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(!this.associatedLayer)return;const e=["popupTemplate","popupEnabled"],t=h(this);for(let r=0;r<e.length;r++){const i=e[r],s=this.originIdOf(i),o=this.associatedLayer.originIdOf(i);s<o&&(o===g.SERVICE||o===g.PORTAL_ITEM)&&t.setAtOrigin(i,this.associatedLayer[i],o)}}_applyAssociatedLayerExtentOverride(){const e=this.associatedLayer?.getAtOrigin("fullExtent","service");if(null==this.associatedLayer?.infoFor3D||!e||!R(this.associatedLayer?.url)||!le(this))return;h(this).setAtOrigin("fullExtent",e.clone(),g.SERVICE)}_applyAssociatedLayerPrivileges(){const e=this.associatedLayer;e&&(this._set("userHasEditingPrivileges",e.userHasEditingPrivileges),this._set("userHasFullEditingPrivileges",e.userHasFullEditingPrivileges),this._set("userHasUpdateItemPrivileges",e.userHasUpdateItemPrivileges))}async _setAssociatedFeatureLayer(e){if(["mesh-pyramids","points"].includes(this.profile))try{const{serverUrl:t,layerId:r,portalItem:i}=await U(`${this.url}/layers/${this.layerId}`,{sceneLayerItem:this.portalItem,customParameters:this.customParameters,apiKey:this.apiKey,signal:e}),s=await oe.FeatureLayer();this.associatedLayer=new s({url:t,customParameters:this.customParameters,layerId:r,portalItem:i}),await this.associatedLayer.load()}catch(t){u(t)||this._logWarningOnPopupEnabled()}}async _logWarningOnPopupEnabled(){await y((()=>this.popupEnabled&&null!=this.popupTemplate));const e=`this SceneLayer: ${this.title}`;null==this.attributeStorageInfo?n.getLogger(this).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):n.getLogger(this).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;"mesh-pyramids"===this.profile&&ye(n.getLogger(this),ce("Mesh scene layers","relative-to-scene",e)),ye(n.getLogger(this),he("Scene layers",e))}async fetchStatistics(e,t){return await pe({fieldName:e,statisticsInfo:this.statisticsInfo,errorContext:"scenelayer",fieldsIndex:this.fieldsIndex,path:this.parsedUrl?.path??"",customParameters:this.customParameters,apiKey:this.apiKey,signal:t?.signal})}};e([c({types:{key:"type",base:K,typeMap:{selection:$}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],je.prototype,"featureReduction",void 0),e([c({type:[ae],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],je.prototype,"rangeInfos",void 0),e([c({json:{read:!1}})],je.prototype,"associatedLayer",void 0),e([c({type:["show","hide"]})],je.prototype,"listMode",void 0),e([c({type:["ArcGISSceneServiceLayer"]})],je.prototype,"operationalLayerType",void 0),e([c({json:{read:!1},readOnly:!0})],je.prototype,"type",void 0),e([c({...Le.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],je.prototype,"fields",void 0),e([c()],je.prototype,"types",null),e([c()],je.prototype,"typeIdField",null),e([c()],je.prototype,"templates",null),e([c()],je.prototype,"formTemplate",null),e([c()],je.prototype,"attributeTableTemplate",null),e([c({readOnly:!0,clonable:!1})],je.prototype,"fieldsIndex",null),e([c({type:se,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],je.prototype,"floorInfo",void 0),e([c(Le.outFields)],je.prototype,"outFields",void 0),e([c({type:Z,readOnly:!0,json:{read:!1}})],je.prototype,"nodePages",void 0),e([m("service","nodePages",["nodePages","pointNodePages"])],je.prototype,"readNodePages",null),e([c({type:[J],readOnly:!0})],je.prototype,"materialDefinitions",void 0),e([c({type:[X],readOnly:!0})],je.prototype,"textureSetDefinitions",void 0),e([c({type:[Y],readOnly:!0})],je.prototype,"geometryDefinitions",void 0),e([c({readOnly:!0})],je.prototype,"serviceUpdateTimeStamp",void 0),e([c({readOnly:!0})],je.prototype,"attributeStorageInfo",void 0),e([c({readOnly:!0})],je.prototype,"statisticsInfo",void 0),e([c({type:o.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],je.prototype,"excludeObjectIds",void 0),e([c({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],je.prototype,"definitionExpression",void 0),e([c({type:ne,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],je.prototype,"filter",void 0),e([c({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],je.prototype,"path",void 0),e([c(C)],je.prototype,"elevationInfo",null),e([c({readOnly:!0,json:{read:!1}})],je.prototype,"effectiveCapabilities",null),e([c({readOnly:!0})],je.prototype,"effectiveEditingEnabled",null),e([c({type:String})],je.prototype,"geometryType",null),e([c(G)],je.prototype,"labelsVisible",void 0),e([c({type:[re],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:ie},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ie},write:!0}})],je.prototype,"labelingInfo",void 0),e([c(N)],je.prototype,"legendEnabled",void 0),e([c({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){if("number"==typeof e&&e>=0&&e<=1)return e;const r=t.layerDefinition?.drawingInfo?.transparency;return void 0!==r?we(r):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],je.prototype,"opacity",void 0),e([c({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],je.prototype,"priority",void 0),e([c({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],je.prototype,"semantic",void 0),e([c({types:i,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],je.prototype,"renderer",null),e([c({json:{read:!1}})],je.prototype,"cachedDrawingInfo",void 0),e([m("service","cachedDrawingInfo")],je.prototype,"readCachedDrawingInfo",null),e([c({readOnly:!0,json:{read:!1}})],je.prototype,"capabilities",null),e([c({type:Boolean,json:{read:!1}})],je.prototype,"editingEnabled",null),e([c({readOnly:!0,json:{write:!1,read:!1}})],je.prototype,"infoFor3D",null),e([c({readOnly:!0,json:{write:!1,read:!1}})],je.prototype,"relationships",null),e([c(Q)],je.prototype,"popupEnabled",void 0),e([c({type:r,json:{name:"popupInfo",write:!0}})],je.prototype,"popupTemplate",void 0),e([c({readOnly:!0,json:{read:!1}})],je.prototype,"defaultPopupTemplate",null),e([c({type:String,json:{read:!1}})],je.prototype,"objectIdField",void 0),e([m("service","objectIdField",["objectIdField","fields"])],je.prototype,"readObjectIdField",null),e([c({type:String,json:{read:!1}})],je.prototype,"globalIdField",void 0),e([m("service","globalIdField",["globalIdField","fields"])],je.prototype,"readGlobalIdField",null),e([c({readOnly:!0,type:String,json:{read:!1}})],je.prototype,"displayField",null),e([c({type:String,json:{read:!1}})],je.prototype,"profile",void 0),e([m("service","profile",["store.profile"])],je.prototype,"readProfile",null),e([c({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],je.prototype,"normalReferenceFrame",void 0),e([c(V)],je.prototype,"screenSizePerspectiveEnabled",void 0),e([c({json:{read:!1,origins:{service:{read:!0}}}})],je.prototype,"serviceItemId",void 0),e([c(x)],je.prototype,"useViewTime",null),je=e([f("esri.layers.SceneLayer")],je);const Fe={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Se={"mesh-pyramids":"mesh",points:"point"},_e=je;export{_e as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const t=2;class s{constructor(t=[],s=[]){this.lengths=t??[],this.coords=s??[]}static fromJSON(t){return new s(t.lengths,t.coords)}static fromRect(t){const[e,r,h,
|
|
5
|
+
const t=2;class s{constructor(t=[],s=[]){this.lengths=t??[],this.coords=s??[]}static fromJSON(t){return new s(t.lengths,t.coords)}static fromRect(t){const[e,r,h,o]=t,n=h-e,l=o-r;return new s([5],[e,r,n,0,0,l,-n,0,0,-l])}get isPoint(){return 0===this.lengths.length&&this.coords.length>=2}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce(((t,s)=>t+s))}forEachVertex(s){let e=0;this.lengths.length||s(this.coords[0],this.coords[1]);for(let r=0;r<this.lengths.length;r++){const h=this.lengths[r];for(let r=0;r<h;r++){s(this.coords[t*(r+e)],this.coords[t*(r+e)+1])}e+=h}}deltaDecode(){const t=this.clone(),{coords:s,lengths:e}=t;let r=0;for(const h of e){for(let t=1;t<h;t++)s[2*(r+t)]+=s[2*(r+t)-2],s[2*(r+t)+1]+=s[2*(r+t)-1];r+=h}return t}clone(e){if(0===this.lengths.length)return new s([],[this.coords[0],this.coords[1]]);const r=(0===this.lengths.length?1:this.lengths.reduce(((t,s)=>t+s)))*t,h=this.coords.slice(0,r);return e?(e.set(h),new s(this.lengths,e)):new s(Array.from(this.lengths),Array.from(h))}}export{s as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import r from"../../../core/Loadable.js";import o from"../../../core/Logger.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{getFilename as s}from"../../../core/urlUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{createDrawingInfo as p}from"./support/clientSideDefaults.js";import{inferGeometrySource as l}from"../../support/parquetLayerUtils.js";import{ParquetMetadata as m}from"../../../libs/parquet/parquet.js";import{toJSONGeometryType as c}from"../../../views/2d/layers/support/util.js";import u from"../../../geometry/SpatialReference.js";const d=["parquet"];let y=class extends r{constructor(e){super(e),this.type="parquet"}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._initialize(t)),Promise.resolve(this)}async _initialize(e){const r=this.loadOptions.url;if(null==r)throw new t("missing-metadata","Unable to create parquet source: no url specified",this.loadOptions);const o=this.loadOptions.metadata??await m.create(r,(()=>this.customParameters));i(e);const a=this._createGeometrySource(o,this.loadOptions);if(null==a)throw new t("missing-metadata","Unable to create parquet source: cannot infer geometrySource",this.loadOptions);this.geometryInfo=a,this.sourceJSON={name:s(r,d)||"parquet",drawingInfo:p(c(a.geometryType)),geometryType:c(a.geometryType),spatialReference:a.spatialReference,objectIdField:this.loadOptions.objectIdField??"__OBJECTID",fields:o.fields}}_createGeometrySource(e,t){const r=t.geometrySourceInfo??l(e);if(!r)return null;switch(r.type){case"location":return this._createLocationInfo(r);case"geometry":return this._createGeometryInfo(r)}}_createLocationInfo(e){if(null==e.latitudeFieldName)throw new t("missing-metadata","Missing latitudeFieldName",e);if(null==e.longitudeFieldName)throw new t("missing-metadata","Missing longitudeFieldName",e);return{type:"location",latitudeFieldName:e.latitudeFieldName,longitudeFieldName:e.longitudeFieldName,geometryType:"point",spatialReference:e.spatialReference??
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import r from"../../../core/Loadable.js";import o from"../../../core/Logger.js";import{throwIfAborted as i}from"../../../core/promiseUtils.js";import{getFilename as s}from"../../../core/urlUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{createDrawingInfo as p}from"./support/clientSideDefaults.js";import{inferGeometrySource as l}from"../../support/parquetLayerUtils.js";import{ParquetMetadata as m}from"../../../libs/parquet/parquet.js";import{toJSONGeometryType as c}from"../../../views/2d/layers/support/util.js";import u from"../../../geometry/SpatialReference.js";const d=["parquet"];let y=class extends r{constructor(e){super(e),this.type="parquet"}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._initialize(t)),Promise.resolve(this)}async _initialize(e){const r=this.loadOptions.url;if(null==r)throw new t("missing-metadata","Unable to create parquet source: no url specified",this.loadOptions);const o=this.loadOptions.metadata??await m.create(r,(()=>this.customParameters));i(e);const a=this._createGeometrySource(o,this.loadOptions);if(null==a)throw new t("missing-metadata","Unable to create parquet source: cannot infer geometrySource",this.loadOptions);this.geometryInfo=a,this.sourceJSON={name:s(r,d)||"parquet",drawingInfo:p(c(a.geometryType)),geometryType:c(a.geometryType),spatialReference:a.spatialReference,objectIdField:this.loadOptions.objectIdField??"__OBJECTID",fields:o.fields}}_createGeometrySource(e,t){const r=t.geometrySourceInfo??l(e);if(!r)return null;switch(r.type){case"location":return this._createLocationInfo(r);case"geometry":return this._createGeometryInfo(r)}}_createLocationInfo(e){if(null==e.latitudeFieldName)throw new t("missing-metadata","Missing latitudeFieldName",e);if(null==e.longitudeFieldName)throw new t("missing-metadata","Missing longitudeFieldName",e);return{type:"location",latitudeFieldName:e.latitudeFieldName,longitudeFieldName:e.longitudeFieldName,geometryType:"point",spatialReference:e.spatialReference??u.WGS84}}_createGeometryInfo(e){if(null==e.geometryType)throw new t("missing-metadata","Missing geometryType",e);let r=e.spatialReference;if(null==r)throw new t("missing-metadata","Missing spatialReference",e);if(r.wkid!==u.WGS84.wkid){const i=u.fromJSON(r);if(!i.isGeographic&&!i.isWebMercator)throw new t("unsupported-spatial-reference","Only WGS84 and WebMercator are currently supported",e);o.getLogger("parquet-support").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",e),r=u.WGS84}if(null==e.primaryFieldName)throw new t("missing-metadata","Missing primaryFieldName",e);if("WKB"!==e.format)throw new t("unsupported","Geometry encoding must be 'WKB'",e);return{type:"geometry",format:"WKB",spatialReference:r,primaryFieldName:e.primaryFieldName,geometryType:e.geometryType}}};e([a()],y.prototype,"type",void 0),e([a()],y.prototype,"loadOptions",void 0),e([a()],y.prototype,"sourceJSON",void 0),e([a()],y.prototype,"geometryInfo",void 0),e([a()],y.prototype,"customParameters",void 0),y=e([n("esri.layers.graphics.sources.ParquetSource")],y);export{y as ParquetSource};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../geometry.js";import e from"../../Graphic.js";import t from"../../request.js";import"../../symbols.js";import r from"../../core/Error.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import n from"../GraphicsLayer.js";import{convertFromGeometry as i}from"../graphics/featureConversionUtils.js";import s from"../graphics/OptimizedGeometry.js";import{systemOidFieldName as a}from"./layerUtils.js";import l from"./SessionMemoryStorage.js";import{Direction2D as c}from"../../libs/linkchartlayout/LinkChartLayout.js";import{executeQueryStreaming as d}from"../../rest/knowledgeGraphService.js";import m from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import{ProtoOutboundRelationshipFeatureCollectionAttributionIndexes as y,ProtoInboundFeatureCollectionAttributionNames as p,ProtoOutboundEntityFeatureCollectionAttributionIndexes as f}from"../../rest/knowledgeGraph/ProtoFeatureCollection.js";import{getWasmInterface as u}from"../../rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js";import{EsriFieldTypes as g}from"../../rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js";import{WasmQuantizeOriginPositionTypeCode as h,SqlTypeCode as _,IdArrayType as w}from"../../rest/knowledgeGraph/wasmInterface/WasmSerializedLayerData.js";import{wasmToProtoFeatureCollection as b}from"../../rest/knowledgeGraph/wasmInterface/wasmToFeatureFactories.js";import T from"../../symbols/CIMSymbol.js";import M from"../../geometry/Polyline.js";import E from"../../symbols/SimpleFillSymbol.js";import k from"../../geometry/Polygon.js";import I from"../../symbols/TextSymbol.js";import S from"../../geometry/Point.js";function C(e){if(!e.spatialReference.isWGS84)throw new r("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map((e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]))}function A(e,t){const r=new Map;if(t.dataModel?.relationshipTypes)for(const o of t.dataModel.relationshipTypes)o.name&&r.set(o.name,[]);for(const o of e)r.has(o.typeName)&&r.get(o.typeName)?.push(o.id);return r}async function N(e,t){const r=[],o=A(e,t),n={},i=[];for(const[c,d]of o){if(d.length<1)continue;const e=`${c}_ids`;n[e]=d,i.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${e} RETURN id(n), labels(n)[0], id(m), labels(m)[0]`)}if(0===i.length)return[];const s=i.join(" UNION "),a=new m({openCypherQuery:s,bindParameters:n}),l=(await d(t,a)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await l.read();if(e)break;for(const o of t)r.push({id:o[0],typeName:o[1]}),r.push({id:o[2],typeName:o[3]})}return r}async function G(e,t){const r=new Map,o=A(e,t),n={},i=[];for(const[c,d]of o){if(d.length<1)continue;const e=`${c}_ids`;n[e]=d,i.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${e} RETURN id(r), id(n), id(m)`)}if(0===i.length)return r;const s=i.join(" UNION "),a=new m({openCypherQuery:s,bindParameters:n}),l=(await d(t,a)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await l.read();if(e)break;for(const o of t)r.set(o[0],[o[1],o[2]])}return r}async function j(e){const t=[],r={generateAllSublayers:!1,namedTypeDefinitions:new Map};return e.entitiesUrl&&t.push(U(e.entitiesUrl).then((e=>{z(e,r)}))),e.relationshipsUrl&&t.push(U(e.relationshipsUrl).then((e=>{z(e,r)}))),e.idCollectionsUrl&&t.push(O(e.idCollectionsUrl).then((e=>{W(e,r)}))),await Promise.all(t),r}async function F(e,t){t??=!1;const r={generateAllSublayers:t,namedTypeDefinitions:new Map};return await O(e).then((e=>{W(e,r)})),r}async function R(e,t,r){const o=await u(),n=new o.FeatureCollection,i=new o.FeatureCollection;try{D(n,o,e,"entities",t,r),D(i,o,e,"relationships",t,r);const s=new o.FeatureCollectionEncoder,a=new o.FeatureCollectionEncoder,l=H(n,s),c=structuredClone(l),d=H(i,a),m={entitiesFC:c,relationshipsFC:structuredClone(d),idCollections:await x(e)};return s.delete(),a.delete(),m}finally{n.delete(),i.delete()}}async function x(e){const t=await u(),o=new t.MapOfObjectIdentifierSets;L(o,t,e);const n=new t.MapOfObjectIdentifierSetsEncoder;try{n.set_map_of_identifier_sets(o),n.encode();const e=n.get_encoding_result();if(0!==e.error.error_code)throw new r("knowledge-graph:layer-support-utils",e.error.error_message);const t=structuredClone(e.get_byte_buffer());return n.delete(),t}finally{o.delete()}}function D(e,t,r,o,n,s){e.version="";const a=new t.QueryResult,l=new t.FeatureResult,c="entities"===o?f:y;l.unique_id_field={name:c[c.ELEMENTUID],isSystemMaintained:!1},l.globalid_field_name=c[c.ELEMENTUID],l.geohash_field_name="",l.geometry_properties={shapeAreaFieldName:"",shapeLengthFieldName:"",units:""},l.spatial_reference={wkid:4326,latestWkid:4326,vcsWkid:0,latestVcsWkid:0,wkt:""},l.exceeded_transfer_limit=!1,l.has_z=!1,l.has_m=!1,l.transform={quantizeOriginPosition:{value:h.upperLeft},scale:{xScale:1e-9,yScale:1e-9,mScale:1e-4,zScale:1e-4},translate:{xTranslate:-400,yTranslate:-400,mTranslate:-1e5,zTranslate:-1e5}};for(const i of Object.keys(c).filter((e=>isNaN(Number(e))))){const e=new t.Field;if(e.name=i,e.alias=i,e.sql_type={value:_.sqlTypeBigInt},"entities"===o)switch(i){case c[c.ELEMENTUID]:case c[c.TYPENAME]:e.field_type={value:g.esriFieldTypeString}}else switch(i){case c[c.ELEMENTUID]:case c[c.TYPENAME]:case y[y.FROMUID]:case y[y.TOUID]:e.field_type={value:g.esriFieldTypeString}}e.domain="",l.add_field(e),e.delete()}const d=new Map;for(const i of n.dataModel.entityTypes)d.set(i.name,"entities");for(const i of n.dataModel.relationshipTypes)d.set(i.name,"relationships");for(const[m,p]of r.namedTypeDefinitions)if(o===d.get(m))for(const e of p.members.values()){const r=new t.Feature;for(const i of Object.keys(c).filter((e=>isNaN(Number(e)))))if("entities"===o)switch(i){case c[c.ELEMENTUID]:r.add_attribute(e.id,t.esriFieldType.esriFieldTypeString);break;case c[c.TYPENAME]:r.add_attribute(m,t.esriFieldType.esriFieldTypeString)}else switch(i){case c[c.ELEMENTUID]:r.add_attribute(e.id,t.esriFieldType.esriFieldTypeString);break;case y[y.FROMUID]:r.add_attribute(s.has(e.id)?s.get(e.id)[0]:"",t.esriFieldType.esriFieldTypeString);break;case y[y.TOUID]:r.add_attribute(s.has(e.id)?s.get(e.id)[1]:"",t.esriFieldType.esriFieldTypeString);break;case c[c.TYPENAME]:r.add_attribute(m,t.esriFieldType.esriFieldTypeString)}let n;if(e.linkChartLocation&&"x"in e.linkChartLocation?n=i(e.linkChartLocation):e.linkChartLocation&&(n=e.linkChartLocation),e.linkChartLocation&&n){const e=new t.FeatureCollectionGeometry;let i=!1;switch(o){case"entities":e.geometry_type=t.esriGeometryType.esriGeometryPoint,i=!0;break;case"relationships":e.geometry_type=t.esriGeometryType.esriGeometryPolyline}e.coords=new Float64Array(n.coords),e.lengths=new Uint32Array(i?[1]:n.lengths),r.set_compressed_geometry(e),e.delete()}l.add_feature(r),r.delete()}switch(o){case"entities":l.geometry_type=t.esriGeometryType.esriGeometryPoint;break;case"relationships":l.geometry_type=t.esriGeometryType.esriGeometryPolyline}return a.set_feature_result(l),e.set_query_result(a),l.delete(),a.delete(),e}function L(e,t,r){for(const[o,n]of r.namedTypeDefinitions){if(!n.members||n.useAllData)continue;const r=n.members.keys();let i=!1,s=!0;const a=new t.ObjectIdArray,l=new t.StringArray,c=new t.GlobalIdArray,d=new t.IdentifierArray,m=new t.ObjectIdentifierSet;for(const e of r)s&&(i=!isNaN(Number(e)),s=!1),i?a.add_objectid(Number(e)):(l.add_string(e),c.add_globalid(e)),d.add_identifier(e);m.set_oid_array(a),m.set_string_array(l),m.set_globalid_array(c),m.set_identifier_array(d),a.delete(),l.delete(),c.delete(),d.delete(),e.put_identifier_set(o,m),m.delete()}return e}async function U(e){const r=await t(e,{responseType:"array-buffer"});return P(await r.data)}async function P(e){const t=new((await u()).FeatureCollectionDecoder),o=t.decode(new Uint8Array(e));if(0!==o.error_code)throw new r("knowledge-graph:layer-support-utils",o.error_message);const n=t.get_feature_collection(),i=b(n);return t.delete(),i}async function O(e){const r=await t(e,{responseType:"array-buffer"}),o=await r.data;return v(new Uint8Array(o))}async function v(e){const t=new((await u()).MapOfObjectIdentifierSetsDecoder),o=t.decode(new Uint8Array(e)),n=new Map;if(0!==o.error_code)throw new r("knowledge-graph:layer-support-utils",o.error_message);const i=t.get_map_of_identifier_sets(),s=i.keys,a=s.size();for(let l=0;l<a;l++){const e=s.get(l),t=i.query_identifier_set(e),o=[];if(t.id_array_type.value===w.GLOBALID_ARRAY){const e=t.get_globalid_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_globalid_at(t))}else if(t.id_array_type.value===w.IDENTIFIER_ARRAY){const e=t.get_identifier_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_identifier_at(t).toString())}else if(t.id_array_type.value===w.STRING_ARRAY){const e=t.get_string_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_string_at(t))}else{if(t.id_array_type.value!==w.OID_ARRAY)throw new r("knowledge-graph:layer-support-utils","Tried to encode an unexpected ID Array type.");{const e=t.get_oid_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_objectid_at(t).toString())}}n.set(e,o)}return t.delete(),n}function z(e,t){if(!e?.queryResult?.featureResult)return t;const r=e.queryResult.featureResult.fieldNameToAttributeIndexMap;for(const n of e.queryResult.featureResult.features){const e=n.attributes[r[p.TYPENAME]],i=o(t.namedTypeDefinitions,e,(()=>({useAllData:!1,members:new Map}))),a=n.attributes[r[p.ELEMENTUID]];if(n.compressedGeometry?.coords?.length>0){let e=n.compressedGeometry.lengths;"esriGeometryPoint"===n.compressedGeometry.geometryType&&(e=[]),i.members.set(a,{id:a,linkChartLocation:new s(e,n.compressedGeometry.coords)})}else i.members.set(a,{id:a})}return t}function W(e,t){for(const[r,n]of e){const e=o(t.namedTypeDefinitions,r,(()=>({useAllData:!1,members:new Map})));for(const t of n)e.members.has(t)||e.members.set(t,{id:t})}return t}const q="ESRI__ChronologicalLayoutOverlay",Y=()=>q,$=t=>{const r=[],o={type:"CIMGeometricEffectCut",beginCut:3,endCut:3};for(const n of t.chronologicalAuxiliaryGraphics?.lines??[]){const t={type:"CIMSolidStroke",enable:!0,width:n.width,color:[n.color.r,n.color.g,n.color.b,Math.round(n.color.a/100*255)],effects:n.dashPattern.length>0?[{type:"CIMGeometricEffectDashes",dashTemplate:n.dashPattern,lineDashEnding:"NoConstraint"},o]:[o]},i={type:"CIMVectorMarker",enable:!0,size:10,frame:{xmin:-5,ymin:-5,xmax:0,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-12,-3.47],[-12,3.6],[-2.06,-.03],[-12,-3.47]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[n.color.r,n.color.g,n.color.b,Math.round(n.color.a/100*255)]}]}}],markerPlacement:{type:"CIMMarkerPlacementOnLine",angleToLine:!0,relativeTo:"LineEnd",offsetAlongLine:0}},s=new T({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:n.arrowheadSizeAtEnd?[t,i]:[t]}}});for(const o of n.elements){const t=new M({paths:[[[o.origin.x,o.origin.y],[o.destination.x,o.destination.y]]]});r.push(new e({geometry:t,symbol:s}))}}for(const n of t.chronologicalAuxiliaryGraphics?.polygons??[]){const t=new E({color:[n.color.r,n.color.g,n.color.b,n.color.a/100],style:"solid",outline:null});for(const o of n.elements){const n=new k({rings:[o.points.map((e=>[e.x,e.y]))]});r.push(new e({geometry:n,symbol:t}))}}for(const n of t.chronologicalAuxiliaryGraphics?.texts??[]){let t="middle",o="center";switch(n.direction?.value){case c.left:o="right";break;case c.right:o="left";break;case c.bottom:t="bottom"}for(const i of n.elements){const s=new I({color:[n.color.r,n.color.g,n.color.b,n.color.a/100],text:i.str,font:{size:n.height,weight:"bold"},verticalAlignment:t,horizontalAlignment:o}),a=new S({x:i.anchor.x,y:i.anchor.y});r.push(new e({geometry:a,symbol:s}))}}return new n({graphics:r,listMode:"hide",title:q,id:q})},H=(e,t)=>{t.set_feature_collection(e),t.encode();const o=t.get_encoding_result();if(0!==o.error.error_code)throw new r("knowledge-graph:layer-support-utils",o.error.error_message);return o.get_byte_buffer()},Q=(e,t)=>{const r=new Map;for(const n of[...t.entityTypes??[],...t.relationshipTypes??[]])for(const e of n.properties??[])e.geometryType&&"esriGeometryNull"!==e.geometryType&&r.set(n.name,e.name??"");const o=l.getInstance();for(const n of e)o.writeToStore([n],a,r.get(n.typeName??"")??"")};export{z as addFeatureCollectionToInclusionDefinition,W as addIdMapToInclusionDefinition,P as deserializeFeatureCollection,v as deserializeIdCollectionMap,C as extentToInBoundsRings,F as fetchAndConvertSerializedKgIdMap,j as fetchAndConvertSerializedLinkChart,U as fetchAndDeserializeFeatureCollection,O as fetchAndDeserializeIdCollectionMap,$ as getChronologicalOverlay,Y as getDefaultChronologicalOverlayLayerId,N as getRelationshipEndNodeIds,G as getRelationshipEndNodeMap,Q as loadRecordsIntoLocalCache,R as serializeInclusionDefinitionToAllPbf,x as serializeInclusionDefinitionToIdCollectionsMapPbf,D as setFeatureCollectionProperties};
|
|
5
|
+
import"../../geometry.js";import e from"../../Graphic.js";import t from"../../request.js";import"../../symbols.js";import r from"../../core/Error.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import n from"../GraphicsLayer.js";import{convertFromGeometry as i}from"../graphics/featureConversionUtils.js";import a from"../graphics/OptimizedGeometry.js";import{IdealEdgeLengthTypeOptions as s}from"./IdealEdgeLengthTypeOptions.js";import{systemOidFieldName as l}from"./layerUtils.js";import c from"./SessionMemoryStorage.js";import{Direction2D as d}from"../../libs/linkchartlayout/LinkChartLayout.js";import{executeQueryStreaming as m}from"../../rest/knowledgeGraphService.js";import y from"../../rest/knowledgeGraph/GraphQueryStreaming.js";import{ProtoOutboundRelationshipFeatureCollectionAttributionIndexes as p,ProtoInboundFeatureCollectionAttributionNames as u,ProtoOutboundEntityFeatureCollectionAttributionIndexes as f}from"../../rest/knowledgeGraph/ProtoFeatureCollection.js";import{getWasmInterface as g}from"../../rest/knowledgeGraph/wasmInterface/knowledgeWasmAccess.js";import{EsriFieldTypes as h}from"../../rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js";import{WasmQuantizeOriginPositionTypeCode as _,SqlTypeCode as w,IdArrayType as b}from"../../rest/knowledgeGraph/wasmInterface/WasmSerializedLayerData.js";import{wasmToProtoFeatureCollection as T}from"../../rest/knowledgeGraph/wasmInterface/wasmToFeatureFactories.js";import E from"../../symbols/CIMSymbol.js";import I from"../../geometry/Polyline.js";import C from"../../symbols/SimpleFillSymbol.js";import M from"../../geometry/Polygon.js";import R from"../../symbols/TextSymbol.js";import A from"../../geometry/Point.js";function L(e){if(!e.spatialReference.isWGS84)throw new r("knowledge-graph:layer-support-utils","The extentToInBoundsRings function only supports WGS84 spatial references.");return e.clone().normalize().map((e=>[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]))}function S(e,t){const r=new Map;if(t.dataModel?.relationshipTypes)for(const o of t.dataModel.relationshipTypes)o.name&&r.set(o.name,[]);for(const o of e)r.has(o.typeName)&&r.get(o.typeName)?.push(o.id);return r}async function k(e,t){const r=[],o=S(e,t),n={},i=[];for(const[c,d]of o){if(d.length<1)continue;const e=`${c}_ids`;n[e]=d,i.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${e} RETURN id(n), labels(n)[0], id(m), labels(m)[0]`)}if(0===i.length)return[];const a=i.join(" UNION "),s=new y({openCypherQuery:a,bindParameters:n}),l=(await m(t,s)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await l.read();if(e)break;for(const o of t)r.push({id:o[0],typeName:o[1]}),r.push({id:o[2],typeName:o[3]})}return r}async function N(e,t){const r=new Map,o=S(e,t),n={},i=[];for(const[c,d]of o){if(d.length<1)continue;const e=`${c}_ids`;n[e]=d,i.push(`MATCH (n)-[r:${c}]->(m) WHERE id(r) in $${e} RETURN id(r), id(n), id(m)`)}if(0===i.length)return r;const a=i.join(" UNION "),s=new y({openCypherQuery:a,bindParameters:n}),l=(await m(t,s)).resultRowsStream.getReader();for(;;){const{done:e,value:t}=await l.read();if(e)break;for(const o of t)r.set(o[0],[o[1],o[2]])}return r}async function F(e){const t=[],r={generateAllSublayers:!1,namedTypeDefinitions:new Map};return e.entitiesUrl&&t.push(P(e.entitiesUrl).then((e=>{q(e,r)}))),e.relationshipsUrl&&t.push(P(e.relationshipsUrl).then((e=>{q(e,r)}))),await Promise.all(t),r}async function G(e,t){t??=!1;const r={generateAllSublayers:t,namedTypeDefinitions:new Map};return await H(e).then((e=>{Y(e,r)})),r}async function D(e,t,r){const o=await g(),n=new o.FeatureCollection,i=new o.FeatureCollection;try{U(n,o,e,"entities",t,r),U(i,o,e,"relationships",t,r);const a=new o.FeatureCollectionEncoder,s=new o.FeatureCollectionEncoder,l=V(n,a),c=structuredClone(l),d=V(i,s),m={entitiesFC:c,relationshipsFC:structuredClone(d)};return a.delete(),s.delete(),m}finally{n.delete(),i.delete()}}async function j(e,t,r){const o=await g(),n=new o.FeatureCollection;try{U(n,o,e,"entities",t,r);const i=new o.FeatureCollectionEncoder,a=V(n,i),s=structuredClone(a);return i.delete(),s}finally{n.delete()}}async function O(e,t,r){const o=await g(),n=new o.FeatureCollection;try{U(n,o,e,"relationships",t,r);const i=new o.FeatureCollectionEncoder,a=V(n,i),s=structuredClone(a);return i.delete(),s}finally{n.delete()}}async function x(e){const t=await g(),o=new t.MapOfObjectIdentifierSets;v(o,t,e);const n=new t.MapOfObjectIdentifierSetsEncoder;try{n.set_map_of_identifier_sets(o),n.encode();const e=n.get_encoding_result();if(0!==e.error.error_code)throw new r("knowledge-graph:layer-support-utils",e.error.error_message);const t=structuredClone(e.get_byte_buffer());return n.delete(),t}finally{o.delete()}}function U(e,t,r,o,n,a){e.version="";const s=new t.QueryResult,l=new t.FeatureResult,c="entities"===o?f:p;l.unique_id_field={name:c[c.ELEMENTUID],isSystemMaintained:!1},l.globalid_field_name=c[c.ELEMENTUID],l.geohash_field_name="",l.geometry_properties={shapeAreaFieldName:"",shapeLengthFieldName:"",units:""},l.spatial_reference={wkid:4326,latestWkid:4326,vcsWkid:0,latestVcsWkid:0,wkt:""},l.exceeded_transfer_limit=!1,l.has_z=!1,l.has_m=!1,l.transform={quantizeOriginPosition:{value:_.upperLeft},scale:{xScale:1e-9,yScale:1e-9,mScale:1e-4,zScale:1e-4},translate:{xTranslate:-400,yTranslate:-400,mTranslate:-1e5,zTranslate:-1e5}};for(const i of Object.keys(c).filter((e=>isNaN(Number(e))))){const e=new t.Field;if(e.name=i,e.alias=i,e.sql_type={value:w.sqlTypeBigInt},"entities"===o)switch(i){case c[c.ELEMENTUID]:case c[c.TYPENAME]:e.field_type={value:h.esriFieldTypeString}}else switch(i){case c[c.ELEMENTUID]:case c[c.TYPENAME]:case p[p.FROMUID]:case p[p.TOUID]:e.field_type={value:h.esriFieldTypeString}}e.domain="",l.add_field(e),e.delete()}const d=new Map;for(const i of n.dataModel.entityTypes)d.set(i.name,"entities");for(const i of n.dataModel.relationshipTypes)d.set(i.name,"relationships");for(const[m,y]of r.namedTypeDefinitions)if(o===d.get(m))for(const e of y.members.values()){const r=new t.Feature;for(const i of Object.keys(c).filter((e=>isNaN(Number(e)))))if("entities"===o)switch(i){case c[c.ELEMENTUID]:r.add_attribute(e.id,t.esriFieldType.esriFieldTypeString);break;case c[c.TYPENAME]:r.add_attribute(m,t.esriFieldType.esriFieldTypeString)}else switch(i){case c[c.ELEMENTUID]:r.add_attribute(e.id,t.esriFieldType.esriFieldTypeString);break;case p[p.FROMUID]:r.add_attribute(a.has(e.id)?a.get(e.id)[0]:"",t.esriFieldType.esriFieldTypeString);break;case p[p.TOUID]:r.add_attribute(a.has(e.id)?a.get(e.id)[1]:"",t.esriFieldType.esriFieldTypeString);break;case c[c.TYPENAME]:r.add_attribute(m,t.esriFieldType.esriFieldTypeString)}let n;if(e.linkChartLocation&&"x"in e.linkChartLocation?n=i(e.linkChartLocation):e.linkChartLocation&&(n=e.linkChartLocation),e.linkChartLocation&&n){const e=new t.FeatureCollectionGeometry;let i=!1;switch(o){case"entities":e.geometry_type=t.esriGeometryType.esriGeometryPoint,i=!0;break;case"relationships":e.geometry_type=t.esriGeometryType.esriGeometryPolyline}e.coords=new Float64Array(n.coords),e.lengths=new Uint32Array(i?[1]:n.lengths),r.set_compressed_geometry(e),e.delete()}l.add_feature(r),r.delete()}switch(o){case"entities":l.geometry_type=t.esriGeometryType.esriGeometryPoint;break;case"relationships":l.geometry_type=t.esriGeometryType.esriGeometryPolyline}return s.set_feature_result(l),e.set_query_result(s),l.delete(),s.delete(),e}function v(e,t,r){for(const[o,n]of r.namedTypeDefinitions){if(!n.members||n.useAllData)continue;const r=n.members.keys();let i=!1,a=!0;const s=new t.ObjectIdArray,l=new t.StringArray,c=new t.GlobalIdArray,d=new t.IdentifierArray,m=new t.ObjectIdentifierSet;for(const e of r)a&&(i=!isNaN(Number(e)),a=!1),i?s.add_objectid(Number(e)):(l.add_string(e),c.add_globalid(e)),d.add_identifier(e);m.set_oid_array(s),m.set_string_array(l),m.set_globalid_array(c),m.set_identifier_array(d),s.delete(),l.delete(),c.delete(),d.delete(),e.put_identifier_set(o,m),m.delete()}return e}async function P(e){const r=await t(e,{responseType:"array-buffer"});return z(await r.data)}async function z(e){const t=new((await g()).FeatureCollectionDecoder),o=t.decode(new Uint8Array(e));if(0!==o.error_code)throw new r("knowledge-graph:layer-support-utils",o.error_message);const n=t.get_feature_collection(),i=T(n);return t.delete(),i}async function H(e){const r=await t(e,{responseType:"array-buffer"}),o=await r.data;return W(new Uint8Array(o))}async function W(e){const t=new((await g()).MapOfObjectIdentifierSetsDecoder),o=t.decode(new Uint8Array(e)),n=new Map;if(0!==o.error_code)throw new r("knowledge-graph:layer-support-utils",o.error_message);const i=t.get_map_of_identifier_sets(),a=i.keys,s=a.size();for(let l=0;l<s;l++){const e=a.get(l),t=i.query_identifier_set(e),o=[];if(t.id_array_type.value===b.GLOBALID_ARRAY){const e=t.get_globalid_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_globalid_at(t))}else if(t.id_array_type.value===b.IDENTIFIER_ARRAY){const e=t.get_identifier_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_identifier_at(t).toString())}else if(t.id_array_type.value===b.STRING_ARRAY){const e=t.get_string_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_string_at(t))}else{if(t.id_array_type.value!==b.OID_ARRAY)throw new r("knowledge-graph:layer-support-utils","Tried to encode an unexpected ID Array type.");{const e=t.get_oid_array(),r=e.count();for(let t=0;t<r;t++)o.push(e.get_objectid_at(t).toString())}}n.set(e,o)}return t.delete(),n}function q(e,t){if(!e?.queryResult?.featureResult)return t;const r=e.queryResult.featureResult.fieldNameToAttributeIndexMap;for(const n of e.queryResult.featureResult.features){const e=n.attributes[r[u.TYPENAME]],i=o(t.namedTypeDefinitions,e,(()=>({useAllData:!1,members:new Map}))),s=n.attributes[r[u.ELEMENTUID]];if(n.compressedGeometry?.coords?.length>0){let e=n.compressedGeometry.lengths;"esriGeometryPoint"===n.compressedGeometry.geometryType&&(e=[]),i.members.set(s,{id:s,linkChartLocation:new a(e,n.compressedGeometry.coords)})}else i.members.set(s,{id:s})}return t}function Y(e,t){for(const[r,n]of e){const e=o(t.namedTypeDefinitions,r,(()=>({useAllData:!1,members:new Map})));for(const t of n)e.members.has(t)||e.members.set(t,{id:t})}return t}const $="ESRI__ChronologicalLayoutOverlay",B=()=>$,Q=t=>{const r=[],o={type:"CIMGeometricEffectCut",beginCut:3,endCut:3};for(const n of t.chronologicalAuxiliaryGraphics?.lines??[]){const t={type:"CIMSolidStroke",enable:!0,width:n.width,color:[n.color.r,n.color.g,n.color.b,Math.round(n.color.a/100*255)],effects:n.dashPattern.length>0?[{type:"CIMGeometricEffectDashes",dashTemplate:n.dashPattern,lineDashEnding:"NoConstraint"},o]:[o]},i={type:"CIMVectorMarker",enable:!0,size:10,frame:{xmin:-5,ymin:-5,xmax:0,ymax:5},markerGraphics:[{type:"CIMMarkerGraphic",geometry:{rings:[[[-12,-3.47],[-12,3.6],[-2.06,-.03],[-12,-3.47]]]},symbol:{type:"CIMPolygonSymbol",symbolLayers:[{type:"CIMSolidFill",enable:!0,color:[n.color.r,n.color.g,n.color.b,Math.round(n.color.a/100*255)]}]}}],markerPlacement:{type:"CIMMarkerPlacementOnLine",angleToLine:!0,relativeTo:"LineEnd",offsetAlongLine:0}},a=new E({data:{type:"CIMSymbolReference",symbol:{type:"CIMLineSymbol",symbolLayers:n.arrowheadSizeAtEnd?[t,i]:[t]}}});for(const o of n.elements){const t=new I({paths:[[[o.origin.x,o.origin.y],[o.destination.x,o.destination.y]]]});r.push(new e({geometry:t,symbol:a}))}}for(const n of t.chronologicalAuxiliaryGraphics?.polygons??[]){const t=new C({color:[n.color.r,n.color.g,n.color.b,n.color.a/100],style:"solid",outline:null});for(const o of n.elements){const n=new M({rings:[o.points.map((e=>[e.x,e.y]))]});r.push(new e({geometry:n,symbol:t}))}}for(const n of t.chronologicalAuxiliaryGraphics?.texts??[]){let t="middle",o="center";switch(n.direction?.value){case d.left:o="right";break;case d.right:o="left";break;case d.bottom:t="bottom"}for(const i of n.elements){const a=new R({color:[n.color.r,n.color.g,n.color.b,n.color.a/100],text:i.str,font:{size:n.height,weight:"bold"},verticalAlignment:t,horizontalAlignment:o}),s=new A({x:i.anchor.x,y:i.anchor.y});r.push(new e({geometry:s,symbol:a}))}}return new n({graphics:r,listMode:"hide",title:$,id:$})},V=(e,t)=>{t.set_feature_collection(e),t.encode();const o=t.get_encoding_result();if(0!==o.error.error_code)throw new r("knowledge-graph:layer-support-utils",o.error.error_message);return o.get_byte_buffer()},J=(e,t)=>{const r=new Map;for(const n of[...t.entityTypes??[],...t.relationshipTypes??[]])for(const e of n.properties??[])e.geometryType&&"esriGeometryNull"!==e.geometryType&&r.set(n.name,e.name??"");const o=c.getInstance();for(const n of e)o.writeToStore([n],l,r.get(n.typeName??"")??"")},K={"basic-grid":"SIMPLE","geographic-organic-standard":"GEOGRAPHIC","hierarchical-bottom-to-top":"HIERARCHICAL","hierarchical-top-to-bottom":"HIERARCHICAL","organic-community":"COMMUNITY","organic-fusiform":"FORCE_DIRECTED","organic-leaf-circle":"FORCE_DIRECTED","organic-standard":"FORCE_DIRECTED","radial-node-centric":"RADIAL_TREE","radial-root-centric":"RADIAL_TREE","tree-bottom-to-top":"SMART_TREE","tree-left-to-right":"SMART_TREE","tree-right-to-left":"SMART_TREE","tree-top-to-bottom":"SMART_TREE","chronological-mono-timeline":"CHRONOLOGICAL_SINGLE","chronological-multi-timeline":"CHRONOLOGICAL_MULTIPLE"},X=e=>K[e],Z=(e,t)=>{const r=e?.chronologicalLayoutSettings,o=e?.organicLayoutSettings;return{chronologicalLayoutSettings:null!==r?r:void 0,organicLayoutSettings:o?{idealEdgeLengthType:"absolute-value"===o.idealEdgeLengthType?s.ABSOLUTE:s.MULTIPLIER,repulsionRadiusMultiplier:o.autoRepulsionRadius?void 0:o.repulsionRadiusMultiplier,idealEdgeLength:null==o.idealEdgeLengthType?void 0:"absolute-value"===o.idealEdgeLengthType?o.absoluteIdealEdgeLength:o.multiplicativeIdealEdgeLength,computationBudgetTime:t}:void 0}},ee={fetchAndConvertSerializedLinkChart:e=>F(e)};export{q as addFeatureCollectionToInclusionDefinition,Y as addIdMapToInclusionDefinition,Z as convertLayoutSettingsJSON,X as convertLayoutTypeJSON,z as deserializeFeatureCollection,W as deserializeIdCollectionMap,L as extentToInBoundsRings,G as fetchAndConvertSerializedKgIdMap,F as fetchAndConvertSerializedLinkChart,P as fetchAndDeserializeFeatureCollection,H as fetchAndDeserializeIdCollectionMap,Q as getChronologicalOverlay,B as getDefaultChronologicalOverlayLayerId,k as getRelationshipEndNodeIds,N as getRelationshipEndNodeMap,ee as graphLayersSupportUtilsModuleWrapper,J as loadRecordsIntoLocalCache,D as serializeInclusionDefinitionToAllPbf,j as serializeInclusionDefinitionToEntitiesPbf,x as serializeInclusionDefinitionToIdCollectionsMapPbf,O as serializeInclusionDefinitionToRelationshipsPbf,U as setFeatureCollectionProperties};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class t{constructor(t){this._store=t}destroy(){this._store.destroy()}get(t){return this._store.get(t)}put(t,s){this._store.put(t,s
|
|
5
|
+
class t{constructor(t){this._store=t}destroy(){this._store.destroy()}get(t){return this._store.get(t)}put(t,s){this._store.put(t,s)}}export{t as ElevationQueryTileCache};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
class a{constructor(a,t,s,e){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in a?(this.values=a.pixelData,this.width=a.width,this.height=a.height,this.noDataValue=a.noDataValue):(this.values=a,this.width=t,this.height=s,this.noDataValue=e)}get hasNoDataValues(){if(null==this._hasNoDataValues){const a=this.noDataValue;this._hasNoDataValues=this.values.includes(a)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}_ensureBounds(){if(null!=this._minValue)return;const{noDataValue:a,values:t}=this;let s=1/0,e=-1/0,i=!0;for(const
|
|
5
|
+
class a{constructor(a,t,s,e){this._hasNoDataValues=null,this._minValue=null,this._maxValue=null,"pixelData"in a?(this.values=a.pixelData,this.width=a.width,this.height=a.height,this.noDataValue=a.noDataValue):(this.values=a,this.width=t,this.height=s,this.noDataValue=e)}get hasNoDataValues(){if(null==this._hasNoDataValues){const a=this.noDataValue;this._hasNoDataValues=this.values.includes(a)}return this._hasNoDataValues}get minValue(){return this._ensureBounds(),this._minValue}get maxValue(){return this._ensureBounds(),this._maxValue}get cachedMemory(){return this.values.byteLength+256}_ensureBounds(){if(null!=this._minValue)return;const{noDataValue:a,values:t}=this;let s=1/0,e=-1/0,i=!0;for(const h of t)h===a?this._hasNoDataValues=!0:(s=h<s?h:s,e=h>e?h:e,i=!1);i?(this._minValue=0,this._maxValue=0):(this._minValue=s,this._maxValue=e>-3e38?e:0)}}export{a as ElevationTileData};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"../../geometry.js";import{createScreenPoint as e}from"../../core/screenUtils.js";import{nameToId as t,OriginId as n}from"../../core/accessorSupport/PropertyOrigin.js";import{getInfo as o}from"../../geometry/support/spatialReferenceUtils.js";import r from"./ControlPointsGeoreference.js";import i from"./CornersGeoreference.js";import s from"./ExtentAndRotationGeoreference.js";import a from"./GeoreferenceBase.js";import c from"../../geometry/Extent.js";import p from"../../geometry/Point.js";const l=100,y=.5;async function m(e,t){e.loaded||await e.load();const{contentWidth:n,contentHeight:i}=e,{spatialReference:s}=t,a=o(s);let m=!1;if(a){const e=a.valid[1]-a.valid[0];t.width>e&&(t=new c({xmin:a.valid[0],ymin:t.ymin,xmax:a.valid[1],ymax:t.ymax,spatialReference:t.spatialReference}),m=!0)}const f=t.expand(y),{center:u,width:P,height:d}=f,x=
|
|
5
|
+
import"../../geometry.js";import{createScreenPoint as e}from"../../core/screenUtils.js";import{nameToId as t,OriginId as n}from"../../core/accessorSupport/PropertyOrigin.js";import{getInfo as o}from"../../geometry/support/spatialReferenceUtils.js";import r from"./ControlPointsGeoreference.js";import i from"./CornersGeoreference.js";import s from"./ExtentAndRotationGeoreference.js";import a from"./GeoreferenceBase.js";import c from"../../geometry/Extent.js";import p from"../../geometry/Point.js";const l=100,y=.5;async function m(e,t){e.loaded||await e.load();const{contentWidth:n,contentHeight:i}=e,{spatialReference:s}=t,a=o(s);let m=!1;if(a){const e=a.valid[1]-a.valid[0];t.width>e&&(t=new c({xmin:a.valid[0],ymin:t.ymin,xmax:a.valid[1],ymax:t.ymax,spatialReference:t.spatialReference}),m=!0)}const f=t.expand(y),{center:u,width:P,height:d}=f,x=n/i,w=m||x>1,g=w?l:l*x,h=w?l/x:l,R=w?P:d*x,j=w?P/x:d,v=u.x-R/2,O=u.x+R/2,b=u.y+j/2,G=u.y-j/2;return new r({controlPoints:[{sourcePoint:{x:g,y:i-h},mapPoint:new p({x:v,y:G,spatialReference:s})},{sourcePoint:{x:g,y:h},mapPoint:new p({x:v,y:b,spatialReference:s})},{sourcePoint:{x:n-g,y:h},mapPoint:new p({x:O,y:b,spatialReference:s})},{sourcePoint:{x:n-g,y:i-h},mapPoint:new p({x:O,y:G,spatialReference:s})}],width:n,height:i})}function f(e){const t=e.georeference;if("control-points"!==t.type)return null;const n={wkid:0},{width:o,height:i}=t,s=t.controlPoints;return new r({controlPoints:s.map((e=>{const{x:t,y:o}=e.sourcePoint;return{sourcePoint:{x:t,y:o},mapPoint:new p({x:t,y:i-o,spatialReference:n})}})),width:o,height:i})}function u(e){return"media"===e?.type}function P(e,o){const r=t(o);return u(e)&&!!e.portalItem&&null!=r&&r>n.PORTAL_ITEM}function d(t,n,o){if(!t||"control-points"===t.type)return t;const{coords:i}=t;if(5!==i?.rings[0]?.length)return null;const[s,a,c,l]=i.rings[0],{spatialReference:y}=i;return new r({controlPoints:[{mapPoint:new p({x:s[0],y:s[1],spatialReference:y}),sourcePoint:e(0,o)},{mapPoint:new p({x:a[0],y:a[1],spatialReference:y}),sourcePoint:e(0,0)},{mapPoint:new p({x:c[0],y:c[1],spatialReference:y}),sourcePoint:e(n,0)},{mapPoint:new p({x:l[0],y:l[1],spatialReference:y}),sourcePoint:e(n,o)}],width:n,height:o})}function x(e,t,n){return{enabled:!P(n?.layer,n?.origin),ignoreOrigin:!0}}const w={json:{name:"url",type:String,write:{overridePolicy:x}}},g={readOnly:!0,json:{read:!1,write:{target:"mediaType",overridePolicy:x}}},h={types:{key:"type",base:a,typeMap:{"control-points":r,corners:i,"extent-and-rotation":s}},json:{types:{key:"type",base:a,typeMap:{"control-points":r}},write:{overridePolicy:()=>({enabled:!0,ignoreOrigin:!0})}}};export{m as createDefaultControlPointsGeoreference,f as createLocalModeControlPointsGeoreference,P as isWritingLayerFromItemToWebDocument,w as mediaElementUrlProperty,h as mediaGeoreferenceProperty,g as mediaTypeProperty,d as toControlPointsGeoreference};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{JSONMap as e}from"../../core/jsonMap.js";import{inferLocationInfo as
|
|
5
|
+
import{JSONMap as e}from"../../core/jsonMap.js";import t from"../../geometry/SpatialReference.js";import{inferLocationInfo as o}from"./locationUtils.js";import{ParquetMetadata as n}from"../../libs/parquet/parquet.js";const i=new e({esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint"});function r(e){return i.toJSON(e)}function l(e){return"location"===e.type?{type:"location",geometryType:"esriGeometryPoint",spatialReference:e.spatialReference.toJSON(),latitudeFieldName:e.latitudeFieldName,longitudeFieldName:e.longitudeFieldName}:{type:"geometry",geometryType:r(e.geometryType),spatialReference:e.spatialReference.toJSON(),format:e.format,primaryFieldName:e.primaryFieldName}}async function a(e){const t=await n.create(e,(()=>null));return{objectIdField:null,url:e,geometrySourceInfo:u(t),metadata:t}}function m(e){switch(e){case"Point":return"point";case"Polygon":case"MultiPolygon":return"polygon";case"LineString":return"polyline";case"MultiPoint":return"multipoint";default:return null}}function u(e){const n=e.tryReadGeoMetadata();if(null!=n){const e=n.primary_column,o=n.columns[e],{geometry_types:i,encoding:r,orientation:l,crs:a}=o,u=1===i.length?m(i[0]):null,p=a?.id?.code;return{type:"geometry",format:r,geometryType:u,orientation:l??null,primaryFieldName:e,spatialReference:p&&"number"==typeof p?new t({wkid:p}):null}}const i=o(e.fields.map((e=>e.name)));return{type:"location",latitudeFieldName:i.latitudeFieldName,longitudeFieldName:i.longitudeFieldName,spatialReference:t.WGS84}}export{u as inferGeometrySource,a as inferParquetLoadOptions,i as parquetGeometryTypeKebabDict,l as toParquetGeometryInfoJSON,r as toParquetJSONGeometryType};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as
|
|
5
|
+
import{_ as t}from"../../../chunks/tslib.es6.js";import{property as e}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import s from"./BaseRasterFunction.js";import o from"./ClipFunctionArguments.js";import{clipRasterInfo as i}from"./clipUtils.js";import{projectExtent as p,projectPolygon as n}from"./rasterProjectionHelper.js";let c=class extends s{constructor(){super(...arguments),this.functionName="Clip",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isNoopProcess=!0}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone();this.outputPixelType=this._getOutputPixelType(t.pixelType),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{functionArguments:e}=this,{clippingGeometry:r,clippingType:s}=e;if(!r)return{success:!1,supportsGPU:!1,error:"missing clipping geometry"};if("outside"===s)try{const{spatialReference:e}=t,s="extent"===r.type?p(r,e):n(r,e).extent;s&&i(t,s)}catch{}return{success:!0,supportsGPU:!0}}_processPixels(t){return t.pixelBlocks?.[0]}_getWebGLParameters(){const{clippingGeometry:t,clippingType:e}=this.functionArguments;return{clippingGeometry:t.toJSON(),clippingType:e}}};t([e({json:{write:!0,name:"rasterFunction"}})],c.prototype,"functionName",void 0),t([e({type:o,json:{write:!0,name:"rasterFunctionArguments"}})],c.prototype,"functionArguments",void 0),t([e()],c.prototype,"rasterArgumentNames",void 0),t([e()],c.prototype,"isNoopProcess",void 0),c=t([r("esri.layers.support.rasterFunctions.ClipFunction")],c);const u=c;export{u as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import e from"../../../geometry/Extent.js";import i from"../PixelBlock.js";function
|
|
5
|
+
import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import e from"../../../geometry/Extent.js";import i from"../../../geometry/Point.js";import n from"../PixelBlock.js";function a(e,i){if(e.spatialReference.equals(i))return e;const n=t(e.spatialReference),a=t(i);if(n===a)return e;const h=n/a;return{x:e.x*h,y:e.y*h}}async function h(t,e,i){if("extent"===i.type)return o(t,e,i);const{width:a,height:h}=t,m=new Uint8Array(a*h),{contains:l,intersects:s}=await import("../../../geometry/geometryEngine.js");return s(e,i)?"polyline"===i.type?r(t,e,i):l(i,e)?t:x(t,e,i):new n({pixelType:t.pixelType,width:a,height:h,mask:m,maskIsAlpha:!1,pixels:[...t.pixels]})}function x(t,e,i){if(!t)return t;const{width:a,height:h}=t,x=e.width/a,o=e.height/h,{xmin:r,ymax:m}=e;let l;if("extent"===i.type){const t=(i.xmin-r)/x,e=(i.xmax-r)/x,n=(m-i.ymax)/o,a=(m-i.ymin)/o;l=[[[t,n],[t,a],[e,a],[e,n],[t,n]]]}else l=i.rings.map((t=>t.map((([t,e])=>[(t-r)/x,(m-e)/o]))));const s=document.createElement("canvas");s.width=a,s.height=h;const p=s.getContext("2d");p.fillStyle="#f00",p.beginPath(),l.forEach((t=>{p.moveTo(t[0][0],t[0][1]);for(let e=0;e<t.length;e++)p.lineTo(t[e][0],t[e][1]);p.closePath()})),p.fill();const y=p.getImageData(0,0,a,h).data,f=t.mask,c=a*h,M=new Uint8Array(c);for(let n=0;n<c;n++)f&&!f[n]||(M[n]=y[4*n+3]>127?255:0);return new n({pixelType:t.pixelType,width:a,height:h,mask:M,maskIsAlpha:!1,pixels:[...t.pixels]})}function o(t,e,i){const{width:a,height:h}=t,x=new Uint8Array(a*h),o=e.width/a,r=e.height/h;if(i.width/o<.5||i.height/r<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});const{xmin:m,xmax:l,ymin:s,ymax:p}=e,{xmin:y,xmax:f,ymin:c,ymax:M}=i,u=Math.max(m,y),d=Math.min(l,f),w=Math.max(s,c),g=Math.min(p,M),T=.5*o,k=.5*r;if(d-u<T||g-w<k||d<m+T||u>l-T||w>p-k||g<s+k)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});const R=Math.max(0,(u-m)/o),A=Math.min(a,Math.max(0,(d-m)/o)),j=Math.max(0,(p-g)/r),U=Math.min(h,Math.max(0,(p-w)/r)),E=Math.round(R),P=Math.round(A)-1,S=Math.round(j),z=Math.round(U)-1;if(E===P&&R%1>.5&&A%1<.5||S===z&&j%1>.5&&U%1<.5)return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]});if(0===E&&0===S&&P===a&&z===h)return t;const I=t.mask;for(let n=S;n<=z;n++)for(let t=E;t<=P;t++){const e=n*a+t;x[e]=I?I[e]:255}return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]})}function r(t,e,i){const{width:a,height:h}=t,x=new Uint8Array(a*h),o=e.width/a,r=e.height/h,{xmin:m,ymax:l}=e,{paths:s}=i,p=t.mask;for(let n=0;n<s.length;n++){const t=s[n];for(let e=0;e<t.length-1;e++){const[i,n]=t[e],[s,y]=t[e+1];let f=Math.floor((l-n)/r),c=Math.floor((l-y)/r);if(c<f){const t=f;f=c,c=t}f=Math.max(0,f),c=Math.min(h-1,c);const M=(s-i)/(y-n);for(let t=f;t<=c;t++){const e=t===f?Math.max(n,y):(h+1-t)*r,l=t===c?Math.min(n,y):e-r;let u=y===n?Math.floor((i-m)/o):Math.floor((M*(e-n)+i-m)/o),d=y===n?Math.floor((s-m)/o):Math.floor((M*(l-n)+i-m)/o);if(d<u){const t=u;u=d,d=t}const w=t*a;u=Math.max(0,u),d=Math.min(a-1,d);for(let t=w+u;t<=w+d;t++)x[t]=p?p[t]:255}}}return new n({pixelType:t.pixelType,width:a,height:h,mask:x,pixels:[...t.pixels]})}function m(t,e){const{extent:n}=l(t,e,new i({x:t.pixelSize.x,y:t.pixelSize.y,spatialReference:t.spatialReference})),{extent:a}=t.extent;if(n.xmax=Math.min(n.xmax,a.xmax),n.ymax=Math.min(n.ymax,a.ymax),n.xmin<n.xmax&&n.ymin<n.ymax){const{x:e,y:i}=t.pixelSize,a=Math.round(n.width/e),h=Math.round(n.height/i);t.extent=n,t.width=a,t.height=h}}function l(t,i,n,h=!0){const{spatialReference:x}=t,{x:o,y:r}=a(n,x);let m,l,s;const p="extent"===i.type?i:i.extent;let{xmin:y,xmax:f,ymax:c,ymin:M}=p;const{xmin:u,ymax:d}=t.extent;return h?(y=u+(y>u?o*Math.round((y-u)/o):0),c=d-(c<d?r*Math.round((d-c)/r):0),f=u+(f>u?o*Math.round((f-u)/o):0),M=d-(M<d?r*Math.round((d-M)/r):0),m=new e({xmin:y,ymax:c,xmax:f,ymin:M,spatialReference:x}),l=Math.round(m.width/o),s=Math.round(m.height/r)):(l=Math.floor((f-y)/o+.8),s=Math.floor((c-M)/r+.8),y=u+(y>u?o*Math.floor((y-u)/o+.1):0),c=d-(c<d?r*Math.floor((d-c)/r+.1):0),f=y+l*o,M=c-s*r,m=new e({xmin:y,ymax:c,xmax:f,ymin:M,spatialReference:x})),{extent:m,width:l,height:s}}export{h as clip,m as clipRasterInfo,l as snapToRaster};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import t from"../PixelBlock.js";import{localTrigonometricOperation as e,localLogicalOperation as n,localConditionalOperation as r}from"../rasterFunctionConstants.js";import{fixNaN as o,clipBandToPixelTypeRange as s}from"../rasterFormats/pixelRangeUtils.js";const a=new Map([[e.acos,{domain:[0,Math.PI],isInteger:!1}],[e.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[e.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[e.cos,{domain:[-1,1],isInteger:!1}],[e.sin,{domain:[-1,1],isInteger:!1}],[n.booleanAnd,{domain:[0,1],isInteger:!0}],[n.booleanNot,{domain:[0,1],isInteger:!0}],[n.booleanOr,{domain:[0,1],isInteger:!0}],[n.booleanXOr,{domain:[0,1],isInteger:!0}],[n.equalTo,{domain:[0,1],isInteger:!0}],[n.notEqual,{domain:[0,1],isInteger:!0}],[n.greaterThan,{domain:[0,1],isInteger:!0}],[n.greaterThanEqual,{domain:[0,1],isInteger:!0}],[n.lessThan,{domain:[0,1],isInteger:!0}],[n.lessThanEqual,{domain:[0,1],isInteger:!0}],[n.isNull,{domain:[0,1],isInteger:!0}]]);function l(t){return a.get(t)}const c=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function f(t,e=!1){const n=t.map((t=>t.mask)),r=n.filter((t=>null!=t)),o=t[0].pixels[0].length;if(0===r.length||e&&r.length!==n.length)return new Uint8Array(o).fill(255);const s=r[0],a=new Uint8Array(s);if(1===r.length)return a;if(!e){for(let t=1;t<r.length;t++){const e=r[t];for(let t=0;t<a.length;t++)a[t]&&(a[t]=e[t]?255:0)}return a}for(let l=1;l<r.length;l++){const t=r[l];for(let e=0;e<a.length;e++)0===a[e]&&(a[e]=t[e]?255:0)}return a}function i(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]+s[t]);return l}function u(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand("f32",s);return a.set(o),a}function h(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=o[t]*o[t]);return a}function g(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]-s[t]);return l}function p(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]*s[t]);return l}function m(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=Math.sign(o[t])*Math.floor(Math.abs(o[t])));return a}function d(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]/s[t]);return l}function y(t,e,n){return d(t,e,"f32")}function E(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=Math.floor(o[t]/s[t]));return l}function M(n,r,o,s){const a=n[0],l=a.length,c=t.createEmptyBand(o,l);if(s===e.atanh){for(let t=0;t<l;t++)if(r[t]){const e=a[t];Math.abs(e)>=1?r[t]=0:c[t]=Math.atanh(e)}return c}const f=s===e.asin?Math.asin:Math.acos;for(let t=0;t<l;t++)if(r[t]){const e=a[t];Math.abs(e)>1?r[t]=0:c[t]=f(e)}return c}function B(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o(s[t]));return l}function I(e,n,r,o){const[s,a]=e,l=s.length,c=t.createEmptyBand(r,l);for(let t=0;t<l;t++)n&&!n[t]||(c[t]=o(s[t],a[t]));return c}function w(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]&s[t]);return l}function x(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<<s[t]);return l}function b(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=~o[t]);return a}function A(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]|s[t]);return l}function P(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>>s[t]);return l}function T(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]^s[t]);return l}function k(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]&&s[t]?1:0);return l}function q(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=o[t]?0:1);return a}function N(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]||s[t]?1:0);return l}function U(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=(o[t]?1:0)^(s[t]?1:0));return l}function F(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]===s[t]?1:0);return l}function j(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a),c=o===Math.E;for(let t=0;t<a;t++)n&&!n[t]||(l[t]=c?Math.exp(s[t]):o**s[t]);return l}function z(t,e,n){return j(t,e,n,10)}function O(t,e,n){return j(t,e,n,2)}function C(t,e,n){return j(t,e,n,Math.E)}function R(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(s[t]<=0?n[t]=0:l[t]=o(s[t]));return l}function S(t,e,n){return R(t,e,n,Math.log10)}function X(t,e,n){return R(t,e,n,Math.log2)}function v(t,e,n){return R(t,e,n,Math.log)}function D(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>s[t]?1:0);return l}function G(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>=s[t]?1:0);return l}function H(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<s[t]?1:0);return l}function J(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<=s[t]?1:0);return l}function K(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);if(!n)return a;for(let t=0;t<s;t++)a[t]=n[t]?0:1;return a}function L(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]%s[t]);return l}function Q(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=-o[t]);return a}function V(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]===s[t]?0:1);return l}function W(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a),c=new Uint8Array(a);for(let t=0;t<a;t++)null!=n&&!n[t]||0!==o[t]||(l[t]=s[t],c[t]=255);return{band:l,mask:c}}function Y(e,n,r){const[o,s,a]=e,l=o.length,c=t.createEmptyBand(r,l);for(let t=0;t<l;t++)n&&!n[t]||(c[t]=o[t]?s[t]:a[t]);return c}function Z(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t];for(let r=1;r<o;r++){const o=e[r][t];n<o&&(n=o)}l[t]=n}return l}function $(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t];for(let r=1;r<o;r++){const o=e[r][t];n>o&&(n=o)}l[t]=n}return l}function _(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t],r=n;for(let s=1;s<o;s++){const o=e[s][t];r<o?r=o:n>o&&(n=o)}l[t]=r-n}return l}function tt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=0;for(let r=0;r<o;r++)n+=e[r][t];l[t]=n/o}return l}function et(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t])for(let n=0;n<o;n++){const r=e[n];l[t]+=r[t]}return l}function nt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){const n=new Float32Array(o);let r=0;for(let a=0;a<o;a++){const o=e[a];r+=o[t],n[a]=o[t]}r/=o;let s=0;for(let t=0;t<o;t++)s+=(n[t]-r)**2;l[t]=Math.sqrt(s/o)}return l}function rt(e,n,r){const o=e.length;if(o<2)return e[0];const s=Math.floor(o/2),[a]=e,l=a.length,c=t.createEmptyBand(r,l),f=new Float32Array(o),i=o%2==1;for(let t=0;t<l;t++)if(!n||n[t]){for(let n=0;n<o;n++)f[n]=e[n][t];f.sort(),c[t]=i?f[s]:(f[s]+f[s-1])/2}return c}function ot(e,n,r){const[o,s]=e;if(null==s)return o;const a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n[t]&&(o[t]===s[t]?l[t]=o[t]:n[t]=0);return l}function st(e,n,r){const o=e.length;if(o<=2)return ot(e,n,r);const s=e[0].length,a=t.createEmptyBand(r,s),l=new Map;for(let t=0;t<s;t++)if(!n||n[t]){let n;l.clear();for(let a=0;a<o;a++)n=e[a][t],l.set(n,l.has(n)?l.get(n)+1:1);let r=0,s=0;for(const t of l.keys())r=l.get(t),r>s&&(s=r,n=t);a[t]=n}return a}function at(e,n,r){const o=e.length;if(o<=2)return ot(e,n,r);const s=e[0].length,a=t.createEmptyBand(r,s),l=new Map;for(let t=0;t<s;t++)if(!n||n[t]){let n;l.clear();for(let a=0;a<o;a++)n=e[a][t],l.set(n,l.has(n)?l.get(n)+1:1);let r=0,s=e.length;for(const t of l.keys())r=l.get(t),r<s&&(s=r,n=t);a[t]=n}return a}function lt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a),c=new Set;for(let t=0;t<a;t++)if(!n||n[t]){let n;c.clear();for(let r=0;r<o;r++)n=e[r][t],c.add(n);l[t]=c.size}return l}const ct=new Map,ft=new Map,it=new Map,ut=new Map;function ht(){ct.size||(ct.set(4,Math.sqrt),ct.set(6,Math.acos),ct.set(7,Math.asin),ct.set(8,Math.atan),ct.set(9,Math.atanh),ct.set(10,Math.abs),ct.set(21,Math.cos),ct.set(22,Math.cosh),ct.set(48,Math.floor),ct.set(49,Math.ceil),ct.set(51,Math.sin),ct.set(52,Math.sinh),ct.set(56,Math.tan),ct.set(57,Math.tanh),ct.set(59,Math.acosh),ct.set(60,Math.asinh),ct.set(65,Math.floor),ft.set(5,Math.pow),ft.set(61,Math.atan2),it.set(1,i),it.set(2,g),it.set(3,p),it.set(11,w),it.set(12,x),it.set(13,b),it.set(14,A),it.set(15,P),it.set(16,T),it.set(17,k),it.set(18,q),it.set(19,N),it.set(20,U),it.set(23,d),it.set(24,F),it.set(25,C),it.set(26,z),it.set(27,O),it.set(28,D),it.set(29,G),it.set(30,m),it.set(31,K),it.set(32,u),it.set(33,H),it.set(34,J),it.set(35,v),it.set(36,S),it.set(37,X),it.set(44,L),it.set(45,Q),it.set(46,V),it.set(53,h),it.set(64,y),it.set(65,E),it.set(76,Y),it.set(78,Y),ut.set(38,st),ut.set(39,Z),ut.set(40,tt),ut.set(41,rt),ut.set(42,$),ut.set(43,at),ut.set(47,_),ut.set(54,nt),ut.set(55,et),ut.set(58,lt),ut.set(66,st),ut.set(67,Z),ut.set(68,tt),ut.set(69,rt),ut.set(70,$),ut.set(71,at),ut.set(72,_),ut.set(73,nt),ut.set(74,et),ut.set(75,lt))}function gt(l,c,i={}){ht();let u=f(l,c>=66&&c<=75);const{outputPixelType:h="f32"}=i,g=!ut.has(c)||i.processAsMultiband,p=g?l[0].pixels.length:1,m=[];for(let f=0;f<p;f++){const i=ut.has(c)&&!g?l.flatMap((t=>t.pixels)):l.map((t=>t.pixels[f]));let p,d=!0;if(c===r.setNull){const t=W(i,u,h);p=t.band,u=t.mask,d=!1}else if(it.has(c)){p=it.get(c)(i,u,"f64")}else if(ct.has(c))p=c===e.asin||c===e.acos||c===e.atanh?M(i,u,"f64",c):B(i,u,"f64",ct.get(c));else if(ft.has(c))p=I(i,u,"f64",ft.get(c));else if(ut.has(c)){p=ut.get(c)(i,u,"f64")}else p=i[0],d=!1;if(d&&c!==n.isNull&&!a.has(c)){const e=t.createEmptyBand(h,p.length);u||(u=new Uint8Array(p.length).fill(255)),o(p,u),s(p,u,h,e),p=e}m.push(p)}const d=l[0];return new t({width:d.width,height:d.height,pixelType:h,mask:c===n.isNull?null:u,pixels:m})}function pt(t,e,n){return gt(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}export{pt as arithmetic,l as getOutputDomain,gt as local,c as operandsCount};
|
|
5
|
+
import t from"../PixelBlock.js";import{localTrigonometricOperation as e,localLogicalOperation as n,localConditionalOperation as r}from"../rasterFunctionConstants.js";import{fixNaN as o,clipBandToPixelTypeRange as s}from"../rasterFormats/pixelRangeUtils.js";const a=new Map([[e.acos,{domain:[0,Math.PI],isInteger:!1}],[e.asin,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[e.atan,{domain:[-Math.PI/2,Math.PI/2],isInteger:!1}],[e.cos,{domain:[-1,1],isInteger:!1}],[e.sin,{domain:[-1,1],isInteger:!1}],[n.booleanAnd,{domain:[0,1],isInteger:!0}],[n.booleanNot,{domain:[0,1],isInteger:!0}],[n.booleanOr,{domain:[0,1],isInteger:!0}],[n.booleanXOr,{domain:[0,1],isInteger:!0}],[n.equalTo,{domain:[0,1],isInteger:!0}],[n.notEqual,{domain:[0,1],isInteger:!0}],[n.greaterThan,{domain:[0,1],isInteger:!0}],[n.greaterThanEqual,{domain:[0,1],isInteger:!0}],[n.lessThan,{domain:[0,1],isInteger:!0}],[n.lessThanEqual,{domain:[0,1],isInteger:!0}],[n.isNull,{domain:[0,1],isInteger:!0}]]);function l(t){return a.get(t)}const c=[0,2,2,2,1,2,1,1,1,1,1,2,2,1,2,2,2,2,1,2,2,1,1,2,2,1,1,1,2,2,1,1,1,2,2,1,1,1,999,999,999,999,999,999,2,1,2,999,1,1,2,1,1,1,999,999,1,1,999,1,1,2,999,999,2,2,999,999,999,999,999,999,999,999,999,999,3,999,3];function f(t,e=!1){const n=t.map((t=>t.mask)),r=n.filter((t=>null!=t)),o=t[0].pixels[0].length;if(0===r.length||e&&r.length!==n.length)return new Uint8Array(o).fill(255);const s=r[0],a=new Uint8Array(s);if(1===r.length)return a;if(!e){for(let t=1;t<r.length;t++){const e=r[t];for(let t=0;t<a.length;t++)a[t]&&(a[t]=e[t]?255:0)}return a}for(let l=1;l<r.length;l++){const t=r[l];for(let e=0;e<a.length;e++)0===a[e]&&(a[e]=t[e]?255:0)}return a}function i(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]+s[t]);return l}function u(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand("f32",s);return a.set(o),a}function h(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=o[t]*o[t]);return a}function g(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]-s[t]);return l}function p(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]*s[t]);return l}function m(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=Math.sign(o[t])*Math.floor(Math.abs(o[t])));return a}function d(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]/s[t]);return l}function y(t,e,n){return d(t,e,"f32")}function E(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=Math.floor(o[t]/s[t]));return l}function M(n,r,o,s){const a=n[0],l=a.length,c=t.createEmptyBand(o,l);if(s===e.atanh){for(let t=0;t<l;t++)if(r[t]){const e=a[t];Math.abs(e)>=1?r[t]=0:c[t]=Math.atanh(e)}return c}const f=s===e.asin?Math.asin:Math.acos;for(let t=0;t<l;t++)if(r[t]){const e=a[t];Math.abs(e)>1?r[t]=0:c[t]=f(e)}return c}function B(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o(s[t]));return l}function I(e,n,r,o){const[s,a]=e,l=s.length,c=t.createEmptyBand(r,l);for(let t=0;t<l;t++)n&&!n[t]||(c[t]=o(s[t],a[t]));return c}function w(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]&s[t]);return l}function x(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<<s[t]);return l}function b(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=~o[t]);return a}function A(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]|s[t]);return l}function P(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>>s[t]);return l}function T(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]^s[t]);return l}function k(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]&&s[t]?1:0);return l}function q(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=o[t]?0:1);return a}function N(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]||s[t]?1:0);return l}function U(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=(o[t]?1:0)^(s[t]?1:0));return l}function F(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]===s[t]?1:0);return l}function j(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a),c=o===Math.E;for(let t=0;t<a;t++)n&&!n[t]||(l[t]=c?Math.exp(s[t]):o**s[t]);return l}function z(t,e,n){return j(t,e,n,10)}function O(t,e,n){return j(t,e,n,2)}function C(t,e,n){return j(t,e,n,Math.E)}function R(e,n,r,o){const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(s[t]<=0?n[t]=0:l[t]=o(s[t]));return l}function S(t,e,n){return R(t,e,n,Math.log10)}function X(t,e,n){return R(t,e,n,Math.log2)}function v(t,e,n){return R(t,e,n,Math.log)}function D(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>s[t]?1:0);return l}function G(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]>=s[t]?1:0);return l}function H(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<s[t]?1:0);return l}function J(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<=s[t]?1:0);return l}function K(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);if(!n)return a;for(let t=0;t<s;t++)a[t]=n[t]?0:1;return a}function L(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]%s[t]);return l}function Q(e,n,r){const[o]=e,s=o.length,a=t.createEmptyBand(r,s);for(let t=0;t<s;t++)n&&!n[t]||(a[t]=-o[t]);return a}function V(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]===s[t]?0:1);return l}function W(e,n,r){const[o,s]=e,a=o.length,l=t.createEmptyBand(r,a),c=new Uint8Array(a);for(let t=0;t<a;t++)null!=n&&!n[t]||0!==o[t]||(l[t]=s[t],c[t]=255);return{band:l,mask:c}}function Y(e,n,r){const[o,s,a]=e,l=o.length,c=t.createEmptyBand(r,l);for(let t=0;t<l;t++)n&&!n[t]||(c[t]=o[t]?s[t]:a[t]);return c}function Z(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t];for(let r=1;r<o;r++){const o=e[r][t];n<o&&(n=o)}l[t]=n}return l}function $(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t];for(let r=1;r<o;r++){const o=e[r][t];n>o&&(n=o)}l[t]=n}return l}function _(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=s[t],r=n;for(let s=1;s<o;s++){const o=e[s][t];r<o?r=o:n>o&&(n=o)}l[t]=r-n}return l}function tt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){let n=0;for(let r=0;r<o;r++)n+=e[r][t];l[t]=n/o}return l}function et(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t])for(let n=0;n<o;n++){const r=e[n];l[t]+=r[t]}return l}function nt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)if(!n||n[t]){const n=new Float32Array(o);let r=0;for(let a=0;a<o;a++){const o=e[a];r+=o[t],n[a]=o[t]}r/=o;let s=0;for(let t=0;t<o;t++)s+=(n[t]-r)**2;l[t]=Math.sqrt(s/o)}return l}function rt(e,n,r){const o=e.length;if(o<2)return e[0];const s=Math.floor(o/2),[a]=e,l=a.length,c=t.createEmptyBand(r,l),f=new Float32Array(o),i=o%2==1;for(let t=0;t<l;t++)if(!n||n[t]){for(let n=0;n<o;n++)f[n]=e[n][t];f.sort(),c[t]=i?f[s]:(f[s]+f[s-1])/2}return c}function ot(e,n,r){const[o,s]=e;if(null==s)return o;const a=o.length,l=t.createEmptyBand(r,a);for(let t=0;t<a;t++)n&&!n[t]||(l[t]=o[t]<s[t]?o[t]:s[t]);return l}function st(e,n,r){const o=e.length;if(o<=2)return ot(e,n,r);const s=e[0].length,a=t.createEmptyBand(r,s),l=new Map;for(let t=0;t<s;t++)if(!n||n[t]){l.clear();for(let a=0;a<o;a++){const n=e[a][t];l.set(n,l.has(n)?l.get(n)+1:1)}let n=0,r=0;const s=[];for(const t of l.keys())n=l.get(t),n>r?(r=n,s.length=0,s.push(t)):n===r&&s.push(t);s.length>1&&s.sort(((t,e)=>t-e)),a[t]=s[0]}return a}function at(e,n,r){const o=e.length;if(o<=2)return ot(e,n,r);const s=e[0].length,a=t.createEmptyBand(r,s),l=new Map;for(let t=0;t<s;t++)if(!n||n[t]){l.clear();for(let a=0;a<o;a++){const n=e[a][t];l.set(n,l.has(n)?l.get(n)+1:1)}let n=0,r=e.length;const s=[];for(const t of l.keys())n=l.get(t),n<r?(r=n,s.length=0,s.push(t)):n===r&&s.push(t);s.length>1&&s.sort(((t,e)=>t-e)),a[t]=s[0]}return a}function lt(e,n,r){const o=e.length;if(o<2)return e[0];const[s]=e,a=s.length,l=t.createEmptyBand(r,a),c=new Set;for(let t=0;t<a;t++)if(!n||n[t]){let n;c.clear();for(let r=0;r<o;r++)n=e[r][t],c.add(n);l[t]=c.size}return l}const ct=new Map,ft=new Map,it=new Map,ut=new Map;function ht(){ct.size||(ct.set(4,Math.sqrt),ct.set(6,Math.acos),ct.set(7,Math.asin),ct.set(8,Math.atan),ct.set(9,Math.atanh),ct.set(10,Math.abs),ct.set(21,Math.cos),ct.set(22,Math.cosh),ct.set(48,Math.floor),ct.set(49,Math.ceil),ct.set(51,Math.sin),ct.set(52,Math.sinh),ct.set(56,Math.tan),ct.set(57,Math.tanh),ct.set(59,Math.acosh),ct.set(60,Math.asinh),ct.set(65,Math.floor),ft.set(5,Math.pow),ft.set(61,Math.atan2),it.set(1,i),it.set(2,g),it.set(3,p),it.set(11,w),it.set(12,x),it.set(13,b),it.set(14,A),it.set(15,P),it.set(16,T),it.set(17,k),it.set(18,q),it.set(19,N),it.set(20,U),it.set(23,d),it.set(24,F),it.set(25,C),it.set(26,z),it.set(27,O),it.set(28,D),it.set(29,G),it.set(30,m),it.set(31,K),it.set(32,u),it.set(33,H),it.set(34,J),it.set(35,v),it.set(36,S),it.set(37,X),it.set(44,L),it.set(45,Q),it.set(46,V),it.set(53,h),it.set(64,y),it.set(65,E),it.set(76,Y),it.set(78,Y),ut.set(38,st),ut.set(39,Z),ut.set(40,tt),ut.set(41,rt),ut.set(42,$),ut.set(43,at),ut.set(47,_),ut.set(54,nt),ut.set(55,et),ut.set(58,lt),ut.set(66,st),ut.set(67,Z),ut.set(68,tt),ut.set(69,rt),ut.set(70,$),ut.set(71,at),ut.set(72,_),ut.set(73,nt),ut.set(74,et),ut.set(75,lt))}function gt(l,c,i={}){ht();let u=f(l,c>=66&&c<=75);const{outputPixelType:h="f32"}=i,g=!ut.has(c)||i.processAsMultiband,p=g?l[0].pixels.length:1,m=[];for(let f=0;f<p;f++){const i=ut.has(c)&&!g?l.flatMap((t=>t.pixels)):l.map((t=>t.pixels[f]));let p,d=!0;if(c===r.setNull){const t=W(i,u,h);p=t.band,u=t.mask,d=!1}else if(it.has(c)){p=it.get(c)(i,u,"f64")}else if(ct.has(c))p=c===e.asin||c===e.acos||c===e.atanh?M(i,u,"f64",c):B(i,u,"f64",ct.get(c));else if(ft.has(c))p=I(i,u,"f64",ft.get(c));else if(ut.has(c)){p=ut.get(c)(i,u,"f64")}else p=i[0],d=!1;if(d&&c!==n.isNull&&!a.has(c)){const e=t.createEmptyBand(h,p.length);u||(u=new Uint8Array(p.length).fill(255)),o(p,u),s(p,u,h,e),p=e}m.push(p)}const d=l[0];return new t({width:d.width,height:d.height,pixelType:h,mask:c===n.isNull?null:u,pixels:m})}function pt(t,e,n){return gt(t,e=[null,1,2,3,23,5,44][e]??1,{outputPixelType:n})}export{pt as arithmetic,l as getOutputDomain,gt as local,c as operandsCount};
|
package/libs/parquet/parquet.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getAssetUrl as e}from"../../assets.js";import t from"../../request.js";let n;const _=new Array(128).fill(void 0);function r(e){return _[e]}_.push(void 0,null,!0,!1);let i=_.length;function o(e){e<132||(_[e]=i,i=e)}function a(e){const t=r(e);return o(e),t}function s(e){i===_.length&&_.push(_.length+1);const t=i;return i=_[t],_[t]=e,t}const d="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&d.decode();let g=null;function c(){return null!==g&&0!==g.byteLength||(g=new Uint8Array(n.memory.buffer)),g}function u(e,t){return e>>>=0,d.decode(c().subarray(e,e+t))}function l(e,t){return e>>>=0,c().subarray(e/1,e/1+t)}const w="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>{n.__wbindgen_export_1.get(e.dtor)(e.a,e.b)}));function b(e,t,_,r){const i={a:e,b:t,cnt:1,dtor:_},o=(...e)=>{i.cnt++;const t=i.a;i.a=0;try{return r(t,i.b,...e)}finally{0==--i.cnt?(n.__wbindgen_export_1.get(i.dtor)(t,i.b),w.unregister(i)):i.a=t}};return o.original=i,w.register(o,i,i),o}function p(e,t,_){n._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h976f7baa817b77e0(e,t,s(_))}function f(){n.enable_tracing()}let y=0;const h="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},m="function"==typeof h.encodeInto?function(e,t){return h.encodeInto(e,t)}:function(e,t){const n=h.encode(e);return t.set(n),{read:e.length,written:n.length}};function k(e,t,n){if(void 0===n){const n=h.encode(e),_=t(n.length,1)>>>0;return c().subarray(_,_+n.length).set(n),y=n.length,_}let _=e.length,r=t(_,1)>>>0;const i=c();let o=0;for(;o<_;o++){const t=e.charCodeAt(o);if(t>127)break;i[r+o]=t}if(o!==_){0!==o&&(e=e.slice(o)),r=n(r,_,_=o+3*e.length,1)>>>0;const t=c().subarray(r+o,r+_);o+=m(e,t).written,r=n(r,_,o,1)>>>0}return y=o,r}let I=null;function F(){return(null===I||!0===I.buffer.detached||void 0===I.buffer.detached&&I.buffer!==n.memory.buffer)&&(I=new DataView(n.memory.buffer)),I}function v(e,t){try{return e.apply(this,t)}catch(_){n.__wbindgen_exn_store(s(_))}}function x(e,t,_,r){n.wasm_bindgen__convert__closures__invoke2_mut__h942ec15236fcac1d(e,t,s(_),s(r))}let T=null;function q(){return null!==T&&0!==T.byteLength||(T=new Float64Array(n.memory.buffer)),T}function R(e,t){return e>>>=0,q().subarray(e/8,e/8+t)}let z=null;function M(){return null!==z&&0!==z.byteLength||(z=new Uint32Array(n.memory.buffer)),z}function O(e,t){return e>>>=0,M().subarray(e/4,e/4+t)}function j(e,t){e>>>=0;const n=F(),_=[];for(let r=e;r<e+4*t;r+=4)_.push(a(n.getUint32(r,!0)));return _}let C=null;function A(){return null!==C&&0!==C.byteLength||(C=new Uint16Array(n.memory.buffer)),C}function W(e,t){const n=t(2*e.length,2)>>>0;return A().set(e,n/2),y=e.length,n}function S(e,t,_){const r=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),i=y;return a(n.readMetadata(r,i,s(t),s(_)))}function B(e,t){const n=t(1*e.length,1)>>>0;return c().set(e,n/1),y=e.length,n}function D(e){const t=B(e,n.__wbindgen_malloc),_=y;return a(n.readMetadataFromFile(t,_))}function U(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`);return e.ptr}function E(e){return null==e}function L(e,t,_,r,i){const o=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),d=y;U(r,J);var g=r.__destroy_into_raw();let c=0;E(i)||(U(i,H),c=i.__destroy_into_raw());return a(n.readFile(o,d,s(t),s(_),g,c))}function P(e,t){let _=0;E(e)||(U(e,H),_=e.__destroy_into_raw());const r=B(t,n.__wbindgen_malloc),i=y;return a(n.readFileFromBinary(_,r,i))}const G=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],V="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_columndescriptor_free(e>>>0,1)));class X{static __wrap(e){e>>>=0;const t=Object.create(X.prototype);return t.__wbg_ptr=e,V.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,V.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_columndescriptor_free(e,0)}name(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_name(i,this.__wbg_ptr);var _=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return e=_,t=r,u(_,r)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}physicalType(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_physicalType(i,this.__wbg_ptr);var _=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return e=_,t=r,u(_,r)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}logicalType(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_logicalType(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0);let r;return 0!==e&&(r=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}encodings(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_encodings(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0),_=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}pageEncodings(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_pageEncodings(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0);let r;return 0!==e&&(r=j(e,t).slice(),n.__wbindgen_free(e,4*t,4)),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}numValues(){return n.columndescriptor_numValues(this.__wbg_ptr)}compression(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_compression(i,this.__wbg_ptr);var _=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return e=_,t=r,u(_,r)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}compressedSize(){return n.columndescriptor_compressedSize(this.__wbg_ptr)}uncompressedSize(){return n.columndescriptor_uncompressedSize(this.__wbg_ptr)}nullCount(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_nullCount(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getBigInt64(_+8,!0);return 0===e?void 0:t}finally{n.__wbindgen_add_to_stack_pointer(16)}}distinctCount(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_distinctCount(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getBigInt64(_+8,!0);return 0===e?void 0:t}finally{n.__wbindgen_add_to_stack_pointer(16)}}minValue(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_minValue(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0);let r;return 0!==e&&(r=l(e,t).slice(),n.__wbindgen_free(e,1*t,1)),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}maxValue(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_maxValue(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0);let r;return 0!==e&&(r=l(e,t).slice(),n.__wbindgen_free(e,1*t,1)),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}}const Y="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_fieldmetadata_free(e>>>0,1)));class N{static __wrap(e){e>>>=0;const t=Object.create(N.prototype);return t.__wbg_ptr=e,Y.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_fieldmetadata_free(e,0)}get name(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.fieldmetadata_name(i,this.__wbg_ptr);var _=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return e=_,t=r,u(_,r)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}get index(){return n.fieldmetadata_index(this.__wbg_ptr)}get type(){const e=n.fieldmetadata_esri_type(this.__wbg_ptr);return G[e]}get physicalType(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.fieldmetadata_physical_type(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0);let r;return 0!==e&&(r=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}get logicalType(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.fieldmetadata_logical_type(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0);let r;return 0!==e&&(r=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}}const $="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_filemetadata_free(e>>>0,1)));class J{static __wrap(e){e>>>=0;const t=Object.create(J.prototype);return t.__wbg_ptr=e,$.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,$.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_filemetadata_free(e,0)}version(){return n.filemetadata_version(this.__wbg_ptr)}numRows(){return n.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return n.filemetadata_numFields(this.__wbg_ptr)>>>0}createdBy(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.filemetadata_createdBy(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0);let r;return 0!==e&&(r=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}keyValueMetadata(e){try{const r=n.__wbindgen_add_to_stack_pointer(-16),i=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),o=y;n.filemetadata_keyValueMetadata(r,this.__wbg_ptr,i,o);var t=F().getInt32(r+0,!0),_=F().getInt32(r+4,!0);let a;return 0!==t&&(a=u(t,_).slice(),n.__wbindgen_free(t,1*_,1)),a}finally{n.__wbindgen_add_to_stack_pointer(16)}}keys(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.filemetadata_keys(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0);let r;return 0!==e&&(r=j(e,t).slice(),n.__wbindgen_free(e,4*t,4)),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(e){const t=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),_=y,r=n.filemetadata_getFieldIndex(this.__wbg_ptr,t,_);return 16777215===r?void 0:r}getFieldByIndex(e){const t=n.filemetadata_getFieldByIndex(this.__wbg_ptr,e);return 0===t?void 0:N.__wrap(t)}getFields(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.filemetadata_getFields(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0),_=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}}const Q="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_geometryinfodescriptor_free(e>>>0,1)));class H{static __wrap(e){e>>>=0;const t=Object.create(H.prototype);return t.__wbg_ptr=e,Q.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Q.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_geometryinfodescriptor_free(e,0)}get wkbIndex(){const e=n.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set wkbIndex(e){n.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,E(e)?16777215:e)}get lngIndex(){const e=n.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set lngIndex(e){n.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,E(e)?16777215:e)}get latIndex(){const e=n.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set latIndex(e){n.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,E(e)?16777215:e)}get inWkid(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.__wbg_get_geometryinfodescriptor_inWkid(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0);return 0===e?void 0:t>>>0}finally{n.__wbindgen_add_to_stack_pointer(16)}}set inWkid(e){n.__wbg_set_geometryinfodescriptor_inWkid(this.__wbg_ptr,!E(e),E(e)?0:e)}get outWkid(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.__wbg_get_geometryinfodescriptor_outWkid(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0);return 0===e?void 0:t>>>0}finally{n.__wbindgen_add_to_stack_pointer(16)}}set outWkid(e){n.__wbg_set_geometryinfodescriptor_outWkid(this.__wbg_ptr,!E(e),E(e)?0:e)}static new(){const e=n.geometryinfodescriptor_new();return H.__wrap(e)}}const K="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_pageencodingdescriptor_free(e>>>0,1)));class Z{static __wrap(e){e>>>=0;const t=Object.create(Z.prototype);return t.__wbg_ptr=e,K.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_pageencodingdescriptor_free(e,0)}pageType(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.pageencodingdescriptor_pageType(i,this.__wbg_ptr);var _=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return e=_,t=r,u(_,r)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}encoding(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.pageencodingdescriptor_encoding(i,this.__wbg_ptr);var _=F().getInt32(i+0,!0),r=F().getInt32(i+4,!0);return e=_,t=r,u(_,r)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}count(){return n.pageencodingdescriptor_count(this.__wbg_ptr)}}const ee="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_parquetchunk_free(e>>>0,1)));class te{static __wrap(e){e>>>=0;const t=Object.create(te.prototype);return t.__wbg_ptr=e,ee.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ee.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_parquetchunk_free(e,0)}size(){return n.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(e){return 0!==n.parquetchunk_hasField(this.__wbg_ptr,e)}readX(e){return n.parquetchunk_readX(this.__wbg_ptr,e)}readY(e){return n.parquetchunk_readY(this.__wbg_ptr,e)}readCoords(e){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.parquetchunk_readCoords(r,this.__wbg_ptr,e);var t=F().getInt32(r+0,!0),_=F().getInt32(r+4,!0);let i;return 0!==t&&(i=R(t,_).slice(),n.__wbindgen_free(t,8*_,8)),i}finally{n.__wbindgen_add_to_stack_pointer(16)}}readLengths(e){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.parquetchunk_readLengths(r,this.__wbg_ptr,e);var t=F().getInt32(r+0,!0),_=F().getInt32(r+4,!0);let i;return 0!==t&&(i=O(t,_).slice(),n.__wbindgen_free(t,4*_,4)),i}finally{n.__wbindgen_add_to_stack_pointer(16)}}readGeometryTransformed(e,t,_,r,i){const o=n.parquetchunk_readGeometryTransformed(this.__wbg_ptr,e,t,_,r,i);return 0===o?void 0:ie.__wrap(o)}boundsXMin(e){return n.parquetchunk_boundsXMin(this.__wbg_ptr,e)}boundsYMin(e){return n.parquetchunk_boundsYMin(this.__wbg_ptr,e)}boundsXMax(e){return n.parquetchunk_boundsXMax(this.__wbg_ptr,e)}boundsYMax(e){return n.parquetchunk_boundsYMax(this.__wbg_ptr,e)}readAttribute(e,t){return a(n.parquetchunk_readAttribute(this.__wbg_ptr,e,t))}}const ne="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_parquetfile_free(e>>>0,1)));let _e=class e{static __wrap(t){t>>>=0;const n=Object.create(e.prototype);return n.__wbg_ptr=t,ne.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ne.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_parquetfile_free(e,0)}metadata(){const e=n.parquetfile_metadata(this.__wbg_ptr);return J.__wrap(e)}rowGroups(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.parquetfile_rowGroups(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0),_=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}readChunksWithCallback(e,t){const _=W(e,n.__wbindgen_malloc),r=y;return a(n.parquetfile_readChunksWithCallback(this.__wbg_ptr,_,r,s(t)))}readFirstChunk(e){const t=W(e,n.__wbindgen_malloc),_=y;return a(n.parquetfile_readFirstChunk(this.__wbg_ptr,t,_))}readAllChunks(e){const t=W(e,n.__wbindgen_malloc),_=y;return a(n.parquetfile_readAllChunks(this.__wbg_ptr,t,_))}updateChunks(e){const t=W(e,n.__wbindgen_malloc),_=y;return a(n.parquetfile_updateChunks(this.__wbg_ptr,t,_))}};const re="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_quantizedgeometry_free(e>>>0,1)));class ie{static __wrap(e){e>>>=0;const t=Object.create(ie.prototype);return t.__wbg_ptr=e,re.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,re.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_quantizedgeometry_free(e,0)}readCoordsUnsafe(){return a(n.quantizedgeometry_readCoordsUnsafe(this.__wbg_ptr))}readLengthsUnsafe(){return a(n.quantizedgeometry_readLengthsUnsafe(this.__wbg_ptr))}}const oe="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_rangeproviderjs_free(e>>>0,1)));class ae{static __wrap(e){e>>>=0;const t=Object.create(ae.prototype);return t.__wbg_ptr=e,oe.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,oe.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_rangeproviderjs_free(e,0)}static new(e,t){const _=n.rangeproviderjs_new(s(e),s(t));return ae.__wrap(_)}static withFetch(){const e=n.rangeproviderjs_withFetch();return ae.__wrap(e)}}const se="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_rowgroup_free(e>>>0,1)));class de{static __wrap(e){e>>>=0;const t=Object.create(de.prototype);return t.__wbg_ptr=e,se.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,se.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_rowgroup_free(e,0)}columns(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.rowgroup_columns(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0),_=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}}async function ge(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(n){if("application/wasm"==e.headers.get("Content-Type"))throw n;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n)}const _=await e.arrayBuffer();return await WebAssembly.instantiate(_,t)}{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function ce(){const e={wbg:{}};return e.wbg.__wbg_new_abda76e883ba8a5f=function(){return s(new Error)},e.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const _=k(r(t).stack,n.__wbindgen_malloc,n.__wbindgen_realloc),i=y;F().setInt32(e+4,i,!0),F().setInt32(e+0,_,!0)},e.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let _,r;try{_=e,r=t,console.error(u(e,t))}finally{n.__wbindgen_free(_,r,1)}},e.wbg.__wbindgen_object_drop_ref=function(e){a(e)},e.wbg.__wbindgen_is_function=function(e){return"function"==typeof r(e)},e.wbg.__wbg_self_3093d5d1f7bcb682=function(){return v((function(){return s(self.self)}),arguments)},e.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return v((function(){return s(window.window)}),arguments)},e.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return v((function(){return s(globalThis.globalThis)}),arguments)},e.wbg.__wbg_global_e5a3fe56f8be9485=function(){return v((function(){return s(global.global)}),arguments)},e.wbg.__wbindgen_is_undefined=function(e){return void 0===r(e)},e.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){return s(new Function(u(e,t)))},e.wbg.__wbindgen_object_clone_ref=function(e){return s(r(e))},e.wbg.__wbindgen_number_new=function(e){return s(e)},e.wbg.__wbindgen_string_new=function(e,t){return s(u(e,t))},e.wbg.__wbg_call_1084a111329e68ce=function(){return v((function(e,t){return s(r(e).call(r(t)))}),arguments)},e.wbg.__wbg_call_89af060b4e1523f2=function(){return v((function(e,t,n){return s(r(e).call(r(t),r(n)))}),arguments)},e.wbg.__wbg_call_7de908392845a9a5=function(){return v((function(e,t,n,_,i){return s(r(e).call(r(t),r(n),r(_),r(i)))}),arguments)},e.wbg.__wbg_valueOf_563b3487b1b116aa=function(e){return r(e).valueOf()},e.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){return s(r(e).buffer)},e.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var n={a:e,b:t},_=(e,t)=>{const _=n.a;n.a=0;try{return x(_,n.b,e,t)}finally{n.a=_}};return s(new Promise(_))}finally{n.a=n.b=0}},e.wbg.__wbg_resolve_570458cb99d56a43=function(e){return s(Promise.resolve(r(e)))},e.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){return s(r(e).then(r(t)))},e.wbg.__wbg_then_876bb3c633745cc6=function(e,t,n){return s(r(e).then(r(t),r(n)))},e.wbg.__wbg_newwithbyteoffsetandlength_b5293b0eedbac651=function(e,t,n){return s(new Int16Array(r(e),t>>>0,n>>>0))},e.wbg.__wbg_new_ea1883e1e5e86686=function(e){return s(new Uint8Array(r(e)))},e.wbg.__wbg_newwithbyteoffsetandlength_874df3e29cb555f9=function(e,t,n){return s(new Uint32Array(r(e),t>>>0,n>>>0))},e.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return r(e).length},e.wbg.__wbg_set_d1e79e2388520f18=function(e,t,n){r(e).set(r(t),n>>>0)},e.wbg.__wbindgen_throw=function(e,t){throw new Error(u(e,t))},e.wbg.__wbindgen_memory=function(){return s(n.memory)},e.wbg.__wbindgen_array_new=function(){return s([])},e.wbg.__wbindgen_array_push=function(e,t){r(e).push(a(t))},e.wbg.__wbindgen_uint8_array_new=function(e,t){var _=l(e,t).slice();n.__wbindgen_free(e,1*t,1);return s(_)},e.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){return s(r(e).queueMicrotask)},e.wbg.__wbindgen_cb_drop=function(e){const t=a(e).original;if(1==t.cnt--)return t.a=0,!0;return!1},e.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(r(e))},e.wbg.__wbg_parquetchunk_new=function(e){return s(te.__wrap(e))},e.wbg.__wbg_parquetfile_new=function(e){return s(_e.__wrap(e))},e.wbg.__wbg_filemetadata_new=function(e){return s(J.__wrap(e))},e.wbg.__wbg_fieldmetadata_new=function(e){return s(N.__wrap(e))},e.wbg.__wbg_rowgroup_new=function(e){return s(de.__wrap(e))},e.wbg.__wbg_columndescriptor_new=function(e){return s(X.__wrap(e))},e.wbg.__wbg_pageencodingdescriptor_new=function(e){return s(Z.__wrap(e))},e.wbg.__wbindgen_closure_wrapper1459=function(e,t,n){return s(b(e,t,75,p))},e}function ue(e,t){return n=e.exports,we.__wbindgen_wasm_module=t,I=null,T=null,C=null,z=null,g=null,n.__wbindgen_start(),n}function le(e){if(void 0!==n)return n;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module:e}=e):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const t=ce();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));return ue(new WebAssembly.Instance(e,t),e)}async function we(e){if(void 0!==n)return n;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module_or_path:e}=e):console.warn("using deprecated parameters for the initialization function; pass a single object instead"));const t=ce();("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));const{instance:_,module:r}=await ge(await e,t);return ue(_,r)}const be=Object.freeze(Object.defineProperty({__proto__:null,ColumnDescriptor:X,FieldMetadata:N,FileMetadata:J,GeometryInfoDescriptor:H,PageEncodingDescriptor:Z,ParquetChunk:te,ParquetFile:_e,QuantizedGeometry:ie,RangeProviderJs:ae,RowGroup:de,default:we,enable_tracing:f,initSync:le,readFile:L,readFileFromBinary:P,readMetadata:S,readMetadataFromFile:D},Symbol.toStringTag,{value:"Module"}));let pe=null;async function fe(){return pe||(pe=ye()),pe}async function ye(){const t=await Promise.resolve().then((()=>be));return await t.default({module_or_path:e("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),t}const he=e=>async function(n,_,r){const i=e(),{data:o}=await t(n,{responseType:"array-buffer",query:i,headers:{range:`bytes=${_}-${r}`}});return o},me=e=>async function(n){const _=e(),{data:r}=await t(n,{responseType:"native",method:"head",query:_}),i=r.headers.get("Content-Length");if(null==i)throw new Error("Unable to parse content length");return parseInt(i,10)};class ke{static async create(e,t){const n=await fe(),_=await n.readMetadata(e,he(t),me(t));return ke.fromFileMetadata(_)}static fromFileMetadata(e){const t=[];for(let n=0;n<e.numFields();n++){const _=e.getFieldByIndex(n);t.push({name:_.name,type:_.type,alias:_.name,index:_.index}),_.free()}return new ke(e,t)}constructor(e,t){this._inner=e,this.fields=t}destroy(){this._inner.free()}[Symbol.dispose](){this.destroy()}get size(){return this._inner.numRows()}getFieldIndex(e){return this._inner.getFieldIndex(e)}tryReadGeoMetadata(){const e=this._inner.keyValueMetadata("geo");return null==e?null:JSON.parse(e)}}function Ie(e,t,n){const _=H.new();return"location"===e.type?(_.latIndex=t.getFieldIndex(e.latitudeFieldName),_.lngIndex=t.getFieldIndex(e.longitudeFieldName)):_.wkbIndex=t.getFieldIndex(e.primaryFieldName),_.inWkid=e.spatialReference.wkid,n&&(_.outWkid=n.wkid),_}class Fe{static async create(e,t){const n=await fe(),_=he(t.getCustomParameters),r=me(t.getCustomParameters),i=await S(e,_,r),o=Ie(t.geometryInfo,i,t.outSpatialReference),a=await n.readFile(e,_,r,i,o);return new Fe(a,ke.fromFileMetadata(a.metadata()))}static async fromFile(e,t,n){const _=await fe(),r=await _.readMetadataFromFile(e),i=t?Ie(t,r,n):void 0,o=await _.readFileFromBinary(i,e);return new Fe(o,ke.fromFileMetadata(o.metadata()))}constructor(e,t){this.inner=e,this.metadata=t}destroy(){this.inner.free(),this.metadata.destroy()}[Symbol.dispose](){this.destroy()}}export{Fe as ParquetFile,ke as ParquetMetadata};
|
|
5
|
+
import{getAssetUrl as e}from"../../assets.js";import t from"../../request.js";let n;const r=new Array(128).fill(void 0);function _(e){return r[e]}r.push(void 0,null,!0,!1);let i=r.length;function o(e){e<132||(r[e]=i,i=e)}function a(e){const t=_(e);return o(e),t}function s(e){i===r.length&&r.push(r.length+1);const t=i;return i=r[t],r[t]=e,t}const d="undefined"!=typeof TextDecoder?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};"undefined"!=typeof TextDecoder&&d.decode();let g=null;function c(){return null!==g&&0!==g.byteLength||(g=new Uint8Array(n.memory.buffer)),g}function u(e,t){return e>>>=0,d.decode(c().subarray(e,e+t))}function l(e,t){return e>>>=0,c().subarray(e/1,e/1+t)}const w="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>{n.__wbindgen_export_1.get(e.dtor)(e.a,e.b)}));function b(e,t,r,_){const i={a:e,b:t,cnt:1,dtor:r},o=(...e)=>{i.cnt++;const t=i.a;i.a=0;try{return _(t,i.b,...e)}finally{0==--i.cnt?(n.__wbindgen_export_1.get(i.dtor)(t,i.b),w.unregister(i)):i.a=t}};return o.original=i,w.register(o,i,i),o}function p(e,t,r){n._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h976f7baa817b77e0(e,t,s(r))}function f(){n.enable_tracing()}let y=0;const h="undefined"!=typeof TextEncoder?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},m="function"==typeof h.encodeInto?function(e,t){return h.encodeInto(e,t)}:function(e,t){const n=h.encode(e);return t.set(n),{read:e.length,written:n.length}};function k(e,t,n){if(void 0===n){const n=h.encode(e),r=t(n.length,1)>>>0;return c().subarray(r,r+n.length).set(n),y=n.length,r}let r=e.length,_=t(r,1)>>>0;const i=c();let o=0;for(;o<r;o++){const t=e.charCodeAt(o);if(t>127)break;i[_+o]=t}if(o!==r){0!==o&&(e=e.slice(o)),_=n(_,r,r=o+3*e.length,1)>>>0;const t=c().subarray(_+o,_+r);o+=m(e,t).written,_=n(_,r,o,1)>>>0}return y=o,_}let I=null;function F(){return(null===I||!0===I.buffer.detached||void 0===I.buffer.detached&&I.buffer!==n.memory.buffer)&&(I=new DataView(n.memory.buffer)),I}function v(e,t){try{return e.apply(this,t)}catch(r){n.__wbindgen_exn_store(s(r))}}function T(e,t,r,_){n.wasm_bindgen__convert__closures__invoke2_mut__h942ec15236fcac1d(e,t,s(r),s(_))}let x=null;function q(){return null!==x&&0!==x.byteLength||(x=new Float64Array(n.memory.buffer)),x}function M(e,t){return e>>>=0,q().subarray(e/8,e/8+t)}let R=null;function z(){return null!==R&&0!==R.byteLength||(R=new Uint32Array(n.memory.buffer)),R}function O(e,t){return e>>>=0,z().subarray(e/4,e/4+t)}function j(e,t){e>>>=0;const n=F(),r=[];for(let _=e;_<e+4*t;_+=4)r.push(a(n.getUint32(_,!0)));return r}let C=null;function A(){return null!==C&&0!==C.byteLength||(C=new Uint16Array(n.memory.buffer)),C}function P(e,t){const n=t(2*e.length,2)>>>0;return A().set(e,n/2),y=e.length,n}function W(e,t,r){const _=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),i=y;return a(n.readMetadata(_,i,s(t),s(r)))}function S(e,t){const n=t(1*e.length,1)>>>0;return c().set(e,n/1),y=e.length,n}function G(e){const t=S(e,n.__wbindgen_malloc),r=y;return a(n.readMetadataFromFile(t,r))}function E(e,t){if(!(e instanceof t))throw new Error(`expected instance of ${t.name}`);return e.ptr}function B(e){return null==e}function D(e,t,r,_,i){const o=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),d=y;E(_,Q);var g=_.__destroy_into_raw();let c=0;B(i)||(E(i,K),c=i.__destroy_into_raw());return a(n.readFile(o,d,s(t),s(r),g,c))}function U(e,t){let r=0;B(e)||(E(e,K),r=e.__destroy_into_raw());const _=S(t,n.__wbindgen_malloc),i=y;return a(n.readFileFromBinary(r,_,i))}const L=Object.freeze({Point:0,0:"Point",Polygon:1,1:"Polygon",Polyline:2,2:"Polyline",Multipoint:3,3:"Multipoint"}),V=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeBigInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML","esriFieldTypeDateOnly","esriFieldTypeTimeOnly","esriFieldTypeTimestampOffset"],X="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_columndescriptor_free(e>>>0,1)));class Y{static __wrap(e){e>>>=0;const t=Object.create(Y.prototype);return t.__wbg_ptr=e,X.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,X.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_columndescriptor_free(e,0)}name(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_name(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}physicalType(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_physicalType(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}logicalType(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_logicalType(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}encodings(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_encodings(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0),r=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}pageEncodings(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_pageEncodings(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=j(e,t).slice(),n.__wbindgen_free(e,4*t,4)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}numValues(){return n.columndescriptor_numValues(this.__wbg_ptr)}compression(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_compression(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}compressedSize(){return n.columndescriptor_compressedSize(this.__wbg_ptr)}uncompressedSize(){return n.columndescriptor_uncompressedSize(this.__wbg_ptr)}nullCount(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_nullCount(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getBigInt64(r+8,!0);return 0===e?void 0:t}finally{n.__wbindgen_add_to_stack_pointer(16)}}distinctCount(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_distinctCount(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getBigInt64(r+8,!0);return 0===e?void 0:t}finally{n.__wbindgen_add_to_stack_pointer(16)}}minValue(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_minValue(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=l(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}maxValue(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.columndescriptor_maxValue(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=l(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}}const N="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_fieldmetadata_free(e>>>0,1)));class ${static __wrap(e){e>>>=0;const t=Object.create($.prototype);return t.__wbg_ptr=e,N.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,N.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_fieldmetadata_free(e,0)}get name(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.fieldmetadata_name(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}get index(){return n.fieldmetadata_index(this.__wbg_ptr)}get type(){const e=n.fieldmetadata_esri_type(this.__wbg_ptr);return V[e]}get physicalType(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.fieldmetadata_physical_type(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}get logicalType(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.fieldmetadata_logical_type(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}}const J="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_filemetadata_free(e>>>0,1)));class Q{static __wrap(e){e>>>=0;const t=Object.create(Q.prototype);return t.__wbg_ptr=e,J.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,J.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_filemetadata_free(e,0)}version(){return n.filemetadata_version(this.__wbg_ptr)}numRows(){return n.filemetadata_numRows(this.__wbg_ptr)>>>0}numFields(){return n.filemetadata_numFields(this.__wbg_ptr)>>>0}createdBy(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.filemetadata_createdBy(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=u(e,t).slice(),n.__wbindgen_free(e,1*t,1)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}keyValueMetadata(e){try{const _=n.__wbindgen_add_to_stack_pointer(-16),i=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),o=y;n.filemetadata_keyValueMetadata(_,this.__wbg_ptr,i,o);var t=F().getInt32(_+0,!0),r=F().getInt32(_+4,!0);let a;return 0!==t&&(a=u(t,r).slice(),n.__wbindgen_free(t,1*r,1)),a}finally{n.__wbindgen_add_to_stack_pointer(16)}}keys(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.filemetadata_keys(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);let _;return 0!==e&&(_=j(e,t).slice(),n.__wbindgen_free(e,4*t,4)),_}finally{n.__wbindgen_add_to_stack_pointer(16)}}getFieldIndex(e){const t=k(e,n.__wbindgen_malloc,n.__wbindgen_realloc),r=y,_=n.filemetadata_getFieldIndex(this.__wbg_ptr,t,r);return 16777215===_?void 0:_}getFieldByIndex(e){const t=n.filemetadata_getFieldByIndex(this.__wbg_ptr,e);return 0===t?void 0:$.__wrap(t)}getFields(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.filemetadata_getFields(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0),r=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}}const H="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_geometryinfodescriptor_free(e>>>0,1)));class K{static __wrap(e){e>>>=0;const t=Object.create(K.prototype);return t.__wbg_ptr=e,H.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_geometryinfodescriptor_free(e,0)}get geometryType(){const e=n.__wbg_get_geometryinfodescriptor_geometryType(this.__wbg_ptr);return 4===e?void 0:e}set geometryType(e){n.__wbg_set_geometryinfodescriptor_geometryType(this.__wbg_ptr,B(e)?4:e)}get wkbIndex(){const e=n.__wbg_get_geometryinfodescriptor_wkbIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set wkbIndex(e){n.__wbg_set_geometryinfodescriptor_wkbIndex(this.__wbg_ptr,B(e)?16777215:e)}get lngIndex(){const e=n.__wbg_get_geometryinfodescriptor_lngIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set lngIndex(e){n.__wbg_set_geometryinfodescriptor_lngIndex(this.__wbg_ptr,B(e)?16777215:e)}get latIndex(){const e=n.__wbg_get_geometryinfodescriptor_latIndex(this.__wbg_ptr);return 16777215===e?void 0:e}set latIndex(e){n.__wbg_set_geometryinfodescriptor_latIndex(this.__wbg_ptr,B(e)?16777215:e)}get inWkid(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.__wbg_get_geometryinfodescriptor_inWkid(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);return 0===e?void 0:t>>>0}finally{n.__wbindgen_add_to_stack_pointer(16)}}set inWkid(e){n.__wbg_set_geometryinfodescriptor_inWkid(this.__wbg_ptr,!B(e),B(e)?0:e)}get outWkid(){try{const r=n.__wbindgen_add_to_stack_pointer(-16);n.__wbg_get_geometryinfodescriptor_outWkid(r,this.__wbg_ptr);var e=F().getInt32(r+0,!0),t=F().getInt32(r+4,!0);return 0===e?void 0:t>>>0}finally{n.__wbindgen_add_to_stack_pointer(16)}}set outWkid(e){n.__wbg_set_geometryinfodescriptor_outWkid(this.__wbg_ptr,!B(e),B(e)?0:e)}static new(){const e=n.geometryinfodescriptor_new();return K.__wrap(e)}}const Z="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_pageencodingdescriptor_free(e>>>0,1)));class ee{static __wrap(e){e>>>=0;const t=Object.create(ee.prototype);return t.__wbg_ptr=e,Z.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,Z.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_pageencodingdescriptor_free(e,0)}pageType(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.pageencodingdescriptor_pageType(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}encoding(){let e,t;try{const i=n.__wbindgen_add_to_stack_pointer(-16);n.pageencodingdescriptor_encoding(i,this.__wbg_ptr);var r=F().getInt32(i+0,!0),_=F().getInt32(i+4,!0);return e=r,t=_,u(r,_)}finally{n.__wbindgen_add_to_stack_pointer(16),n.__wbindgen_free(e,t,1)}}count(){return n.pageencodingdescriptor_count(this.__wbg_ptr)}}const te="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_parquetchunk_free(e>>>0,1)));class ne{static __wrap(e){e>>>=0;const t=Object.create(ne.prototype);return t.__wbg_ptr=e,te.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,te.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_parquetchunk_free(e,0)}size(){return n.parquetchunk_size(this.__wbg_ptr)>>>0}hasField(e){return 0!==n.parquetchunk_hasField(this.__wbg_ptr,e)}readX(e){return n.parquetchunk_readX(this.__wbg_ptr,e)}readY(e){return n.parquetchunk_readY(this.__wbg_ptr,e)}readCoords(e){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.parquetchunk_readCoords(_,this.__wbg_ptr,e);var t=F().getInt32(_+0,!0),r=F().getInt32(_+4,!0);let i;return 0!==t&&(i=M(t,r).slice(),n.__wbindgen_free(t,8*r,8)),i}finally{n.__wbindgen_add_to_stack_pointer(16)}}readLengths(e){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.parquetchunk_readLengths(_,this.__wbg_ptr,e);var t=F().getInt32(_+0,!0),r=F().getInt32(_+4,!0);let i;return 0!==t&&(i=O(t,r).slice(),n.__wbindgen_free(t,4*r,4)),i}finally{n.__wbindgen_add_to_stack_pointer(16)}}readGeometryTransformed(e,t,r,_,i){const o=n.parquetchunk_readGeometryTransformed(this.__wbg_ptr,e,t,r,_,i);return 0===o?void 0:oe.__wrap(o)}boundsXMin(e){return n.parquetchunk_boundsXMin(this.__wbg_ptr,e)}boundsYMin(e){return n.parquetchunk_boundsYMin(this.__wbg_ptr,e)}boundsXMax(e){return n.parquetchunk_boundsXMax(this.__wbg_ptr,e)}boundsYMax(e){return n.parquetchunk_boundsYMax(this.__wbg_ptr,e)}readAttribute(e,t){return a(n.parquetchunk_readAttribute(this.__wbg_ptr,e,t))}}const re="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_parquetfile_free(e>>>0,1)));let _e=class e{static __wrap(t){t>>>=0;const n=Object.create(e.prototype);return n.__wbg_ptr=t,re.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,re.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_parquetfile_free(e,0)}metadata(){const e=n.parquetfile_metadata(this.__wbg_ptr);return Q.__wrap(e)}rowGroups(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.parquetfile_rowGroups(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0),r=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}readChunksWithCallback(e,t){const r=P(e,n.__wbindgen_malloc),_=y;return a(n.parquetfile_readChunksWithCallback(this.__wbg_ptr,r,_,s(t)))}readFirstChunk(e){const t=P(e,n.__wbindgen_malloc),r=y;return a(n.parquetfile_readFirstChunk(this.__wbg_ptr,t,r))}readAllChunks(e){const t=P(e,n.__wbindgen_malloc),r=y;return a(n.parquetfile_readAllChunks(this.__wbg_ptr,t,r))}updateChunks(e){const t=P(e,n.__wbindgen_malloc),r=y;return a(n.parquetfile_updateChunks(this.__wbg_ptr,t,r))}};const ie="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_quantizedgeometry_free(e>>>0,1)));class oe{static __wrap(e){e>>>=0;const t=Object.create(oe.prototype);return t.__wbg_ptr=e,ie.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ie.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_quantizedgeometry_free(e,0)}readCoordsUnsafe(){return a(n.quantizedgeometry_readCoordsUnsafe(this.__wbg_ptr))}readLengthsUnsafe(){return a(n.quantizedgeometry_readLengthsUnsafe(this.__wbg_ptr))}}const ae="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_rangeproviderjs_free(e>>>0,1)));class se{static __wrap(e){e>>>=0;const t=Object.create(se.prototype);return t.__wbg_ptr=e,ae.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,ae.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_rangeproviderjs_free(e,0)}static new(e,t){const r=n.rangeproviderjs_new(s(e),s(t));return se.__wrap(r)}static withFetch(){const e=n.rangeproviderjs_withFetch();return se.__wrap(e)}}const de="undefined"==typeof FinalizationRegistry?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry((e=>n.__wbg_rowgroup_free(e>>>0,1)));class ge{static __wrap(e){e>>>=0;const t=Object.create(ge.prototype);return t.__wbg_ptr=e,de.register(t,t.__wbg_ptr,t),t}__destroy_into_raw(){const e=this.__wbg_ptr;return this.__wbg_ptr=0,de.unregister(this),e}free(){const e=this.__destroy_into_raw();n.__wbg_rowgroup_free(e,0)}columns(){try{const _=n.__wbindgen_add_to_stack_pointer(-16);n.rowgroup_columns(_,this.__wbg_ptr);var e=F().getInt32(_+0,!0),t=F().getInt32(_+4,!0),r=j(e,t).slice();return n.__wbindgen_free(e,4*t,4),r}finally{n.__wbindgen_add_to_stack_pointer(16)}}}async function ce(e,t){if("function"==typeof Response&&e instanceof Response){if("function"==typeof WebAssembly.instantiateStreaming)try{return await WebAssembly.instantiateStreaming(e,t)}catch(n){if("application/wasm"==e.headers.get("Content-Type"))throw n;console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",n)}const r=await e.arrayBuffer();return await WebAssembly.instantiate(r,t)}{const n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function ue(){const e={wbg:{}};return e.wbg.__wbg_new_abda76e883ba8a5f=function(){return s(new Error)},e.wbg.__wbg_stack_658279fe44541cf6=function(e,t){const r=k(_(t).stack,n.__wbindgen_malloc,n.__wbindgen_realloc),i=y;F().setInt32(e+4,i,!0),F().setInt32(e+0,r,!0)},e.wbg.__wbg_error_f851667af71bcfc6=function(e,t){let r,_;try{r=e,_=t,console.error(u(e,t))}finally{n.__wbindgen_free(r,_,1)}},e.wbg.__wbindgen_object_drop_ref=function(e){a(e)},e.wbg.__wbindgen_is_function=function(e){return"function"==typeof _(e)},e.wbg.__wbg_self_3093d5d1f7bcb682=function(){return v((function(){return s(self.self)}),arguments)},e.wbg.__wbg_window_3bcfc4d31bc012f8=function(){return v((function(){return s(window.window)}),arguments)},e.wbg.__wbg_globalThis_86b222e13bdf32ed=function(){return v((function(){return s(globalThis.globalThis)}),arguments)},e.wbg.__wbg_global_e5a3fe56f8be9485=function(){return v((function(){return s(global.global)}),arguments)},e.wbg.__wbindgen_is_undefined=function(e){return void 0===_(e)},e.wbg.__wbg_newnoargs_76313bd6ff35d0f2=function(e,t){return s(new Function(u(e,t)))},e.wbg.__wbindgen_object_clone_ref=function(e){return s(_(e))},e.wbg.__wbindgen_number_new=function(e){return s(e)},e.wbg.__wbindgen_string_new=function(e,t){return s(u(e,t))},e.wbg.__wbg_call_1084a111329e68ce=function(){return v((function(e,t){return s(_(e).call(_(t)))}),arguments)},e.wbg.__wbg_call_89af060b4e1523f2=function(){return v((function(e,t,n){return s(_(e).call(_(t),_(n)))}),arguments)},e.wbg.__wbg_call_7de908392845a9a5=function(){return v((function(e,t,n,r,i){return s(_(e).call(_(t),_(n),_(r),_(i)))}),arguments)},e.wbg.__wbg_valueOf_563b3487b1b116aa=function(e){return _(e).valueOf()},e.wbg.__wbg_buffer_b7b08af79b0b0974=function(e){return s(_(e).buffer)},e.wbg.__wbg_new_b85e72ed1bfd57f9=function(e,t){try{var n={a:e,b:t},r=(e,t)=>{const r=n.a;n.a=0;try{return T(r,n.b,e,t)}finally{n.a=r}};return s(new Promise(r))}finally{n.a=n.b=0}},e.wbg.__wbg_resolve_570458cb99d56a43=function(e){return s(Promise.resolve(_(e)))},e.wbg.__wbg_then_95e6edc0f89b73b1=function(e,t){return s(_(e).then(_(t)))},e.wbg.__wbg_then_876bb3c633745cc6=function(e,t,n){return s(_(e).then(_(t),_(n)))},e.wbg.__wbg_newwithbyteoffsetandlength_b5293b0eedbac651=function(e,t,n){return s(new Int16Array(_(e),t>>>0,n>>>0))},e.wbg.__wbg_new_ea1883e1e5e86686=function(e){return s(new Uint8Array(_(e)))},e.wbg.__wbg_newwithbyteoffsetandlength_874df3e29cb555f9=function(e,t,n){return s(new Uint32Array(_(e),t>>>0,n>>>0))},e.wbg.__wbg_length_8339fcf5d8ecd12e=function(e){return _(e).length},e.wbg.__wbg_set_d1e79e2388520f18=function(e,t,n){_(e).set(_(t),n>>>0)},e.wbg.__wbindgen_throw=function(e,t){throw new Error(u(e,t))},e.wbg.__wbindgen_memory=function(){return s(n.memory)},e.wbg.__wbindgen_array_new=function(){return s([])},e.wbg.__wbindgen_array_push=function(e,t){_(e).push(a(t))},e.wbg.__wbindgen_uint8_array_new=function(e,t){var r=l(e,t).slice();n.__wbindgen_free(e,1*t,1);return s(r)},e.wbg.__wbg_queueMicrotask_48421b3cc9052b68=function(e){return s(_(e).queueMicrotask)},e.wbg.__wbindgen_cb_drop=function(e){const t=a(e).original;if(1==t.cnt--)return t.a=0,!0;return!1},e.wbg.__wbg_queueMicrotask_12a30234db4045d3=function(e){queueMicrotask(_(e))},e.wbg.__wbg_parquetchunk_new=function(e){return s(ne.__wrap(e))},e.wbg.__wbg_parquetfile_new=function(e){return s(_e.__wrap(e))},e.wbg.__wbg_filemetadata_new=function(e){return s(Q.__wrap(e))},e.wbg.__wbg_fieldmetadata_new=function(e){return s($.__wrap(e))},e.wbg.__wbg_rowgroup_new=function(e){return s(ge.__wrap(e))},e.wbg.__wbg_columndescriptor_new=function(e){return s(Y.__wrap(e))},e.wbg.__wbg_pageencodingdescriptor_new=function(e){return s(ee.__wrap(e))},e.wbg.__wbindgen_closure_wrapper1461=function(e,t,n){return s(b(e,t,75,p))},e}function le(e,t){return n=e.exports,be.__wbindgen_wasm_module=t,I=null,x=null,C=null,R=null,g=null,n.__wbindgen_start(),n}function we(e){if(void 0!==n)return n;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module:e}=e):console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const t=ue();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));return le(new WebAssembly.Instance(e,t),e)}async function be(e){if(void 0!==n)return n;void 0!==e&&(Object.getPrototypeOf(e)===Object.prototype?({module_or_path:e}=e):console.warn("using deprecated parameters for the initialization function; pass a single object instead"));const t=ue();("string"==typeof e||"function"==typeof Request&&e instanceof Request||"function"==typeof URL&&e instanceof URL)&&(e=fetch(e));const{instance:r,module:_}=await ce(await e,t);return le(r,_)}const pe=Object.freeze(Object.defineProperty({__proto__:null,ColumnDescriptor:Y,FieldMetadata:$,FileMetadata:Q,GeometryInfoDescriptor:K,GeometryType:L,PageEncodingDescriptor:ee,ParquetChunk:ne,ParquetFile:_e,QuantizedGeometry:oe,RangeProviderJs:se,RowGroup:ge,default:be,enable_tracing:f,initSync:we,readFile:D,readFileFromBinary:U,readMetadata:W,readMetadataFromFile:G},Symbol.toStringTag,{value:"Module"}));let fe=null;async function ye(){return fe||(fe=he()),fe}async function he(){const t=await Promise.resolve().then((()=>pe));return await t.default({module_or_path:e("esri/libs/parquet/pkg/arcgis_parquet_bg.wasm")}),t}const me=e=>async function(n,r,_){const i=e(),{data:o}=await t(n,{responseType:"array-buffer",query:i,headers:{range:`bytes=${r}-${_}`}});return o},ke=e=>async function(n){const r=e(),{data:_}=await t(n,{responseType:"native",method:"head",query:r}),i=_.headers.get("Content-Length");if(null==i)throw new Error("Unable to parse content length");return parseInt(i,10)};class Ie{static async create(e,t){const n=await ye(),r=await n.readMetadata(e,me(t),ke(t));return Ie.fromFileMetadata(r)}static fromFileMetadata(e){const t=[];for(let n=0;n<e.numFields();n++){const r=e.getFieldByIndex(n);t.push({name:r.name,type:r.type,alias:r.name,index:r.index}),r.free()}return new Ie(e,t)}constructor(e,t){this._inner=e,this.fields=t}destroy(){this._inner.free()}[Symbol.dispose](){this.destroy()}get size(){return this._inner.numRows()}getFieldIndex(e){return this._inner.getFieldIndex(e)}tryReadGeoMetadata(){const e=this._inner.keyValueMetadata("geo");return null==e?null:JSON.parse(e)}}function Fe(e){switch(e){case"esriGeometryPoint":return L.Point;case"esriGeometryPolygon":return L.Polygon;case"esriGeometryPolyline":return L.Polyline;case"esriGeometryMultipoint":return L.Multipoint;default:throw new Error(`InternalError: Found unexpected GeometryType: ${e}`)}}function ve(e,t,n){const r=K.new();return r.geometryType=Fe(e.geometryType),"location"===e.type?(r.latIndex=t.getFieldIndex(e.latitudeFieldName),r.lngIndex=t.getFieldIndex(e.longitudeFieldName)):r.wkbIndex=t.getFieldIndex(e.primaryFieldName),r.inWkid=e.spatialReference.wkid,n&&(r.outWkid=n.wkid),r}class Te{static async create(e,t){const n=await ye(),r=me(t.getCustomParameters),_=ke(t.getCustomParameters),i=await W(e,r,_),o=ve(t.geometryInfo,i,t.outSpatialReference),a=await n.readFile(e,r,_,i,o);return new Te(a,Ie.fromFileMetadata(a.metadata()))}static async fromFile(e,t,n){const r=await ye(),_=await r.readMetadataFromFile(e),i=t?ve(t,_,n):void 0,o=await r.readFileFromBinary(i,e);return new Te(o,Ie.fromFileMetadata(o.metadata()))}constructor(e,t){this.inner=e,this.metadata=t}destroy(){this.inner.free(),this.metadata.destroy()}[Symbol.dispose](){this.destroy()}}export{Te as ParquetFile,Ie as ParquetMetadata};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as t}from"../chunks/tslib.es6.js";import{ClonableMixin as
|
|
5
|
+
import{_ as t}from"../chunks/tslib.es6.js";import{ClonableMixin as e}from"../core/Clonable.js";import{MultiOriginJSONSupport as r}from"../core/MultiOriginJSONSupport.js";import{join as o}from"../core/urlUtils.js";import{generateUUID as i}from"../core/uuid.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as n}from"../core/accessorSupport/decorators/reader.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import{writer as p}from"../core/accessorSupport/decorators/writer.js";import{nameToId as l}from"../core/accessorSupport/PropertyOrigin.js";import{getRelationshipEndNodeMap as u,serializeInclusionDefinitionToEntitiesPbf as c,serializeInclusionDefinitionToRelationshipsPbf as m}from"../layers/knowledgeGraph/supportUtils.js";import{layoutTypes as d}from"./enums.js";import h from"./LayoutSettings.js";import y from"./NonspatialDataDisplay.js";import{f as g,t as U}from"../chunks/persistableUrlUtils.js";let f=class extends(e(r)){constructor(t){super(t),this.aggregatedEntitiesUrl=null,this.aggregatedRelationshipsUrl=null,this.autoCollapseRelationships=!0,this.centralityIsUpToDate=!0,this.entitiesUrl=null,this.layoutSettings=null,this.layoutType="organic-standard",this.nonspatialDataDisplay=null,this.relationshipsUrl=null}readEntitiesUrl(t,e,r){return g(t,r)}writeEntitiesUrl(t,e,r,o){const i=o?.portalItem,s=o?.resources,n=l(o?.origin),a=o?.webmap?.activeLinkChartLayer;i&&s&&null!=n&&a&&a.membershipModified?this._saveUrlAsNewResource(e,r,s,i,a):t&&(e[r]=U(t,o))}readRelationshipsUrl(t,e,r){return g(t,r)}writeRelationshipsUrl(t,e,r,o){const i=o?.portalItem,s=o?.resources,n=l(o?.origin),a=o?.webmap?.activeLinkChartLayer;i&&s&&null!=n&&a&&a.membershipModified?this._saveUrlAsNewResource(e,r,s,i,a):t&&(e[r]=U(t,o))}_saveUrlAsNewResource(t,e,r,o,i){t[e]="<pending>";const s=(i.knowledgeGraph.dataModel.relationshipTypes??[]).map((t=>t.name)).reduce(((t,e)=>{if(!e)return t;const{members:r}=i.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e)||{members:void 0};if(!r)return t;for(const[o]of r)t.push({id:o,typeName:e});return t}),[]);r.pendingOperations.push(new Promise((n=>{u(s,i.knowledgeGraph).then((s=>{b(i.dataManager.inclusionModeDefinition,e,i.knowledgeGraph,s).then((i=>{const s=j(o,"entitiesUrl"===e?"entitiesUrl":"relationshipsUrl");t[e]=s.itemRelativeUrl,r.toAdd.push({resource:s,content:{type:"blob",blob:i},compress:!1,finish:t=>{"entitiesUrl"===e?this.entitiesUrl=t.url:this.relationshipsUrl=t.url}}),n()}))}))})))}};t([s({type:String,json:{write:!0}})],f.prototype,"aggregatedEntitiesUrl",void 0),t([s({type:String,json:{write:!0}})],f.prototype,"aggregatedRelationshipsUrl",void 0),t([s({type:Boolean,json:{write:!0}})],f.prototype,"autoCollapseRelationships",void 0),t([s({type:Boolean,json:{write:!0}})],f.prototype,"centralityIsUpToDate",void 0),t([s({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"entitiesUrl",void 0),t([n("entitiesUrl")],f.prototype,"readEntitiesUrl",null),t([p("entitiesUrl")],f.prototype,"writeEntitiesUrl",null),t([s({type:h,json:{write:!0}})],f.prototype,"layoutSettings",void 0),t([s({type:d,json:{write:!0}})],f.prototype,"layoutType",void 0),t([s({type:y,json:{write:!0}})],f.prototype,"nonspatialDataDisplay",void 0),t([s({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],f.prototype,"relationshipsUrl",void 0),t([n("relationshipsUrl")],f.prototype,"readRelationshipsUrl",null),t([p("relationshipsUrl")],f.prototype,"writeRelationshipsUrl",null),f=t([a("esri.linkChart.LinkChartProperties")],f);const w=f;function j(t,e){const r=`${e}-${i()}.dat`,s=o("linkChart",r);return t.resourceFromPath(s)}async function b(t,e,r,o){let i;return i="entitiesUrl"===e?await c(t,r,o):await m(t,r,o),new Blob([i],{type:"application/x-protobuf"})}export{w as default};
|