@arcgis/core 5.2.0-next.12 → 5.2.0-next.14
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/arcgisGlobal.d.ts +3 -3
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/03354e9256b2f77fd4f2.js +1 -0
- package/assets/esri/core/workers/chunks/0826d36dfbfa28442b70.js +1 -0
- package/assets/esri/core/workers/chunks/{8103d06f760a2c79773d.js → 0a8ba5cb857f61de40fb.js} +15 -15
- package/assets/esri/core/workers/chunks/152f1c08197955224ad3.js +1 -0
- package/assets/esri/core/workers/chunks/1a0903b1d2d5101977c6.js +1 -0
- package/assets/esri/core/workers/chunks/{de541ad390a8d258d2e6.js → 1d5db8746a4f1ed1d18f.js} +1 -1
- package/assets/esri/core/workers/chunks/1effde6a39ef0d4af525.js +1 -0
- package/assets/esri/core/workers/chunks/{2a5176533e78a92d8e5b.js → 20c729fca2e4b4c6b28d.js} +1 -1
- package/assets/esri/core/workers/chunks/23d50c4478f40a7d62bf.js +1 -0
- package/assets/esri/core/workers/chunks/2623cd08487fdc9a94f1.js +1 -0
- package/assets/esri/core/workers/chunks/2c3fc2805f6de0963789.js +1 -0
- package/assets/esri/core/workers/chunks/2c4f10eaf02ef090ee8f.js +1 -0
- package/assets/esri/core/workers/chunks/314bc1b356d43bfa72a8.js +1 -0
- package/assets/esri/core/workers/chunks/{34544c79ce568f30a094.js → 31762eb20a9a0ed3f8b0.js} +1 -1
- package/assets/esri/core/workers/chunks/{26dca1d387183282276a.js → 318a2702632aaa4d3a63.js} +1 -1
- package/assets/esri/core/workers/chunks/3526ab3b1f87c24ae6f8.js +1 -0
- package/assets/esri/core/workers/chunks/{0b169bb1969f86232a1a.js → 35b3ff25f5fe24fe15e2.js} +1 -1
- package/assets/esri/core/workers/chunks/{81808c3aead7dfac3049.js → 38cfedce779dd75bd217.js} +1 -1
- package/assets/esri/core/workers/chunks/{5075e85e1eafd431a8c0.js → 39c994536ce6c1e5c956.js} +1 -1
- package/assets/esri/core/workers/chunks/3b74749db78bcba2bc16.js +1 -0
- package/assets/esri/core/workers/chunks/3d83ac791212b81c9d11.js +1 -0
- package/assets/esri/core/workers/chunks/3ecb906322a6a5c8c93b.js +1 -0
- package/assets/esri/core/workers/chunks/3f67162456a1f02190fa.js +1 -0
- package/assets/esri/core/workers/chunks/{ef46ef4f0ee9f2aeaa4a.js → 426b8e1e2eef2460851d.js} +1 -1
- package/assets/esri/core/workers/chunks/4376bc2934a996d8bc27.js +1 -0
- package/assets/esri/core/workers/chunks/44d0ca9d4c5f1722688c.js +1 -0
- package/assets/esri/core/workers/chunks/{c187bc997bad61b6c6e9.js → 47f21b65065558d583ca.js} +1 -1
- package/assets/esri/core/workers/chunks/{e25bcfdd8f20f8a08b19.js → 4d57c771af4137f74bfb.js} +1 -1
- package/assets/esri/core/workers/chunks/4e4419282c4bf7ee4678.js +1 -0
- package/assets/esri/core/workers/chunks/4e788fc6cb2ea936f676.js +1 -0
- package/assets/esri/core/workers/chunks/4f51963815b0d53ffbd9.js +1 -0
- package/assets/esri/core/workers/chunks/5100b5a6a506c704dfaf.js +1 -0
- package/assets/esri/core/workers/chunks/52afd43bbe23e358efb5.js +1 -0
- package/assets/esri/core/workers/chunks/5aba23584e0b230c75f5.js +1 -0
- package/assets/esri/core/workers/chunks/{d3c760109a70a71448c5.js → 67773a9f031d9f1d672f.js} +1 -1
- package/assets/esri/core/workers/chunks/6f7193b9ff5942c0d354.js +1 -0
- package/assets/esri/core/workers/chunks/70737052bab29fcaa120.js +1 -0
- package/assets/esri/core/workers/chunks/718d2d430c1a5a940b83.js +1 -0
- package/assets/esri/core/workers/chunks/71c996e1ae84d9daddf2.js +1 -0
- package/assets/esri/core/workers/chunks/753e0b21e57c12c742ee.js +1 -0
- package/assets/esri/core/workers/chunks/764c8ba14ab74b66b391.js +1 -0
- package/assets/esri/core/workers/chunks/{1996f0a930abdd97b855.js → 7a8ed08cd173963b3112.js} +1 -1
- package/assets/esri/core/workers/chunks/{4a20f7a0700fd14a129f.js → 7dcf804e1918b94fa4e1.js} +3 -10
- package/assets/esri/core/workers/chunks/{cc697c4d9cdc116373dc.js → 81726d997a2d34449bb2.js} +1 -1
- package/assets/esri/core/workers/chunks/{74e1826ad9e2c4fd3b42.js → 81883bca8a79ee2ddb00.js} +1 -1
- package/assets/esri/core/workers/chunks/{9fee0110dc7fee4c95e2.js → 854c320af09b6afc4b80.js} +2 -2
- package/assets/esri/core/workers/chunks/85505a8b8b0794656d06.js +1 -0
- package/assets/esri/core/workers/chunks/859bc873e7af911a518f.js +1 -0
- package/assets/esri/core/workers/chunks/{8407c91cce31e087b41b.js → 886ae23a1d8fa21e531f.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ff7aa216cd794d951e8.js → 8e99f937fd36cf2cd05f.js} +1 -1
- package/assets/esri/core/workers/chunks/{c357c0a08b99c1e7f290.js → 9331969046f2b277d620.js} +1 -1
- package/assets/esri/core/workers/chunks/93d08d82ceab19e314f8.js +1 -0
- package/assets/esri/core/workers/chunks/97a654e8054302582a3b.js +1 -0
- package/assets/esri/core/workers/chunks/97d2bdbea39cbcf8fd0f.js +1 -0
- package/assets/esri/core/workers/chunks/a0208e35b217808777c4.js +1 -0
- package/assets/esri/core/workers/chunks/{f25bb204cf6727f6fdef.js → a0876a52a3c2ad849370.js} +1 -1
- package/assets/esri/core/workers/chunks/{7ad09ac5793e8d47b4b2.js → a4b970a841b3085500fc.js} +1 -1
- package/assets/esri/core/workers/chunks/aa5f36d7ed59c625ba78.js +1 -0
- package/assets/esri/core/workers/chunks/b045bffb4f2eb9203183.js +1 -0
- package/assets/esri/core/workers/chunks/b590402170ae289290d7.js +1 -0
- package/assets/esri/core/workers/chunks/b9935cc8e2bd4045058a.js +1 -0
- package/assets/esri/core/workers/chunks/{1a527c0740d9f4fa0791.js → bc547cf814d6703cef59.js} +1 -1
- package/assets/esri/core/workers/chunks/bcc097271f5cdf0a97a7.js +1 -0
- package/assets/esri/core/workers/chunks/bdc66ef2b6ed783047d5.js +1 -0
- package/assets/esri/core/workers/chunks/be1d2c3a61e6447fbbc7.js +1 -0
- package/assets/esri/core/workers/chunks/bf6ae205fbfbfcd1a0ee.js +1 -0
- package/assets/esri/core/workers/chunks/bfd1aef8ac795e1ce227.js +1 -0
- package/assets/esri/core/workers/chunks/c148ad0ea9258046ac1f.js +1 -0
- package/assets/esri/core/workers/chunks/{0f75c19d8e296a32e329.js → c2cd80b712f29e8cbb8d.js} +1 -1
- package/assets/esri/core/workers/chunks/cc0efa716b8414a44398.js +1 -0
- package/assets/esri/core/workers/chunks/{8f6833671c071b522923.js → cd66bd30f654fe571e57.js} +1 -1
- package/assets/esri/core/workers/chunks/cf41a66fb97c1076fb34.js +1 -0
- package/assets/esri/core/workers/chunks/cf8ce21dc649021e97f6.js +1 -0
- package/assets/esri/core/workers/chunks/d2f47f21ce0b0ab4da17.js +262 -0
- package/assets/esri/core/workers/chunks/d3be4d914fc99a1d686c.js +1 -0
- package/assets/esri/core/workers/chunks/dbd2bfcbf3e0f86f07b8.js +1 -0
- package/assets/esri/core/workers/chunks/{6675d56f49d07a97dc40.js → dd0c1cf921369e2bc48b.js} +1 -1
- package/assets/esri/core/workers/chunks/df18b0a653b328d8d052.js +1 -0
- package/assets/esri/core/workers/chunks/df54e741db40b308c2dd.js +2 -0
- package/assets/esri/core/workers/chunks/{89e09276086745aa21fa.js → e4e2f479c0c45ae1b2c3.js} +1 -1
- package/assets/esri/core/workers/chunks/e656fd5ecf9ac059a87b.js +1 -0
- package/assets/esri/core/workers/chunks/{58a7cdebc3d182c15ec6.js → e77df11aee136d64ff0f.js} +1 -1
- package/assets/esri/core/workers/chunks/{7a474ce61cf484df87b4.js → e80376832050a4b6d28a.js} +1 -1
- package/assets/esri/core/workers/chunks/{f75295cdd5e84eb97d5a.js → e8d65900eefff1152207.js} +1 -1
- package/assets/esri/core/workers/chunks/f116331c6eca937aac8e.js +1 -0
- package/assets/esri/core/workers/chunks/{3b837b512999e6ab24bc.js → f148666308071bdb185a.js} +1 -1
- package/assets/esri/core/workers/chunks/f23e995320674b32e142.js +1 -0
- package/assets/esri/core/workers/chunks/f334bf192dff5af10a70.js +1 -0
- package/assets/esri/core/workers/chunks/f76b1fc36f5606cac2c8.js +1 -0
- package/assets/esri/core/workers/chunks/{893c0d28a5bf3f9f29f1.js → f93facf47aba9b128fcc.js} +1 -1
- package/assets/esri/core/workers/chunks/fa1336b60278017d2525.js +1 -0
- package/assets/esri/core/workers/chunks/{c911f0b5bdd43b66b731.js → fa3faec65882c5b6f1a0.js} +1 -1
- package/assets/esri/core/workers/chunks/fccc34b86454c56f27ab.js +1 -0
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +5 -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/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
- package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
- package/chunks/{ComponentShader.glsl.js → Component.glsl.js} +11 -11
- package/chunks/GlobalIlluminationBlur.glsl.js +7 -7
- package/chunks/GlowBlur.glsl.js +5 -6
- package/chunks/LineMarker.glsl.js +27 -26
- package/chunks/MeasurementArrow.glsl.js +5 -4
- package/chunks/RibbonLine.glsl.js +1 -8
- package/chunks/Terrain.glsl.js +24 -26
- package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
- package/chunks/arcgis-knowledge-client-core.js +1 -1
- package/chunks/bundle2.js +1 -1
- package/config.js +1 -1
- package/core/promiseUtils.d.ts +1 -1
- package/core/promiseUtils.js +1 -1
- package/core/units.js +1 -1
- package/form/types.d.ts +1 -1
- package/geometry/Mesh.d.ts +220 -95
- package/geometry/operators/support/projectionZScaling.js +1 -1
- package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +35 -13
- package/geometry/support/MeshLocalVertexSpace.d.ts +32 -8
- package/geometry/support/MeshVertexAttributes.d.ts +6 -2
- package/geometry/support/heightModelInfoUtils.js +1 -1
- package/geometry/support/zscale.js +1 -1
- package/graphic/{AnnotationGraphicOrigin.d.ts → AnnotationFeatureGraphicOrigin.d.ts} +9 -9
- package/graphic/{AnnotationGraphicOrigin.js → AnnotationFeatureGraphicOrigin.js} +1 -1
- package/interfaces.d.ts +3 -3
- package/kernel.js +1 -1
- package/layers/{AnnotationLayer.d.ts → AnnotationFeatureLayer.d.ts} +24 -24
- package/layers/AnnotationFeatureLayer.js +2 -0
- package/layers/GaussianSplatLayer.d.ts +4 -1
- package/layers/graphics/data/QueryEngine.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/sources/parquet/ParquetFileStatistics.js +1 -1
- package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
- package/layers/graphics/sources/support/parquetIdUtils.js +1 -1
- package/layers/save/featureLayerUtils.js +1 -1
- package/layers/support/AnnotationSublayer.d.ts +7 -7
- package/layers/support/FeatureEffect.d.ts +3 -2
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/fetchService.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/layersLoader.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/layers/support/schemaValidator.js +1 -1
- package/layers/types.d.ts +1 -1
- package/networks/Network.js +1 -1
- package/networks/UtilityNetwork.js +1 -1
- package/networks/support/networkFieldUtils.js +1 -1
- package/package.json +2 -2
- package/portal/schemas/definitions.js +1 -1
- package/portal/schemas/gaussianSplatLayerItem.js +2 -0
- package/portal/schemas/integratedMesh3DTilesLayerItem.js +1 -1
- package/portal/support/loadUtils.js +1 -1
- package/renderers/support/types.d.ts +1 -1
- package/renderers/visualVariables/RotationVariable.d.ts +1 -16
- package/renderers/visualVariables/RotationVariable.js +1 -1
- package/rest/knowledgeGraph/ReplicaDefinition.d.ts +0 -2
- package/rest/knowledgeGraph/ServiceDefinition.d.ts +1 -1
- package/rest/knowledgeGraph/wasmInterface/replicaToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToReplicaFactories.js +1 -1
- package/rest/knowledgeGraphService.js +1 -1
- package/rest/networks/support/QueryAssociationsParameters.d.ts +2 -2
- package/rest/networks/support/SynthesizeAssociationGeometriesParameters.d.ts +2 -2
- package/rest/networks/support/TraceParameters.d.ts +2 -2
- package/rest/support/AttributeBinsQuery.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/TopFeaturesQuery.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/engine/webgl/util/createMatcher.js +1 -1
- package/views/2d/layerViewModuleImportUtils.js +1 -1
- package/views/2d/layers/AnnotationFeatureLayerView2D.js +2 -0
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/features/sources/strategies/support/queryAdapters.js +1 -1
- package/views/2d/layers/support/annodime/annotationSchema.js +1 -1
- package/views/2d/types.d.ts +2 -2
- package/views/3d/analysis/LineOfSight/LineOfSightTool.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool2.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/support/GaussianSplatSortWorker.js +1 -1
- package/views/3d/support/GaussianSplatWorkerHandle.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatDataStore.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/isTerrainSurfaceLayer.js +1 -1
- package/views/3d/types.d.ts +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/{ComponentShader.glsl.js → Component.glsl.js} +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechnique.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBuffer.glsl.js +7 -7
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +29 -20
- package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialAuxiliaryPasses.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatTextureFetch.glsl.js +6 -8
- package/views/3d/webgl-engine/lib/Compositor.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TexelFormatInfo.js +2 -0
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferLayout.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBuffer.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/WaterTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/HUDMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineCalloutTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +10 -10
- package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/alphaCutoff.glsl.js +1 -1
- package/views/SceneView.d.ts +1 -1
- package/views/layers/{AnnotationLayerView.d.ts → AnnotationFeatureLayerView.d.ts} +6 -6
- package/views/layers/FeatureLikeLayerView.d.ts +2 -2
- package/views/layers/FeatureLikeLayerView.js +1 -1
- package/webdoc/widgets/FloorFilter.d.ts +14 -1
- package/webdoc/widgets/FloorFilter.js +1 -1
- package/webscene/support/AlphaCutoff.js +1 -1
- package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +12 -4
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
- package/widgets/BatchAttributeForm/ValueChangeTransaction.js +2 -0
- package/widgets/BatchAttributeForm/VisibleElements.d.ts +8 -1
- package/widgets/BatchAttributeForm/VisibleElements.js +1 -1
- package/widgets/BatchAttributeForm/batchAttributeFormUtils.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsManager.js +1 -1
- package/widgets/BatchAttributeForm/expressions/ExpressionsModel.js +1 -1
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.d.ts +3 -0
- package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
- package/widgets/BatchAttributeForm/stringUtils.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +19 -3
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Editor/AddAssociationWorkflow.js +1 -1
- package/widgets/Editor/AddAssociationWorkflowData.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/EditorViewModel.d.ts +1 -1
- package/widgets/Editor/EditorViewModel.js +1 -1
- package/widgets/Editor/MergeFeaturesWorkflow.d.ts +3 -3
- package/widgets/Editor/MergeFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.d.ts +3 -3
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateRecordWorkflowData.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/Editor.js +1 -1
- package/widgets/FloorFilter/FloorFilterViewModel.d.ts +10 -0
- package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/07cc5743cb6a9fd68adb.js +0 -1
- package/assets/esri/core/workers/chunks/0bb159ba0226122465cf.js +0 -1
- package/assets/esri/core/workers/chunks/160e5b99f1097a473e6b.js +0 -1
- package/assets/esri/core/workers/chunks/17e68828ca6ff6912d3e.js +0 -1
- package/assets/esri/core/workers/chunks/1e340536d3c5f94920b5.js +0 -1
- package/assets/esri/core/workers/chunks/24810c36ae09bb4e83dc.js +0 -1
- package/assets/esri/core/workers/chunks/274b82cb183ddd0042f3.js +0 -1
- package/assets/esri/core/workers/chunks/297ae764445e6f73a5ea.js +0 -1
- package/assets/esri/core/workers/chunks/29aba121db7f00e0cf81.js +0 -1
- package/assets/esri/core/workers/chunks/2a3145a595d19391bb8a.js +0 -1
- package/assets/esri/core/workers/chunks/3297658ccd8d4b9ce733.js +0 -1
- package/assets/esri/core/workers/chunks/38ca59db0e8f45bd7811.js +0 -1
- package/assets/esri/core/workers/chunks/3c5534c576528c1921d2.js +0 -1
- package/assets/esri/core/workers/chunks/40b3cdf81c79bbc44527.js +0 -2
- package/assets/esri/core/workers/chunks/41f12eb7c9b7086528d5.js +0 -1
- package/assets/esri/core/workers/chunks/426156137f279d979ddd.js +0 -1
- package/assets/esri/core/workers/chunks/4714241189c13d0db897.js +0 -1
- package/assets/esri/core/workers/chunks/537c5dd4cd0a067199d1.js +0 -1
- package/assets/esri/core/workers/chunks/538537f9bc866d9caa75.js +0 -1
- package/assets/esri/core/workers/chunks/5437a1c05c1bd2175981.js +0 -1
- package/assets/esri/core/workers/chunks/58ac245ff7fb57c1004f.js +0 -1
- package/assets/esri/core/workers/chunks/5c7aff9604b4576a0e1d.js +0 -1
- package/assets/esri/core/workers/chunks/5d3ddbf94539cb4f493e.js +0 -1
- package/assets/esri/core/workers/chunks/5eb9fdb076488de9cd83.js +0 -1
- package/assets/esri/core/workers/chunks/603177137eb680afe371.js +0 -1
- package/assets/esri/core/workers/chunks/629099f05ca5c9ca1973.js +0 -1
- package/assets/esri/core/workers/chunks/62f78fa455d556008f6a.js +0 -1
- package/assets/esri/core/workers/chunks/686c51fd2144e132783e.js +0 -1
- package/assets/esri/core/workers/chunks/6f0341cfa4c68e6e60b3.js +0 -1
- package/assets/esri/core/workers/chunks/70229007d594536ba6a3.js +0 -1
- package/assets/esri/core/workers/chunks/7e89cb9ff615742e0894.js +0 -1
- package/assets/esri/core/workers/chunks/890b7a1153b7f65eba9a.js +0 -1
- package/assets/esri/core/workers/chunks/9660ae52fb3951a19e9c.js +0 -1
- package/assets/esri/core/workers/chunks/a4245bd4e67a428fd835.js +0 -1
- package/assets/esri/core/workers/chunks/ac33b10fe65f9e9e824f.js +0 -1
- package/assets/esri/core/workers/chunks/b5937ce657c1fff3864f.js +0 -1
- package/assets/esri/core/workers/chunks/b895674c0550826ecb28.js +0 -262
- package/assets/esri/core/workers/chunks/c3cf9e6e91f71c9cc5f3.js +0 -1
- package/assets/esri/core/workers/chunks/c80fc1b3048e8d58a1f8.js +0 -1
- package/assets/esri/core/workers/chunks/cc3e895cff019e811c07.js +0 -1
- package/assets/esri/core/workers/chunks/d122431f3b0b88dcb488.js +0 -1
- package/assets/esri/core/workers/chunks/d24e027bb8b2c09f25c8.js +0 -1
- package/assets/esri/core/workers/chunks/d2df8c328054dc6cb7b7.js +0 -1
- package/assets/esri/core/workers/chunks/d41caf20c26f80385265.js +0 -1
- package/assets/esri/core/workers/chunks/d468994822f9bc3d6279.js +0 -1
- package/assets/esri/core/workers/chunks/d63f532dd7d60ee8ef2c.js +0 -1
- package/assets/esri/core/workers/chunks/d64613209a9eb1eafb11.js +0 -1
- package/assets/esri/core/workers/chunks/d7be278aed1fb37ad5ec.js +0 -1
- package/assets/esri/core/workers/chunks/d8ec0afb2b91ccf32e55.js +0 -1
- package/assets/esri/core/workers/chunks/da1e8b338ab9fe9e0a8e.js +0 -1
- package/assets/esri/core/workers/chunks/dd920a6f6422fa213eba.js +0 -1
- package/assets/esri/core/workers/chunks/e279bcbe4f10e87bde6c.js +0 -1
- package/assets/esri/core/workers/chunks/e2de13810dce01b98520.js +0 -1
- package/assets/esri/core/workers/chunks/e5837e5ac6ef761f26a2.js +0 -1
- package/assets/esri/core/workers/chunks/e82488b9b3bb0c1dedb4.js +0 -1
- package/assets/esri/core/workers/chunks/f274a8e8c7ca4294e876.js +0 -1
- package/assets/esri/core/workers/chunks/f292c2c22a3822343118.js +0 -1
- package/assets/esri/core/workers/chunks/f4f642ddd4d5db7cbbb4.js +0 -1
- package/assets/esri/core/workers/chunks/f6d047358d14328f3622.js +0 -1
- package/assets/esri/core/workers/chunks/fb6605be0c5e36785543.js +0 -1
- package/assets/esri/core/workers/chunks/fd70a25ffdf2cc6c5be2.js +0 -1
- package/layers/AnnotationLayer.js +0 -2
- package/views/2d/layers/AnnotationLayerView2D.js +0 -2
- /package/assets/esri/core/workers/chunks/{9fee0110dc7fee4c95e2.js.LICENSE.txt → 854c320af09b6afc4b80.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{40b3cdf81c79bbc44527.js.LICENSE.txt → df54e741db40b308c2dd.js.LICENSE.txt} +0 -0
- /package/views/layers/{AnnotationLayerView.js → AnnotationFeatureLayerView.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import t from"../../../core/Error.js";import{JSONMap as e}from"../../../core/jsonMap.js";import{getUnitString as i}from"../../../core/units.js";import{canProjectWithoutEngine as r}from"../../../geometry/projectionUtils.js";import{getGeometryExtent as n}from"../../../geometry/support/extentUtils.js";import{isPolygon as o,isExtent as s,isPolyline as a}from"../../../geometry/support/jsonTypeUtils.js";import{fromJSON as l}from"../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as m}from"../../../geometry/support/normalizeUtils.js";import{isGeographic as u,isWebMercator as c,wgs84 as p,equals as f}from"../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as y,project as d}from"./projectionSupport.js";const g=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),S=Object.freeze({}),R="frequency";async function x(t,e,i){const r=t.bin;return r.onField&&(r.onField=r.onField.trim()),r.onExpression?.value&&(r.onExpression.value=r.onExpression.value.trim()),r.splitBy&&(r.splitBy.value&&(r.splitBy.value=r.splitBy.value.trim()),r.splitBy.outAlias&&(r.splitBy.outAlias=r.splitBy.outAlias.trim())),r.stackBy&&(r.stackBy.value&&(r.stackBy.value=r.stackBy.value.trim()),r.stackBy.outAlias&&(r.stackBy.outAlias=r.stackBy.outAlias.trim())),"normalizationField"in r.parameters&&r.parameters.normalizationField&&(r.parameters.normalizationField=r.parameters.normalizationField.trim()),t.outStatistics?.length||(t.outStatistics=[{statisticType:"count",onStatisticField:"1",outStatisticFieldName:R}]),j(t,e,i)}async function j(t,e,i){const{outFields:r,orderByFields:n,groupByFieldsForStatistics:o,outStatistics:s}=t;if(r)for(let a=0;a<r.length;a++)r[a]=r[a].trim();if(n)for(let a=0;a<n.length;a++)n[a]=n[a].trim();if(o)for(let a=0;a<o.length;a++)o[a]=o[a].trim();if(s)for(let a=0;a<s.length;a++)s[a].onStatisticField&&(s[a].onStatisticField=s[a].onStatisticField.trim());return t.geometry&&!t.outSR&&(t.outSR=t.geometry.spatialReference),w(t,e,i)}async function w(t,e,i){if(!t)return null;let{where:r}=t;if(t.where=r=r?.trim(),(!r||/^1 *= *1$/.test(r)||e&&e===r)&&(t.where=null),!t.geometry)return t;let o=await v(t);if(t.distance=0,t.units=null,"esriSpatialRelEnvelopeIntersects"===t.spatialRel){const{spatialReference:e}=t.geometry;o=n(o),o.spatialReference=e}if(o){await y(o.spatialReference,i),o=F(o,i);const e=(await m(l(o)))[0];if(null==e)throw S;const r="quantizationParameters"in t&&t.quantizationParameters?.tolerance||"maxAllowableOffset"in t&&t.maxAllowableOffset||0,n=r&&B(o,i)?{extendedParams:{densificationStep:8*r}}:void 0,s=e.toJSON(),a=d(s,s.spatialReference,i,n);if(!a)throw S;a.spatialReference=i,t.geometry=a}return t}function B(t,e){if(!t)return!1;const i=t.spatialReference;return(s(t)||o(t)||a(t))&&!f(i,e)&&!r(i,e)}function F(t,e){const i=t.spatialReference;return B(t,e)&&s(t)?{spatialReference:i,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:t}async function v(e){const{distance:r,units:n}=e,s=e.geometry;if(
|
|
2
|
+
import t from"../../../core/Error.js";import{JSONMap as e}from"../../../core/jsonMap.js";import{getUnitString as i}from"../../../core/units.js";import{canProjectWithoutEngine as r}from"../../../geometry/projectionUtils.js";import{getGeometryExtent as n}from"../../../geometry/support/extentUtils.js";import{isPolygon as o,isExtent as s,isPolyline as a}from"../../../geometry/support/jsonTypeUtils.js";import{fromJSON as l}from"../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as m}from"../../../geometry/support/normalizeUtils.js";import{isGeographic as u,isWebMercator as c,wgs84 as p,equals as f}from"../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as y,project as d}from"./projectionSupport.js";const g=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),S=Object.freeze({}),R="frequency";async function x(t,e,i){const r=t.bin;return r.onField&&(r.onField=r.onField.trim()),r.onExpression?.value&&(r.onExpression.value=r.onExpression.value.trim()),r.splitBy&&(r.splitBy.value&&(r.splitBy.value=r.splitBy.value.trim()),r.splitBy.outAlias&&(r.splitBy.outAlias=r.splitBy.outAlias.trim())),r.stackBy&&(r.stackBy.value&&(r.stackBy.value=r.stackBy.value.trim()),r.stackBy.outAlias&&(r.stackBy.outAlias=r.stackBy.outAlias.trim())),"normalizationField"in r.parameters&&r.parameters.normalizationField&&(r.parameters.normalizationField=r.parameters.normalizationField.trim()),t.outStatistics?.length||(t.outStatistics=[{statisticType:"count",onStatisticField:"1",outStatisticFieldName:R}]),j(t,e,i)}async function j(t,e,i){const{outFields:r,orderByFields:n,groupByFieldsForStatistics:o,outStatistics:s}=t;if(r)for(let a=0;a<r.length;a++)r[a]=r[a].trim();if(n)for(let a=0;a<n.length;a++)n[a]=n[a].trim();if(o)for(let a=0;a<o.length;a++)o[a]=o[a].trim();if(s)for(let a=0;a<s.length;a++)s[a].onStatisticField&&(s[a].onStatisticField=s[a].onStatisticField.trim());return t.geometry&&!t.outSR&&(t.outSR=t.geometry.spatialReference),w(t,e,i)}async function w(t,e,i){if(!t)return null;let{where:r}=t;if(t.where=r=r?.trim(),(!r||/^1 *= *1$/.test(r)||e&&e===r)&&(t.where=null),!t.geometry)return t;let o=await v(t);if(t.distance=0,t.units=null,"esriSpatialRelEnvelopeIntersects"===t.spatialRel){const{spatialReference:e}=t.geometry;o=n(o),o.spatialReference=e}if(o){await y(o.spatialReference,i),o=F(o,i);const e=(await m(l(o)))[0];if(null==e)throw S;const r="quantizationParameters"in t&&t.quantizationParameters?.tolerance||"maxAllowableOffset"in t&&t.maxAllowableOffset||0,n=r&&B(o,i)?{extendedParams:{densificationStep:8*r}}:void 0,s=e.toJSON(),a=d(s,s.spatialReference,i,n);if(!a)throw S;a.spatialReference=i,t.geometry=a}return t}function B(t,e){if(!t)return!1;const i=t.spatialReference;return(s(t)||o(t)||a(t))&&!f(i,e)&&!r(i,e)}function F(t,e){const i=t.spatialReference;return B(t,e)&&s(t)?{spatialReference:i,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:t}async function v(e){const{distance:r,units:n}=e,s=e.geometry;if(!r||"vertexAttributes"in s)return s;const a=s.spatialReference,l=n?g.fromJSON(n):i(a),m=a&&(u(a)||c(a))?s:await y(a,p).then(()=>d(s,p)),f=await import("../../../geometry/operators/json/geodesicBufferOperator.js");await f.load();const S=f.execute(m,r||1,{unit:l})??void 0;if(!S||!o(S)||0===S.rings.length)throw new t("unsupported-query:invalid-parameters","Invalid parameters for query by distance");return S}function h(t,e){return null==t?null:"string"==typeof t?e?new Date(`1970-01-01T${t}Z`).getTime():new Date(t).getTime():t instanceof Date?t.getTime():t}export{h as getDateInNumber,x as normalizeAttributeBinsQuery,j as normalizeQuery,w as normalizeQueryLike,S as queryEngineEmptyResult,g as unitsKebabDict};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function n(n){const u=new Map;for(const o of n.files){const n=t(o);u.set(o.name,n)}return u}function t(n){const t=new Map;for(const u of n.statistics??[]){const n=u.column.at(-1);null!=n&&t.set(n,{minValue:u.minValue,maxValue:u.maxValue,nullCount:u.nullCount??0,distinctCount:u.distinctCount??null})}return new u(0,0,t)}class u{static fromFile(n){const t=n.numRows(),o=n.byteLength(),l=new Map;for(const u of n.getColumnDescriptors()){const n=u.minValue(),t=u.maxValue(),o=u.distinctCount(),s=u.nullCount();null!=n&&null!=t&&
|
|
2
|
+
function n(n){const u=new Map;for(const o of n.files){const n=t(o);u.set(o.name,n)}return u}function t(n){const t=new Map;for(const u of n.statistics??[]){const n=u.column.at(-1);null!=n&&t.set(n,{minValue:u.minValue,maxValue:u.maxValue,nullCount:u.nullCount??0,distinctCount:u.distinctCount??null})}return new u(0,0,t)}class u{static fromFile(n){const t=n.numRows(),o=n.byteLength(),l=new Map;for(const u of n.getColumnDescriptors()){const n=u.minValue(),t=u.maxValue(),o=u.distinctCount()??null,s=u.nullCount()??null;null!=n&&null!=t&&l.set(u.name(),{minValue:n,maxValue:t,distinctCount:o,nullCount:s}),u.free()}return new u(t,o,l)}constructor(n,t,u){this.rowCount=n,this.byteSize=t,this.statistics=u}}export{u as FileStatistics,t as parseFileStatistics,n as parseFileStatisticsMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as r}from"../../../../core/compilerUtils.js";import s from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{onAbortOrThrow as a,throwIfAborted as n}from"../../../../core/promiseUtils.js";import{QueueProcessor as o}from"../../../../core/QueueProcessor.js";import{parseWhereClause as u}from"../../../../core/sql.js";import l from"../../../../geometry/SpatialReference.js";import{set as p,create as c,expandWithAABB as d,expandWithRect as f,negativeInfinity as m}from"../../../../geometry/support/aaBoundingBox.js";import{getQueryResultExtent as h,QueryEngine as y}from"../../data/QueryEngine.js";import{queryBinsCapabilities as g,queryCapabilities as _}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as w}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as x}from"../../data/queryUtils.js";import{createFileProvider as I}from"../parquet/createFileProvider.js";import{createDrawingInfo as F}from"./clientSideDefaults.js";import{getParquetFileId as S,getParquetRowId as R}from"./parquetIdUtils.js";import q from"../../../support/Field.js";import v from"../../../support/FieldsIndex.js";import{fromParquetGeometryEncodingJSON as C}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as E,fromParquetJSONGeometryType as O,toParquetJSONGeometryType as b}from"../../../support/parquetUtils.js";import{loadParquetModule as P}from"../../../../libs/parquet/loadParquetModule.js";import{FeatureStoreQueryAdapter as Q}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as T}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as j}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as N}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as A}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const M=new Q,B=4,G="__OBJECTID",D=new TextDecoder,z=8e3,k=8,V=2,W=20;class U{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){n(e),await this._fill(e);const t=await J(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,null!=t.chunk)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<k;){const t=this._getOrCreateNextStream(e);if(null==t)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){const t=this._resolvedCount>=k?k:V;if(this._fileIndex<this._files.length&&this._streams.length<t){const t=this._files[this._fileIndex++],r=new Z(t.id,this._createFileStream(t,e));return this._streams.push(r),r}return this._getNextStream()}_getNextStream(){const e=this._streams.length;for(let t=0;t<e;t++){const r=(this._streamIndex+t)%e,s=this._streams[r];if(s.canRead)return this._streamIndex=(r+1)%e,s}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function J(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class Z{constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&0===this._readCount}async read(e){this._readCount++;try{const t=await this._stream,r=await t.next(e);return null==r?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:r}}finally{this._readCount--}}}class L{constructor(){this._queue=new o({concurrency:B,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={}}async load(e){const t=e.spatialReference?l.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new s("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");this._customParameters=e.customParameters,this._provider=I(e.provider,null,()=>this._customParameters);const r=await this._provider.getMetadata(),a=await E(r,{fields:e.fields?.map(e=>q.fromJSON(e)),geometryEncoding:e.geometryEncoding?C(e.geometryEncoding):null,geometryType:e.geometryType?O(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(!a.fields)throw new s("parquet:unsupported","Fields must be defined");let n;if(a.spatialReference&&a.geometryType){if(!a.spatialReference)throw new s("parquet:unsupported","SpatialReference must be defined");if(!a.spatialReference.isGeographic&&!a.spatialReference.isWebMercator)throw new s("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");a.spatialReference.isGeographic&&!a.spatialReference.isWGS84&&(i.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:a.spatialReference}),a.spatialReference=l.WGS84),n={geometry:a.geometryEncoding?{geometryType:b(a.geometryType),spatialReference:a.spatialReference.toJSON(),encoding:a.geometryEncoding.toJSON()}:null,displayOptimization:a.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=a.displayOptimization,await this._provider.updateGeometryInfo(n),this._capabilities=ie(await this._getFileStatistics());const o=await this._provider.getFiles();if(!o.length)return{layerDefinition:{},capabilities:ie(null)};const u=await o[0].file;a.file=u;const{fields:p}=a;if(null==p)throw new s("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",p);p.push(new q({name:G,type:"oid",alias:G}));for(const s of p){const e=u.getColumnId(s.name);null!=e&&(this._indexMap[s.name]=e)}const c=new v(p.map(e=>e.toJSON()));this._fieldsIndex=c;const d=b(a.geometryType??"point");return this._metadata=N.createFeature({fieldsIndex:c.toJSON(),geometryType:d,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:a.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:d,featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:a.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=r?.extent?r.extent:await this._tryDeriveParquetFullExtent(a),{capabilities:this._capabilities,layerDefinition:{fields:a.fields?.map(e=>e.toJSON()),drawingInfo:F(d),extent:this._fullExtent??void 0,geometryType:d,geometryEncoding:a.geometryEncoding?.toJSON(),displayOptimization:a.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(const{handle:e}of this._streams.values())e.remove();this._streams.clear()}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._provider=I(e,this._provider.getGeometryInfo(),()=>this._customParameters)}async queryFeatures(e,t){this._validateQuery(e),ae(e)||(e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,z):z,e.resultOffset=e.resultOffset??0),(e.outStatistics||e.returnDistinctValues)&&(e.returnGeometry=void 0);return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){const r=await x(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!H(r))return this._getFeatureCount();r.outFields=void 0,r.returnGeometry=void 0;return(await this._enqueueQuery(r,t)).createQueryResponseForCount()}async queryObjectIds(e,t){const r=await x(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),!H(r))return Array.from({length:await this._getFeatureCount()},(e,t)=>t);r.resultRecordCount=r.resultRecordCount?Math.min(r.resultRecordCount,8e3):8e3,r.resultOffset=r.resultOffset??0,r.returnGeometry=void 0,r.outFields=void 0;return(await this._enqueueQuery(r,t)).items.map(e=>e.getObjectId())}async queryExtent(e,t){const s=await x(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(s),this._fullExtent&&!H(s))return{count:await this._getFeatureCount(),extent:this._fullExtent};const i=r(this._metadata.spatialReference);s.returnGeometry=!0,s.outFields=void 0;const a=p(c(),m),n=c(),o=await this._enqueueQuery(s,t);let u=0;for(const r of o.items)r.getBounds(n)&&(d(a,n),u+=1);return{count:u,extent:h(a,i,s.outSR?r(s.outSR):i.toJSON(),i,!1)}}async queryStream(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const r=await this._getCandidateFiles(e),s=new U(r,async(t,r)=>{const s=await t.file,i=await this._createParquetQuery(s,e);return s.executeQuery(i,r)}),i=this._streamIdCounter++,n=a(t.signal,e=>{const t=this._streams.get(i);null!=t&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:s,handle:n}),i}async getStreamNext(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const r=this._streams.get(e);if(!r)return{result:null};const s=await r.stream.next(t.signal);if(null==s)return r.handle.remove(),this._streams.delete(e),{result:null};const i=s.chunk.serialize().buffer,a={fileId:s.fileId,buffer:i};return i instanceof ArrayBuffer?{result:a,transferList:[i]}:{result:a}}async createPatch(e,t,r,s,i){if(!i.signal)throw new Error("InternalError: AbortSignal must be passed");const a=await this._getFileInfoById(e),n=await a.file;return(await n.createChunkPatch(t,r,s,i.signal)).serialize().buffer}async _getCandidateFiles(e){const t=await this._provider.getFiles(),r=await this._getSpatialFilePruning(e);if(null==r)return t;const s=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,r));return"xz"===r.type?$(s,r):s}async _getSpatialFilePruning(e){if("tile"!==e.type)return null;const t=this._displayOptimization,r=t?.index;if(null==r)return null;const s=e.outSpatialReference.wkid;if(null==r.wkid||null==s)return null;const i=r.wkid,a=await P();switch(r.type){case"xz":return{type:"xz",fieldName:r.code,intersects:(t,n)=>a.queryIntersectsXZStatistics(r.fullExtent,e.extent,s,i,W,t,n)};case"z":return{type:"xy",xFieldName:r.xColumn,yFieldName:r.yColumn,intersects:(t,r,n,o)=>a.queryIntersectsXYStatistics(e.extent,s,i,t,r,n,o)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case"xz":{const r=X(e,t);return null==r||te(r,t)}case"xy":{const{xStatistics:r,yStatistics:s}=ee(e,t);return null==r||null==s||re(r,s,t)}}}async _tryDeriveParquetFullExtent(r){if(!r.spatialReference)return null;if(null==this._fullExtent&&"location"===r.geometryEncoding?.type){const i=await this._provider.getFiles(),{xField:a,yField:n}=r.geometryEncoding,o=p(c(),m);for(const r of i){const i=await r.file;for(const r of i.rowGroups()){const i={stack:[],error:void 0,hasError:!1};try{const t=e(i,r.columnDescriptorForAttribute(a),!1),s=e(i,r.columnDescriptorForAttribute(n),!1),u=[t.minValue(),s.minValue(),t.maxValue(),s.maxValue()];f(o,u),r.free()}catch(s){i.error=s,i.hasError=!0}finally{t(i)}}}return{xmin:o[0],ymin:o[1],xmax:o[3],ymax:o[4],spatialReference:r.spatialReference?.toJSON()}}return null}async _getFileInfoById(e){const t=await this._provider.getFiles();for(const r of t)if(r.id===e)return r;throw new Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t){const r=(await P()).Query.new();return"tile"===t.type&&(r.setExtent(t.extent),r.setQuantizationTransform(t.transform),r.setScale(t.scale)),r.setOutFields(t.outFields.filter(e=>null!=this._indexMap[e])),r.setOutSpatialReference(t.outSpatialReference.wkid),r.setReturnGeometry(t.returnGeometry),t.where&&await this._setWhereClause(r,e,t.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new s("parquet:unsupported","Statistics queries are not supported",{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new s("parquet:unsupported","Queries using orderBy are not supported",{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new s("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:e})}async _setWhereClause(e,t,r){const i=this._indexMap,a=this._fieldsIndex,n={getAttribute(e,r){const s=t.readAttribute(e.rowGroup,e.row,i[r]);if(null==s)return null;const n=a.get(r);return"esriFieldTypeString"===n.type||"esriFieldTypeDateOnly"===n.type||"esriFieldTypeTimeOnly"===n.type||"esriFieldTypeTimestampOffset"===n.type?D.decode(s):s}},o=await u(r,this._fieldsIndex);if(!o.isStandardized)throw new s("sql-parse-error","expression is not standardized");const l=(e,t)=>o.testFeatureCompiled({rowGroup:e,row:t},n,null);e.setWhere(r),e.setWhereEvaluator(l),e.setWhereFields(o.fieldNames)}async*_fetchChunks(e,t){const r=await P(),s=await this._provider.getFiles();for(const i of s){const s=await i.file,a=r.Query.new();a.setOutFields(e.fields),a.setReturnGeometry(e.returnGeometry),e.where&&await this._setWhereClause(a,s,e.where);const o=await s.executeQuery(a),u=[],l=o.next(t);for(let e=0;e<B;e++)u.push(o.next(t));let p=await l;for(;null!=p;){n(t);const e=new A(this._metadata,this._indexMap,p,i.id),r=Y([new T(e,null,0,!1)],this._queryEngineParams),s=u.shift();u.push(o.next(t)),yield r,p=await s}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){const r=await this._getReadParams(e);if(e.where=void 0,e.objectIds?.length){const r=new Map;for(const t of e.objectIds){const e=S(t),s=R(t);let i=r.get(e);i||(i=[],r.set(e,i)),i.push(s)}const s=[];for(const[i,a]of r.entries()){const r=await this._executeFileIdQuery(e,i,a,t);for(const e of r)s.push(e)}return new w(s,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:M,featureIdInfo:this._queryEngineParams.featureIdInfo})}let s=e.resultRecordCount??await this._getFeatureCount(),i=e.resultOffset??0;e.resultRecordCount=void 0,e.resultOffset=void 0;const a=[];for await(const n of this._fetchChunks(r,t)){const r=await n.executeQueryForOpaqueFeatures(e,t);if(r.length>i){const t=r.slice(i,Math.min(i+s,r.length));for(const e of t)a.push(e);if(i=0,s-=t.length,0===s)return new w(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:M,featureIdInfo:this._queryEngineParams.featureIdInfo})}else i-=r.length}return new w(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:M,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,r,s){const i=await this._getReadParams(e),a=(await P()).Query.new();a.setOutFields(i.fields),a.setReturnGeometry(i.returnGeometry),a.setIds(new Uint32Array(r));const n=await this._getFile(t),o=await n.executeQuery(a,s);let u=await o.next(s),l=0;const p=[];for(;null!=u;){const e=new A(this._metadata,this._indexMap,u,t),r=new T(e,null,l++,!1);p.push(r),u=await o.next(s)}return Y(p,this._queryEngineParams).executeQueryForOpaqueFeatures(e,s)}async _getReadParams(e){const t=new Set;if(e.outStatistics)for(const r of e.outStatistics)null!=r.onStatisticField&&t.add(r.onStatisticField);if(e.outFields)for(const r of e.outFields)t.add(r);return{fields:(t.has("*")?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>null!=this._indexMap[e]),returnGeometry:!!e.returnGeometry||!!e.geometry,where:e.where}}}function H(e){for(const t in e){const r=t;switch(r){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"objectIds":case"historicMoment":case"where":return null!=e[r]}}return!1}function Y(e,t){const r=new j;for(const s of e)r.insert(s);return new y({...t,featureStore:r})}function X(e,t){return e.statistics.statistics.get(t.fieldName)??null}function $(e,t){return e.slice().sort((e,r)=>{const s=K(e,t),i=K(r,t);return s===i?0:s<i?-1:1})}function K(e,t){const r=X(e,t);if(null==r)return Number.POSITIVE_INFINITY;const s=se(r.minValue),i=se(r.maxValue);return null==s||null==i||i<s?Number.POSITIVE_INFINITY:i-s}function ee(e,t){return{xStatistics:e.statistics.statistics.get(t.xFieldName)??null,yStatistics:e.statistics.statistics.get(t.yFieldName)??null}}function te(e,t){const r=se(e.minValue),s=se(e.maxValue);return null==r||null==s||t.intersects(r,s)}function re(e,t,r){const s=se(e.minValue),i=se(e.maxValue),a=se(t.minValue),n=se(t.maxValue);return null==s||null==i||null==a||null==n||r.intersects(s,i,a,n)}function se(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function ie(e){const t=e?.featureCount;let r=!1;return null!=t&&t<has("parquetlayer-full-query-feature-count")&&(r=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{..._,maxRecordCount:z,supportsDistinct:r,supportsOrderBy:r,supportsStatistics:r,supportsSpatialAggregationStatistics:r,supportedSpatialAggregationStatistics:{envelope:r,centroid:r,convexHull:r}},queryAttributeBins:r?g:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function ae(e){return!!(e.objectIds?.length||e.outStatistics||e.orderByFields?.length||e.returnDistinctValues)}export{L as default};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{toConst as s}from"../../../../core/compilerUtils.js";import r from"../../../../core/Error.js";import has from"../../../../core/has.js";import i from"../../../../core/Logger.js";import{onAbortOrThrow as n,throwIfAborted as a}from"../../../../core/promiseUtils.js";import{QueueProcessor as o}from"../../../../core/QueueProcessor.js";import{parseWhereClause as u}from"../../../../core/sql.js";import l from"../../../../geometry/SpatialReference.js";import{set as c,create as p,expandWithAABB as d,expandWithRect as f,negativeInfinity as m}from"../../../../geometry/support/aaBoundingBox.js";import{isWebMercator as y,isWGS84 as h}from"../../../../geometry/support/spatialReferenceUtils.js";import{getQueryResultExtent as g,getQueryBBoxes as _,QueryEngine as w}from"../../data/QueryEngine.js";import{queryCapabilities as x}from"../../data/QueryEngineCapabilities.js";import{QueryEngineResult as F}from"../../data/QueryEngineResult.js";import{normalizeQueryLike as S}from"../../data/queryUtils.js";import{createFileProvider as I}from"../parquet/createFileProvider.js";import{createDrawingInfo as v}from"./clientSideDefaults.js";import{getParquetFileId as q,getParquetRowId as R,getParquetObjectId as C}from"./parquetIdUtils.js";import b from"../../../support/Field.js";import E from"../../../support/FieldsIndex.js";import{isNumericField as O}from"../../../support/fieldUtils.js";import{fromParquetGeometryEncodingJSON as T}from"../../../support/parquetEncodingUtils.js";import{completeParquetLayerInfo as P,fromParquetJSONGeometryType as Q,toParquetJSONGeometryType as j}from"../../../support/parquetUtils.js";import{loadParquetModule as N}from"../../../../libs/parquet/loadParquetModule.js";import{FeatureStoreQueryAdapter as A}from"../../../../views/2d/layers/features/FeatureStoreQueryAdapter.js";import{FeatureSnapshotSourceChunk as B}from"../../../../views/2d/layers/features/sources/strategies/chunks/FeatureSnapshotSourceChunk.js";import{FeatureSourceChunkStore as M}from"../../../../views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js";import{FeatureMetadata as D}from"../../../../views/2d/layers/features/support/FeatureMetadata.js";import{FeatureSetReaderParquet as G}from"../../../../views/2d/layers/features/support/FeatureSetReaderParquet.js";const z=new A,V=4,k="__OBJECTID",U=new TextDecoder,W=8e3,J=2e7,Z=8,L=2,H=20;class Y{constructor(e,t){this._files=e,this._createFileStream=t,this._fileIndex=0,this._streamIndex=0,this._streams=[],this._pending=new Set,this._resolvedCount=0}async next(e){for(await this._fill(e);this._pending.size>0;){a(e),await this._fill(e);const t=await X(this._pending);if(this._pending.delete(t.read),this._resolvedCount++,null!=t.chunk)return t.chunk}return null}async _fill(e){for(this._removeDone();this._pending.size<Z;){const t=this._getOrCreateNextStream(e);if(null==t)return;this._pending.add(t.read(e))}}_getOrCreateNextStream(e){const t=this._resolvedCount>=Z?Z:L;if(this._fileIndex<this._files.length&&this._streams.length<t){const t=this._files[this._fileIndex++],s=new $(t.id,this._createFileStream(t,e));return this._streams.push(s),s}return this._getNextStream()}_getNextStream(){const e=this._streams.length;for(let t=0;t<e;t++){const s=(this._streamIndex+t)%e,r=this._streams[s];if(r.canRead)return this._streamIndex=(s+1)%e,r}return null}_removeDone(){let e=this._streamIndex;for(let t=this._streams.length-1;t>=0;t--)this._streams[t].done&&(this._streams.splice(t,1),t<e&&e--);this._streamIndex=this._streams.length>0?e%this._streams.length:0}}function X(e){return Promise.race(Array.from(e,async e=>({read:e,chunk:await e})))}class ${constructor(e,t){this._fileId=e,this._stream=t,this._readCount=0,this._reachedEnd=!1}get canRead(){return!this._reachedEnd}get done(){return this._reachedEnd&&0===this._readCount}async read(e){this._readCount++;try{const t=await this._stream,s=await t.next(e);return null==s?(this._reachedEnd=!0,null):{fileId:this._fileId,chunk:s}}finally{this._readCount--}}}class K{constructor(){this._queue=new o({concurrency:V,process:(e,t)=>this._executeQuery(e,t)}),this._streams=new Map,this._streamIdCounter=0,this._indexMap={}}async load(e){const t=e.spatialReference?l.fromJSON(e.spatialReference):void 0;if(t&&!t.isWGS84&&!t.isWebMercator)throw new r("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");this._customParameters=e.customParameters,this._provider=I(e.provider,null,()=>this._customParameters);const s=await this._provider.getMetadata(),n=await P(s,{fields:e.fields?.map(e=>b.fromJSON(e)),geometryEncoding:e.geometryEncoding?T(e.geometryEncoding):null,geometryType:e.geometryType?Q(e.geometryType):null,displayOptimization:e.displayOptimization,spatialReference:t});if(!n.fields)throw new r("parquet:unsupported","Fields must be defined");let a;if(n.spatialReference&&n.geometryType){if(!n.spatialReference)throw new r("parquet:unsupported","SpatialReference must be defined");if(!n.spatialReference.isGeographic&&!n.spatialReference.isWebMercator)throw new r("parquet:unsupported-projection","Only WGS84 and Web Mercator are supported");n.spatialReference.isGeographic&&!n.spatialReference.isWGS84&&(i.getLogger("parquet:unsupported-projection").warn("Found a geographic projection that is not WGS84. Handling as WGS84.",{spatialReference:n.spatialReference}),n.spatialReference=l.WGS84),a={geometry:n.geometryEncoding?{geometryType:j(n.geometryType),spatialReference:n.spatialReference.toJSON(),encoding:n.geometryEncoding.toJSON()}:null,displayOptimization:n.displayOptimization}}this.setCustomParameters(e.customParameters),this._displayOptimization=n.displayOptimization,await this._provider.updateGeometryInfo(a),this._capabilities=he(await this._getFileStatistics());const o=await this._provider.getFiles();if(!o.length)return{layerDefinition:{},capabilities:he(null)};const u=await o[0].file;n.file=u;const{fields:c}=n;if(null==c)throw new r("parquet-layer:missing-metadata","Unable to create parquet source: cannot infer fields",c);c.push(new b({name:k,type:"oid",alias:k}));for(const r of c){const e=u.getColumnId(r.name);null!=e&&(this._indexMap[r.name]=e)}const p=new E(c.map(e=>e.toJSON()));this._fieldsIndex=p;const d=j(n.geometryType??"point");return this._metadata=D.createFeature({fieldsIndex:p.toJSON(),geometryType:d,hasZ:!1,hasM:!1,featureIdInfo:{type:"object-id",fieldName:"rowId"},subtypes:null,subtypeField:null,types:null,typeIdField:null,globalIdField:null,spatialReference:n.spatialReference,outSpatialReference:null,timeInfo:null,timeReferenceUnknownClient:null,dateFieldsTimeZone:null}),this._queryEngineParams={fieldsIndex:this._metadata.fieldsIndex,geometryType:d,featureIdInfo:{type:"object-id",fieldName:"rowId"},hasM:!1,hasZ:!1,spatialReference:n.spatialReference?.toJSON()??{wkid:4326},aggregateAdapter:null,timeInfo:null,definitionExpression:null},this._fullExtent=s?.extent?s.extent:await this._tryDeriveParquetFullExtent(n),{capabilities:this._capabilities,layerDefinition:{fields:n.fields?.map(e=>e.toJSON()),drawingInfo:v(d),extent:this._fullExtent??void 0,geometryType:d,geometryEncoding:n.geometryEncoding?.toJSON(),displayOptimization:n.displayOptimization}}}destroy(){this._provider.destroy(),this._queue.destroy();for(const{handle:e}of this._streams.values())e.remove();this._streams.clear()}setCustomParameters(e){this._customParameters=e}getIndexMap(){return this._indexMap}async updateFileProvider(e){this._provider=I(e,this._provider.getGeometryInfo(),()=>this._customParameters)}async queryFeatures(e,t){if(this._validateQuery(e),ge(e)||(e.resultRecordCount=e.resultRecordCount?Math.min(e.resultRecordCount,W):W,e.resultOffset=e.resultOffset??0),e.outStatistics)return this._queryStatistics(e,t);e.returnDistinctValues&&(e.returnGeometry=void 0);return(await this._enqueueQuery(e,t)).createQueryResponse()}async queryFeatureCount(e,t){const s=await S(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(s),!ee(s))return this._getFeatureCount();s.outFields=void 0,s.returnGeometry=void 0;return(await this._enqueueQuery(s,t)).createQueryResponseForCount()}async queryObjectIds(e,t){const s=await S(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(s),!ee(s))return Array.from({length:await this._getFeatureCount()},(e,t)=>t);s.resultRecordCount=s.resultRecordCount?Math.min(s.resultRecordCount,8e3):8e3,s.resultOffset=s.resultOffset??0,s.returnGeometry=void 0,s.outFields=void 0;return(await this._enqueueQuery(s,t)).items.map(e=>e.getObjectId())}async queryAttributeBins(e,t={}){throw new r("parquet:unsupported","queryAttributeBins not supported.")}async queryExtent(e,t){const r=await S(e,null,this._queryEngineParams.spatialReference);if(this._validateQuery(r),this._fullExtent&&!ee(r))return{count:await this._getFeatureCount(),extent:this._fullExtent};const i=s(this._metadata.spatialReference);r.returnGeometry=!0,r.outFields=void 0;const n=c(p(),m),a=p(),o=await this._enqueueQuery(r,t);let u=0;for(const s of o.items)s.getBounds(a)&&(d(n,a),u+=1);return{count:u,extent:g(n,i,r.outSR?s(r.outSR):i.toJSON(),i,!1)}}async queryStream(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const s=await this._getCandidateFiles(e),r=new Y(s,async(t,s)=>{const r=await t.file,i=await this._createParquetQuery(r,t.id,e);return r.executeQuery(i,s)}),i=this._streamIdCounter++,a=n(t.signal,e=>{const t=this._streams.get(i);null!=t&&(t.handle.remove(),this._streams.delete(i))});return this._streams.set(i,{stream:r,handle:a}),i}async getStreamNext(e,t){if(!t.signal)throw new Error("InternalError: AbortSignal must be passed");const s=this._streams.get(e);if(!s)return{result:null};const r=await s.stream.next(t.signal);if(null==r)return s.handle.remove(),this._streams.delete(e),{result:null};const i=r.chunk.serialize().buffer,n={fileId:r.fileId,buffer:i};return i instanceof ArrayBuffer?{result:n,transferList:[i]}:{result:n}}async createPatch(e,t,s,r,i){if(!i.signal)throw new Error("InternalError: AbortSignal must be passed");const n=await this._getFileInfoById(e),a=await n.file;return(await a.createChunkPatch(t,s,r,i.signal)).serialize().buffer}async _getCandidateFiles(e){const t=await this._provider.getFiles(),s=await this._getSpatialFilePruning(e);if(null==s)return t;const r=t.filter(e=>this._mayIncludeFileForSpatialPruning(e,s));return"xz"===s.type?ce(r,s):r}async _queryStatistics(e,t){const s=await S({...e},null,this._queryEngineParams.spatialReference);if(s.returnGeometry=void 0,te(s,this._fieldsIndex)){const e=await this._getStatisticsFromFiles(s);if(e)return e}return(await this._enqueueQuery(s,t)).createQueryResponse()}async _getStatisticsFromFiles(e){const t=await this._provider.getFiles(),s={},r=[];for(const i of e.outStatistics??[]){const e=ie(i,t);if(!e.available)return null;s[i.outStatisticFieldName]=e.value,r.push(re(i,this._fieldsIndex))}return{fields:r,features:[{attributes:s}]}}async _getSpatialFilePruning(e){if("tile"!==e.type)return null;const t=this._displayOptimization,s=t?.index;if(null==s)return null;const r=e.outSpatialReference.wkid;if(null==s.wkid||null==r)return null;const i=s.wkid,n=await N();switch(s.type){case"xz":return{type:"xz",fieldName:s.code,intersects:(t,a)=>n.queryIntersectsXZStatistics(s.fullExtent,e.extent,r,i,H,t,a)};case"z":return{type:"xy",xFieldName:s.xColumn,yFieldName:s.yColumn,intersects:(t,s,a,o)=>n.queryIntersectsXYStatistics(e.extent,r,i,t,s,a,o)}}}_mayIncludeFileForSpatialPruning(e,t){switch(t.type){case"xz":{const s=le(e,t);return null==s||fe(s,t)}case"xy":{const{xStatistics:s,yStatistics:r}=de(e,t);return null==s||null==r||me(s,r,t)}}}async _tryDeriveParquetFullExtent(s){if(!s.spatialReference)return null;if(null==this._fullExtent&&"location"===s.geometryEncoding?.type){const i=await this._provider.getFiles(),{xField:n,yField:a}=s.geometryEncoding,o=c(p(),m);for(const s of i){const i=await s.file;for(const s of i.rowGroups()){const i={stack:[],error:void 0,hasError:!1};try{const t=e(i,s.columnDescriptorForAttribute(n),!1),r=e(i,s.columnDescriptorForAttribute(a),!1),u=[t.minValue(),r.minValue(),t.maxValue(),r.maxValue()];f(o,u),s.free()}catch(r){i.error=r,i.hasError=!0}finally{t(i)}}}return{xmin:o[0],ymin:o[1],xmax:o[3],ymax:o[4],spatialReference:s.spatialReference?.toJSON()}}return null}async _getFileInfoById(e){const t=await this._provider.getFiles();for(const s of t)if(s.id===e)return s;throw new Error(`InternalError: File ${e} does not exist`)}async _getFileStatistics(){return{featureCount:await this._getFeatureCount(),byteLength:await this._getByteLength()}}async _getFile(e){return(await this._getFileInfoById(e)).file}async _createParquetQuery(e,t,s){const r=(await N()).Query.new();return"tile"===s.type&&(r.setExtent(s.extent),r.setQuantizationTransform(s.transform),r.setScale(s.scale)),r.setOutFields(s.outFields.filter(e=>null!=this._indexMap[e])),r.setOutSpatialReference(s.outSpatialReference.wkid),r.setReturnGeometry(s.returnGeometry),s.where&&await this._setWhereClause(r,e,t,s.where),r}async _getFeatureCount(){return(await this._provider.getFiles()).map(e=>e.statistics.rowCount).reduce((e,t)=>e+t,0)}async _getByteLength(){return(await this._provider.getFiles()).map(e=>e.statistics.byteSize).reduce((e,t)=>e+t,0)}_validateQuery(e){if(!this._capabilities.query.supportsStatistics&&e.outStatistics)throw new r("parquet:unsupported","Statistics queries are not supported",{query:e});if(!this._capabilities.query.supportsOrderBy&&e.orderByFields?.length)throw new r("parquet:unsupported","Queries using orderBy are not supported",{query:e});if(!this._capabilities.query.supportsDistinct&&e.returnDistinctValues)throw new r("parquet:unsupported","Queries using returnDistinctValues are not supported",{query:e})}async _setWhereClause(e,t,s,i){const n=this._indexMap,a=this._fieldsIndex,o={getAttribute(e,r){const i=n[r];if(null==i){const t=a.get(r);if("__OBJECTID"===t?.name){const t=e.row+e.rowGroupStart;return C(s,t)}return null}const o=t.readAttribute(e.rowGroup,e.row,i);if(null==o)return null;const u=a.get(r);return"esriFieldTypeString"===u.type||"esriFieldTypeDateOnly"===u.type||"esriFieldTypeTimeOnly"===u.type||"esriFieldTypeTimestampOffset"===u.type?U.decode(o):o}},l=await u(i,this._fieldsIndex);if(!l.isStandardized)throw new r("sql-parse-error","expression is not standardized");const c=(e,t,s)=>l.testFeatureCompiled({rowGroup:e,row:t,rowGroupStart:s},o,null),p=l.fieldNames.map(e=>a.get(e)).filter(e=>e&&null!=this._indexMap[e?.name]);e.setWhere(i),e.setWhereEvaluator(c),e.setWhereFields(p.map(e=>e.name))}async*_queryChunks(e,t){const s=await N(),r=await this._provider.getFiles(),i=await this._getRequiredFields(e);for(const n of r){const r=await n.file,o=s.Query.new();o.setOutFields(i),o.setReturnGeometry(!!e.returnGeometry);const u=e.geometry?.spatialReference??this._queryEngineParams.spatialReference,l=u.wkid;if(e.geometry&&(y(u)||h(u))){const t=p();for(const s of _(e.geometry))f(t,s);o.setOutSpatialReference(l),o.setExtent({xmin:t[0],ymin:t[1],xmax:t[2],ymax:t[3]})}e.where&&await this._setWhereClause(o,r,n.id,e.where);const c=await r.executeQuery(o),d=[],m=c.next(t);for(let e=0;e<V;e++)d.push(c.next(t));let g=await m;for(;null!=g;){a(t);const e=new G(this._metadata,this._indexMap,g,n.id),s=ue([new B(e,null,0,!1)],this._queryEngineParams),r=d.shift();d.push(c.next(t)),yield s,g=await r}}}_enqueueQuery(e,t){return this._queue.push(e,t)}async _executeQuery(e,t){if(e.objectIds?.length){const s=new Map;for(const t of e.objectIds){const e=q(t),r=R(t);let i=s.get(e);i||(i=[],s.set(e,i)),i.push(r)}const r=[];for(const[i,n]of s.entries()){const s=await this._executeFileIdQuery(e,i,n,t);for(const e of s)r.push(e)}return new F(r,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:z,featureIdInfo:this._queryEngineParams.featureIdInfo})}let s=e.resultRecordCount??await this._getFeatureCount(),i=e.resultOffset??0;if(s>J)throw new r("parquet:cannot-execute-query","Unable to execute query, dataset is too large.");const n={...e};e.where=void 0,e.resultRecordCount=void 0,e.resultOffset=void 0;const a=[];for await(const r of this._queryChunks(n,t)){const n=await r.executeQueryForOpaqueFeatures(e,t);if(n.length>i){const t=n.slice(i,Math.min(i+s,n.length));for(const e of t)a.push(e);if(i=0,s-=t.length,0===s)return new F(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:z,featureIdInfo:this._queryEngineParams.featureIdInfo})}else i-=n.length}return new F(a,e,{fieldsIndex:this._fieldsIndex,geometryType:this._metadata.geometryType,spatialReference:this._queryEngineParams.spatialReference,hasM:!1,hasZ:!1,featureAdapter:z,featureIdInfo:this._queryEngineParams.featureIdInfo})}async _executeFileIdQuery(e,t,s,r){const i=await this._getRequiredFields(e),n=(await N()).Query.new();n.setOutFields(i),n.setReturnGeometry(!!e.returnGeometry),n.setIds(new Uint32Array(s));const a=await this._getFile(t),o=await a.executeQuery(n,r);let u=await o.next(r),l=0;const c=[];for(;null!=u;){const e=new G(this._metadata,this._indexMap,u,t),s=new B(e,null,l++,!1);c.push(s),u=await o.next(r)}return ue(c,this._queryEngineParams).executeQueryForOpaqueFeatures(e,r)}async _getRequiredFields(e){const t=new Set;if(e.outStatistics)for(const s of e.outStatistics)null!=s.onStatisticField&&t.add(s.onStatisticField);else if(e.outFields)for(const s of e.outFields)t.add(s);return(t.has("*")?this._fieldsIndex.fields.map(e=>e.name):Array.from(t)).filter(e=>null!=this._indexMap[e])}}function ee(e){for(const t in e){const s=t;switch(s){case"resultOffset":case"resultRecordCount":case"aggregateIds":case"distance":case"gdbVersion":case"geometry":case"having":case"timeExtent":case"objectIds":case"historicMoment":case"where":return null!=e[s]}}return!1}function te(e,t){return!!e.outStatistics?.length&&!ee(e)&&!e.groupByFieldsForStatistics?.length&&!e.orderByFields?.length&&!e.returnDistinctValues&&!e.returnAggIds&&e.outStatistics.every(e=>se(e,t))}function se(e,t){switch(e.statisticType){case"count":return"1"===e.onStatisticField||null!=t.get(e.onStatisticField);case"min":case"max":{const s=t.get(e.onStatisticField);return null!=s&&O(s)}default:return!1}}function re(e,t){const s="exceedslimit"!==e.statisticType?t.get(e.onStatisticField):null,r="min"!==e.statisticType&&"max"!==e.statisticType||"esriFieldTypeDate"!==s?.type?"esriFieldTypeDouble":s.type;return{name:e.outStatisticFieldName,alias:e.outStatisticFieldName,type:r}}function ie(e,t){switch(e.statisticType){case"count":return ne(e,t);case"min":return ae(e,t,Math.min);case"max":return ae(e,t,Math.max);default:return{available:!1,value:null}}}function ne(e,t){if("count"!==e.statisticType)return{available:!1,value:null};if("1"===e.onStatisticField)return{available:!0,value:t.reduce((e,t)=>e+t.statistics.rowCount,0)};let s=0;for(const r of t){const t=r.statistics.statistics.get(e.onStatisticField);if(null==t||null==t.nullCount)return{available:!1,value:null};s+=r.statistics.rowCount-t.nullCount}return{available:!0,value:s}}function ae(e,t,s){if("min"!==e.statisticType&&"max"!==e.statisticType)return{available:!1,value:null};let r=null;const i="min"===e.statisticType?"minValue":"maxValue";for(const n of t){const t=n.statistics.statistics.get(e.onStatisticField);if(null==t)return{available:!1,value:null};const a=oe(t[i]);null!=a&&(r=null==r?a:s(r,a))}return{available:!0,value:r}}function oe(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function ue(e,t){const s=new M;for(const r of e)s.insert(r);return new w({...t,featureStore:s})}function le(e,t){return e.statistics.statistics.get(t.fieldName)??null}function ce(e,t){return e.slice().sort((e,s)=>{const r=pe(e,t),i=pe(s,t);return r===i?0:r<i?-1:1})}function pe(e,t){const s=le(e,t);if(null==s)return Number.POSITIVE_INFINITY;const r=ye(s.minValue),i=ye(s.maxValue);return null==r||null==i||i<r?Number.POSITIVE_INFINITY:i-r}function de(e,t){return{xStatistics:e.statistics.statistics.get(t.xFieldName)??null,yStatistics:e.statistics.statistics.get(t.yFieldName)??null}}function fe(e,t){const s=ye(e.minValue),r=ye(e.maxValue);return null==s||null==r||t.intersects(s,r)}function me(e,t,s){const r=ye(e.minValue),i=ye(e.maxValue),n=ye(t.minValue),a=ye(t.maxValue);return null==r||null==i||null==n||null==a||s.intersects(r,i,n,a)}function ye(e){return"number"==typeof e&&Number.isFinite(e)?e:null}function he(e){const t=e?.featureCount;let s=!1;return null!=t&&t<has("parquetlayer-full-query-feature-count")&&(s=!0),{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,isBranchVersioned:!1,supportedCurveTypes:[],supportsAttachment:!1,supportsM:!1,supportsTrueCurve:!1,supportsZ:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!0,supportsQueryBins:!1,supportsQueryPivot:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},query:{...x,maxRecordCount:W,supportsOrderBy:s,supportsDistinct:!0,supportsStatistics:!0,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1}},queryAttributeBins:{supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsTrueCurveUpdate:!1,supportsTrueCurveUpdateByTrueCurveClientsOnly:!0,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1,supportsAsyncApplyEdits:!1,zDefault:void 0}}}function ge(e){return!!(e.objectIds?.length||e.outStatistics||e.orderByFields?.length||e.returnDistinctValues)}export{K as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function
|
|
2
|
+
const n=2**32,t=2**16;function r(r){return Math.floor(r/n)%t}function o(t){return t%n}function u(t,r){return t*n+r}export{r as getParquetFileId,u as getParquetObjectId,o as getParquetRowId};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{isSome as e,equals as r,difference as a}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{updateOrigins as n}from"../../core/accessorSupport/originUtils.js";import{saveAs as s,save as o,getLayerJSON as l,getPortalItem as i,addItem as c,ensureLayerConfig as u,ensureItemConfig as y,setCommonItemProperties as p,createErrorMessage as f}from"./utils.js";import{parse as m}from"../support/arcgisLayerUrl.js";import{fetchFeatureService as d,getLayerModuleType as h}from"../support/fetchService.js";import{isLayerWithFeatureLayerSource as b}from"../support/layerUtils.js";import{createForItemWrite as w}from"../../portal/support/jsonContext.js";import{getWGS84ExtentForItem as T,toggleTypeKeyword as v,typeKeyword as L,removeTypeKeyword as S,hasTypeKeyword as I}from"../../portal/support/portalItemUtils.js";const g="Feature Service",E="feature-layer-utils",P=`${E}-save`,O=`${E}-save-as`,A=`${E}-saveall`,x=`${E}-saveall-as`;function j(e){return{isValid:b(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function N(e,r){const a=w(e,"portal-item");return r?.isTable&&(a.layerContainerType="tables"),a}function $(e){const r=N(e),a=N(e);return a.layerContainerType="tables",{forLayers:r,forTables:a}}function U(e){const r=[],a=[];for(const{layer:t,layerJSON:n}of e)R(t)?a.push(n):r.push(n);return{layers:r,tables:a}}function R(e,r){return e.isTable}function
|
|
2
|
+
import{isSome as e,equals as r,difference as a}from"../../core/arrayUtils.js";import t from"../../core/Error.js";import{updateOrigins as n}from"../../core/accessorSupport/originUtils.js";import{saveAs as s,save as o,getLayerJSON as l,getPortalItem as i,addItem as c,ensureLayerConfig as u,ensureItemConfig as y,setCommonItemProperties as p,createErrorMessage as f}from"./utils.js";import{parse as m}from"../support/arcgisLayerUrl.js";import{fetchFeatureService as d,getLayerModuleType as h}from"../support/fetchService.js";import{isLayerWithFeatureLayerSource as b}from"../support/layerUtils.js";import{createForItemWrite as w}from"../../portal/support/jsonContext.js";import{getWGS84ExtentForItem as T,toggleTypeKeyword as v,typeKeyword as L,removeTypeKeyword as S,hasTypeKeyword as I}from"../../portal/support/portalItemUtils.js";const g="Feature Service",E="feature-layer-utils",P=`${E}-save`,O=`${E}-save-as`,A=`${E}-saveall`,x=`${E}-saveall-as`;function j(e){return{isValid:b(e)&&(!("dynamicDataSource"in e)||!e.dynamicDataSource),errorMessage:"Feature layer should be a layer or table in a map or feature service"}}function N(e,r){const a=w(e,"portal-item");return r?.isTable&&(a.layerContainerType="tables"),a}function $(e){const r=N(e),a=N(e);return a.layerContainerType="tables",{forLayers:r,forTables:a}}function U(e){const r=[],a=[];for(const{layer:t,layerJSON:n}of e)R(t)?a.push(n):r.push(n);return{layers:r,tables:a}}function R(e,r){return e.isTable}function F(e){return U([e])}async function C(e,r){return/\/\d+\/?$/.test(e.url)?F(r[0]):D(r,e)}async function D(e,r){if(e.reverse(),!r)return U(e);const a=await J(r,e);for(const t of e)V(t.layer,t.layerJSON,a);return M(a,e),a}async function J(e,r){let a=await e.fetchData("json");if(G(a)&&!I(e,L.HOSTED_SERVICE))return a;a||={},_(a);const{layer:{url:t,customParameters:n,apiKey:s}}=r[0];return await B(a,{url:t??"",customParameters:n,apiKey:s},r.map(e=>e.layer.layerId)),a}function G(e){return!!(e&&Array.isArray(e.layers)&&Array.isArray(e.tables))}function _(e){e.layers||=[],e.tables||=[]}function M(e,r){const a=[],t=[];for(const{layer:n}of r){const{isTable:e,layerId:r}=n;e?t.push(r):a.push(r)}Y(e.layers,a),Y(e.tables,t)}function Y(e,a){if(e.length<2)return;const t=[];for(const{id:r}of e)t.push(r);r(t.sort(k),a.slice().sort(k))&&e.sort((e,r)=>{const t=a.indexOf(e.id),n=a.indexOf(r.id);return t<n?-1:t>n?1:0})}function k(e,r){return e<r?-1:e>r?1:0}async function B(e,r,a){const{url:t,customParameters:n,apiKey:s}=r,{serviceJSON:o,layersJSON:l}=await d(t,{customParameters:n,apiKey:s}),i=K(e.layers,o.layers,a),c=K(e.tables,o.tables,a);e.layers=i.itemResources,e.tables=c.itemResources;const u=[...i.added,...c.added],y=l?[...l.layers,...l.tables]:[];await z(e,u,t,y)}function K(e,r,t){const n=a(e,r,(e,r)=>e.id===r.id);e=e.filter(e=>!n.removed.some(r=>r.id===e.id));const s=n.added;return s.forEach(({id:r})=>{e.push({id:r})}),{itemResources:e,added:s.filter(({id:e})=>!t.includes(e))}}async function z(e,r,a,t){const n=await H(r),s=r.map(({id:e,type:r})=>new(n.get(r))({url:a,layerId:e,sourceJSON:t.find(({id:r})=>r===e)}));await Promise.allSettled(s.map(e=>e.load())),s.forEach(r=>{const{layerId:a,loaded:t,defaultPopupTemplate:n}=r;if(!t||null==n)return;const s={id:a,popupInfo:n.toJSON()};V(r,"ArcGISFeatureLayer"===r.operationalLayerType?s:{...s,layerType:r.operationalLayerType},e)})}async function H(e){const r=[];e.forEach(({type:e})=>{switch(h(e)){case"AnnotationFeatureLayer":r.push(import("../AnnotationFeatureLayer.js").then(e=>e.default));break;case"CatalogLayer":r.push(import("../CatalogLayer.js").then(e=>e.default));break;case"DimensionFeatureLayer":r.push(import("../DimensionFeatureLayer.js").then(e=>e.default));break;case"FeatureLayer":r.push(import("../FeatureLayer.js").then(e=>e.default));break;case"OrientedImageryLayer":r.push(import("../OrientedImageryLayer.js").then(e=>e.default))}});const a=await Promise.all(r),t=new Map;return e.forEach(({type:e},r)=>{t.set(e,a[r])}),t}function V(e,r,a){e.isTable?q(a.tables,r):q(a.layers,r)}function q(e,r){const a=e.findIndex(({id:e})=>e===r.id);-1===a?e.push(r):e[a]=r}function Q(e,r){if(!e.length)throw new t(`${r}:missing-parameters`,"'layers' array should contain at least one feature layer")}function W(e,r){const a=e.map(e=>e.portalItem.id);if(new Set(a).size>1)throw new t(`${r}:invalid-parameters`,"All layers in the 'layers' array should be loaded from the same portal item")}function X(e,r){const a=e.map(e=>e.layerId);if(new Set(a).size!==a.length)throw new t(`${r}:invalid-parameters`,"'layers' array should contain only one instance each of layer or table in a feature service")}async function Z(e){Q(e,A),await Promise.all(e.map(e=>e.load()));for(const r of e)u(r,A,j),y({layer:r,itemType:g,errorNamePrefix:A});W(e,A),X(e,A)}function ee(e){if(!("layerType"in e))return!!e.charts?.length;switch(e.layerType){case"OrientedImageryLayer":return!!e.charts?.length;case"SubtypeGroupLayer":return!!e.layers.some(e=>!!e.charts?.length);case"SubtypeGroupTable":return!!e.tables.some(e=>!!e.charts?.length);case"CatalogLayer":return!!e.footprintLayer?.charts?.length}}function re(e,r){let a=0,t=0,n=0,s=0;for(const o of[...r.layers,...r.tables])if(ee(o)&&s++,"layerType"in o)switch(o.layerType){case"OrientedImageryLayer":a++;break;case"SubtypeGroupLayer":t++;break;case"SubtypeGroupTable":n++}v(e,L.ORIENTED_IMAGERY_LAYER,a>0),v(e,L.SUBTYPE_GROUP_LAYER,t>0),v(e,L.SUBTYPE_GROUP_TABLE,n>0),v(e,L.CHARTS,s>0)}function ae(e,r,a){S(r,L.METADATA),v(r,L.MULTI_LAYER,e.length>1),v(r,L.SINGLE_LAYER,1===e.length),v(r,L.TABLE,a.tables.length>0&&0===a.layers.length),re(r,a)}function te(e,r,a){re(r,a)}async function ne(e,r,a){const{url:t,layerId:n,title:s,fullExtent:o,isTable:l}=e,i=m(t);r.url=("FeatureServer"===i?.serverType?t:`${t}/${n}`)??null,r.title||=s,r.extent=null,l||null==o||(r.extent=await T(o)),ae([e],r,a)}function se(e,r){for(const o of e){const a=o.parsedUrl.path,n=m(a),s=n?.url.path;if(!s)throw new t(`${r}:invalid-parameters`,f(o,`has unsupported url pattern: ${a}`),{layer:o});const l=n?.serverType;if("FeatureServer"!==l&&"MapServer"!==l)throw new t(`${r}:invalid-parameters`,f(o,`has unsupported server type: ${l}`),{layer:o});if("MapServer"===l&&e.length>1)throw new t(`${r}:invalid-parameters`,"Only one layer or table in a map service can be saved")}const a=m(e[0].parsedUrl.path),n=a?.url.path,s=e.every(e=>{const r=m(e.parsedUrl.path);return r?.url.path===n});if(!s)throw new t(`${r}:invalid-parameters`,"'layers' array should only contain layers or tables that belong to the same feature service")}async function oe(e){Q(e,x),await Promise.all(e.map(e=>e.load()));for(const r of e)u(r,x,j);se(e,x),X(e,x)}function le(e,r){re(e,r),p(e)}async function ie(r,a,t){let n=0;for(const{isTable:e}of r)e||n++;const s=r[0].parsedUrl.path,o=m(s);if(a.url="FeatureServer"===o?.serverType?o.url.path:s,a.title||=o.title,a.extent=null,n>0){const t=r.map(e=>e.fullExtent).filter(e).reduce((e,r)=>e.clone().union(r));t&&(a.extent=await T(t))}ae(r,a,t),p(a)}async function ce(e,r){return o({layer:e,itemType:g,validateLayer:j,createJSONContext:r=>N(r,e),createItemData:(e,r)=>C(r,[e]),errorNamePrefix:P,setItemProperties:te},r)}async function ue(e,r){await Z(e);const a=e[0].portalItem,t=$(a),s=await Promise.all(e.map(e=>l(e,e.isTable?t.forTables:t.forLayers,r))),o=await C(a,e.map((e,r)=>({layer:e,layerJSON:s[r]})));return le(a,o),await a.update({data:o}),await Promise.all(e.slice(1).map(e=>e.portalItem.reload())),n(t.forLayers),n(t.forTables),a.clone()}async function ye(e,r,a){return s({layer:e,itemType:g,validateLayer:j,createJSONContext:r=>N(r,e),createItemData:(e,r)=>Promise.resolve(F(e)),errorNamePrefix:O,newItem:r,setItemProperties:ne},a)}async function pe(e,r,a){await oe(e);const t=i({itemType:g,errorNamePrefix:x,newItem:r}),s=$(t),o=await Promise.all(e.map(e=>l(e,e.isTable?s.forTables:s.forLayers,a))),u=await D(e.map((e,r)=>({layer:e,layerJSON:o[r]})));await ie(e,t,u),await c(t,u,a);for(const n of e)n.portalItem=t.clone();return n(s.forLayers),n(s.forTables),t}export{ce as save,ue as saveAll,pe as saveAllAs,ye as saveAs};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type AnnotationFeatureLayer from "../AnnotationFeatureLayer.js";
|
|
2
2
|
import type { ClonableMixin } from "../../core/Clonable.js";
|
|
3
3
|
import type { IdentifiableMixin, IdentifiableMixinProperties } from "../../core/Identifiable.js";
|
|
4
4
|
import type { Loadable, LoadableMixinProperties } from "../../core/Loadable.js";
|
|
@@ -6,22 +6,22 @@ import type { Loadable, LoadableMixinProperties } from "../../core/Loadable.js";
|
|
|
6
6
|
export interface AnnotationSublayerProperties extends LoadableMixinProperties, IdentifiableMixinProperties, Partial<Pick<AnnotationSublayer, "parent" | "subtypeCode" | "title" | "visible">> {}
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
* Represents a sublayer in a [
|
|
9
|
+
* Represents a sublayer in a [AnnotationFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/AnnotationFeatureLayer/). Each AnnotationSublayer
|
|
10
10
|
* is not a standalone service, but rather each sublayer corresponds to one subtype in the source feature service.
|
|
11
11
|
*
|
|
12
12
|
* The AnnotationSublayers are identified by their unique [subtypeCode](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationSublayer/#subtypeCode). You can configure the properties of each sublayer while
|
|
13
|
-
* initializing the
|
|
13
|
+
* initializing the AnnotationFeatureLayer
|
|
14
14
|
*
|
|
15
15
|
* @since 5.1
|
|
16
|
-
* @see [
|
|
16
|
+
* @see [AnnotationFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/AnnotationFeatureLayer/)
|
|
17
17
|
*/
|
|
18
18
|
export default class AnnotationSublayer extends AnnotationSublayerSuperclass {
|
|
19
19
|
constructor(properties?: AnnotationSublayerProperties);
|
|
20
|
-
/** The [
|
|
21
|
-
accessor parent:
|
|
20
|
+
/** The [AnnotationFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/AnnotationFeatureLayer/) to which the sublayer belongs. */
|
|
21
|
+
accessor parent: AnnotationFeatureLayer | null | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* The unique identifier representing the [AnnotationSublayer](https://developers.arcgis.com/javascript/latest/references/core/layers/support/AnnotationSublayer/)
|
|
24
|
-
* created from the [
|
|
24
|
+
* created from the [AnnotationFeatureLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/AnnotationFeatureLayer/).
|
|
25
25
|
*/
|
|
26
26
|
accessor subtypeCode: number;
|
|
27
27
|
/**
|
|
@@ -173,7 +173,7 @@ export interface FeatureEffectProperties extends Partial<Pick<FeatureEffect, "ex
|
|
|
173
173
|
* layer.effect = "blur(5px)";
|
|
174
174
|
* ```
|
|
175
175
|
*
|
|
176
|
-
* [brightness(percent | number)](https://developer.mozilla.org/docs/Web/CSS/Reference/
|
|
176
|
+
* [brightness(percent | number)](https://developer.mozilla.org/docs/Web/CSS/Reference/Values/filter-function/brightness) - Applies a linear multiplier to a layer or a layerView, making it appear brighter or darker.
|
|
177
177
|
*
|
|
178
178
|
* | Values | Effect |
|
|
179
179
|
* | ------ | ------ |
|
|
@@ -182,7 +182,8 @@ export interface FeatureEffectProperties extends Partial<Pick<FeatureEffect, "ex
|
|
|
182
182
|
* | > 100% or > 1 | Brighter layer |
|
|
183
183
|
* | < 100% or < 1 | Darker layer |
|
|
184
184
|
*
|
|
185
|
-
* [contrast(percent | number)](https://developer.mozilla.org/docs/Web/CSS/Reference/
|
|
185
|
+
* [contrast(percent | number)](https://developer.mozilla.org/docs/Web/CSS/Reference/Values/filter-function/contrast) –
|
|
186
|
+
* Adjusts the contrast of a layer or a layerView. Negative values are not allowed.
|
|
186
187
|
*
|
|
187
188
|
* | Values | Effect |
|
|
188
189
|
* | ------ | ------ |
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Error.js";import{urlToObject as r,getFilename as a}from"../../core/urlUtils.js";import{parse as t,parseNonStandardSublayerUrl as s}from"./arcgisLayerUrl.js";import{findAssociatedFeatureService as n}from"./associatedFeatureServiceUtils.js";import{getLayerModuleType as o,fetchFeatureService as l}from"./fetchService.js";import{layersLoaderMap as i}from"./layersLoader.js";import{getPreferredUrl as c,sceneServiceLayerTypeToClassName as u}from"./layerUtils.js";import{requestServiceJSON as y}from"../../request/serviceJSON.js";const f="KHR_gaussian_splatting",m={FeatureLayer:!0,SceneLayer:!0,VideoLayer:!0};async function p(e){const{properties:r,url:a}=e,t={...r,url:a},s=await w(a,r?.customParameters),{Constructor:n,layerId:o,sourceJSON:l,parsedUrl:i,layers:c,tables:u}=s;if(c.length+u.length===0)return null!=o&&(t.layerId=o),null!=l&&(t.sourceJSON=l),new n(t);const y=new(0,(await import("../GroupLayer.js")).default)({title:i.title});return await v(y,s,t),y}function d(e,r){return e?e.find(({id:e})=>e===r):null}function S(e,r,a,t,s){const n={...s,layerId:r};return null!=e&&(n.url=e),null!=a&&(n.sourceJSON=a),"sublayerTitleMode"in t.prototype&&(n.sublayerTitleMode="service-name"),new t(n)}async function v(e,r,a){const t=r.sublayerConstructorProvider;for(const{id:s,serverUrl:n}of r.layers){const o=d(r.layerInfos,s),l=S(n,s,o,(o&&t?.(o))??r.Constructor,a);e.add(l)}if(r.tables.length){const t=await g("FeatureLayer");r.tables.forEach(({id:s,serverUrl:n})=>{const o=S(n,s,d(r.tableInfos,s),t,a);e.tables.add(o)})}}async function w(r,a){let s=t(r);if(null==s&&(s=await b(r,a)),null==s)throw new e("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:n,sublayer:l}=s;let i;const f={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},p="FeatureServer"===n,d="SceneServer"===n,S={parsedUrl:s,Constructor:null,layerId:p||d?l??void 0:void 0,layers:[],tables:[]};switch(n){case"MapServer":if(null!=l){const{type:t}=await y(r,{customParameters:a});switch(i="FeatureLayer",t){case"Annotation Layer":i="
|
|
2
|
+
import e from"../../core/Error.js";import{urlToObject as r,getFilename as a}from"../../core/urlUtils.js";import{parse as t,parseNonStandardSublayerUrl as s}from"./arcgisLayerUrl.js";import{findAssociatedFeatureService as n}from"./associatedFeatureServiceUtils.js";import{getLayerModuleType as o,fetchFeatureService as l}from"./fetchService.js";import{layersLoaderMap as i}from"./layersLoader.js";import{getPreferredUrl as c,sceneServiceLayerTypeToClassName as u}from"./layerUtils.js";import{requestServiceJSON as y}from"../../request/serviceJSON.js";const f="KHR_gaussian_splatting",m={FeatureLayer:!0,SceneLayer:!0,VideoLayer:!0};async function p(e){const{properties:r,url:a}=e,t={...r,url:a},s=await w(a,r?.customParameters),{Constructor:n,layerId:o,sourceJSON:l,parsedUrl:i,layers:c,tables:u}=s;if(c.length+u.length===0)return null!=o&&(t.layerId=o),null!=l&&(t.sourceJSON=l),new n(t);const y=new(0,(await import("../GroupLayer.js")).default)({title:i.title});return await v(y,s,t),y}function d(e,r){return e?e.find(({id:e})=>e===r):null}function S(e,r,a,t,s){const n={...s,layerId:r};return null!=e&&(n.url=e),null!=a&&(n.sourceJSON=a),"sublayerTitleMode"in t.prototype&&(n.sublayerTitleMode="service-name"),new t(n)}async function v(e,r,a){const t=r.sublayerConstructorProvider;for(const{id:s,serverUrl:n}of r.layers){const o=d(r.layerInfos,s),l=S(n,s,o,(o&&t?.(o))??r.Constructor,a);e.add(l)}if(r.tables.length){const t=await g("FeatureLayer");r.tables.forEach(({id:s,serverUrl:n})=>{const o=S(n,s,d(r.tableInfos,s),t,a);e.tables.add(o)})}}async function w(r,a){let s=t(r);if(null==s&&(s=await b(r,a)),null==s)throw new e("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:n,sublayer:l}=s;let i;const f={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},p="FeatureServer"===n,d="SceneServer"===n,S={parsedUrl:s,Constructor:null,layerId:p||d?l??void 0:void 0,layers:[],tables:[]};switch(n){case"MapServer":if(null!=l){const{type:t}=await y(r,{customParameters:a});switch(i="FeatureLayer",t){case"Annotation Layer":i="AnnotationFeatureLayer";break;case"Dimension Layer":i="DimensionFeatureLayer";break;case"Catalog Layer":i="CatalogLayer";break;case"Annotation SubLayer":case"Catalog Dynamic Group Layer":throw new e("arcgis-layers:unsupported",`fromUrl() not supported for "${t}" layers`)}}else{i=await P(r,a)?"TileLayer":"MapImageLayer"}break;case"ImageServer":{const e=await y(r,{customParameters:a}),{tileInfo:t,cacheType:s}=e;i=t?"LERC"!==t?.format?.toUpperCase()||s&&"elevation"!==s.toLowerCase()?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const e=await y(s.url.path,{customParameters:a});if(i="SceneLayer",e){const r=e?.layers;if("Voxel"===e?.layerType)i="VoxelLayer";else if(r?.length){const e=r[0]?.layerType;null!=e&&null!=u[e]&&(i=u[e])}}break}case"3DTilesServer":i=await U(r,a)?"GaussianSplatLayer":"IntegratedMesh3DTilesLayer";break;case"FeatureServer":if(i="FeatureLayer",null!=l){const e=await y(r,{customParameters:a});S.sourceJSON=e,S.preferredUrl=c(),i=o(e.type)}break;default:i=f[n]}if(m[i]&&null==l){const e=await L(r,n,a);p&&(S.preferredUrl=e.preferredUrl,S.layerInfos=e.layerInfos,S.tableInfos=e.tableInfos);if(1!==e.layers.length+e.tables.length)S.layers=e.layers,S.tables=e.tables,p&&e.layerInfos?.length&&(S.sublayerConstructorProvider=await O(e.layerInfos));else if(p||d){const r=e.layerInfos?.[0]??e.tableInfos?.[0];if(S.layerId=e.layers[0]?.id??e.tables[0]?.id,S.sourceJSON=r,p){const e=r?.type;i=o(e)}}}return S.Constructor=await g(i),S}async function b(e,t){const n=await y(e,{customParameters:t});let o=null,l=null;const i=n.type;if("Feature Layer"===i||"Table"===i?(o="FeatureServer",l=n.id??null):"indexedVector"===i?o="VectorTileServer":n.hasOwnProperty("mapName")?o="MapServer":n.hasOwnProperty("bandCount")&&n.hasOwnProperty("pixelSizeX")?o="ImageServer":n.hasOwnProperty("maxRecordCount")&&n.hasOwnProperty("allowGeometryUpdates")?o="FeatureServer":n.hasOwnProperty("streamUrls")?o="StreamServer":h(n)?(o="SceneServer",l=n.id):n.hasOwnProperty("layers")&&h(n.layers?.[0])&&(o="SceneServer"),!o)return null;const c=null!=l?s(e):null;return{title:null!=c&&n.name||a(e),serverType:o,sublayer:l,url:{path:null!=c?c.serviceUrl:r(e).path}}}function h(e){return null!=e&&e.hasOwnProperty("store")&&e.hasOwnProperty("id")&&"number"==typeof e.id}async function L(e,r,a){let t,s,n,o,i;switch(r){case"FeatureServer":{const r=await l(e,{customParameters:a});n=c(e,{preferredHost:r.preferredHost});const s=!!r.layersJSON,u=r.layersJSON||r.serviceJSON;o=s?u?.layers:[],i=s?u?.tables:[],t=u;break}case"SceneServer":{const r=await I(e,a);t=r.serviceInfo,s=r.tableServerUrl;break}default:t=await y(e,{customParameters:a})}return{preferredUrl:n,layers:t?.layers?.map(e=>({id:e.id})).reverse()||[],tables:t?.tables?.map(e=>({serverUrl:s,id:e.id})).reverse()||[],layerInfos:o,tableInfos:i}}async function I(e,r){const a=await y(e,{customParameters:r}),t=a.layers?.[0];if(!t)return{serviceInfo:a};try{const{serverUrl:t}=await n(e),s=await y(t,{customParameters:r}).catch(()=>null);return s&&(a.tables=s.tables),{serviceInfo:a,tableServerUrl:t}}catch{return{serviceInfo:a}}}async function g(e){return(0,i[e])()}async function P(e,r){return(await y(e,{customParameters:r})).tileInfo}async function U(e,r){const a=await y(e,{customParameters:r}),t=a.extensions?.["3DTILES_content_gltf"];return!0===t?.extensionsRequired?.includes(f)}async function O(e){if(!e.length)return;const r=new Set,a=[];for(const{type:n}of e)r.has(n)||(r.add(n),a.push(g(o(n))));const t=await Promise.all(a),s=new Map;return Array.from(r).forEach((e,r)=>{s.set(e,t[r])}),e=>s.get(e.type)}export{p as fromUrl,U as isGaussianSplat3DTilesUrl};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{getPreferredHost as e,getPreferredUrl as r}from"./layerUtils.js";import{requestServiceJSON as a}from"../../request/serviceJSON.js";const t=new Set(["Annotation Layer","Catalog Layer","Dimension Layer","Feature Layer","Oriented Imagery Layer"]);async function n(t,n){const{loadContext:o,...y}=n||{},s=o?await o.fetchServiceMetadata(t,y):await a(t,y),c=e();u(s),i(s);const l={serviceJSON:s,preferredHost:c};if((s.currentVersion??0)<10.5)return l;const L=`${r()??t}/layers`,f=o?await o.fetchServiceMetadata(L,y):await a(L,y);return u(f),i(f),l.layersJSON={layers:f.layers,tables:f.tables},l}function o(e){const{type:r}=e;return!!r&&t.has(r)}function y(e){return"Table"===e.type}function i(e){e.layers=e.layers?.filter(o),e.tables=e.tables?.filter(y)}function s(e){e.type||="Feature Layer"}function c(e){e.type||="Table"}function u(e){e.layers?.forEach(s),e.tables?.forEach(c)}function l(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"DimensionFeatureLayer";case"Annotation Layer":return"
|
|
2
|
+
import{getPreferredHost as e,getPreferredUrl as r}from"./layerUtils.js";import{requestServiceJSON as a}from"../../request/serviceJSON.js";const t=new Set(["Annotation Layer","Catalog Layer","Dimension Layer","Feature Layer","Oriented Imagery Layer"]);async function n(t,n){const{loadContext:o,...y}=n||{},s=o?await o.fetchServiceMetadata(t,y):await a(t,y),c=e();u(s),i(s);const l={serviceJSON:s,preferredHost:c};if((s.currentVersion??0)<10.5)return l;const L=`${r()??t}/layers`,f=o?await o.fetchServiceMetadata(L,y):await a(L,y);return u(f),i(f),l.layersJSON={layers:f.layers,tables:f.tables},l}function o(e){const{type:r}=e;return!!r&&t.has(r)}function y(e){return"Table"===e.type}function i(e){e.layers=e.layers?.filter(o),e.tables=e.tables?.filter(y)}function s(e){e.type||="Feature Layer"}function c(e){e.type||="Table"}function u(e){e.layers?.forEach(s),e.tables?.forEach(c)}function l(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"DimensionFeatureLayer";case"Annotation Layer":return"AnnotationFeatureLayer"}return"FeatureLayer"}function L(e){switch(e){case"Annotation Layer":return"ArcGISAnnotationLayer";case"Catalog Layer":return"CatalogLayer";case"Dimension Layer":return"ArcGISDimensionLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Parcel Layer":return"ParcelLayer";case"Topology Layer":return"TopologyLayer";case"Trace Network Layer":return"TraceNetworkLayer";case"Utility Network Layer":return"UtilityNetworkLayer"}return null}export{n as fetchFeatureService,L as getFeatureServiceItemLayerType,l as getLayerModuleType};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";import{isBasemap as i}from"../../support/userTypeGuards/isBasemap.js";function u(e,t){return null!=e&&"object"==typeof e&&"type"in e&&e.type===t}function o(e){return w(e)||m(e)}function s(e){return u(e,"feature")}function a(e){return"gaussian-splat"===e?.type}function c(e){return u(e,"oriented-imagery")}function l(e){return u(e,"catalog-footprint")}function f(e){return u(e,"graphics")}function p(e){return u(e,"map-image")}function y(e){return u(e,"map-notes")&&"sublayers"in e}function g(e){return u(e,"knowledge-graph")&&"layers"in e}function d(e){return u(e,"knowledge-graph-sublayer")}function b(e){return u(e,"link-chart")&&"layers"in e}function m(e){return u(e,"scene")}function h(e){return u(e,"subtype-group")&&"sublayers"in e}function v(e){return"subtype-sublayer"===e?.type}function w(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function j(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function L(e){return"group"===e?.type}function S(e){const t=e.parent;return L(t)&&t.tables.includes(e)}const E={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function k(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function C(e){return"integrated-mesh"===e.type||"integrated-mesh-3dtiles"===e.type}function x(e){return"integrated-mesh-3dtiles"===e.type}function R(e){return"voxel"===e?.type}function
|
|
2
|
+
import{id as e}from"../../kernel.js";import t from"../../request.js";import n from"../../core/Collection.js";import"../../core/urlUtils.js";import{isLayerFromCatalog as r}from"../catalog/catalogUtils.js";import{isBasemap as i}from"../../support/userTypeGuards/isBasemap.js";function u(e,t){return null!=e&&"object"==typeof e&&"type"in e&&e.type===t}function o(e){return w(e)||m(e)}function s(e){return u(e,"feature")}function a(e){return"gaussian-splat"===e?.type}function c(e){return u(e,"oriented-imagery")}function l(e){return u(e,"catalog-footprint")}function f(e){return u(e,"graphics")}function p(e){return u(e,"map-image")}function y(e){return u(e,"map-notes")&&"sublayers"in e}function g(e){return u(e,"knowledge-graph")&&"layers"in e}function d(e){return u(e,"knowledge-graph-sublayer")}function b(e){return u(e,"link-chart")&&"layers"in e}function m(e){return u(e,"scene")}function h(e){return u(e,"subtype-group")&&"sublayers"in e}function v(e){return"subtype-sublayer"===e?.type}function w(e){const t=e?.type;return"imagery-tile"===t||"tile"===t||"open-street-map"===t||"vector-tile"===t||"web-tile"===t||"wmts"===t}function j(e){const t=e?.type;return"base-tile"===t||"tile"===t||"elevation"===t||"imagery-tile"===t||"base-elevation"===t||"open-street-map"===t||"wcs"===t||"web-tile"===t||"wmts"===t||"vector-tile"===t}function L(e){return"group"===e?.type}function S(e){const t=e.parent;return L(t)&&t.tables.includes(e)}const E={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};function k(e){const t=e?.type;return"building-scene"===t||"integrated-mesh"===t||"point-cloud"===t||"scene"===t}function C(e){return"integrated-mesh"===e.type||"integrated-mesh-3dtiles"===e.type}function x(e){return"integrated-mesh-3dtiles"===e.type}function R(e){const t=e?.type;return"integrated-mesh-3dtiles"===t||"gaussian-splat"===t}function T(e){return"voxel"===e?.type}function U(e){return"imagery-tile"===e?.type}function M(e,t){return i(e?.parent)&&e.parent[t].includes(e)}function O(e){return M(e,"baseLayers")}function P(e){return M(e,"referenceLayers")}function q(e){return"feature"===e?.type&&!e.url&&"memory"===e.source?.type}function B(e){const t=e?.type;return("feature"===t||"subtype-group"===t||"oriented-imagery"===t||"annotation-feature"===t||"dimension-feature"===t)&&"feature-layer"===e?.source?.type}function I(e){return"feature"===e?.type&&"feature-layer"===e.source?.type}function F(e){return null!=e&&"object"==typeof e&&"featureReduction"in e}function J(e){return l(e)||s(e)&&I(e)||c(e)||v(e)}function N(e){const t=e?.type;return"binning"===t||"cluster"===t}function A(e,t){if(!J(e))return;const n=t?.graphic,r="featureReduction"in e?e.featureReduction:null;if(n){if(n.isAggregate){const e=n.origin;return e&&("featureReductionProvider"in e&&r)?N(r)?r:null:void 0}return e}return t?.checkFeatureReduction&&r?N(r)?r:null:e}function D(e){const t=/[:;]/,n=[];let r=!1;if(e&&(e.forEach((e,i)=>{n.push([i,e]),!r&&t.test(e)&&(r=!0)}),n.length>0)){let e;if(r){const t={};n.forEach(e=>{t[e[0]]=e[1]}),e=JSON.stringify(t)}else{const t=[];n.forEach(e=>{t.push(e[0]+":"+e[1])}),e=t.join(";")}return e}return null}function G(e){if(!e)return;const t=[];return e.forEach((e,n)=>{t.push('"'+n+'":'+JSON.stringify(e))}),t.length?"{"+t.join(",")+"}":void 0}function V(e){if(e.activeLayer){const t=e.activeLayer.tileMatrixSet;if(t)return t;const n=e.activeLayer.tileMatrixSets;if(n)return n}return null}async function $(n,r){const i=e?.findServerInfo(n);if(null!=i?.currentVersion)return i.owningSystemUrl||null;const u=n.toLowerCase().indexOf("/rest/services");if(-1===u)return null;const o=`${n.slice(0,u)}/rest/info`,s=null!=r?r.signal:null,{data:a}=await t(o,{query:{f:"json"},responseType:"json",signal:s});return a?.owningSystemUrl||null}function z(e){if(!("capabilities"in e))return!1;switch(e.type){case"catalog":case"catalog-footprint":case"csv":case"feature":case"parquet":case"geojson":case"imagery":case"knowledge-graph-sublayer":case"ogc-feature":case"oriented-imagery":case"scene":case"sublayer":case"subtype-group":case"subtype-sublayer":case"wfs":return!0;default:return!1}}function H(e){return null!=e&&"object"==typeof e&&"isTable"in e&&!!e.isTable}function K(e){return z(e)?"effectiveCapabilities"in e?e.effectiveCapabilities:e.capabilities:null}function Q(e){if(!("editingEnabled"in e))return!1;switch(e.type){case"csv":case"feature":case"geojson":case"oriented-imagery":case"scene":case"subtype-group":case"subtype-sublayer":case"knowledge-graph-sublayer":return!0;default:return!1}}function W(e){return!!Q(e)&&("effectiveEditingEnabled"in e?e.effectiveEditingEnabled:e.editingEnabled)}function X(e){if(!e)return[];return("subtypes"in e?e.subtypes:h(e.parent)?e.parent.subtypes:[])??[]}function Y(e){return("imagery"===e.type||"imagery-tile"===e.type)&&"flow"===e.renderer?.type}function Z(e){const t=new n;for(const n of e.allLayers.concat(e.allTables))r(n)||S(n)||"annotation-feature"===n.type||"dimension-feature"===n.type||("charts"in n&&t.push(n),"subtype-group"===n.type&&t.push(...n.sublayers));return t}function _(e,t){return null}function ee(e){return null}function te(e){return!e||"Feature Service"===e.type&&!e.sourceUrl}function ne(e,t){if(!t||!te(e))return;const n=_(e.url);n&&(e.url=n)}export{ne as applyPreferredHostToPortalItem,W as getEffectiveEditingEnabled,K as getEffectiveLayerCapabilities,A as getFieldConfigurationsContainer,Z as getLayersWithChartSupport,$ as getOwningPortalUrl,ee as getPreferredHost,_ as getPreferredUrl,X as getSubtypesFromLayer,V as getTileMaxtrixSetFromActiveLayer,R as is3DTilesLayer,O as isBaseLayer,o as isBasemap3DSupportedLayer,w as isBasemapSupportedTiledLayer,q as isFeatureCollectionLayer,s as isFeatureLayer,I as isFeatureServiceLayer,a as isGaussianSplatLayer,f as isGraphicsLayer,L as isGroupLayer,U as isImageryTileLayer,x as isIntegratedMesh3DTilesLayer,C as isIntegratedMeshLayer,g as isKnowledgeGraphLayer,d as isKnowledgeGraphSublayer,z as isLayerWithFeatureCapabilities,B as isLayerWithFeatureLayerSource,Y as isLayerWithFlowRenderer,b as isLinkChartLayer,p as isMapImageLayer,y as isMapNotesLayer,te as isPreferredUrlApplicable,P as isReferenceLayer,m as isSceneLayer,k as isSceneServiceLayer,h as isSubtypeGroupLayer,v as isSubtypeSublayer,H as isTable,j as isTiledLayer,T as isVoxelLayer,E as sceneServiceLayerTypeToClassName,D as serializeLayerDefinitions,G as serializeTimeOptions,F as supportsFeatureReduction,J as supportsFieldConfiguration};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
const a={
|
|
2
|
+
const a={AnnotationFeatureLayer:async()=>(await import("../AnnotationFeatureLayer.js")).default,BingMapsLayer:async()=>(await import("../BingMapsLayer.js")).default,BuildingSceneLayer:async()=>(await import("../BuildingSceneLayer.js")).default,CSVLayer:async()=>(await import("../CSVLayer.js")).default,CatalogLayer:async()=>(await import("../CatalogLayer.js")).default,DimensionFeatureLayer:async()=>(await import("../DimensionFeatureLayer.js")).default,DimensionLayer:async()=>(await import("../DimensionLayer.js")).default,ElevationLayer:async()=>(await import("../ElevationLayer.js")).default,FeatureLayer:async()=>(await import("../FeatureLayer.js")).default,GaussianSplatLayer:async()=>(await import("../GaussianSplatLayer.js")).default,GeoJSONLayer:async()=>(await import("../GeoJSONLayer.js")).default,GeoRSSLayer:async()=>(await import("../GeoRSSLayer.js")).default,GroupLayer:async()=>(await import("../GroupLayer.js")).default,ImageryLayer:async()=>(await import("../ImageryLayer.js")).default,ImageryTileLayer:async()=>(await import("../ImageryTileLayer.js")).default,IntegratedMesh3DTilesLayer:async()=>(await import("../IntegratedMesh3DTilesLayer.js")).default,IntegratedMeshLayer:async()=>(await import("../IntegratedMeshLayer.js")).default,KMLLayer:async()=>(await import("../KMLLayer.js")).default,KnowledgeGraphLayer:async()=>(await import("../KnowledgeGraphLayer.js")).default,LineOfSightLayer:async()=>(await import("../LineOfSightLayer.js")).default,LinkChartLayer:async()=>(await import("../LinkChartLayer.js")).default,MapImageLayer:async()=>(await import("../MapImageLayer.js")).default,MapNotesLayer:async()=>(await import("../MapNotesLayer.js")).default,MediaLayer:async()=>(await import("../MediaLayer.js")).default,OGCFeatureLayer:async()=>(await import("../OGCFeatureLayer.js")).default,OpenStreetMapLayer:async()=>(await import("../OpenStreetMapLayer.js")).default,OrientedImageryLayer:async()=>(await import("../OrientedImageryLayer.js")).default,ParquetLayer:async()=>(await import("../ParquetLayer.js")).default,PointCloudLayer:async()=>(await import("../PointCloudLayer.js")).default,RouteLayer:async()=>(await import("../RouteLayer.js")).default,SceneLayer:async()=>(await import("../SceneLayer.js")).default,StreamLayer:async()=>(await import("../StreamLayer.js")).default,SubtypeGroupLayer:async()=>(await import("../SubtypeGroupLayer.js")).default,TileLayer:async()=>(await import("../TileLayer.js")).default,UnknownLayer:async()=>(await import("../UnknownLayer.js")).default,UnsupportedLayer:async()=>(await import("../UnsupportedLayer.js")).default,VectorTileLayer:async()=>(await import("../VectorTileLayer.js")).default,VideoLayer:async()=>(await import("../VideoLayer.js")).default,ViewshedLayer:async()=>(await import("../ViewshedLayer.js")).default,VoxelLayer:async()=>(await import("../VoxelLayer.js")).default,WCSLayer:async()=>(await import("../WCSLayer.js")).default,WFSLayer:async()=>(await import("../WFSLayer.js")).default,WMSLayer:async()=>(await import("../WMSLayer.js")).default,WMTSLayer:async()=>(await import("../WMTSLayer.js")).default,WebTileLayer:async()=>(await import("../WebTileLayer.js")).default};export{a as layersLoaderMap};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Collection.js";import t from"../../core/Error.js";import{JSONMap as r}from"../../core/jsonMap.js";import
|
|
2
|
+
import e from"../../core/Collection.js";import t from"../../core/Error.js";import{JSONMap as r}from"../../core/jsonMap.js";import i from"../../geometry/SpatialReference.js";import{createFileProvider as o}from"../graphics/sources/parquet/createFileProvider.js";import n from"./Field.js";import{isNumericField as a}from"./fieldUtils.js";import{fromParquetGeometryEncodingJSON as l}from"./parquetEncodingUtils.js";import s from"./ParquetFilesData.js";const p=new r({esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint"});function m(e){return p.toJSON(e)}function d(e){return p.fromJSON(e)}async function u(t,r={}){const i=Array.isArray(t)?new s({urls:new e(t)}):t,n=await y(i,r),a=o(n,null,()=>r.customParameters);return f(await a.getMetadata(),{data:i})}async function f(e,r){if(r.geometryType&&r.spatialReference&&r.geometryEncoding&&r.fields)return r;if(!e)throw new t("parquet:bad-input","No metadata found");const o={...r};if(null==o.fields&&(o.fields=e.fields.map(e=>n.fromJSON(e))),null!=o.geometryEncoding){const e=o.geometryEncoding;switch(e.type){case"wkb":{const r=o.fields.find(t=>t.name===e.field);if(!r)throw new t("parquet:unsupported",`Geometry encoding references field ${e.field} which does not exist`);if("blob"!==r.type)throw new t("parquet:unsupported",`Invalid field type for geometry encoding. Found ${r.type} but expected 'blob'`);break}case"location":for(const r of[e.xField,e.yField])if(null!=r){const e=o.fields.find(e=>e.name===r);if(!e)throw new t("parquet:unsupported",`Geometry encoding references field ${r} which does not exist`);if(!a(e))throw new t("parquet:unsupported",`Invalid field type for location geometry encoding. Found ${e.type} but expected a numeric`)}}}return null==o.geometryEncoding&&(o.geometryEncoding=e.geometryEncoding?l(e.geometryEncoding):null),o.fields=c(o.fields,e),!o.displayOptimization&&e.displayOptimization&&(o.displayOptimization=e.displayOptimization),!o.geometryType&&e.geometryType&&(o.geometryType=d(e.geometryType)),!o.spatialReference&&e.spatialReference&&(o.spatialReference=i.fromJSON(e.spatialReference)),o}function c(e,t){const r=t.geoMetadata;if(null==r)return e;const i=new Set(Object.keys(r.columns));return e.filter(e=>!i.has(e.name))}async function y(e,r){switch(e.type){case"files":return{type:"urls",urls:e.urls.toArray()};case"portal-item":{const i=await e.portalItem.load(r);switch(i.type){case"Apache Parquet":return{type:"portal-parquet-file",itemUrl:i.itemUrl,itemCdnUrl:i.itemCdnUrl,modified:i.modified,size:i.size};case"Parquet layer":case"Parquet Layer":case"Parquet feature layer":case"Parquet Feature Layer":if(!i.url)throw new t("parquet:bad-item",`Item of type ${i.type} must have a url defined`,i);return{type:"portal-parquet-layer",itemUrl:i.itemUrl,itemCdnUrl:i.itemCdnUrl,itemMetadata:{modified:i.modified,url:i.url}};default:throw new t("parquet:bad-item",`Item of type ${i.type} is not supported`,i)}}}}export{f as completeParquetLayerInfo,y as createFileProviderSchema,d as fromParquetJSONGeometryType,u as getParquetLayerInfo,p as parquetGeometryTypeKebabDict,m as toParquetJSONGeometryType};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Error.js";import r from"../../libs/ajv/ajv.bundle-wrapper.js";import{json as t}from"../../portal/schemas/buildingSceneLayerItem.js";import{json as s}from"../../portal/schemas/
|
|
2
|
+
import e from"../../core/Error.js";import r from"../../libs/ajv/ajv.bundle-wrapper.js";import{json as t}from"../../portal/schemas/buildingSceneLayerItem.js";import{json as s}from"../../portal/schemas/gaussianSplatLayerItem.js";import{json as a}from"../../portal/schemas/integratedMesh3DTilesLayerItem.js";import{json as o}from"../../portal/schemas/integratedMeshLayerItem.js";import{json as n}from"../../portal/schemas/pointCloudLayerItem.js";import{json as i}from"../../portal/schemas/sceneLayerItem.js";import{convertAjvErrors as m}from"../../support/validationUtilsAjv.js";const p=new r({allErrors:!0,extendRefs:!0});function l(e,r){return p.validate(c(r),e),m(p.errors||[])}function c(r){switch(r){case"building-scene":return t;case"gaussian-splat":return s;case"integrated-mesh":return o;case"integrated-mesh-3dtiles":return a;case"point-cloud":return n;case"scene":return i;default:throw new e("portalitemlayertype:unknown","Can not validate against unknown PortalItemLayerType.")}}export{l as validate};
|
package/layers/types.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ import type { TimeZone } from "../time/types.js";
|
|
|
33
33
|
* @see [Layer.type](https://developers.arcgis.com/javascript/latest/references/core/layers/Layer/#type)
|
|
34
34
|
* @since 5.0
|
|
35
35
|
*/
|
|
36
|
-
export type LayerType = "annotation" | "base-dynamic" | "base-elevation" | "base-tile" | "bing-maps" | "building-scene" | "catalog" | "catalog-footprint" | "catalog-dynamic-group" | "csv" | "dimension" | "dimension-feature" | "elevation" | "feature" | "geo-rss" | "geojson" | "parquet" | "gaussian-splat" | "graphics" | "group" | "imagery" | "imagery-tile" | "integrated-mesh" | "integrated-mesh-3dtiles" | "kml" | "knowledge-graph" | "knowledge-graph-sublayer" | "line-of-sight" | "link-chart" | "map-image" | "map-notes" | "media" | "video" | "ogc-feature" | "open-street-map" | "oriented-imagery" | "point-cloud" | "route" | "scene" | "stream" | "subtype-group" | "tile" | "unknown" | "unsupported" | "vector-tile" | "viewshed" | "voxel" | "wcs" | "web-tile" | "wfs" | "wms" | "wmts";
|
|
36
|
+
export type LayerType = "annotation-feature" | "base-dynamic" | "base-elevation" | "base-tile" | "bing-maps" | "building-scene" | "catalog" | "catalog-footprint" | "catalog-dynamic-group" | "csv" | "dimension" | "dimension-feature" | "elevation" | "feature" | "geo-rss" | "geojson" | "parquet" | "gaussian-splat" | "graphics" | "group" | "imagery" | "imagery-tile" | "integrated-mesh" | "integrated-mesh-3dtiles" | "kml" | "knowledge-graph" | "knowledge-graph-sublayer" | "line-of-sight" | "link-chart" | "map-image" | "map-notes" | "media" | "video" | "ogc-feature" | "open-street-map" | "oriented-imagery" | "point-cloud" | "route" | "scene" | "stream" | "subtype-group" | "tile" | "unknown" | "unsupported" | "vector-tile" | "viewshed" | "voxel" | "wcs" | "web-tile" | "wfs" | "wms" | "wmts";
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Indicates how the layer should display in the [Layer List](https://developers.arcgis.com/javascript/latest/references/map-components/components/arcgis-layer-list/) component.
|
package/networks/Network.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../request.js";import o from"../core/Error.js";import{Loadable as s}from"../core/Loadable.js";import i from"../core/Logger.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{isAbortError as n}from"../core/promiseUtils.js";import{urlToObject as l}from"../core/urlUtils.js";import{generateUUID as d}from"../core/uuid.js";import{property as u,subclass as c}from"../core/accessorSupport/decorators.js";import p from"../geometry/Extent.js";import m from"../geometry/SpatialReference.js";import{fromJSON as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../request.js";import o from"../core/Error.js";import{Loadable as s}from"../core/Loadable.js";import i from"../core/Logger.js";import{MultiOriginJSONSupportMixin as a}from"../core/MultiOriginJSONSupport.js";import{isAbortError as n}from"../core/promiseUtils.js";import{urlToObject as l}from"../core/urlUtils.js";import{generateUUID as d}from"../core/uuid.js";import{property as u,subclass as c}from"../core/accessorSupport/decorators.js";import p from"../geometry/Extent.js";import m from"../geometry/SpatialReference.js";import{fromJSON as y}from"../geometry/support/jsonUtils.js";import{versionMatches as h,onApplyEditsEvent as f,onUpdateMomentEvent as g,emitApplyEditsEvent as w}from"../layers/mixins/EditBusLayer.js";import{parse as v}from"../layers/support/arcgisLayerUrl.js";import S from"./support/TopologyValidationJobInfo.js";import{networkFromPortalItem as j}from"./support/utils.js";import{isVersionInEditSession as b,currentSessionId as I,isSafeToEditVersion as U}from"../versionManagement/support/versionManagementUtils.js";let k=class extends(a(s)){static fromPortalItem(e){return j(e)}constructor(e){super(e),this.id=d(),this.title=null,this.layerUrl=null,this.dataElement=null,this.fullExtent=null,this.spatialReference=null,this.type=null,this.sourceJSON=null,this._historicMoment=null,this._gdbVersion=null,this._sourceIdByLayerId=new Map,this._layerIdBySourceId=new Map,this._applyEditsHandler=e=>{const{serviceUrl:t,gdbVersion:r,result:o}=e,s=t===this.featureServiceUrl,i=h(t,r,this.gdbVersion);s&&i&&o.then(e=>{b(t,r)&&(this.historicMoment=e.historicMoment)})},this._updateMomentHandler=e=>{const{serviceUrl:t,gdbVersion:r,moment:o}=e,s=t===this.featureServiceUrl,i=h(t,r,this.gdbVersion);s&&i&&(this.historicMoment=o)},this.when().then(()=>{this.addHandles([f(this._applyEditsHandler),g(this._updateMomentHandler)])},()=>{})}initialize(){this.when().catch(e=>{n(e)||i.getLogger(this).error("#load()",`Failed to load layer (title: '${this.title??"no title"}', id: '${this.id??"no id"}')`,{error:e})})}get loaded(){return super.loaded}get datasetName(){return this.dataElement?.name??null}get owner(){return this.dataElement?.userIdentity??null}get schemaGeneration(){return this.dataElement?.schemaGeneration??null}get parsedUrl(){return l(this.layerUrl)}get featureServiceUrl(){return v(this.parsedUrl.path).url.path}get networkServiceUrl(){return this.featureServiceUrl.replace(/\/FeatureServer/i,"/UtilityNetworkServer")}get layerId(){return v(this.parsedUrl.path).sublayer}get networkSystemLayers(){return null}get gdbVersion(){return this._gdbVersion}set gdbVersion(e){this._gdbVersion=e}get historicMoment(){return this._historicMoment}set historicMoment(e){this._historicMoment=e}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await Promise.all([this._fetchDataElement(this.featureServiceUrl,this.layerId.toString(),e),this._fetchLayerMetaData(this.layerUrl,e)])}getLayerIdBySourceId(e){if(!this.dataElement)return null;const t=this._layerIdBySourceId.get(e);if(null!=t)return t;const r=this.dataElement.domainNetworks,o=this._traverseNetworkSources(r,this._layerIdBySourceId,"sourceId","layerId",e);return o>=0?o:null}getSourceIdByLayerId(e){if(!this.dataElement)return null;const t=this._sourceIdByLayerId.get(e);if(null!=t)return t;const r=this.dataElement.domainNetworks,o=this._traverseNetworkSources(r,this._sourceIdByLayerId,"layerId","sourceId",e);return o>=0?o:null}getObjectIdsFromElements(e){const t=[],r=new Map;for(const s of e){const e=this.getLayerIdBySourceId(s.networkSourceId);if(null==e)continue;let t=r.get(e);void 0===t&&(t=[]),t.push(s.objectId),r.set(e,t)}const o=this.featureServiceUrl;return r.forEach((e,r)=>t.push({layerUrl:`${o}/${r}`,objectIds:e})),t}async queryNamedTraceConfigurations(e,t){const[{queryNamedTraceConfigurations:r},{default:o}]=await Promise.all([import("../rest/networks/queryNamedTraceConfigurations.js"),import("../rest/networks/support/QueryNamedTraceConfigurationsParameters.js")]),s=this.networkServiceUrl,i=o.from(e);return(await r(s,i,{...t}))?.namedTraceConfigurations}async validateTopology(e,t){if(!e.validateArea)throw new o("network:undefined-validateArea","the network must have validateArea defined in the validate network topology parameters.");const[{validateNetworkTopology:r},{default:s}]=await Promise.all([import("../rest/networks/validateNetworkTopology.js"),import("../rest/networks/support/ValidateNetworkTopologyParameters.js")]),i=s.from(e);b(this.featureServiceUrl,this.gdbVersion||null)?(i.sessionID=I,await U(this.featureServiceUrl,this.gdbVersion,!0)):i.sessionID=null,i.gdbVersion=this.gdbVersion;const a=this.networkServiceUrl,n=this.featureServiceUrl,l=w(n,null,this.gdbVersion,!0),d=await r(a,i,{...t});if(d?.serviceEdits){const e=[];for(const t of d.serviceEdits){const{editedFeatures:r}=t,o=r?.spatialReference?new m(r.spatialReference):null;e.push({layerId:t.layerId,editedFeatures:{adds:r?.adds?.map(e=>E(e,o))||[],updates:r?.updates?.map(e=>({original:E(e[0],o),current:E(e[1],o)}))||[],deletes:r?.deletes?.map(e=>E(e,o))||[],spatialReference:o}})}l.resolve({edits:null,addedFeatures:[],updatedFeatures:[],deletedFeatures:[],addedAttachments:[],updatedAttachments:[],deletedAttachments:[],editedFeatures:e,exceededTransferLimit:!1,historicMoment:d.moment})}return d}async submitTopologyValidationJob(e,t){let s=null;if(!e.validateArea)throw new o("network:undefined-validateArea","the network must have validateArea defined in the validate network topology parameters.");if(!this.gdbVersion){const e=this.layerUrl.replace(/\/FeatureServer/i,"/VersionManagementServer").replace(/\/\d*$/,"");s=(await r(e,{responseType:"json",query:{f:"json"}})).data.defaultVersionName}const[{submitValidateNetworkTopologyJob:i},{default:a}]=await Promise.all([import("../rest/networks/validateNetworkTopology.js"),import("../rest/networks/support/ValidateNetworkTopologyParameters.js")]),n=a.from(e);b(this.featureServiceUrl,this.gdbVersion||null)?(n.sessionID=I,await U(this.featureServiceUrl,this.gdbVersion,!0)):n.sessionID=null,n.gdbVersion=this.gdbVersion||s;const l=this.networkServiceUrl,d=this.featureServiceUrl?w(this.featureServiceUrl,null,this.gdbVersion,!0):void 0,u=await i(l,n,{...t});return new S({statusUrl:u,editsResolver:d})}getSourceTypeById(e){if(!this.dataElement)return null;for(const t of this.dataElement.domainNetworks)for(const r of[t.edgeSources??[],t.junctionSources??[]])for(const o of r)if(o.sourceId===e)return r===t.edgeSources?"edge":"junction";return null}_traverseNetworkSources(e,t,r,o,s){for(const i of e)for(const e of[i.edgeSources??[],i.junctionSources??[]])for(const i of e)if(i[r]===s)return t.set(s,i[o]),i[o];return-1}async _fetchLayerMetaData(e,t){const{data:o}=await r(e,{responseType:"json",query:{f:"json"},...t});this.sourceJSON=o,this.read(o,{origin:"service"})}async _fetchDataElement(e,t,s){if(this.dataElement)return;const i=await r(`${e}/queryDataElements`,{responseType:"json",query:{layers:JSON.stringify([t]),f:"json"},...s}),a=i.data.layerDataElements?.[0];if(!(a&&"object"==typeof a&&"dataElement"in a&&a.dataElement&&"object"==typeof a.dataElement))throw new o("network:invalid-data-element",`No data element was found for layer ${t}.`);this.read(a,{origin:"service"})}};function E(e,r){return new t({attributes:e.attributes,geometry:y({...e.geometry,spatialReference:r})})}e([u({type:String,nonNullable:!0,json:{origins:{"web-map":{read:!0,write:{isRequired:!0}}},read:!1}})],k.prototype,"id",void 0),e([u({type:String,nonNullable:!0,json:{origins:{"web-map":{read:!0,write:{isRequired:!0}},service:{read:{source:"name"}}},read:!1}})],k.prototype,"title",void 0),e([u({type:String,nonNullable:!0,json:{origins:{"web-map":{read:{source:"url"},write:{target:"url",isRequired:!0}}},read:!1}})],k.prototype,"layerUrl",void 0),e([u({type:Object,json:{origins:{service:{read:!0}},read:!1}})],k.prototype,"dataElement",void 0),e([u({type:p,json:{origins:{service:{read:{source:"extent"}}},read:!1}})],k.prototype,"fullExtent",void 0),e([u({type:m,json:{origins:{service:{read:{source:"extent.spatialReference"}}},read:!1}})],k.prototype,"spatialReference",void 0),e([u({type:["utility","trace"],readOnly:!0,json:{read:!1,write:!1}})],k.prototype,"type",void 0),e([u({readOnly:!0})],k.prototype,"datasetName",null),e([u({readOnly:!0})],k.prototype,"owner",null),e([u({readOnly:!0})],k.prototype,"schemaGeneration",null),e([u({readOnly:!0})],k.prototype,"parsedUrl",null),e([u({readOnly:!0})],k.prototype,"featureServiceUrl",null),e([u({readOnly:!0})],k.prototype,"networkServiceUrl",null),e([u({readOnly:!0})],k.prototype,"layerId",null),e([u()],k.prototype,"sourceJSON",void 0),e([u({readOnly:!0})],k.prototype,"networkSystemLayers",null),e([u({type:String})],k.prototype,"gdbVersion",null),e([u({type:Date})],k.prototype,"historicMoment",null),e([u()],k.prototype,"_historicMoment",void 0),e([u()],k.prototype,"_gdbVersion",void 0),k=e([c("esri.networks.Network")],k);const N=k;export{N as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../Graphic.js";import{getOrCreateMapValue as r}from"../core/MapUtils.js";import{watch as s}from"../core/reactiveUtils.js";import{property as o,subclass as i}from"../core/accessorSupport/decorators.js";import a from"../layers/FeatureLayer.js";import{queryAllJSON as n}from"../layers/support/featureQueryAll.js";import l from"./Network.js";import u from"./RulesTable.js";import d from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as m}from"./support/networkFieldUtils.js";import c from"./support/NetworkSystemLayers.js";import y from"./support/TerminalConfiguration.js";import h from"./support/TraceJobInfo.js";import{AssociationTypeEnum as f,nullGuid as p,associationTypeKebabDict as b}from"./support/typeUtils.js";import{doesRuleAllowAssociation as w}from"./support/utils.js";import I from"../rest/networks/support/TelecomNetworkElement.js";import g from"../rest/support/Query.js";let T=class extends l{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility",this._circuitManagerMap=new Map,this._terminalById=new Map,this._unitIdentifierManager=null}initialize(){this.addHandles(s(()=>[this.gdbVersion,this.historicMoment],()=>{this.networkSystemLayers.associationsTable&&(this.networkSystemLayers.associationsTable.gdbVersion!==this.gdbVersion&&(this.networkSystemLayers.associationsTable.gdbVersion=this.gdbVersion),this.networkSystemLayers.associationsTable.historicMoment!==this.historicMoment&&(this.networkSystemLayers.associationsTable.historicMoment=this.historicMoment))}))}get _rulesLayer(){const{gdbVersion:e,historicMoment:t}=this,r=this.networkSystemLayers.rulesTableUrl;return new a({url:r,gdbVersion:e,historicMoment:t})}get _telecomSourceSet(){const e=new Set;return this.dataElement?.domainNetworks.forEach(t=>{t.isTelecomNetwork&&(t.edgeSources?.forEach(t=>e.add(t.sourceId)),t.junctionSources?.forEach(t=>e.add(t.sourceId)))}),e}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map(t=>{t?.edgeSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)}),t?.junctionSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)})}),e}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new c({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map(e=>y.fromJSON(e))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map(e=>e.domainNetworkName)||[]}get hasTelecomNetwork(){return this.dataElement?.domainNetworks.some(e=>e.isTelecomNetwork)??!1}get associationsTable(){return this.networkSystemLayers.associationsTable}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await super._load(e),await Promise.all([this._loadNamedTraceConfigurationsFromNetwork(e),this.networkSystemLayers.loadAssociationsTable(e)])}getTerminalConfiguration(e){let t=null,r=null;const s=e.sourceLayer??e.origin??e.layer??null;let o=null;if("feature"===s?.type){if(o=s.layerId,null===o)return null}else{if("subtype-sublayer"!==s?.type)return null;if(o=s?.parent?.layerId??null,null===o)return null}const i=e.attributes;if(null==i)return null;for(const l of Object.keys(i))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let a=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find(e=>e.layerId===o);if(e){const s=e.assetGroups?.find(e=>e.assetGroupCode===t);if(s){const e=s.assetTypes?.find(e=>e.assetTypeCode===r);if(e?.isTerminalConfigurationSupported){a=e.terminalConfigurationId;break}}}}if(null!=a){const e=this.dataElement.terminalConfigurations,t=e?.find(e=>e.terminalConfigurationId===a);return t?y.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e);return t?.tiers?.map(e=>e.name)||[]}async getRulesTable(){const e=this._rulesLayer;e.loaded||await e.load();const t=this.dataElement?.domainNetworks;if(!t)return null;const r=t.flatMap(e=>[...e.edgeSources||[],...e.junctionSources||[]]),s=(await this._queryRulesTable(e)).map(t=>this._hydrateRuleInfo(e,r,t));return new u({rulesLayer:e,rules:s})}async getCircuitManager(e){if(!this.hasTelecomNetwork)return null;const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e&&t.isTelecomNetwork);if(!t)return null;const{default:s}=await import("./CircuitManager.js");return r(this._circuitManagerMap,e,()=>new s({utilityNetwork:this,telecomDomainNetwork:t}))}async getUnitIdentifierManager(){if(!this.hasTelecomNetwork)return null;if(this._unitIdentifierManager)return this._unitIdentifierManager;const{default:e}=await import("./UnitIdentifierManager.js");return this._unitIdentifierManager=new e({utilityNetwork:this}),this._unitIdentifierManager}getTerminalById(e){if(!this.dataElement||null==e)return null;const t=this._terminalById.get(e);return null!=t?t:(this.terminalConfigurations.forEach(e=>{e.terminals.forEach(e=>{this._terminalById.set(e.id,e)})}),this._terminalById.get(e))}isUtilityLayer(e){return"layerId"in e?null!=e.layerId&&this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):!("subtype-sublayer"!==e.type||!e.parent)&&(this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1))}async queryAssociations(e,t){const[{queryAssociations:r},{default:s}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=s.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await r(this.networkServiceUrl,o,t)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from({...e,telecomSourceSet:this._telecomSourceSet});return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return new h({statusUrl:o,telecomSourceSet:this._telecomSourceSet})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;const{fromNetworkElement:r,toNetworkElement:s}=e;if(!r||!s)return!1;await t.load();let o=null;switch(e.associationType){case"containment":o=t.rulesCategorized.containment;break;case"attachment":o=t.rulesCategorized.attachment;break;default:o=t.rulesCategorized.connectivity}return o.some(e=>w(e,r,s))}generateAddAssociations(e){const{associationsTable:r}=this.networkSystemLayers,{fromNetworkSourceId:s,fromGlobalId:o,fromTerminalId:i,fromFirstUnit:a,fromLastUnit:n,toNetworkSourceId:l,toGlobalId:u,toTerminalId:d,toFirstUnit:c,toLastUnit:y,associationType:h,isContentVisible:p,percentAlong:b,globalId:w}=m(r);return{addFeatures:e.map(e=>{const r=new t({attributes:{[s]:e.fromNetworkElement?.networkSourceId,[o]:e.fromNetworkElement?.globalId,[i]:e.fromNetworkElement?.terminalId,[l]:e.toNetworkElement?.networkSourceId,[u]:e.toNetworkElement?.globalId,[d]:e.toNetworkElement?.terminalId,[h]:f[e.associationType],[p]:null==e.isContentVisible?void 0:e.isContentVisible?1:0,[b]:e.percentAlong,[w]:e.globalId}}),m=e.associationType.includes("connectivity");return e.fromNetworkElement instanceof I&&(r.attributes[a]=e.fromNetworkElement?.firstUnit,r.attributes[n]=e.fromNetworkElement?.lastUnit,m&&(r.attributes[i]=1)),e.toNetworkElement instanceof I&&(r.attributes[c]=e.toNetworkElement?.firstUnit,r.attributes[y]=e.toNetworkElement?.lastUnit,m&&(r.attributes[d]=1)),r}),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:r?.globalIdField??"globalid",objectIdField:r?.objectIdField??"objectid"}}}generateDeleteAssociations(e){const{associationsTable:t,associationsTableId:r}=this.networkSystemLayers,s={id:r,identifierFields:{globalIdField:t?.globalIdField??"globalid",objectIdField:t?.objectIdField??"objectid"}};if(-8===this.dataElement?.schemaGeneration){const t=this._generateDeleteTelecomAssociationPayload(e);return{...s,deleteAssociations:t}}const o=e.map(e=>({globalId:e.globalId}));return{...s,deleteFeatures:o}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async loadSubnetworksTable(){return this.networkSystemLayers.loadSubnetworksTable()}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map(e=>e.globalId),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const s of this.sharedNamedTraceConfigurations){const e=r?.find(e=>e.globalId===s.globalId);if(e){const t=e.write({},{origin:"service"});s.read(t,{origin:"service"})}}}_hydrateRuleInfo(e,t,r){const s=e.fieldsIndex,o=s.get("RULETYPE"),i=s.get("CREATIONDATE"),a=s.get("FROMNETWORKSOURCEID"),n=s.get("FROMASSETGROUP"),l=s.get("FROMASSETTYPE"),u=s.get("FROMTERMINALID"),d=s.get("TONETWORKSOURCEID"),m=s.get("TOASSETGROUP"),c=s.get("TOASSETTYPE"),y=s.get("TOTERMINALID"),h=s.get("VIANETWORKSOURCEID"),f=s.get("VIAASSETGROUP"),p=s.get("VIAASSETTYPE"),b=s.get("VIATERMINALID"),w=r.attributes[o.name],I=new Date(r.attributes[i.name]),g=[{networkSourceId:r.attributes[a.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[u.name]},{networkSourceId:r.attributes[d.name],assetGroupId:r.attributes[m.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[y.name]},{networkSourceId:r.attributes[h.name],assetGroupId:r.attributes[f.name],assetTypeId:r.attributes[p.name],terminalId:r.attributes[b.name]}],T={ruleType:w,creationDate:I};for(const k of[0,1,2]){if(5!==w&&2===k)continue;const e=g[k],r=t.find(t=>t.sourceId===e.networkSourceId),s=r?.assetGroups.find(t=>t.assetGroupCode===e.assetGroupId),o=s?.assetTypes.find(t=>t.assetTypeCode===e.assetTypeId),i=this._getTerminal(o,e);let a="";switch(k){case 0:a="from";break;case 1:a="to";break;case 2:a="via"}T[`${a}NetworkSource`]=r,T[`${a}AssetGroup`]=s,T[`${a}AssetType`]=o,T[`${a}Terminal`]=i?.toJSON()}return T}_getTerminal(e,t){const r=e?.terminalConfigurationId,s=this.terminalConfigurations?.find(e=>e.id===r);return s?.terminals?.find(e=>e.id===t.terminalId)??null}async _queryRulesTable(e){const{gdbVersion:t,historicMoment:r}=this,s=new g({where:"1=1",outFields:["*"],gdbVersion:t,historicMoment:r});return(await n(e,s)).features}_generateDeleteTelecomAssociationPayload(e){return e.map(e=>({globalId:e.globalId??p,associationType:b.toJSON(e.associationType),fromSourceId:e.fromNetworkElement.networkSourceId,fromGlobalId:e.fromNetworkElement.globalId,fromTerminalId:e.fromNetworkElement.terminalId,toSourceId:e.toNetworkElement.networkSourceId,toGlobalId:e.toNetworkElement.globalId,toTerminalId:e.toNetworkElement.terminalId}))}};e([o({readOnly:!0})],T.prototype,"_rulesLayer",null),e([o({readOnly:!0})],T.prototype,"_telecomSourceSet",null),e([o({type:[d],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],T.prototype,"sharedNamedTraceConfigurations",void 0),e([o({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],T.prototype,"type",void 0),e([o({readOnly:!0})],T.prototype,"serviceTerritoryFeatureLayerId",null),e([o({readOnly:!0})],T.prototype,"networkSystemLayers",null),e([o({readOnly:!0})],T.prototype,"terminalConfigurations",null),e([o({readOnly:!0})],T.prototype,"domainNetworkNames",null),e([o({readOnly:!0})],T.prototype,"hasTelecomNetwork",null),e([o({readOnly:!0,json:{read:!1}})],T.prototype,"associationsTable",null),T=e([i("esri.networks.UtilityNetwork")],T);const k=T;export{k as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../Graphic.js";import r from"../core/Error.js";import{getOrCreateMapValue as s}from"../core/MapUtils.js";import{watch as o}from"../core/reactiveUtils.js";import{property as i,subclass as a}from"../core/accessorSupport/decorators.js";import n from"../layers/FeatureLayer.js";import{queryAllJSON as l}from"../layers/support/featureQueryAll.js";import u from"./Network.js";import d from"./RulesTable.js";import m from"./support/NamedTraceConfiguration.js";import{getAssociationsTableFields as c}from"./support/networkFieldUtils.js";import y from"./support/NetworkSystemLayers.js";import h from"./support/TerminalConfiguration.js";import p from"./support/TraceJobInfo.js";import{AssociationTypeEnum as f,nullGuid as w,associationTypeKebabDict as b}from"./support/typeUtils.js";import{doesRuleAllowAssociation as I}from"./support/utils.js";import g from"../rest/networks/support/TelecomNetworkElement.js";import T from"../rest/support/Query.js";let k=class extends u{constructor(e){super(e),this.sharedNamedTraceConfigurations=[],this.type="utility",this._circuitManagerMap=new Map,this._terminalById=new Map,this._unitIdentifierManager=null}initialize(){this.addHandles(o(()=>[this.gdbVersion,this.historicMoment],()=>{this.networkSystemLayers.associationsTable&&(this.networkSystemLayers.associationsTable.gdbVersion!==this.gdbVersion&&(this.networkSystemLayers.associationsTable.gdbVersion=this.gdbVersion),this.networkSystemLayers.associationsTable.historicMoment!==this.historicMoment&&(this.networkSystemLayers.associationsTable.historicMoment=this.historicMoment))}))}get _rulesLayer(){const{gdbVersion:e,historicMoment:t}=this,r=this.networkSystemLayers.rulesTableUrl;return new n({url:r,gdbVersion:e,historicMoment:t})}get _telecomSourceSet(){const e=new Set;return this.dataElement?.domainNetworks.forEach(t=>{t.isTelecomNetwork&&(t.edgeSources?.forEach(t=>e.add(t.sourceId)),t.junctionSources?.forEach(t=>e.add(t.sourceId)))}),e}get _utilityLayerList(){const e=new Set;return this.dataElement?.domainNetworks?.map(t=>{t?.edgeSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)}),t?.junctionSources?.map(({layerId:t,sourceId:r})=>{this._layerIdBySourceId.set(r,t),this._sourceIdByLayerId.set(t,r),e.add(t)})}),e}get serviceTerritoryFeatureLayerId(){return this.dataElement?.serviceTerritoryFeatureLayerId??null}get networkSystemLayers(){return new y({rulesTableId:this.sourceJSON?.systemLayers.rulesTableId,rulesTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.rulesTableId}`:null,subnetworksTableId:this.sourceJSON?.systemLayers.subnetworksTableId,subnetworksTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.subnetworksTableId}`:null,dirtyAreasLayerId:this.sourceJSON?.systemLayers.dirtyAreasLayerId,dirtyAreasLayerUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.dirtyAreasLayerId}`:null,associationsTableId:this.sourceJSON?.systemLayers.associationsTableId,associationsTableUrl:this.sourceJSON?`${this.featureServiceUrl}/${this.sourceJSON?.systemLayers.associationsTableId}`:null})}get terminalConfigurations(){return this.dataElement?.terminalConfigurations.map(e=>h.fromJSON(e))||[]}get domainNetworkNames(){return this.dataElement?.domainNetworks.map(e=>e.domainNetworkName)||[]}get hasTelecomNetwork(){return this.dataElement?.domainNetworks.some(e=>e.isTelecomNetwork)??!1}get associationsTable(){return this.networkSystemLayers.associationsTable}async load(e){return this.addResolvingPromise(this._load(e)),this}async _load(e){await super._load(e);const{dataElement:t,layerId:s,sourceJSON:o}=this;if(!(t&&"domainNetworks"in t&&Array.isArray(t.domainNetworks)))throw new r("network:invalid-data-element",`The data element for layer ${s} does not have the expected properties for a utility network.`);if(!o||!("type"in o)||"string"!=typeof o.type||"Utility Network Layer"!==o.type)throw new r("network:invalid-layer",`The metadata for layer ${s} does not have the expected properties for a utility network.`);await Promise.all([this._loadNamedTraceConfigurationsFromNetwork(e),this.networkSystemLayers.loadAssociationsTable(e)])}getTerminalConfiguration(e){let t=null,r=null;const s=e.sourceLayer??e.origin??e.layer??null;let o=null;if("feature"===s?.type){if(o=s.layerId,null===o)return null}else{if("subtype-sublayer"!==s?.type)return null;if(o=s?.parent?.layerId??null,null===o)return null}const i=e.attributes;if(null==i)return null;for(const l of Object.keys(i))"ASSETGROUP"===l.toUpperCase()&&(t=e.getAttribute(l)),"ASSETTYPE"===l.toUpperCase()&&(r=e.getAttribute(l));if(!this.dataElement)return null;let a=null;const n=this.dataElement.domainNetworks;for(const l of n){const e=l.junctionSources?.find(e=>e.layerId===o);if(e){const s=e.assetGroups?.find(e=>e.assetGroupCode===t);if(s){const e=s.assetTypes?.find(e=>e.assetTypeCode===r);if(e?.isTerminalConfigurationSupported){a=e.terminalConfigurationId;break}}}}if(null!=a){const e=this.dataElement.terminalConfigurations,t=e?.find(e=>e.terminalConfigurationId===a);return t?h.fromJSON(t):null}return null}getTierNames(e){const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e);return t?.tiers?.map(e=>e.name)||[]}async getRulesTable(){const e=this._rulesLayer;e.loaded||await e.load();const t=this.dataElement?.domainNetworks;if(!t)return null;const r=t.flatMap(e=>[...e.edgeSources||[],...e.junctionSources||[]]),s=(await this._queryRulesTable(e)).map(t=>this._hydrateRuleInfo(e,r,t));return new d({rulesLayer:e,rules:s})}async getCircuitManager(e){if(!this.hasTelecomNetwork)return null;const t=this.dataElement?.domainNetworks.find(t=>t.domainNetworkName===e&&t.isTelecomNetwork);if(!t)return null;const{default:r}=await import("./CircuitManager.js");return s(this._circuitManagerMap,e,()=>new r({utilityNetwork:this,telecomDomainNetwork:t}))}async getUnitIdentifierManager(){if(!this.hasTelecomNetwork)return null;if(this._unitIdentifierManager)return this._unitIdentifierManager;const{default:e}=await import("./UnitIdentifierManager.js");return this._unitIdentifierManager=new e({utilityNetwork:this}),this._unitIdentifierManager}getTerminalById(e){if(!this.dataElement||null==e)return null;const t=this._terminalById.get(e);return null!=t?t:(this.terminalConfigurations.forEach(e=>{e.terminals.forEach(e=>{this._terminalById.set(e.id,e)})}),this._terminalById.get(e))}isUtilityLayer(e){return"layerId"in e?null!=e.layerId&&this._utilityLayerList.has(e.layerId)&&(e.url?.startsWith(this.featureServiceUrl)??!1):!("subtype-sublayer"!==e.type||!e.parent)&&(this._utilityLayerList.has(e.parent.layerId)&&(e.parent.url?.startsWith(this.featureServiceUrl)??!1))}async queryAssociations(e,t){const[{queryAssociations:r},{default:s}]=await Promise.all([import("../rest/networks/queryAssociations.js"),import("../rest/networks/support/QueryAssociationsParameters.js")]),o=s.from(e);o.gdbVersion=this.gdbVersion,o.moment=this.historicMoment;return(await r(this.networkServiceUrl,o,t)).associations}async synthesizeAssociationGeometries(e){const[{synthesizeAssociationGeometries:t},{default:r}]=await Promise.all([import("../rest/networks/synthesizeAssociationGeometries.js"),import("../rest/networks/support/SynthesizeAssociationGeometriesParameters.js")]),s=r.from(e);return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async trace(e){const[{trace:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from({...e,telecomSourceSet:this._telecomSourceSet});return s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment,t(this.networkServiceUrl,s)}async submitTraceJob(e){const[{submitTraceJob:t},{default:r}]=await Promise.all([import("../rest/networks/trace.js"),import("../rest/networks/support/TraceParameters.js")]),s=r.from(e);s.gdbVersion=this.gdbVersion,s.moment=this.historicMoment;const o=await t(this.networkServiceUrl,s);return new p({statusUrl:o,telecomSourceSet:this._telecomSourceSet})}async canAddAssociation(e){const t=await this.getRulesTable();if(!t)return!1;const{fromNetworkElement:r,toNetworkElement:s}=e;if(!r||!s)return!1;await t.load();let o=null;switch(e.associationType){case"containment":o=t.rulesCategorized.containment;break;case"attachment":o=t.rulesCategorized.attachment;break;default:o=t.rulesCategorized.connectivity}return o.some(e=>I(e,r,s))}generateAddAssociations(e){const{associationsTable:r}=this.networkSystemLayers,{fromNetworkSourceId:s,fromGlobalId:o,fromTerminalId:i,fromFirstUnit:a,fromLastUnit:n,toNetworkSourceId:l,toGlobalId:u,toTerminalId:d,toFirstUnit:m,toLastUnit:y,associationType:h,isContentVisible:p,percentAlong:w,globalId:b}=c(r);return{addFeatures:e.map(e=>{const r=new t({attributes:{[s]:e.fromNetworkElement?.networkSourceId,[o]:e.fromNetworkElement?.globalId,[i]:e.fromNetworkElement?.terminalId,[l]:e.toNetworkElement?.networkSourceId,[u]:e.toNetworkElement?.globalId,[d]:e.toNetworkElement?.terminalId,[h]:f[e.associationType],[p]:null==e.isContentVisible?void 0:e.isContentVisible?1:0,[w]:e.percentAlong,[b]:e.globalId}}),c=e.associationType.includes("connectivity");return e.fromNetworkElement instanceof g&&(r.attributes[a]=e.fromNetworkElement?.firstUnit,r.attributes[n]=e.fromNetworkElement?.lastUnit,c&&(r.attributes[i]=1)),e.toNetworkElement instanceof g&&(r.attributes[m]=e.toNetworkElement?.firstUnit,r.attributes[y]=e.toNetworkElement?.lastUnit,c&&(r.attributes[d]=1)),r}),id:this.networkSystemLayers.associationsTableId,identifierFields:{globalIdField:r?.globalIdField??"globalid",objectIdField:r?.objectIdField??"objectid"}}}generateDeleteAssociations(e){const{associationsTable:t,associationsTableId:r}=this.networkSystemLayers,s={id:r,identifierFields:{globalIdField:t?.globalIdField??"globalid",objectIdField:t?.objectIdField??"objectid"}};if(-8===this.dataElement?.schemaGeneration){const t=this._generateDeleteTelecomAssociationPayload(e);return{...s,deleteAssociations:t}}const o=e.map(e=>({globalId:e.globalId}));return{...s,deleteFeatures:o}}async loadAssociationsTable(){return this.networkSystemLayers.loadAssociationsTable()}async loadSubnetworksTable(){return this.networkSystemLayers.loadSubnetworksTable()}async _loadNamedTraceConfigurationsFromNetwork(e){if(0===this.sharedNamedTraceConfigurations?.length)return;const t=this.sharedNamedTraceConfigurations.map(e=>e.globalId),r=await this.queryNamedTraceConfigurations({globalIds:t},e);for(const s of this.sharedNamedTraceConfigurations){const e=r?.find(e=>e.globalId===s.globalId);if(e){const t=e.write({},{origin:"service"});s.read(t,{origin:"service"})}}}_hydrateRuleInfo(e,t,r){const s=e.fieldsIndex,o=s.get("RULETYPE"),i=s.get("CREATIONDATE"),a=s.get("FROMNETWORKSOURCEID"),n=s.get("FROMASSETGROUP"),l=s.get("FROMASSETTYPE"),u=s.get("FROMTERMINALID"),d=s.get("TONETWORKSOURCEID"),m=s.get("TOASSETGROUP"),c=s.get("TOASSETTYPE"),y=s.get("TOTERMINALID"),h=s.get("VIANETWORKSOURCEID"),p=s.get("VIAASSETGROUP"),f=s.get("VIAASSETTYPE"),w=s.get("VIATERMINALID"),b=r.attributes[o.name],I=new Date(r.attributes[i.name]),g=[{networkSourceId:r.attributes[a.name],assetGroupId:r.attributes[n.name],assetTypeId:r.attributes[l.name],terminalId:r.attributes[u.name]},{networkSourceId:r.attributes[d.name],assetGroupId:r.attributes[m.name],assetTypeId:r.attributes[c.name],terminalId:r.attributes[y.name]},{networkSourceId:r.attributes[h.name],assetGroupId:r.attributes[p.name],assetTypeId:r.attributes[f.name],terminalId:r.attributes[w.name]}],T={ruleType:b,creationDate:I};for(const k of[0,1,2]){if(5!==b&&2===k)continue;const e=g[k],r=t.find(t=>t.sourceId===e.networkSourceId),s=r?.assetGroups.find(t=>t.assetGroupCode===e.assetGroupId),o=s?.assetTypes.find(t=>t.assetTypeCode===e.assetTypeId),i=this._getTerminal(o,e);let a="";switch(k){case 0:a="from";break;case 1:a="to";break;case 2:a="via"}T[`${a}NetworkSource`]=r,T[`${a}AssetGroup`]=s,T[`${a}AssetType`]=o,T[`${a}Terminal`]=i?.toJSON()}return T}_getTerminal(e,t){const r=e?.terminalConfigurationId,s=this.terminalConfigurations?.find(e=>e.id===r);return s?.terminals?.find(e=>e.id===t.terminalId)??null}async _queryRulesTable(e){const{gdbVersion:t,historicMoment:r}=this,s=new T({where:"1=1",outFields:["*"],gdbVersion:t,historicMoment:r});return(await l(e,s)).features}_generateDeleteTelecomAssociationPayload(e){return e.map(e=>({globalId:e.globalId??w,associationType:b.toJSON(e.associationType),fromSourceId:e.fromNetworkElement.networkSourceId,fromGlobalId:e.fromNetworkElement.globalId,fromTerminalId:e.fromNetworkElement.terminalId,toSourceId:e.toNetworkElement.networkSourceId,toGlobalId:e.toNetworkElement.globalId,toTerminalId:e.toNetworkElement.terminalId}))}};e([i({readOnly:!0})],k.prototype,"_rulesLayer",null),e([i({readOnly:!0})],k.prototype,"_telecomSourceSet",null),e([i({type:[m],json:{origins:{"web-map":{read:{source:"traceConfigurations"},write:{target:"traceConfigurations"}},service:{read:{source:"traceConfigurations"}}},read:!1}})],k.prototype,"sharedNamedTraceConfigurations",void 0),e([i({type:["utility"],readOnly:!0,json:{read:!1,write:!1}})],k.prototype,"type",void 0),e([i({readOnly:!0})],k.prototype,"serviceTerritoryFeatureLayerId",null),e([i({readOnly:!0})],k.prototype,"networkSystemLayers",null),e([i({readOnly:!0})],k.prototype,"terminalConfigurations",null),e([i({readOnly:!0})],k.prototype,"domainNetworkNames",null),e([i({readOnly:!0})],k.prototype,"hasTelecomNetwork",null),e([i({readOnly:!0,json:{read:!1}})],k.prototype,"associationsTable",null),k=e([a("esri.networks.UtilityNetwork")],k);const S=k;export{S as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
function t(t){const e=t?.fieldsIndex,n="fromnetworksourceid",o="fromglobalid",i="fromterminalid",r="fromfirstunit",a="fromlastunit",s="tonetworksourceid",l="toglobalid",m="toterminalid",
|
|
2
|
+
function t(t){const e=t?.fieldsIndex,n="fromnetworksourceid",o="fromglobalid",i="fromterminalid",r="fromfirstunit",a="fromlastunit",s="tonetworksourceid",l="toglobalid",m="toterminalid",u="tofirstunit",f="tolastunit",g="status",d="associationtype",c="iscontentvisible",p="percentalong",y="globalid";return{fromNetworkSourceId:e?.get(n)?.name??n,fromGlobalId:e?.get(o)?.name??o,fromTerminalId:e?.get(i)?.name??i,fromFirstUnit:e?.get(r)?.name??r,fromLastUnit:e?.get(a)?.name??a,toNetworkSourceId:e?.get(s)?.name??s,toGlobalId:e?.get(l)?.name??l,toTerminalId:e?.get(m)?.name??m,toFirstUnit:e?.get(u)?.name??u,toLastUnit:e?.get(f)?.name??f,status:e?.get(g)?.name??g,associationType:e?.get(d)?.name??d,isContentVisible:e?.get(c)?.name??c,percentAlong:e?.get(p)?.name??p,globalId:e?.get(t?.globalIdField??y)?.name??y}}function e(t,e){if("feature"!==e.type&&"subtype-group"!==e.type&&"dimension-feature"!==e.type&&"annotation-feature"!==e.type)return[];if(!e.url)return[];const n="utilityNetworks"in t.map?t.map.utilityNetworks??[]:[];for(const o of n)if(o.isUtilityLayer(e)){const t=e.fieldsIndex.get("assetgroup"),n=e.fieldsIndex.get("assettype");return[t?.name,n?.name].filter(t=>null!=t)}return[]}export{t as getAssociationsTableFields,e as getUtilityNetworkFields};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/core",
|
|
3
|
-
"version": "5.2.0-next.
|
|
3
|
+
"version": "5.2.0-next.14",
|
|
4
4
|
"homepage": "https://js.arcgis.com",
|
|
5
5
|
"description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
|
|
6
6
|
"keywords": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@amcharts/amcharts5": "~5.18.0",
|
|
22
|
-
"@arcgis/toolkit": "^5.1.0-next.
|
|
22
|
+
"@arcgis/toolkit": "^5.1.0-next.129",
|
|
23
23
|
"@esri/arcgis-html-sanitizer": "~4.1.0",
|
|
24
24
|
"@esri/calcite-components": "^5.1.1-next.3",
|
|
25
25
|
"@vaadin/grid": "~25.1.3",
|