@arcgis/core 5.0.0-next.35 → 5.0.0-next.37
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/WebLinkChart.js +1 -1
- package/analysis/ShadowCast/types.d.ts +2 -0
- package/applications/Components/analysisUtils.d.ts +1 -0
- package/applications/Components/analysisUtils.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/Adapted.js +1 -1
- package/arcade/featureset/actions/AttributeFilter.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/SpatialFilter.js +1 -1
- package/arcade/featureset/sources/FeatureLayerDynamic.js +1 -1
- package/arcade/featureset/sources/FeatureLayerMemory.js +1 -1
- package/arcade/featureset/sources/FeatureLayerOGC.js +1 -1
- package/arcade/featureset/sources/FeatureLayerRelated.js +1 -1
- package/arcade/featureset/support/FeatureSet.js +1 -1
- package/arcade/featureset/support/FeatureSetIterator.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/014dbe6fa93a277b08f7.js +1 -0
- package/assets/esri/core/workers/chunks/06462b267ff8d5984882.js +1 -0
- package/assets/esri/core/workers/chunks/{b48bb38e5d60fc7a9097.js → 08ef90e3fcfd4eda4301.js} +1 -1
- package/assets/esri/core/workers/chunks/{fa01d1813fa78034526e.js → 0a5427127634738aa239.js} +1 -1
- package/assets/esri/core/workers/chunks/0a58b57e1777a8b0ea23.js +1 -0
- package/assets/esri/core/workers/chunks/{7115c52e22b7becff8de.js → 103153951ba312dc5e9e.js} +1 -1
- package/assets/esri/core/workers/chunks/{c7c721de93bc8688e13c.js → 1d4ea8db272655c0608c.js} +1 -1
- package/assets/esri/core/workers/chunks/1d566539ff6fb6ac798c.js +1 -0
- package/assets/esri/core/workers/chunks/1de216d9850c39c1735d.js +1 -0
- package/assets/esri/core/workers/chunks/20e4243ea563d05a5256.js +1 -0
- package/assets/esri/core/workers/chunks/262232437d37a7460b11.js +1 -0
- package/assets/esri/core/workers/chunks/{fafbacf2467e6883b6c9.js → 28db329528def851efd7.js} +1 -1
- package/assets/esri/core/workers/chunks/{2367bd1cb34799a3f08a.js → 30184e39129d9c66ea54.js} +1 -1
- package/assets/esri/core/workers/chunks/{f55328aabf84770c8e6a.js → 328106e181e5957ceaa5.js} +1 -1
- package/assets/esri/core/workers/chunks/48e2737182c75005fb8f.js +1 -0
- package/assets/esri/core/workers/chunks/{d3db7244fac7398cc700.js → 4b6a44c6265c8959abd8.js} +1 -1
- package/assets/esri/core/workers/chunks/{a372d9af43ade7c6314c.js → 52c8687b473c9953c2f2.js} +1 -1
- package/assets/esri/core/workers/chunks/{63933cbcb5c12df09715.js → 59ce992d3a5e7c32b9fb.js} +1 -1
- package/assets/esri/core/workers/chunks/{c9c2e00fed979c21e2f0.js → 5e30acfda04f7fc2b676.js} +1 -1
- package/assets/esri/core/workers/chunks/6330d8767ba1d5329daa.js +1 -0
- package/assets/esri/core/workers/chunks/640085b5ade5c7f16228.js +1 -0
- package/assets/esri/core/workers/chunks/690a40d2eef52bfc149f.js +1 -0
- package/assets/esri/core/workers/chunks/727804cf901094b1d620.js +1 -0
- package/assets/esri/core/workers/chunks/{dd34d56caafa38d4b8e4.js → 7aa730e5ac7b268e3c98.js} +1 -1
- package/assets/esri/core/workers/chunks/8c271e9272e4eaf1325a.js +1 -0
- package/assets/esri/core/workers/chunks/{2a0fe1aede5c68374ccf.js → 8ec238b5b59ef18a1713.js} +1 -1
- package/assets/esri/core/workers/chunks/{f1dfb1323d50247e80f9.js → 9110287f272141f60c35.js} +1 -1
- package/assets/esri/core/workers/chunks/951a3442d4342539f2ea.js +1 -0
- package/assets/esri/core/workers/chunks/9664d9e679abc41f6c42.js +1 -0
- package/assets/esri/core/workers/chunks/{2921f05a40fda12f9f81.js → a00bba1c7cbf8cd7892c.js} +1 -1
- package/assets/esri/core/workers/chunks/a716b8fdeda4e16f03ab.js +1 -0
- package/assets/esri/core/workers/chunks/aead7c9830fa310e5b53.js +1 -0
- package/assets/esri/core/workers/chunks/{1fa55d4c4b092a98bdd7.js → b56c07c0b43cb1999070.js} +1 -1
- package/assets/esri/core/workers/chunks/b59be95949445ff5afab.js +1 -0
- package/assets/esri/core/workers/chunks/b6dec5dfdeca54bae88d.js +1 -0
- package/assets/esri/core/workers/chunks/{6afd59412bfc134bdf75.js → c052fb8c952cda0b5d13.js} +1 -1
- package/assets/esri/core/workers/chunks/c5967133f3ba34a883f8.js +1 -0
- package/assets/esri/core/workers/chunks/{4356274cfa477eb6d749.js → cda5c95fd49b8901f7d4.js} +1 -1
- package/assets/esri/core/workers/chunks/{82cc758bddd9f8397b9f.js → ce8fc1ca229d53a4b68d.js} +8 -8
- package/assets/esri/core/workers/chunks/{f2ebd6471e1259a6eac0.js → ce99abfdcd71ff9e4e36.js} +1 -1
- package/assets/esri/core/workers/chunks/{726a797f5df7eeee0b3d.js → d786b17cc9062b1450ac.js} +1 -1
- package/assets/esri/core/workers/chunks/dd105d6e0fcedee32644.js +1 -0
- package/assets/esri/core/workers/chunks/{2e76fbd3c874300fc4a7.js → de3da4d31a7529761565.js} +1 -1
- package/assets/esri/core/workers/chunks/e1148067ceae7d9eaaf8.js +1 -0
- package/assets/esri/core/workers/chunks/{b536fdb655ad293d9024.js → e501d68a1464805c4b4e.js} +1 -1
- package/assets/esri/core/workers/chunks/{33431e8131f6017de2f9.js → e7f4d135ef9665de1468.js} +1 -1
- package/assets/esri/core/workers/chunks/{97650ee3d0eecb69ccbb.js → e9bc3c6482ba778c9349.js} +39 -39
- package/assets/esri/core/workers/chunks/{7804be2f5b3d86188a24.js → edc3d98f33d7bf959154.js} +1 -1
- package/assets/esri/core/workers/chunks/{0446562aee0639c61485.js → ee67c8a7c1f8b482cd99.js} +1 -1
- package/assets/esri/core/workers/chunks/eefad79be500667af96e.js +1 -0
- package/assets/esri/core/workers/chunks/{2b7f9a57a2cfbc108673.js → f1b99529e2055873b65a.js} +1 -1
- package/assets/esri/core/workers/chunks/{abb05a903440d97a6a74.js → f441fc74451330384fb0.js} +1 -1
- package/assets/esri/core/workers/chunks/f609b256df9eb3803464.js +1 -0
- package/assets/esri/core/workers/chunks/f693a4d97b2762d0e6ff.js +1 -0
- package/assets/esri/core/workers/chunks/f8caceeaa14d99c35526.js +1 -0
- package/assets/esri/core/workers/chunks/f97a7cb367634353177d.js +1 -0
- package/assets/esri/core/workers/chunks/febce0d80f019dc2a427.js +1 -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/_Attribution.scss +1 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/chunks/CloudsComposition.glsl.js +1 -1
- package/chunks/ComponentShader.glsl.js +2 -2
- package/chunks/DefaultMaterial.glsl.js +1 -1
- package/chunks/GaussianSplat.glsl.js +2 -2
- package/chunks/Laserlines.glsl.js +1 -1
- package/chunks/Magnifier.glsl.js +1 -1
- package/chunks/Path.glsl.js +1 -1
- package/chunks/RealisticTree.glsl.js +1 -1
- package/chunks/Terrain.glsl.js +34 -36
- package/chunks/WaterSurface.glsl.js +1 -1
- package/chunks/arcgis-knowledge-client-core-simd.js +1 -1
- package/chunks/arcgis-knowledge-client-core.js +1 -1
- package/chunks/boundedPlane.js +1 -1
- package/chunks/cameraUtilsSpherical.js +1 -1
- package/chunks/vec32.js +1 -1
- package/chunks/vec42.js +1 -1
- package/config.js +1 -1
- package/core/has.js +1 -1
- package/core/iteratorUtils.js +1 -1
- package/core/libs/gl-matrix-2/math/quat.js +1 -1
- package/core/libs/gl-matrix-2/math/vec3.js +1 -1
- package/core/libs/gl-matrix-2/math/vec4.js +1 -1
- package/geometry/support/aaBoundingRect.js +1 -1
- package/geometry/support/buffer/BufferView.js +1 -1
- package/geometry/support/buffer/internals/Vec4.js +1 -1
- package/geometry/support/lineSegment.js +1 -1
- package/geometry/support/meshUtils/merge.js +1 -1
- package/geometry/support/sphere.js +1 -1
- package/interfaces.d.ts +143 -5
- package/kernel.js +1 -1
- package/layers/GaussianSplatLayer.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/VoxelWasmPerSceneView.js +1 -1
- package/layers/knowledgeGraph/layerUtils.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/csvUtils.js +1 -1
- package/layers/video/VideoController.js +1 -1
- package/layers/voxel/VoxelVolume.js +1 -1
- package/package.json +5 -5
- package/rest/knowledgeGraph/DataModel.js +1 -1
- package/rest/knowledgeGraph/GraphDataModelSingletonOperationResult.d.ts +4 -0
- package/rest/knowledgeGraph/GraphDataModelSingletonOperationResult.js +5 -0
- package/rest/knowledgeGraph/GraphProperty.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/updateToWasmEncodedFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelChangeResponseFactories.js +1 -1
- package/rest/knowledgeGraph/wasmInterface/wasmToDataModelFactories.js +1 -1
- package/rest/knowledgeGraphService.d.ts +3 -0
- package/rest/knowledgeGraphService.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileLineVisualization2D.js +1 -1
- package/views/2d/interactive/SegmentLabels2D.js +1 -1
- package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionConstraintUtils.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineSceneComputation.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileLineVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightController.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightIntersectionResult.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/Slice/sliceToolUtils.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/animation/pointToPoint/Camera.js +1 -1
- package/views/3d/camera/constraintUtils/distance.js +1 -1
- package/views/3d/camera/constraintUtils/tilt.js +1 -1
- package/views/3d/environment/ChapmanAtmosphere.js +1 -1
- package/views/3d/environment/CloudsParameters.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/environment/Fog.js +1 -1
- package/views/3d/environment/MarsAtmosphere.js +1 -1
- package/views/3d/interactive/SegmentLabels3D.js +1 -1
- package/views/3d/interactive/editingTools/manipulations/MoveZManipulation.js +1 -1
- package/views/3d/interactive/editingTools/media/MediaElementManipulator3D.js +1 -1
- package/views/3d/interactive/editingTools/reshape/edgeOffsetUtils.js +1 -1
- package/views/3d/interactive/measurementTools/directLineMeasurement3D/DirectLineMeasurement3DTool.js +1 -1
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementAreaVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/MeasurementArrowVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/PointVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/SlicePlaneVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/VerticesVisualElement.js +1 -1
- package/views/3d/layers/DrapedSubView3D.js +1 -1
- package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
- package/views/3d/layers/GraphicsLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/ImagerySubView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/RouteLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Deconflictor.js +1 -1
- package/views/3d/layers/graphics/Graphics3DFrustumVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DScaleVisibility.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/graphicUtils.js +1 -1
- package/views/3d/layers/graphics/objectResourceUtils.js +1 -1
- package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
- package/views/3d/layers/i3s/I3SViewportQueries.js +1 -1
- package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
- package/views/3d/layers/support/FastSymbolUpdates.js +1 -1
- package/views/3d/layers/support/FeatureTileMeasurements3D.js +1 -1
- package/views/3d/layers/support/FeatureTileVisibility3D.js +1 -1
- package/views/3d/layers/support/Tiles3DIntersectionHandler.js +1 -1
- package/views/3d/state/ConstraintsManager.js +1 -1
- package/views/3d/state/Frustum.js +1 -1
- package/views/3d/state/ViewStateManager.js +1 -1
- package/views/3d/state/controllers/FovController.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/state/controllers/momentum/ZoomPlanarMomentumController.js +1 -1
- package/views/3d/support/FrustumExtentIntersection.js +1 -1
- package/views/3d/support/cameraUtils.js +1 -1
- package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatOrderTexture.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatTextureAtlas.js +1 -1
- package/views/3d/support/intersectionUtils.js +1 -1
- package/views/3d/support/pointsOfInterest/CameraOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/CenterOnSurface.js +1 -1
- package/views/3d/support/pointsOfInterest/Focus.js +1 -1
- package/views/3d/support/pointsOfInterest/PointsOfInterest.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/support/viewpointUtils.js +1 -1
- package/views/3d/terrain/Overlay.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchRenderData.js +1 -1
- package/views/3d/terrain/ScaleRangeQueries.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/TextureFader.js +1 -1
- package/views/3d/terrain/TextureReference.js +1 -1
- package/views/3d/terrain/Tile.js +1 -1
- package/views/3d/terrain/TileCompositor.js +1 -1
- package/views/3d/webgl/RenderCamera.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.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/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/Slice.glsl.js +4 -7
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/VerticalOffset.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/hud/HUD.glsl.js +6 -6
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateAmbientLighting.glsl.js +4 -4
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +19 -15
- package/views/3d/webgl-engine/core/shaderLibrary/shading/MainLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterDistortion.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/Overlay.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TerrainTexture.glsl.js +5 -5
- package/views/3d/webgl-engine/core/shaderLibrary/terrain/TileBackground.glsl.js +14 -14
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +16 -37
- package/views/3d/webgl-engine/core/shaderLibrary/util/CameraSpace.glsl.js +2 -2
- package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
- package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
- package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/transparency/OITBlend.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/MainFramebuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.js +1 -1
- package/views/3d/webgl-engine/lib/Object3D.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
- package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBuffer.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/edgePreprocessing.js +1 -1
- package/views/3d/webgl-engine/lib/geometryDataUtils.js +1 -1
- package/views/3d/webgl-engine/lib/triangleIntersectionUtils.js +1 -1
- package/views/3d/webgl-engine/materials/CheckerBoardMaterial.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/DefaultTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/HeatmapDensityMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/SlicePlaneMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/WaterMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/renderers/VaoWriter.js +1 -1
- package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplat.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/NativeLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +9 -10
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SphereDepthInterpolate.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/Terrain.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/TerrainTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/ensureColor4.js +1 -1
- package/views/3d/webgl-engine/shaders/sources/edgeRenderer/EdgeUtil.glsl.js +5 -5
- package/views/GroundView.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/analysis/ElevationProfile/elevationProfileVisualizationUtils.js +1 -1
- package/views/interactive/GraphicManipulator.js +1 -1
- package/views/interactive/coordinateHelper.js +1 -1
- package/views/interactive/editGeometry/operations/OffsetEdgeVertex.js +1 -1
- package/views/interactive/sketch/constraints.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
- package/views/interactive/snapping/featureSources/sceneLayerSource/sceneLayerSnappingUtils.js +1 -1
- package/views/interactive/snapping/hints/LineSnappingHint.js +1 -1
- package/views/interactive/tooltip/tooltipCommonUtils.js +1 -1
- package/views/layers/LayerView.js +1 -1
- package/views/navigation/PanSphericalMomentumEstimator.js +1 -1
- package/views/support/GroundElevationSampler.js +1 -1
- package/views/support/LayerViewManager.js +1 -1
- package/views/support/euclideanAreaMeasurementUtils.js +1 -1
- package/views/support/euclideanLengthMeasurementUtils.js +1 -1
- package/views/support/geodesicLengthMeasurementUtils.js +1 -1
- package/views/support/geometry3dUtils.js +1 -1
- package/webmap/utils.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/support/SelectionList.js +1 -1
- package/assets/esri/core/workers/chunks/032444974011118127d7.js +0 -1
- package/assets/esri/core/workers/chunks/05e55118dc0023d500fc.js +0 -1
- package/assets/esri/core/workers/chunks/089221bac1f019692f48.js +0 -1
- package/assets/esri/core/workers/chunks/11687718c8635eb7bf37.js +0 -1
- package/assets/esri/core/workers/chunks/15c1a48e8cd2a8882d85.js +0 -1
- package/assets/esri/core/workers/chunks/1b9e7d416c9f00e020bb.js +0 -1
- package/assets/esri/core/workers/chunks/1bfe0b2bf38d4dee7fd6.js +0 -1
- package/assets/esri/core/workers/chunks/27bd88e1101873d4ce12.js +0 -1
- package/assets/esri/core/workers/chunks/483dc4ee5d73cdfe6229.js +0 -1
- package/assets/esri/core/workers/chunks/53d95ba86d010231fc4e.js +0 -1
- package/assets/esri/core/workers/chunks/7d3e665613927904ba4f.js +0 -1
- package/assets/esri/core/workers/chunks/a5f2da24497349239648.js +0 -1
- package/assets/esri/core/workers/chunks/a7b1b42bdb9cb9ecac45.js +0 -1
- package/assets/esri/core/workers/chunks/acaaefd4997316d319b8.js +0 -1
- package/assets/esri/core/workers/chunks/ad138b989c2c7a1168ac.js +0 -1
- package/assets/esri/core/workers/chunks/cc7c37f9ed3f831fd25c.js +0 -1
- package/assets/esri/core/workers/chunks/d14bd320f72d8e8a0ad8.js +0 -1
- package/assets/esri/core/workers/chunks/d86e59da76eea888ba86.js +0 -1
- package/assets/esri/core/workers/chunks/d8975dd7b85b5d065ee4.js +0 -1
- package/assets/esri/core/workers/chunks/de99c4fd1582a8e610cf.js +0 -1
- package/assets/esri/core/workers/chunks/ded3ef385d5a3a2ec8ca.js +0 -1
- package/assets/esri/core/workers/chunks/e3a994587f9b2e88db85.js +0 -1
- package/assets/esri/core/workers/chunks/eab0938d4ad7d7cc7309.js +0 -1
- package/assets/esri/core/workers/chunks/ed1dabed10ff9f4e0369.js +0 -1
- package/assets/esri/core/workers/chunks/ef5b13ee3362763c1096.js +0 -1
- package/assets/esri/core/workers/chunks/effbc4d240752e8ba0ab.js +0 -1
- package/assets/esri/core/workers/chunks/f403d8e414766fab2936.js +0 -1
- package/assets/esri/core/workers/chunks/f43e1e1a1b2eb737e00c.js +0 -1
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import{neverAbortedSignal as e}from"../../arcadeEnvironment.js";import{StringEnum as t}from"../../enum.js";import{a2 as s}from"../../../chunks/languageUtils.js";import{SqlExpressionAdapted as i,OriginalField as r,AdaptedFeatureSet as o}from"./Adapted.js";import a from"./AttributeFilter.js";import n from"./OrderBy.js";import{FeatureSetError as l,throwIfCancelled as d}from"../support/errorsupport.js";import{FeatureSet as u,emptyFeaturesResult as p}from"../support/FeatureSet.js";import f from"../support/OrderbyClause.js";import{isSingleField as c,toWhereClause as h,predictType as g,scanForField as m,reformulateWithoutField as _}from"../support/sqlUtils.js";import y from"../support/StatsField.js";import{createMD5Hash as F,outputTypes as w}from"../../../core/MD5.js";import{aggregateFunction as b}from"../../../core/sql/AggregateFunctions.js";import{DateOnly as S}from"../../../core/sql/DateOnly.js";import{SqlTimeStampOffset as A}from"../../../core/sql/SqlTimestampOffset.js";import{TimeOnly as x}from"../../../core/sql/TimeOnly.js";import I from"../../../core/sql/WhereClause.js";import G from"../../../layers/support/Field.js";const B=new t(["MIN","MAX","VAR","STDDEV","COUNT","SUM","AVG"],[["VARIANCE","VAR"],["AVERAGE","AVG"],["MEAN","AVG"],["STDEV","STDDEV"]]);class j extends u{constructor(e){super(),this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._decodedStatsFields=[],this._decodedGroupByFields=[],this._canDoSimpleGroupBy=!0,this._physicalGroupByFields=[],this.objectIdField="ROW__ID",this._adaptedFields=[],this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}_nextUniqueName(e){for(;1===e["T"+this._uniqueIds.toString()];)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e=this._parent.getFieldsIndex();this.objectIdField="ROW__ID",this.globalIdField="";let t=!1,s=1;for(;!1===t;){let e=!1;for(const t of this._config.groupbyfields)if(t.name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}if(!1===e)for(const t of this._config.statsfields)if(t.name.toLowerCase()===this.objectIdField.toLowerCase()){e=!0;break}!1===e?t=!0:(this.objectIdField="ROW__ID"+s.toString(),s++)}for(const i of this._config.statsfields){const t=new y;t.field=i.name,t.tofieldname=i.name,t.workingexpr=i.expression instanceof I?i.expression:I.create(i.expression,{fieldsIndex:e,timeZone:this.dateFieldsTimeZoneDefaultUTC}),t.typeofstat=B.lookup(i.statistic)??"COUNT",this._decodedStatsFields.push(t)}this._decodedGroupByFields=[];for(const i of this._config.groupbyfields){const t={name:i.name,singlefield:null,tofieldname:i.name,expression:i.expression instanceof I?i.expression:I.create(i.expression,{fieldsIndex:e,timeZone:this.dateFieldsTimeZoneDefaultUTC}),sqlType:null};this._decodedGroupByFields.push(t)}const o={};this.geometryType=this._parent.geometryType,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField="";for(const i of this._parent.fields)o[i.name.toUpperCase()]=1;this.types=null,this.subtypes=null,this.subtypeField="",this.fields=[];const a=new y;a.field=this._nextUniqueName(o),a.tofieldname=this.objectIdField,a.workingexpr=I.create(this._parent.objectIdField,{fieldsIndex:this._parent.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),a.typeofstat="MIN",this._decodedStatsFields.push(a);for(const r of this._decodedGroupByFields){const e=new G;if(r.name=this._nextUniqueName(o),e.name=r.tofieldname,e.alias=e.name,c(r.expression)){const t=this._parent.getField(h(r.expression,0));if(!t)throw new l("AggregationFieldNotFound");r.name=t.name,r.singlefield=t.name,this._physicalGroupByFields.push(t.name),e.type=t.type,r.sqlType=t.type}else{e.type=this._convertToEsriFieldType(g(r.expression,this._parent.fields));const t=new G;t.name=r.name,t.alias=t.name,this._physicalGroupByFields.push(r.name),this._adaptedFields.push(new i(t,r.expression)),this._canDoSimpleGroupBy=!1,r.sqlType=e.type}this.fields.push(e)}if(this._adaptedFields.length>0)for(const i of this._parent.fields)this._adaptedFields.push(new r(i));for(const i of this._decodedStatsFields){const e=new G;let t=null;i.field=this._nextUniqueName(o),e.name=i.tofieldname,e.alias=e.name;const s=null!==i.workingexpr&&c(i.workingexpr)?h(i.workingexpr,0):"";switch(i.typeofstat){case"SUM":if(""!==s){if(t=this._parent.getField(s),!t)throw new l("AggregationFieldNotFound");e.type=t.type}else e.type="double";break;case"MIN":case"MAX":if(""!==s){if(t=this._parent.getField(s),!t)throw new l("AggregationFieldNotFound");e.type=t.type}else e.type="double";break;case"COUNT":e.type="integer";break;case"STDDEV":case"VAR":case"AVG":if(""!==s&&(t=this._parent.getField(s),!t))throw new l("AggregationFieldNotFound");e.type="double"}this.fields.push(e)}}async _queryAll(){return(await this.query({abortSignal:e})).features}async query(e){if(null!=e.spatialFilter)return p;const t={ordered:!1,nowhereclause:!1};await this._ensureLoaded();let s=e.where;if(null!=s)for(const o of this._decodedStatsFields)if(!0===m(s,o.tofieldname)){t.nowhereclause=!0,s=null;break}let i=e.orderBy;if(null!=i){t.ordered=!0;for(const e of this._decodedStatsFields)if(!0===i.scanForField(e.tofieldname)){i=null,t.ordered=!1;break}if(null!==i)for(const e of this._decodedGroupByFields)if(null===e.singlefield&&!0===i.scanForField(e.tofieldname)){i=null,t.ordered=!1;break}}if(!1!==this._canDoSimpleGroupBy&&await this._parent.canQueryAggregate({groupBy:this._physicalGroupByFields,statistics:this._decodedStatsFields,where:null,spatialFilter:null,abortSignal:e.abortSignal})){const r=await this._parent.queryAggregate({groupBy:this._physicalGroupByFields,statistics:this._decodedStatsFields,where:s?this._reformulateWhereClauseWithoutGroupByFields(s):null,spatialFilter:null,orderBy:i?this._reformulateOrderClauseWithoutGroupByFields(i):null,abortSignal:e.abortSignal});return d(e.abortSignal),{...r,filterApplied:!t.nowhereclause&&r.filterApplied,ordered:!0===t.ordered&&r.ordered,features:this._fixAggregateAttributeNames(r.features)}}const r=this._adaptedFields.length>0?new o({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null}):this._parent;if(!0===t.nowhereclause){const t=new n({parentfeatureset:r,orderbyclause:new f(this._physicalGroupByFields.join(",")+","+this._parent.objectIdField+" ASC")});return{filterApplied:!1,spatialFilterApplied:!1,ordered:!1,features:this._aggregateSortedFeatureGroups((await t.query({abortSignal:e.abortSignal})).features,this._maxQuery,e.abortSignal)}}let l=r;null!=s&&(l=new a({parentfeatureset:l,whereclause:this._reformulateWhereClauseWithoutGroupByFields(s)}));const u=new n({parentfeatureset:l,orderbyclause:new f(this._physicalGroupByFields.join(",")+","+this._parent.objectIdField+" ASC")});return{filterApplied:!1,spatialFilterApplied:!1,ordered:!1,features:this._aggregateSortedFeatureGroups((await u.query({abortSignal:e.abortSignal})).features,this._maxQuery,e.abortSignal)}}async*_fixAggregateAttributeNames(e){for await(const t of e)yield t.map(e=>{const t={geometry:e.geometry,attributes:{}},s={};for(const i in e.attributes)s[i.toLowerCase()]=e.attributes[i];for(const i of this._decodedGroupByFields)t.attributes[i.tofieldname]=s[i.name.toLowerCase()];for(const i of this._decodedStatsFields)t.attributes[i.tofieldname]=s[i.field.toLowerCase()];return t})}async*_aggregateSortedFeatureGroups(e,t,i){let r=null,o=[];for await(const a of e){await s(),d(i);for(const e of a){const t=this._generateAggregateHash(e);null==r?r={features:[e],id:t}:t!==r.id?(o.push(this._calculateAndAppendAggregateItem(r)),r={features:[e],id:t}):r.features.push(e)}o.length>=t&&(yield o,o=[])}null!=r&&(o.push(this._calculateAndAppendAggregateItem(r)),yield o)}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new l("NeverReach")}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsFields)e=_(e,t.tofieldname,h(t.workingexpr,0),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupByFields)t.tofieldname!==t.name&&(e=_(e,t.tofieldname,h(t.expression,0),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const s of this._decodedGroupByFields)s.tofieldname!==s.name&&t.push({field:s.tofieldname,newfield:s.name});return t.length>0?e.replaceFields(t):e}_calculateFieldStat(e,t,s){const i=[];for(const r of e.features)if(null!==t.workingexpr){const e=t.workingexpr.calculateValue(r);null!==e&&(e instanceof S||e instanceof x?i.push(e.toNumber()):e instanceof A?i.push(e.toMilliseconds()):i.push(e))}else i.push(null);s.attributes[t.tofieldname]=b(t.typeofstat,[i])}_calculateAndAppendAggregateItem(e){const t={attributes:{}};for(const s of this._decodedGroupByFields){const i=s.singlefield?e.features[0].attributes[s.singlefield]:I.convertValueToStorageFormat(s.expression.calculateValue(e.features[0]),s.sqlType);t.attributes[s.tofieldname]=i}for(const s of this._decodedStatsFields)this._calculateFieldStat(e,s,t);return t}_generateAggregateHash(e){let t="";for(const s of this._decodedGroupByFields){const i=s.singlefield?e.attributes[s.singlefield]:s.expression.calculateValue(e);t+=null==i?":":":"+i.toString()}return F(t,w.String)}async getFeatureByObjectId(){throw new l("NotImplemented")}}export{j as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{neverAbortedSignal as t}from"../../arcadeEnvironment.js";import{shapeExtent as e}from"../../kernel.js";import{throwIfCancelled as r,FeatureSetError as a}from"../support/errorsupport.js";import{FeatureSet as i}from"../support/FeatureSet.js";import{defaultMaxRecords as s}from"../support/shared.js";import{invokeRemoteGeometryOp as l}from"../../geometry/operatorsWorkerConnection.js";import{neverReachedSilent as o}from"../../../core/compilerUtils.js";
|
|
5
|
+
import{neverAbortedSignal as t}from"../../arcadeEnvironment.js";import{shapeExtent as e}from"../../kernel.js";import{throwIfCancelled as r,FeatureSetError as a}from"../support/errorsupport.js";import{FeatureSet as i}from"../support/FeatureSet.js";import{defaultMaxRecords as s}from"../support/shared.js";import{invokeRemoteGeometryOp as l}from"../../geometry/operatorsWorkerConnection.js";import{neverReachedSilent as o}from"../../../core/compilerUtils.js";import{getGeometryExtent as n}from"../../../geometry/support/extentUtils.js";class p extends i{constructor(t){super(),this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._maxProcessing=40,this._parent=t.parentfeatureset,this._relation=t.relation,this._relationString=t.relationString??"",this._relationGeom=t.relationGeom}get _spatialFilter(){return{relation:"esriSpatialRelRelation"!==this._relation?this._relation:`esriSpatialRelRelation:${this._relationString}`,geometry:this._relationGeom}}async _queryAll(){return(await this.query({abortSignal:t})).features}async query(t){await this._ensureLoaded();const e=await this._parent.query({...t,spatialFilter:this._spatialFilter});return r(t.abortSignal),{...e,spatialFilterApplied:null==t.spatialFilter,features:e.spatialFilterApplied?e.features:this._applySpatialFilter(e.features,t.abortSignal)}}async*_applySpatialFilter(t,e){for await(const a of t){r(e);const t=[];for(const e of a)await this._executeSpatialRelationTest(e)&&t.push(e);t.length>0&&(yield t)}}async queryStat(t){if(null!=t.spatialFilter)return{calculated:!1};const e=await this._parent.queryStat({...t,spatialFilter:this._spatialFilter});return e.calculated?e:null==t.where&&null==t.spatialFilter?this._manualStat(t.stat,t.field,t.limit??s,t.abortSignal):{calculated:!1}}async canQueryAggregate(t){return null==t.spatialFilter&&this._parent.canQueryAggregate({...t,spatialFilter:this._spatialFilter})}async queryAggregate(t){if(null!=t.spatialFilter)throw new a("NeverReach");return this._parent.queryAggregate({...t,spatialFilter:this._spatialFilter})}async _executeSpatialRelationTest(t){if(null==t.geometry)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":{const r=e(this._relationGeom),a=n(t.geometry);return null!=r&&null!=a&&l("intersects",[r.toJSON(),a])}case"esriSpatialRelIntersects":return l("intersects",[this._relationGeom.toJSON(),t.geometry]);case"esriSpatialRelContains":return l("contains",[this._relationGeom.toJSON(),t.geometry]);case"esriSpatialRelOverlaps":return l("overlaps",[this._relationGeom.toJSON(),t.geometry]);case"esriSpatialRelWithin":return l("within",[this._relationGeom.toJSON(),t.geometry]);case"esriSpatialRelTouches":return l("touches",[this._relationGeom.toJSON(),t.geometry]);case"esriSpatialRelCrosses":return l("crosses",[this._relationGeom.toJSON(),t.geometry]);case"esriSpatialRelRelation":return l("relate",[this._relationGeom.toJSON(),t.geometry,this._relationString]);default:return o(this._relation),!1}}getFieldsIndex(){return this._parent.getFieldsIndex()}}export{p as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../Graphic.js";import{id as t}from"../../../kernel.js";import r from"../../../request.js";import{neverAbortedSignal as i}from"../../arcadeEnvironment.js";import a from"../../Attachment.js";import s from"../../Dictionary.js";import{throwIfCancelled as l,FeatureSetError as n}from"../support/errorsupport.js";import{RootFeatureSet as o,emptyFeaturesResult as u}from"../support/FeatureSet.js";import{defaultMaxRecords as c,stableStringify as h,extractServiceUrl as y}from"../support/shared.js";import{toWhereClause as d,isSingleField as p}from"../support/sqlUtils.js";import{decodeStatType as _}from"../support/stats.js";import{sliceEquals as m}from"../../../core/arrayUtils.js";import{createMD5Hash as f,outputTypes as F}from"../../../core/MD5.js";import{sqlAnd as w}from"../../../core/sql.js";import g from"../../../core/sql/WhereClause.js";import{fromJSON as S}from"../../../geometry/support/jsonUtils.js";import b from"../../../layers/FeatureLayer.js";import{toQueryStringParameters as R}from"../../../rest/query/operations/queryRelatedRecords.js";import I from"../../../rest/support/AttachmentQuery.js";import q from"../../../rest/support/Query.js";import T from"../../../rest/support/StatisticDefinition.js";function Q(e){if(0===e.length)throw new n("NeverReach");const t=[];for(let i=0;i<e.length;i++){const r=e[i],a=[`"${r.name.replaceAll('"','""')}" ${r.asc?">":"<"} @last_${i}`];for(let t=0;t<i;t++){const r=e[t];a.push(`"${r.name.replaceAll('"','""')}" = @last_${t}`)}t.push(a.join(" AND "))}const r=t.join(" OR ");return g.create(r)}function v(e,t){null==e.clause&&(e.clause=Q(e.keyFields));for(let r=0;r<e.keyFields.length;r++){const i=e.keyFields[r].name;e.clause.parameters[`last_${r}`]=t.attributes[i]}}class j extends o{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this._requestStandardised=!1,this._useDefinitionExpression=!0,this._recentlyUsedQueries=null,this._featureSetQueryInterceptor=null,this._featureSetInfo=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry),e.lrucache&&(this._recentlyUsedQueries=e.lrucache),e.interceptor&&(this._featureSetQueryInterceptor=e.interceptor)}_maxQueryRate(){return c}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+h(e.toJSON());return f(t,F.String)}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=1,null!=e&&e>=10.61&&(this._databaseType=0)):null!=e&&(e>=10.5&&(this._databaseType=1,this._requestStandardised=!0),e>=10.61&&(this._databaseType=0))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new q;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}async _queryAll(){return(await this.query({abortSignal:i})).features}async query(e){return await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter?u:this._canUsePagination()?this._queryUsingPaging(e):this._queryUsingIdSetTraversal(e)}async _queryUsingPaging(e){let t="",r=!1;null!=e.orderBy&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(t=e.orderBy.constructClause(),r=!0);const i=await this.databaseType(),a=null==e.where?null==e.spatialFilter?"1=1":"":d(e.where,i);let s=this._maxQueryRate();const l=this._layer.capabilities?.query.maxRecordCount;null!=l&&l<s&&(s=l);const n=!0!==this._removeGeometry,o=this._overrideFields??this._fieldsIncludingObjectId(["*"]),u=this._createQuery();return u.where=w(u.where,a),null!=e.spatialFilter&&(u.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),u.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),u.geometry=e.spatialFilter.geometry),u.orderByFields=""!==t?t.split(","):null,u.outFields=o,u.returnGeometry=n,u.outSpatialReference=this.spatialReference,{ordered:r,filterApplied:!0,spatialFilterApplied:!0,features:this._queryPaginated(u,s,e.abortSignal)}}async*_queryPaginated(e,t,r){let i;e.num=t,e.start=0;do{l(r),i=await this.executeQuery(e,"execute"),yield i.features,e.start+=t}while(void 0===i.exceededTransferLimit&&i.features.length===t||!1!==i.exceededTransferLimit)}async _queryUsingIdSetTraversal(e){let t="",r=!1;null!=e.orderBy&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(t=e.orderBy.constructClause(),r=!0);const i=await this.databaseType(),a=null==e.where?null==e.spatialFilter?"1=1":"":d(e.where,i),s=this._createQuery();s.where=w(s.where,a),null!=e.spatialFilter&&(s.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),s.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),s.geometry=e.spatialFilter.geometry),s.orderByFields=""!==t?t.split(","):null,s.outSpatialReference=this.spatialReference;const n=await this.executeQuery(s,"executeForIds");if(l(e.abortSignal),null==n||n.length<=0)return u;let o=this._maxQueryRate();const c=this._layer.capabilities?.query.maxRecordCount;null!=c&&c<o&&(o=c);const h=this._createQuery();return s.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),s.returnGeometry=!0!==this._removeGeometry,s.outSpatialReference=this.spatialReference,{ordered:r,filterApplied:!0,spatialFilterApplied:!0,features:this._traverseIdSet(h,n,o,e.abortSignal)}}async*_traverseIdSet(e,t,r,i){for(let a=0;a<t.length;a+=r){e.objectIds=t.slice(a,a+r),l(i);const s=await this.executeQuery(e,"execute");yield s.features}}async queryStat(e){await this._ensureLoaded();const t=this._layer.capabilities?.query,r=!!t?.supportsSqlExpression,i=!!t?.supportsStatistics,a=!!t?.supportsDistinct,s=_(e.stat);if("count"===s)return a?this._queryCount(e):{calculated:!1};const l=e.field;if(null==l)return{calculated:!1};if(!1===i||!1===p(l)&&!1===r||!1===l.isStandardized)return null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(e.stat,l,e.limit??c,e.abortSignal);if("distinct"===s)return!1===a?null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(s,l,e.limit??c,e.abortSignal):{calculated:!1};const o=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:null};const u=this._createQuery();u.where=w(u.where,null==e.where?null==e.spatialFilter?"1=1":"":d(e.where,o)),null!=e.spatialFilter&&(u.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),u.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),u.geometry=e.spatialFilter.geometry);const h=new T;h.statisticType=s,h.onStatisticField=d(l,o),h.outStatisticFieldName="ARCADE_STAT_RESULT",u.returnGeometry=!1;let y="ARCADE_STAT_RESULT";u.outStatistics=[h];const m=await this.executeQuery(u,"execute");if(!m.hasOwnProperty("features")||0===m.features.length)throw new n("InvalidStatResponse");let f=!1;const F=m.fields??[];for(const n of F)if("ARCADE_STAT_RESULT"===n.name.toUpperCase()){y=n.name,"date"===n.type&&(f=!0);break}const g=m.features[0].attributes[y];return{calculated:!0,result:f&&null!=g?new Date(g):g}}async _queryCount(e){const t=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:0};const r=this._createQuery();r.where=w(r.where,null==e.where?null==e.spatialFilter?"1=1":"":d(e.where,t)),null!=e.spatialFilter&&(r.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),r.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),r.geometry=e.spatialFilter.geometry),r.returnGeometry=!1;return{calculated:!0,result:await this.executeQuery(r,"executeForCount")}}async canQueryAggregate(e){await this._ensureLoaded();let t=!1;const r=this._layer.capabilities?.query,i=!0===r?.supportsSqlExpression;if(null!=r&&!0===r.supportsStatistics&&!0===r.supportsOrderBy&&(t=!0),t)for(const a of e.statistics)(!1===a.workingexpr?.isStandardized||!1===p(a.workingexpr)&&!1===i)&&(t=!1);return t}async queryAggregate(e){if(await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter)return u;const t=await this.databaseType(),r=e.groupBy,i=e.orderBy;let a=null;if(!this._layer.capabilities.query.supportsPaginationOnAggregatedQueries){const e=this.getFieldsIndex();a={keyFields:r.map((t,r)=>({name:e.normalizeFieldName(t)??t,asc:null==i||1===i._directions[r]}))}}let s="",l=!1;null!=i&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(null==a||m(r,0,r.length,i._fields,0,Math.min(i._fields.length,r.length),(e,t)=>e.toLowerCase()===t.toLowerCase()))&&(s=i.constructClause(),l=!0),""===s&&(s=r.join(","));const n=e.statistics.map(e=>new T({onStatisticField:null!==e.workingexpr?d(e.workingexpr,t):"",outStatisticFieldName:e.field,statisticType:e.toStatisticsName()}));let o=this._maxQueryRate();const c=this._layer.capabilities?.query.maxRecordCount;null!=c&&c<o&&(o=c);const h=null==e.where?null==e.spatialFilter?"1=1":"":d(e.where,t),y=this._createQuery();return y.where=w(y.where,h),null!=e.spatialFilter&&(y.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),y.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),y.geometry=e.spatialFilter.geometry),y.orderByFields=""!==s?s.split(","):null,y.outFields=["*"],y.outStatistics=n,y.groupByFieldsForStatistics=r,y.returnGeometry=!1,null==a?{filterApplied:!0,spatialFilterApplied:!0,ordered:l,features:this._queryPaginated(y,o,e.abortSignal)}:{filterApplied:!0,spatialFilterApplied:!0,ordered:l,features:this._queryKeysetPaginated(y,a,e.abortSignal)}}async*_queryKeysetPaginated(e,t,r){const i=e.where;for(;;){if(null!=t.clause){if(!this._layer.capabilities.query.supportsOrderBy)throw new n("NotImplemented");e.where=w(i,d(t.clause,await this.databaseType()))}const a=await this.executeQuery(e,"execute");if(l(r),!a.hasOwnProperty("features"))throw new n("InvalidStatResponse");if(yield a.features,0===a.features.length||!a.exceededTransferLimit)break;v(t,a.features.at(-1))}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?"subtype-group"===this._layer.type&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const r="execute"===t?this._layer.queryFeatures.bind(this._layer):"executeForCount"===t?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let i=null;if(this._recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);i=this._recentlyUsedQueries.getFromCache(t),null===i&&(i=r(e),this._recentlyUsedQueries.addToCache(t,i),i=i.catch(e=>{throw this._recentlyUsedQueries?.removeFromCache(t),e}))}return this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===i&&(i=r(e)),i}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let r=!1;for(const i of t)if(i.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return r||t.push(this.objectIdField),t}isTable(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType||"esriGeometryNull"===this._layer.geometryType}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}static create(e,t,r,i,a){const s=new b({url:e,outFields:null===t?["*"]:t});return new j({layer:s,spatialReference:r,lrucache:i,interceptor:a})}relationshipMetadata(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON?.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return y(this._layer.parsedUrl.path)}async queryAttachments(e,t,r,i,l){function n(e){const t=e.capabilities;return t?.data.supportsAttachment&&t?.operations.supportsQueryAttachments}const o=this._layer;if(!n(o))return[];const u=new I({objectIds:[e],returnMetadata:l});(t&&t>0||r&&r>0)&&(u.size=[t&&t>0?t:0,r&&r>0?r:t+1]),i&&i.length>0&&(u.attachmentTypes=i),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:o,query:u,method:"attachments"});const c=await o.queryAttachments(u);return c?.[e]?c[e].map(t=>{const r=`${this._layer.parsedUrl.path}/${e}/attachments/${t.id}`;let i=null;return l&&t.exifInfo&&(i=s.convertJsonToArcade(t.exifInfo,"system",!0)),new a(t.id,t.name,t.contentType,t.size,r,i,t.keywords??null)}):[]}async queryRelatedFeatures(t){const i=R(t);i.f="json",this._requestStandardised&&(i.sqlFormat="standard"),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:i,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const a=await r(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:i});if(a.data){const t={},r=a.data;if(r?.relatedRecordGroups){const i=r.spatialReference,a=!0===r.exceededTransferLimit;for(const s of r.relatedRecordGroups){const r=s.relatedRecords.map(t=>(t.geometry&&(t.geometry.spatialReference=i),new e({geometry:t.geometry?S(t.geometry):null,attributes:t.attributes})));t[s.objectId]={features:r,exceededTransferLimit:a}}}return t}throw new n("InvalidRequest")}async getFeatureByObjectId(e,t){const r=this._createQuery();r.outFields=t,r.returnGeometry=!1,r.outSpatialReference=this.spatialReference,r.where=w(r.where,this.objectIdField+"="+e.toString()),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:r,method:"execute"});const i=await this._layer.queryFeatures(r);return 1===i.features.length?i.features[0]:null}async getIdentityUser(){await this.load();const e=t?.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){await this.load();const e=t?.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl??"";let i=this._layer.url;const a=i.toLowerCase().indexOf("/rest/services");if(i=a>-1?i.slice(0,a):i,i){i+="/rest/info";try{const e=await r(i,{query:{f:"json"}});let t="";return e.data?.owningSystemUrl&&(t=e.data.owningSystemUrl),t}catch{return""}}return""}getDataSourceFeatureSet(){const e=new j({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this._recentlyUsedQueries??void 0,interceptor:this._featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this._featureSetInfo)return this._featureSetInfo;let e=null,t="serviceItemId"in this._layer?this._layer.serviceItemId:null;const i=this._layer.parsedUrl?.path??null;if(i){const a=await r(i,{responseType:"json",query:{f:"json"}});e=a?.data?.name??null,t=a?.data?.serviceItemId??null}const a=this._layer.title&&null!==(this._layer.parent??null);return this._featureSetInfo={layerId:this._layer.layerId,layerName:""===e?null:e,itemId:""===t?null:t,serviceLayerUrl:""===i?null:i,webMapLayerId:a?this._layer.id??null:null,webMapLayerTitle:a?this._layer.title??null:null,className:null,objectClassId:null},this._featureSetInfo}}export{j as default};
|
|
5
|
+
import{id as e}from"../../../kernel.js";import t from"../../../request.js";import{neverAbortedSignal as r}from"../../arcadeEnvironment.js";import i from"../../Attachment.js";import a from"../../Dictionary.js";import{throwIfCancelled as s,FeatureSetError as l}from"../support/errorsupport.js";import{RootFeatureSet as n,emptyFeaturesResult as o,assignSpatialReferenceOnFeatures as u}from"../support/FeatureSet.js";import{defaultMaxRecords as c,stableStringify as h,extractServiceUrl as y}from"../support/shared.js";import{toWhereClause as d,isSingleField as p}from"../support/sqlUtils.js";import{decodeStatType as _}from"../support/stats.js";import{sliceEquals as m}from"../../../core/arrayUtils.js";import{createMD5Hash as f,outputTypes as F}from"../../../core/MD5.js";import{sqlAnd as w}from"../../../core/sql.js";import S from"../../../core/sql/WhereClause.js";import g from"../../../layers/FeatureLayer.js";import{toQueryStringParameters as b}from"../../../rest/query/operations/queryRelatedRecords.js";import R from"../../../rest/support/AttachmentQuery.js";import I from"../../../rest/support/Query.js";import q from"../../../rest/support/StatisticDefinition.js";function T(e){if(0===e.length)throw new l("NeverReach");const t=[];for(let i=0;i<e.length;i++){const r=e[i],a=[`"${r.name.replaceAll('"','""')}" ${r.asc?">":"<"} @last_${i}`];for(let t=0;t<i;t++){const r=e[t];a.push(`"${r.name.replaceAll('"','""')}" = @last_${t}`)}t.push(a.join(" AND "))}const r=t.join(" OR ");return S.create(r)}function Q(e,t){null==e.clause&&(e.clause=T(e.keyFields));for(let r=0;r<e.keyFields.length;r++){const i=e.keyFields[r].name;e.clause.parameters[`last_${r}`]=t.attributes[i]}}class v extends n{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this._requestStandardised=!1,this._useDefinitionExpression=!0,this._recentlyUsedQueries=null,this._featureSetQueryInterceptor=null,this._featureSetInfo=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry),e.lrucache&&(this._recentlyUsedQueries=e.lrucache),e.interceptor&&(this._featureSetQueryInterceptor=e.interceptor)}_maxQueryRate(){return c}get urlQueryPath(){return this._layer.parsedUrl.path||""}convertQueryToLruCacheKey(e){const t=this.urlQueryPath+","+h(e.toJSON());return f(t,F.String)}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}if(this._layer.source&&this._layer.source.sourceJSON){const e=this._layer.source.sourceJSON.currentVersion;!0===this._layer.source.sourceJSON.useStandardizedQueries?(this._databaseType=1,null!=e&&e>=10.61&&(this._databaseType=0)):null!=e&&(e>=10.5&&(this._databaseType=1,this._requestStandardised=!0),e>=10.61&&(this._databaseType=0))}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this.subtypeField=this._layer.subtypeField??"",this.subtypes=this._layer.subtypes,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new I;this.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||!0!==this._layer.capabilities.query.supportsPagination)}_cacheableFeatureSetSourceKey(){return this._layer.url}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion||"SDE.DEFAULT":""}nativeCapabilities(){return{title:this._layer.title??"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}async _queryAll(){return(await this.query({abortSignal:r})).features}async query(e){return await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter?o:this._canUsePagination()?this._queryUsingPaging(e):this._queryUsingIdSetTraversal(e)}async _queryUsingPaging(e){let t="",r=!1;null!=e.orderBy&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(t=e.orderBy.constructClause(),r=!0);const i=await this.databaseType(),a=null==e.where?null==e.spatialFilter?"1=1":"":d(e.where,i);let s=this._maxQueryRate();const l=this._layer.capabilities?.query.maxRecordCount;null!=l&&l<s&&(s=l);const n=!0!==this._removeGeometry,o=this._overrideFields??this._fieldsIncludingObjectId(["*"]),u=this._createQuery();return u.where=w(u.where,a),null!=e.spatialFilter&&(u.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),u.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),u.geometry=e.spatialFilter.geometry),u.orderByFields=""!==t?t.split(","):null,u.outFields=o,u.returnGeometry=n,u.outSpatialReference=this.spatialReference,{ordered:r,filterApplied:!0,spatialFilterApplied:!0,features:this._queryPaginated(u,s,e.abortSignal)}}async*_queryPaginated(e,t,r){let i;e.num=t,e.start=0;do{s(r),i=await this.executeQuery(e,"execute"),yield i.features,e.start+=t}while(!0===i.exceededTransferLimit)}async _queryUsingIdSetTraversal(e){let t="",r=!1;null!=e.orderBy&&this._layer.capabilities&&this._layer.capabilities.query&&!0===this._layer.capabilities.query.supportsOrderBy&&(t=e.orderBy.constructClause(),r=!0);const i=await this.databaseType(),a=null==e.where?null==e.spatialFilter?"1=1":"":d(e.where,i),l=this._createQuery();l.where=w(l.where,a),null!=e.spatialFilter&&(l.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),l.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),l.geometry=e.spatialFilter.geometry),l.orderByFields=""!==t?t.split(","):null,l.outSpatialReference=this.spatialReference;const n=await this.executeQuery(l,"executeForIds");if(s(e.abortSignal),null==n||n.length<=0)return o;let u=this._maxQueryRate();const c=this._layer.capabilities?.query.maxRecordCount;null!=c&&c<u&&(u=c);const h=this._createQuery();return l.outFields=this._overrideFields??this._fieldsIncludingObjectId(["*"]),l.returnGeometry=!0!==this._removeGeometry,l.outSpatialReference=this.spatialReference,{ordered:r,filterApplied:!0,spatialFilterApplied:!0,features:this._traverseIdSet(h,n,u,e.abortSignal)}}async*_traverseIdSet(e,t,r,i){for(let a=0;a<t.length;a+=r){e.objectIds=t.slice(a,a+r),s(i);const l=await this.executeQuery(e,"execute");yield l.features}}async queryStat(e){await this._ensureLoaded();const t=this._layer.capabilities?.query,r=!!t?.supportsSqlExpression,i=!!t?.supportsStatistics,a=!!t?.supportsDistinct,s=_(e.stat);if("count"===s)return a?this._queryCount(e):{calculated:!1};const n=e.field;if(null==n)return{calculated:!1};if(!1===i||!1===p(n)&&!1===r||!1===n.isStandardized)return null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(e.stat,n,e.limit??c,e.abortSignal);if("distinct"===s)return!1===a?null!=e.spatialFilter||null!=e.where?{calculated:!1}:this._manualStat(s,n,e.limit??c,e.abortSignal):{calculated:!1};const o=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:null};const u=this._createQuery();u.where=w(u.where,null==e.where?null==e.spatialFilter?"1=1":"":d(e.where,o)),null!=e.spatialFilter&&(u.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),u.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),u.geometry=e.spatialFilter.geometry);const h=new q;h.statisticType=s,h.onStatisticField=d(n,o),h.outStatisticFieldName="ARCADE_STAT_RESULT",u.returnGeometry=!1;let y="ARCADE_STAT_RESULT";u.outStatistics=[h];const m=await this.executeQuery(u,"execute");if(!m.hasOwnProperty("features")||0===m.features.length)throw new l("InvalidStatResponse");let f=!1;const F=m.fields??[];for(const l of F)if("ARCADE_STAT_RESULT"===l.name.toUpperCase()){y=l.name,"esriFieldTypeDate"===l.type&&(f=!0);break}const S=m.features[0].attributes[y];return{calculated:!0,result:f&&null!=S?new Date(S):S}}async _queryCount(e){const t=await this.databaseType();if(this.isTable()&&null!=e.spatialFilter)return{calculated:!0,result:0};const r=this._createQuery();r.where=w(r.where,null==e.where?null==e.spatialFilter?"1=1":"":d(e.where,t)),null!=e.spatialFilter&&(r.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),r.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),r.geometry=e.spatialFilter.geometry),r.returnGeometry=!1;return{calculated:!0,result:await this.executeQuery(r,"executeForCount")}}async canQueryAggregate(e){await this._ensureLoaded();let t=!1;const r=this._layer.capabilities?.query,i=!0===r?.supportsSqlExpression;if(null!=r&&!0===r.supportsStatistics&&!0===r.supportsOrderBy&&(t=!0),t)for(const a of e.statistics)(!1===a.workingexpr?.isStandardized||!1===p(a.workingexpr)&&!1===i)&&(t=!1);return t}async queryAggregate(e){if(await this._ensureLoaded(),this.isTable()&&null!=e.spatialFilter)return o;const t=await this.databaseType(),r=e.groupBy,i=e.orderBy;let a=null;if(!this._layer.capabilities.query.supportsPaginationOnAggregatedQueries){const e=this.getFieldsIndex();a={keyFields:r.map((t,r)=>({name:e.normalizeFieldName(t)??t,asc:null==i||1===i._directions[r]}))}}let s="",l=!1;null!=i&&!0===this._layer.capabilities?.query?.supportsOrderBy&&(null==a||m(r,0,r.length,i._fields,0,Math.min(i._fields.length,r.length),(e,t)=>e.toLowerCase()===t.toLowerCase()))&&(s=i.constructClause(),l=!0),""===s&&(s=r.join(","));const n=e.statistics.map(e=>new q({onStatisticField:null!==e.workingexpr?d(e.workingexpr,t):"",outStatisticFieldName:e.field,statisticType:e.toStatisticsName()}));let u=this._maxQueryRate();const c=this._layer.capabilities?.query.maxRecordCount;null!=c&&c<u&&(u=c);const h=null==e.where?null==e.spatialFilter?"1=1":"":d(e.where,t),y=this._createQuery();return y.where=w(y.where,h),null!=e.spatialFilter&&(y.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),y.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),y.geometry=e.spatialFilter.geometry),y.orderByFields=""!==s?s.split(","):null,y.outFields=["*"],y.outStatistics=n,y.groupByFieldsForStatistics=r,y.returnGeometry=!1,null==a?{filterApplied:!0,spatialFilterApplied:!0,ordered:l,features:this._queryPaginated(y,u,e.abortSignal)}:{filterApplied:!0,spatialFilterApplied:!0,ordered:l,features:this._queryKeysetPaginated(y,a,e.abortSignal)}}async*_queryKeysetPaginated(e,t,r){const i=e.where;for(;;){if(null!=t.clause){if(!this._layer.capabilities.query.supportsOrderBy)throw new l("NotImplemented");e.where=w(i,d(t.clause,await this.databaseType()))}const a=await this.executeQuery(e,"execute");if(s(r),!a.hasOwnProperty("features"))throw new l("InvalidStatResponse");if(yield a.features,0===a.features.length||!0!==a.exceededTransferLimit)break;Q(t,a.features.at(-1))}}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,this.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),this._requestStandardised&&(e.sqlFormat="standard"),this._useDefinitionExpression?"subtype-group"===this._layer.type&&(e.where=this._layer.definitionExpression):e.where=null,e}executeQuery(e,t){const r="execute"===t?async e=>{const t=await this._layer.source.queryFeaturesJSON(e);return u(t.features,t.spatialReference??this.spatialReference.toJSON()),t}:"executeForCount"===t?this._layer.queryFeatureCount.bind(this._layer):this._layer.queryObjectIds.bind(this._layer);let i=null;if(this._recentlyUsedQueries){const t=this.convertQueryToLruCacheKey(e);i=this._recentlyUsedQueries.getFromCache(t),null===i&&(i=r(e),this._recentlyUsedQueries.addToCache(t,i),i=i.catch(e=>{throw this._recentlyUsedQueries?.removeFromCache(t),e}))}return this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),null===i&&(i=r(e)),i}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let r=!1;for(const i of t)if(i.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return r||t.push(this.objectIdField),t}isTable(){return this._layer.isTable||null===this._layer.geometryType||"table"===this._layer.type||""===this._layer.geometryType||"esriGeometryNull"===this._layer.geometryType}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}static create(e,t,r,i,a){const s=new g({url:e,outFields:null===t?["*"]:t});return new v({layer:s,spatialReference:r,lrucache:i,interceptor:a})}relationshipMetadata(){return this._layer&&this._layer.source&&this._layer.source.sourceJSON?.relationships?this._layer.source.sourceJSON.relationships:[]}serviceUrl(){return y(this._layer.parsedUrl.path)}async queryAttachments(e,t,r,s,l){function n(e){const t=e.capabilities;return t?.data.supportsAttachment&&t?.operations.supportsQueryAttachments}const o=this._layer;if(!n(o))return[];const u=new R({objectIds:[e],returnMetadata:l});(t&&t>0||r&&r>0)&&(u.size=[t&&t>0?t:0,r&&r>0?r:t+1]),s&&s.length>0&&(u.attachmentTypes=s),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:o,query:u,method:"attachments"});const c=await o.queryAttachments(u);return c?.[e]?c[e].map(t=>{const r=`${this._layer.parsedUrl.path}/${e}/attachments/${t.id}`;let s=null;return l&&t.exifInfo&&(s=a.convertJsonToArcade(t.exifInfo,"system",!0)),new i(t.id,t.name,t.contentType,t.size,r,s,t.keywords??null)}):[]}async queryRelatedFeatures(e){const r=b(e);r.f="json",this._requestStandardised&&(r.sqlFormat="standard"),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:r,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const i=await t(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:r});if(i.data){const e={},t=i.data;if(t?.relatedRecordGroups){const r=t.spatialReference,i=!0===t.exceededTransferLimit;for(const a of t.relatedRecordGroups)u(a.relatedRecords,r),e[a.objectId]={features:a.relatedRecords,exceededTransferLimit:i}}return e}throw new l("InvalidRequest")}async getFeatureByObjectId(e,t){const r=this._createQuery();r.outFields=t,r.returnGeometry=!1,r.outSpatialReference=this.spatialReference,r.where=w(r.where,this.objectIdField+"="+e.toString()),this._featureSetQueryInterceptor&&this._featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:r,method:"execute"});const i=await this._layer.source.queryFeaturesJSON(r);return 1===i.features.length?(u(i.features,i.spatialReference??this.spatialReference.toJSON()),i.features[0]):null}async getIdentityUser(){await this.load();const t=e?.findCredential(this._layer.url);return t?t.userId:null}async getOwningSystemUrl(){await this.load();const r=e?.findServerInfo(this._layer.url);if(r)return r.owningSystemUrl??"";let i=this._layer.url;const a=i.toLowerCase().indexOf("/rest/services");if(i=a>-1?i.slice(0,a):i,i){i+="/rest/info";try{const e=await t(i,{query:{f:"json"}});let r="";return e.data?.owningSystemUrl&&(r=e.data.owningSystemUrl),r}catch{return""}}return""}getDataSourceFeatureSet(){const e=new v({layer:this._layer,spatialReference:this.spatialReference??void 0,outFields:this._overrideFields??void 0,includeGeometry:!this._removeGeometry,lrucache:this._recentlyUsedQueries??void 0,interceptor:this._featureSetQueryInterceptor??void 0});return e._useDefinitionExpression=!1,e}get preferredTimeZone(){return this._layer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._layer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._layer.datesInUnknownTimezone??!1}get editFieldsInfo(){return this._layer.editFieldsInfo??null}get timeInfo(){return this._layer.timeInfo??null}async getFeatureSetInfo(){if(this._featureSetInfo)return this._featureSetInfo;let e=null,r="serviceItemId"in this._layer?this._layer.serviceItemId:null;const i=this._layer.parsedUrl?.path??null;if(i){const a=await t(i,{responseType:"json",query:{f:"json"}});e=a?.data?.name??null,r=a?.data?.serviceItemId??null}const a=this._layer.title&&null!==(this._layer.parent??null);return this._featureSetInfo={layerId:this._layer.layerId,layerName:""===e?null:e,itemId:""===r?null:r,serviceLayerUrl:""===i?null:i,webMapLayerId:a?this._layer.id??null:null,webMapLayerTitle:a?this._layer.title??null:null,className:null,objectClassId:null},this._featureSetInfo}}export{v as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import{neverAbortedSignal as e}from"../../arcadeEnvironment.js";import{throwIfCancelled as t,FeatureSetError as r}from"../support/errorsupport.js";import{RootFeatureSet as i,emptyFeaturesResult as s,assignSpatialReferenceOnFeatures as a}from"../support/FeatureSet.js";import{defaultMaxRecords as l}from"../support/shared.js";import{toWhereClause as n}from"../support/sqlUtils.js";import{splitIntoChunks as o}from"../../../core/arrayUtils.js";import{sqlAnd as y}from"../../../core/sql.js";import u from"../../../geometry/Geometry.js";import p from"../../../layers/FeatureLayer.js";import h from"../../../layers/support/FeatureType.js";import d from"../../../layers/support/Field.js";class c extends i{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),!0===e.isTable&&(this._forceIsTable=!0),void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return l}async loadImpl(){return!0===this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||this._layer.objectIdField===r||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)"global-id"===e.type&&(this.globalIdField=e.name);this._databaseType=0,this.hasZ=!0===this._layer.capabilities?.data?.supportsZ,this.hasM=!0===this._layer.capabilities?.data?.supportsM,this.subtypeField=("subtypeField"in this._layer?this._layer.subtypeField:null)??"",this.subtypes="subtypes"in this._layer?this._layer.subtypes:null,this.typeIdField=("typeIdField"in this._layer?this._layer.typeIdField:null)??"",this.types="types"in this._layer?this._layer.types:null}isTable(){return this._forceIsTable||"isTable"in this._layer&&this._layer.isTable||"table"===this._layer.type||!this._layer.geometryType}async _queryAll(){return(await this.query({abortSignal:e})).features}_queryLayerFeaturesJSON(e){return"queryFeaturesJSON"in this._layer?this._layer.queryFeaturesJSON(e):this._layer.source.queryFeaturesJSON(e)}async query(e){await this._ensureLoaded();let r="",i=!1;if(null!=e.orderBy&&(r=e.orderBy.constructClause(),i=!0),this.isTable()&&null!=e.spatialFilter)return s;const l=this._createQuery();return l.where=y(l.where,null==e.where?null==e.spatialFilter?"1=1":"":n(e.where,0)),null!=e.spatialFilter&&(l.spatialRelationship=this._makeRelationshipEnum(e.spatialFilter.relation),l.relationParameter=this._makeRelationshipParam(e.spatialFilter.relation),l.geometry=e.spatialFilter.geometry),l.outSpatialReference=this.spatialReference,l.orderByFields=""!==r?r.split(","):null,{filterApplied:!0,spatialFilterApplied:!0,ordered:i,features:async function*(){const r=await this._queryLayerFeaturesJSON(l);t(e.abortSignal);for(const e of o(r.features,this._maxQueryRate()))a(e,r.spatialReference??this.spatialReference.toJSON()),yield e}.apply(this)}}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new r("NeverReach")}_createQuery(){const e=this._layer.createQuery();return e.returnZ=this.hasZ,e.returnM=this.hasM,e.outFields=this._overrideFields??["*"],e.returnGeometry=!this._removeGeometry,e}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}relationshipMetadata(){return[]}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let r=e.layerDefinition.objectIdField;const i=e.layerDefinition.typeIdField??"",s=[];if(e.layerDefinition.types)for(const u of e.layerDefinition.types)s.push(h.fromJSON(u));let a=e.layerDefinition.geometryType;void 0===a&&(a=e.featureSet.geometryType||"");let l=e.featureSet.features;if(!r){let t=!1;for(const i of e.layerDefinition.fields)if("oid"===i.type||"esriFieldTypeOID"===i.type){r=i.name,t=!0;break}if(!1===t){let t="FID",i=!0,s=0;for(;i;){let r=!0;for(const i of e.layerDefinition.fields)if(i.name===t){r=!1;break}!0===r?i=!1:(s++,t="FID"+s.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:t,alias:t});const a=[];for(let r=0;r<l.length;r++)a.push({geometry:e.featureSet.features[r].geometry,attributes:{...e.featureSet.features[r].attributes,[t]:r}});l=a,r=t}}const n=[];for(const u of e.layerDefinition.fields)u instanceof d?n.push(u):n.push(d.fromJSON(u));let o=a;switch(o||(o=""),o){case"esriGeometryPoint":o="point";break;case"esriGeometryPolyline":o="polyline";break;case"esriGeometryPolygon":o="polygon";break;case"esriGeometryEnvelope":o="extent";break;case"esriGeometryMultipoint":o="multipoint";break;case"":case"esriGeometryNull":o="esriGeometryNull"}if("esriGeometryNull"!==o){const e=t.toJSON();for(const t of l)t.geometry&&t.geometry instanceof u==!1&&(t.geometry.type=o,void 0===t.geometry.spatialReference&&(t.geometry.spatialReference=e))}else for(const u of l)u.geometry&&(u.geometry=null);const y={outFields:["*"],source:l,fields:n,hasZ:!0===e.layerDefinition.hasZ||!0===e.featureSet.hasZ,hasM:!0===e.layerDefinition.hasM||!0===e.featureSet.hasM,types:s,typeIdField:i,objectIdField:r,spatialReference:t},f="esriGeometryNull"===o||null===o;f||(y.geometryType=o);const m=new p(y);return e.layerDefinition.subtypeField&&e.layerDefinition.subtypes&&m.read({subtypes:e.layerDefinition.subtypes,subtypeField:e.layerDefinition.subtypeField}),new c({layer:m,spatialReference:t,isTable:f})}async queryAttachments(){return[]}async getFeatureByObjectId(e){const t=this._createQuery();t.where=this.objectIdField+"="+e.toString();const r=await this._queryLayerFeaturesJSON(t);return 1===r.features.length?(a(r.features,r.spatialReference??this.spatialReference.toJSON()),r.features[0]):null}serviceUrl(){return""}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return"preferredTimeZone"in this._layer?this._layer.preferredTimeZone:null}get dateFieldsTimeZone(){return"dateFieldsTimeZone"in this._layer?this._layer.dateFieldsTimeZone:null}get datesInUnknownTimezone(){return"datesInUnknownTimezone"in this._layer&&this._layer.datesInUnknownTimezone}get editFieldsInfo(){return"editFieldsInfo"in this._layer?this._layer.editFieldsInfo:null}get timeInfo(){return this._layer.timeInfo}async getFeatureSetInfo(){const e=this._layer.title&&this._layer.parent;return{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}export{c as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import
|
|
5
|
+
import{neverAbortedSignal as e}from"../../arcadeEnvironment.js";import{throwIfCancelled as t,FeatureSetError as r}from"../support/errorsupport.js";import{RootFeatureSet as a}from"../support/FeatureSet.js";import{isCurvedGeometry as i}from"../../../geometry/support/curves/curveUtils.js";class s extends a{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerOGC",this._outFields=null,this._returnGeometry=!0,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),null!=e.outFields&&(this._outFields=e.outFields),null!=e.includeGeometry&&(this._returnGeometry=e.includeGeometry)}_maxQueryRate(){return this._layer.effectiveMaxRecordCount}async loadImpl(){return this._layer.loaded?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){if(this.spatialReference??=this._layer.spatialReference,this.geometryType=this._layer.geometryType??"",this.fields=this._layer.fields.slice(),null!=this._outFields)if(1===this._outFields.length&&"*"===this._outFields[0])this._outFields=null;else{const e=new Set(this._outFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({name:t})=>t===this._layer.objectIdField||e.has(t.toLowerCase())),this._outFields=this.fields.map(({name:e})=>e)}this.objectIdField=this._layer.objectIdField,this.hasZ=!!this._layer.hasZ,this.hasM=!1,this.typeIdField=this._layer.typeIdField??"",this.types=this._layer.types??null;const e=this._layer.source.getSource().layerDefinition.featureCount;null!=e&&e>=0&&(this._totalCount=e)}isTable(){return this._layer.isTable}async _queryAll(){const t=this._layer.createQuery();return t.outSpatialReference=this.spatialReference,this._queryPaginated(t,this._layer.effectiveMaxRecordCount,e)}async query(e){await this._ensureLoaded();const t=this._layer.createQuery();if(t.outSpatialReference=this.spatialReference,null!=e.spatialFilter&&!i(e.spatialFilter.geometry))switch(e.spatialFilter.relation){case"esriSpatialRelIntersects":case"esriSpatialRelContains":case"esriSpatialRelOverlaps":case"esriSpatialRelWithin":case"esriSpatialRelTouches":case"esriSpatialRelCrosses":t.geometry=e.spatialFilter.geometry.extent}return this._hasCachedFeatures||null==t.geometry?{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter,ordered:!1,features:await this.queryAll(e.abortSignal)}:{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter||"extent"===e.spatialFilter.geometry.type&&"esriSpatialRelIntersects"===e.spatialFilter.relation,ordered:!1,features:this._queryPaginated(t,this._layer.effectiveMaxRecordCount,e.abortSignal)}}async*_queryPaginated(e,r,a){let i;e.num=r,e.start=0;do{t(a),i=await this._layer.source.queryFeaturesJSON(e);const r=i.spatialReference??this.spatialReference.toJSON();yield i.features.map(e=>{const t={};for(const r of this.fields)t[r.name]=e.attributes[r.name];let a=null;return this._returnGeometry&&!this.isTable()&&null!=e.geometry&&(e.geometry.spatialReference=r,a=e.geometry),{geometry:a,attributes:t}}),e.start+=i.features.length}while(!0===i.exceededTransferLimit)}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new r("NeverReach")}nativeCapabilities(){return{title:this._layer.title??"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}async queryAttachments(){return[]}serviceUrl(){return""}relationshipMetadata(){return[]}get gdbVersion(){return""}getFeatureByObjectId(){throw new r("NeverReach")}async getOwningSystemUrl(){return""}async getIdentityUser(){return""}get preferredTimeZone(){return null}get dateFieldsTimeZone(){return null}get datesInUnknownTimezone(){return!1}get editFieldsInfo(){return null}get timeInfo(){return this._layer.timeInfo}async getFeatureSetInfo(){const e=this._layer.title&&this._layer.parent;return{layerId:null,layerName:null,itemId:null,serviceLayerUrl:null,webMapLayerId:e?this._layer.id??null:null,webMapLayerTitle:e?this._layer.title??null:null,className:null,objectClassId:null}}}export{s as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{neverAbortedSignal as e}from"../../arcadeEnvironment.js";import{throwIfCancelled as t,FeatureSetError as r}from"../support/errorsupport.js";import{RootFeatureSet as i,emptyFeaturesResult as a}from"../support/FeatureSet.js";import{defaultMaxRecords as s}from"../support/shared.js";import l from"../../../rest/support/RelationshipQuery.js";class d extends i{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._removeGeometry=!1,this._overrideFields=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),this._findObjectId=e.objectId,this.relationship=e.relationship,this._relatedLayer=e.relatedLayer,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return s}async loadImpl(){return await Promise.all([this._layer.load(),this._relatedLayer.load()]),this._initialiseFeatureSet(),this}nativeCapabilities(){return this._relatedLayer.nativeCapabilities()}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._relatedLayer.geometryType,this.fields=this._relatedLayer.fields.slice(),this.hasZ=this._relatedLayer.hasZ,this.hasM=this._relatedLayer.hasM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}const e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType),this.objectIdField=this._relatedLayer.objectIdField,this.globalIdField=this._relatedLayer.globalIdField,this.hasM=this._relatedLayer.supportsM,this.hasZ=this._relatedLayer.supportsZ,this.typeIdField=this._relatedLayer.typeIdField,this.types=this._relatedLayer.types,this.subtypeField=this._relatedLayer.subtypeField,this.subtypes=this._relatedLayer.subtypes}async databaseType(){return this._databaseType=await this._relatedLayer.databaseType(),this._databaseType}isTable(){return this._relatedLayer.isTable()}async _queryAll(){return(await this.query({abortSignal:e})).features}async query(e){if(await this._ensureLoaded(),await this.databaseType(),this.isTable()&&null!=e.spatialFilter)return a;const r=this._layer.nativeCapabilities();if(!1===r.canQueryRelated)return a;if(r.capabilities?.queryRelated.supportsPagination)return this._queryUsingPaging(r.source,e);let i="",s=!1;null!=e.orderBy&&!0===r.capabilities?.queryRelated.supportsOrderBy&&(i=e.orderBy.constructClause(),s=!0);const d=new l;return d.objectIds=[this._findObjectId],d.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]),d.relationshipId=this.relationship.id,d.where="1=1",d.returnGeometry=!0!==this._removeGeometry,d.outSpatialReference=this.spatialReference,d.orderByFields=""!==i?i.split(","):null,{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter,ordered:s,features:async function*(){const i=await r.source.queryRelatedFeatures(d);t(e.abortSignal),yield i[this._findObjectId]?i[this._findObjectId].features:[]}.apply(this)}}async _queryUsingPaging(e,t){let r="",i=!1;const a=this._layer.nativeCapabilities();null!=t.orderBy&&!0===a.capabilities?.queryRelated.supportsOrderBy&&(r=t.orderBy.constructClause(),i=!0),await this.databaseType();let s=this._maxQueryRate();const d=a.capabilities?.query.maxRecordCount;null!=d&&d<s&&(s=d);const n=new l;return n.relationshipId=this.relationship.id,n.objectIds=[this._findObjectId],n.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]),n.where="1=1",n.orderByFields=""!==r?r.split(","):null,n.returnGeometry=!0!==this._removeGeometry,n.outSpatialReference=this.spatialReference,{filterApplied:null==t.where,spatialFilterApplied:null==t.spatialFilter,ordered:i,features:this._queryPaginated(e,n,s,t.abortSignal)}}async*_queryPaginated(e,r,i,a){let s;r.num=i,r.start=0;do{t(a);s=(await e.queryRelatedFeatures(r))[this._findObjectId]??{exceededTransferLimit:!1,features:[]},yield s.features,r.start+=i}while(
|
|
5
|
+
import{neverAbortedSignal as e}from"../../arcadeEnvironment.js";import{throwIfCancelled as t,FeatureSetError as r}from"../support/errorsupport.js";import{RootFeatureSet as i,emptyFeaturesResult as a}from"../support/FeatureSet.js";import{defaultMaxRecords as s}from"../support/shared.js";import l from"../../../rest/support/RelationshipQuery.js";class d extends i{constructor(e){super(),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerRelated",this._removeGeometry=!1,this._overrideFields=null,this._maxProcessing=1e3,this._layer=e.layer,e.spatialReference&&(this.spatialReference=e.spatialReference),this._findObjectId=e.objectId,this.relationship=e.relationship,this._relatedLayer=e.relatedLayer,void 0!==e.outFields&&(this._overrideFields=e.outFields),void 0!==e.includeGeometry&&(this._removeGeometry=!1===e.includeGeometry)}_maxQueryRate(){return s}async loadImpl(){return await Promise.all([this._layer.load(),this._relatedLayer.load()]),this._initialiseFeatureSet(),this}nativeCapabilities(){return this._relatedLayer.nativeCapabilities()}_initialiseFeatureSet(){if(null==this.spatialReference&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._relatedLayer.geometryType,this.fields=this._relatedLayer.fields.slice(),this.hasZ=this._relatedLayer.hasZ,this.hasM=this._relatedLayer.hasM,null!==this._overrideFields)if(1===this._overrideFields.length&&"*"===this._overrideFields[0])this._overrideFields=null;else{const e=new Set(this._overrideFields.map(e=>e.toLowerCase()));this.fields=this.fields.filter(({type:t,name:r})=>"oid"===t||e.has(r.toLowerCase())),this._overrideFields=this.fields.map(({name:e})=>e)}const e=this._layer.nativeCapabilities();e&&(this._databaseType=e.databaseType),this.objectIdField=this._relatedLayer.objectIdField,this.globalIdField=this._relatedLayer.globalIdField,this.hasM=this._relatedLayer.supportsM,this.hasZ=this._relatedLayer.supportsZ,this.typeIdField=this._relatedLayer.typeIdField,this.types=this._relatedLayer.types,this.subtypeField=this._relatedLayer.subtypeField,this.subtypes=this._relatedLayer.subtypes}async databaseType(){return this._databaseType=await this._relatedLayer.databaseType(),this._databaseType}isTable(){return this._relatedLayer.isTable()}async _queryAll(){return(await this.query({abortSignal:e})).features}async query(e){if(await this._ensureLoaded(),await this.databaseType(),this.isTable()&&null!=e.spatialFilter)return a;const r=this._layer.nativeCapabilities();if(!1===r.canQueryRelated)return a;if(r.capabilities?.queryRelated.supportsPagination)return this._queryUsingPaging(r.source,e);let i="",s=!1;null!=e.orderBy&&!0===r.capabilities?.queryRelated.supportsOrderBy&&(i=e.orderBy.constructClause(),s=!0);const d=new l;return d.objectIds=[this._findObjectId],d.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]),d.relationshipId=this.relationship.id,d.where="1=1",d.returnGeometry=!0!==this._removeGeometry,d.outSpatialReference=this.spatialReference,d.orderByFields=""!==i?i.split(","):null,{filterApplied:null==e.where,spatialFilterApplied:null==e.spatialFilter,ordered:s,features:async function*(){const i=await r.source.queryRelatedFeatures(d);t(e.abortSignal),yield i[this._findObjectId]?i[this._findObjectId].features:[]}.apply(this)}}async _queryUsingPaging(e,t){let r="",i=!1;const a=this._layer.nativeCapabilities();null!=t.orderBy&&!0===a.capabilities?.queryRelated.supportsOrderBy&&(r=t.orderBy.constructClause(),i=!0),await this.databaseType();let s=this._maxQueryRate();const d=a.capabilities?.query.maxRecordCount;null!=d&&d<s&&(s=d);const n=new l;return n.relationshipId=this.relationship.id,n.objectIds=[this._findObjectId],n.outFields=null!==this._overrideFields?this._overrideFields:this._fieldsIncludingObjectId(this._relatedLayer.fields?this._relatedLayer.fields.map(e=>e.name):["*"]),n.where="1=1",n.orderByFields=""!==r?r.split(","):null,n.returnGeometry=!0!==this._removeGeometry,n.outSpatialReference=this.spatialReference,{filterApplied:null==t.where,spatialFilterApplied:null==t.spatialFilter,ordered:i,features:this._queryPaginated(e,n,s,t.abortSignal)}}async*_queryPaginated(e,r,i,a){let s;r.num=i,r.start=0;do{t(a);s=(await e.queryRelatedFeatures(r))[this._findObjectId]??{exceededTransferLimit:!1,features:[]},yield s.features,r.start+=i}while(!0===s.exceededTransferLimit)}async queryStat(e){return{calculated:!1}}async canQueryAggregate(e){return!1}async queryAggregate(e){throw new r("NeverReach")}_fieldsIncludingObjectId(e){if(null===e)return[this.objectIdField];const t=e.slice();if(t.includes("*"))return t;let r=!1;for(const i of t)if(i.toUpperCase()===this.objectIdField.toUpperCase()){r=!0;break}return r||t.push(this.objectIdField),t}get gdbVersion(){return this._relatedLayer.gdbVersion}relationshipMetadata(){return this._relatedLayer.relationshipMetadata()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,r,i,a){return this._relatedLayer.queryAttachments(e,t,r,i,a)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}get preferredTimeZone(){return this._relatedLayer.preferredTimeZone??null}get dateFieldsTimeZone(){return this._relatedLayer.dateFieldsTimeZone??null}get datesInUnknownTimezone(){return this._relatedLayer.datesInUnknownTimezone}get editFieldsInfo(){return this._relatedLayer.editFieldsInfo??null}get timeInfo(){return this._relatedLayer.timeInfo??null}getFeatureSetInfo(){return this._relatedLayer.getFeatureSetInfo()}}export{d as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{neverAbortedSignal as e}from"../../arcadeEnvironment.js";import t from"./cache.js";import{throwIfCancelled as a,FeatureSetError as s}from"./errorsupport.js";import{QueryIterator as r}from"./FeatureSetIterator.js";import{layerGeometryEsriConstants as i,esriFieldToJson as n,layerGeometryEsriRestConstants as l}from"./shared.js";import{max as o,min as u,sum as h,variance as d,stdev as
|
|
5
|
+
import{neverAbortedSignal as e}from"../../arcadeEnvironment.js";import t from"./cache.js";import{throwIfCancelled as a,FeatureSetError as s}from"./errorsupport.js";import{QueryIterator as r}from"./FeatureSetIterator.js";import{layerGeometryEsriConstants as i,esriFieldToJson as n,layerGeometryEsriRestConstants as l}from"./shared.js";import{max as o,min as u,sum as h,variance as d,stdev as c,mean as p,distinct as y}from"./stats.js";import{invokeRemoteGeometryOp as m}from"../../geometry/operatorsWorkerConnection.js";import{cacheAsync as f}from"../../../core/iteratorUtils.js";import _ from"../../../core/sql/WhereClause.js";import g from"../../../geometry/SpatialReference.js";import{fromJSON as b}from"../../../geometry/support/jsonUtils.js";import T from"../../../layers/support/FieldsIndex.js";function F(e,t){for(const a of e)null!=a.geometry&&(a.geometry.spatialReference??=t)}const I=Object.freeze({ordered:!0,filterApplied:!0,spatialFilterApplied:!0,features:Object.freeze({next:()=>Promise.resolve({done:!0,value:void 0}),[Symbol.asyncIterator](){return this}})});class w{constructor(){this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._parent=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=7,this._databaseTypeProbed=null,this._loadPromise=null,this._allFeatures=null,this._fieldsIndex=null,this.typeIdField=null,this.types=null,this.subtypeField=null,this.subtypes=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1}_ensureLoaded(){return this.load()}load(){return null===this._loadPromise&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){return await(this._parent?.load()),this._initialiseFeatureSet(),this}_initialiseFeatureSet(){null!==this._parent?(this.fields=this._parent.fields.slice(),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types,this.subtypeField=this._parent.subtypeField,this.subtypes=this._parent.subtypes):(this.fields=[],this.typeIdField="",this.subtypeField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new g({wkid:4326}),this.geometryType=i.point)}getField(e,t){return e=e.toLowerCase(),(t||this.fields).find(t=>t.name.toLowerCase()===e)}getFieldsIndex(){return null===this._fieldsIndex&&(this._fieldsIndex=T.fromLayer({timeInfo:this.timeInfo,editFieldsInfo:this.editFieldsInfo,dateFieldsTimeZone:this.dateFieldsTimeZone,datesInUnknownTimezone:this.datesInUnknownTimezone,fields:this.fields})),this._fieldsIndex}_maxProcessingRate(){return null!==this._parent?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return null!==this._parent?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}nativeCapabilities(){return this._parent.nativeCapabilities()}get _hasCachedFeatures(){return null!=this._allFeatures}async queryAll(t){null==this._allFeatures&&(this._allFeatures=this._queryAll().then(e=>f(e)));const s=(await this._allFeatures)();return null==t||t===e?s:async function*(){for await(const e of s)a(t),yield e}()}async databaseType(){if(7===this._databaseType){if(null!==t.applicationCache){const e=t.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(null!==e)return e}if(null!==this._databaseTypeProbed)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),null!==t.applicationCache&&t.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw null!==t.applicationCache&&t.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{dbType:2,probeSql:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{dbType:3,probeSql:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{dbType:1,probeSql:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e){if(!0===await this._runDatabaseProbe(t.probeSql))return t.dbType}return 1}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(null!==this._parent)return this._parent._runDatabaseProbe(e);throw new s("NotImplemented")}isTable(){return this._parent?.isTable()??!1}first(e){return this.iterator(e).next()}async isEmpty(e){return this._totalCount>=0?0===this._totalCount:null==await this.first(e)}async calculateStatistic(e,t,a,s){await this._ensureLoaded();let r=await this.queryStat({stat:e,field:t,limit:a,abortSignal:s});return!1===r.calculated&&(r=await this._manualStat(e,t,a,s)),r.result}async _manualStat(e,t,a,s){let r=null;switch(e.toLowerCase()){case"count":{if(this._totalCount>=0)return{calculated:!0,result:this._totalCount};const e=await this.queryAll(s);let t=0;for await(const a of e)t+=a.length;return this._totalCount=t,{calculated:!0,result:t}}case"distinct":return r=await y(this,t,a,s),{calculated:!0,result:r};case"avg":case"mean":return r=await p(this,t,s),{calculated:!0,result:r};case"stdev":return r=await c(this,t,s),{calculated:!0,result:r};case"variance":return r=await d(this,t,s),{calculated:!0,result:r};case"sum":return r=await h(this,t,s),{calculated:!0,result:r};case"min":return r=await u(this,t,s),{calculated:!0,result:r};case"max":return r=await o(this,t,s),{calculated:!0,result:r};default:return{calculated:!0,result:0}}}iterator(e){return new r(this,e)}async sumArea(e,t,a){let s=0;for await(const r of await this.queryAll(a))for(const a of r)null!=a.geometry&&(s+=null!=t?await m("geodeticArea",[a.geometry,e,t]):await m("area",[a.geometry,e]));return s}async sumLength(e,t,a){let s=0;for await(const r of await this.queryAll(a))for(const a of r)null!=a.geometry&&(s+=null!=t?await m("geodeticLength",[a.geometry,e,t]):await m("length",[a.geometry,e]));return s}async count(t){return await this.load(),this.calculateStatistic("count",_.create("1",{fieldsIndex:this.getFieldsIndex(),timeZone:this.dateFieldsTimeZoneDefaultUTC}),-1,t??e)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,a,s,r){return this._parent.queryAttachments(e,t,a,s,r)}serviceUrl(){return this._parent.serviceUrl()}subtypeMetadata(){return this.subtypeField&&this.subtypes?{subtypeField:this.subtypeField,subtypes:this.subtypes?this.subtypes.map(e=>({name:e.name,code:e.code})):[]}:this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetadata(){return this._parent.relationshipMetadata()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(n(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:void 0===l[this.geometryType]?"esriGeometryNull":l[this.geometryType],fields:e}}async convertToText(e,t){if("schema"===e)return await this._ensureLoaded(),JSON.stringify(this.schema());if("featureset"===e){await this._ensureLoaded();const e=[];for await(const a of await this.queryAll(t))for(const t of a){const a={geometry:t.geometry??null,attributes:t.attributes};if(null!==a.geometry&&a.geometry.spatialReference){const{spatialReference:e,...t}=a.geometry;a.geometry=t}e.push(a)}return JSON.stringify({...this.schema(),features:e,spatialReference:this.spatialReference.toJSON()})}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent.getRootFeatureSet()}getDataSourceFeatureSet(){return null!==this._parent?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return"keeptype"===e?.featureset?this:"none"===e?.featureset?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){if("keeptype"===t?.featureset)return this;if("schema"===t?.featureset)return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if("none"===t?.featureset)return null;await this._ensureLoaded();const a=[];for await(const s of await this.queryAll(e))for(const e of s){const s={geometry:e.geometry?!0===t?.keepGeometryType?b(e.geometry):e.geometry:null,attributes:e.attributes};if(null!==s.geometry&&s.geometry.spatialReference&&!0!==t?.keepGeometryType){delete s.geometry.spatialReference;const{spatialReference:e,...t}=s.geometry;s.geometry=t}a.push(s)}return{...this.schema(),features:a,spatialReference:!0===t?.keepGeometryType?this.spatialReference:this.spatialReference?.toJSON()}}fieldTimeZone(e){return this.getFieldsIndex().getTimeZone(e)}get preferredTimeZone(){return this._parent?.preferredTimeZone??null}get dateFieldsTimeZone(){return this._parent?.dateFieldsTimeZone??null}get dateFieldsTimeZoneDefaultUTC(){return this.datesInUnknownTimezone?"unknown":this.dateFieldsTimeZone||"UTC"}get datesInUnknownTimezone(){return this._parent.datesInUnknownTimezone}get editFieldsInfo(){return this._parent?.editFieldsInfo??null}get timeInfo(){return this._parent?.timeInfo??null}getFeatureSetInfo(){return this._parent?this._parent.getFeatureSetInfo():Promise.resolve(null)}}class S extends w{constructor(){super(...arguments),this._parent=null}getRootFeatureSet(){return this}}export{w as FeatureSet,S as RootFeatureSet,F as assignSpatialReferenceOnFeatures,I as emptyFeaturesResult};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__addDisposableResource as t,__disposeResources as r}from"tslib";import{Feature as
|
|
5
|
+
import{__addDisposableResource as t,__disposeResources as r}from"tslib";import e from"../../../Graphic.js";import{Feature as a}from"../../Feature.js";import{AsyncMutex as s}from"../../../core/asyncUtils.js";class i{constructor(t,r){this._parent=t,this._abortSignal=r,this._done=!1,this._features=null,this._batchMutex=new s,this._currentPage=null,this._pageCursor=-1}get _numAvailable(){return null==this._currentPage||this._pageCursor<0?0:Math.max(this._currentPage.length-this._pageCursor,0)}_takeNFeatures(t){if(null==this._currentPage)return[];const r=this._currentPage.slice(this._pageCursor,this._pageCursor+t);return this._pageCursor+=r.length,r.map(t=>e.fromJSON(t))}_takeOneFeature(){const t=this._currentPage[this._pageCursor];return this._pageCursor+=1,e.fromJSON(t)}async _nextBatch(){if(this._done)return!1;const t=await(this._features??=this._parent.queryAll(this._abortSignal));let r;do{if(r=await t.next(),r.done)return this._done=!0,this._currentPage=null,this._pageCursor=-1,!1}while(r.value.length<=0);return this._currentPage=r.value,this._pageCursor=0,!0}async nextBatchAsArcadeFeatures(t,r){const e=await this.nextBatch(t);return null==e?e:e.map(t=>a.createFromGraphicLikeObject(t.geometry,t.attributes,this._parent,r))}async nextBatch(e){const a={stack:[],error:void 0,hasError:!1};try{if(this._done)return null;if(e<=0)return[];t(a,await this._batchMutex.acquire(),!1);if(this._numAvailable>=e)return this._takeNFeatures(e);const r=[];let s=e;do{const t=this._takeNFeatures(s);s-=t.length,r.push(t)}while(s>0&&await this._nextBatch());const i=r.flat();return i.length>0?i:null}catch(s){a.error=s,a.hasError=!0}finally{r(a)}}async next(){const e={stack:[],error:void 0,hasError:!1};try{if(this._done)return null;t(e,await this._batchMutex.acquire(),!1);return this._numAvailable>=1||await this._nextBatch()?this._takeOneFeature():null}catch(a){e.error=a,e.hasError=!0}finally{r(e)}}}export{i as QueryIterator};
|