@arcgis/core 6.0.0-next.48 → 6.0.0-next.49
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/Ground.js +1 -1
- package/analysis/AreaMeasurementAnalysis.d.ts +12 -10
- package/analysis/AreaMeasurementAnalysis.js +1 -1
- package/applications/Components/formatUtils.d.ts +3 -2
- package/applications/MapViewer/templateUtils.d.ts +4 -1
- package/applications/SceneViewer/sceneViewerUtils.d.ts +12 -1
- package/applications/SceneViewer/sceneViewerUtils.js +1 -1
- package/arcade/featureset/actions/SpatialFilter.js +1 -1
- package/arcade/functions/featuresetgeom.js +1 -1
- package/arcade/functions/geomasync.js +1 -1
- package/arcade/geometry/operatorsWorker.js +1 -1
- package/arcade/geometry/operatorsWorkerConnection.js +1 -1
- package/arcgisGlobal.d.ts +4 -0
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/063cc462524646cd45e8.js +1 -0
- package/assets/esri/core/workers/chunks/119c62e9c9c7440a6129.js +1 -0
- package/assets/esri/core/workers/chunks/14c04fde8d33b739b415.js +1 -0
- package/assets/esri/core/workers/chunks/27a91b52d1bee92b6f20.js +1 -0
- package/assets/esri/core/workers/chunks/31eb09e96f31bced71ad.js +1 -0
- package/assets/esri/core/workers/chunks/{056a815273653271bf75.js → 3236e18921955450fc0d.js} +5 -5
- package/assets/esri/core/workers/chunks/3ce7120056040af3bab1.js +1 -0
- package/assets/esri/core/workers/chunks/435dacf493aec07ff6e3.js +1 -0
- package/assets/esri/core/workers/chunks/4c26d6408ee7a3b9d163.js +1 -0
- package/assets/esri/core/workers/chunks/{73bf76a3a0418edb26a5.js → 506954fb374ea528d020.js} +1 -1
- package/assets/esri/core/workers/chunks/55db28616f810ca063b7.js +1 -0
- package/assets/esri/core/workers/chunks/59ae5bd0ee1bae7a9fb3.js +1 -0
- package/assets/esri/core/workers/chunks/630a36c4817f33f4cad2.js +1 -0
- package/assets/esri/core/workers/chunks/6779afc2d6ee46c301b5.js +1 -0
- package/assets/esri/core/workers/chunks/6a509ffb4852d694a097.js +1 -0
- package/assets/esri/core/workers/chunks/6d25a7071fceb707858a.js +1 -0
- package/assets/esri/core/workers/chunks/7a97eec9823941fd210f.js +29 -0
- package/assets/esri/core/workers/chunks/82bbf0c5e18fc1c795f4.js +1 -0
- package/assets/esri/core/workers/chunks/91019e9dff63107f8cb4.js +1 -0
- package/assets/esri/core/workers/chunks/{1345413ec0b4128849b1.js → 954f9854a9bf4a852b81.js} +1 -1
- package/assets/esri/core/workers/chunks/9846abf2d3991a15b2b5.js +1 -0
- package/assets/esri/core/workers/chunks/9f74b3f0f453bc957e3a.js +1 -0
- package/assets/esri/core/workers/chunks/a0e2a1c6f37454547193.js +1 -0
- package/assets/esri/core/workers/chunks/a1c45e8f5bba471b3905.js +1 -0
- package/assets/esri/core/workers/chunks/a2825285d46f8cd5d814.js +1 -0
- package/assets/esri/core/workers/chunks/{d4f6be8290ad0243e1b8.js → b511b5c68defefccde0b.js} +1 -1
- package/assets/esri/core/workers/chunks/bf81b3670b5323621e2d.js +1 -0
- package/assets/esri/core/workers/chunks/c4794d692934098988e7.js +1 -0
- package/assets/esri/core/workers/chunks/d0900a901197948bd7df.js +1 -0
- package/assets/esri/core/workers/chunks/d2ed93bbfa98395bbed7.js +1 -0
- package/assets/esri/core/workers/chunks/d486a8a61ff993f8202a.js +1 -0
- package/assets/esri/core/workers/chunks/e06036392a982dbf3ae3.js +1 -0
- package/assets/esri/core/workers/chunks/{773ba0909ccd3a034c31.js → ed1db6571b0c61fe4f91.js} +1 -1
- package/chunks/BlendWeights.glsl.js +4 -5
- package/chunks/Blur.glsl.js +10 -7
- package/chunks/BlurEmission.glsl.js +27 -7
- package/chunks/Clouds.glsl.js +2 -2
- package/chunks/Component.glsl.js +1 -1
- package/chunks/EdgeDetect.glsl.js +1 -1
- package/chunks/EdgeShader.glsl.js +1 -1
- package/chunks/EmissionComposite.glsl.js +2 -2
- package/chunks/Fog.glsl.js +4 -4
- package/chunks/GlobalIlluminationBlur.glsl.js +1 -1
- package/chunks/HighlightSharpApply.glsl.js +4 -1
- package/chunks/LineMarker.glsl.js +4 -4
- package/chunks/Magnifier.glsl.js +1 -1
- package/chunks/NoiseTextureAtlas.glsl.js +3 -3
- package/chunks/Pattern.glsl.js +35 -32
- package/chunks/{ChapmanAtmosphere.glsl.js → RealisticAtmosphere.glsl.js} +18 -9
- package/chunks/RealisticAtmosphereCompositing.glsl.js +35 -0
- package/chunks/SSAO.glsl.js +2 -2
- package/chunks/SimpleAtmosphere.glsl.js +1 -1
- package/config.js +1 -1
- package/core/accessorSupport/ObservableBase.js +1 -1
- package/core/accessorSupport/tracking/ObservationHandle.js +1 -1
- package/core/accessorSupport/tracking/SimpleObservable.js +1 -1
- package/core/accessorSupport/tracking/SimpleTrackingTarget.js +1 -1
- package/core/accessorSupport/tracking/TrackingTarget.js +1 -1
- package/core/quantity.js +1 -1
- package/core/timeUtils.js +1 -1
- package/geometry/coordinateConversion/CoordinateConversionModel.d.ts +258 -0
- package/geometry/coordinateConversion/CoordinateConversionModel.js +2 -0
- package/geometry/coordinateConversion/support/Conversion.d.ts +73 -0
- package/geometry/coordinateConversion/support/Conversion.js +2 -0
- package/geometry/coordinateConversion/support/Format.d.ts +131 -0
- package/geometry/coordinateConversion/support/Format.js +2 -0
- package/geometry/coordinateConversion/support/coordinateConversionUtils.js +2 -0
- package/geometry/coordinateConversion/support/formatUtils.js +2 -0
- package/geometry/coordinateConversion/types.d.ts +116 -0
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/IntegratedMeshLayer.js +1 -1
- package/layers/catalog/CatalogFootprintLayer.d.ts +2 -2
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/cypherUtils.js +1 -1
- package/layers/mixins/FeatureLayerBase.d.ts +2 -2
- package/layers/raster/formats/Lzw.js +1 -1
- package/layers/raster/formats/TiffDecoder.js +1 -1
- package/layers/raster/formats/tiffParser.js +1 -1
- package/layers/raster/formats/tiffTag.js +1 -1
- package/layers/support/IntegratedMeshSemantics.js +2 -0
- package/layers/support/VideoElement.js +1 -1
- package/legend/ActiveLayerInfo.js +1 -1
- package/package.json +2 -2
- package/symbols/FillSymbol3DLayer.d.ts +1 -4
- package/time/daylightUtils.d.ts +29 -0
- package/time/daylightUtils.js +2 -0
- package/time/timeZoneUtils.js +1 -1
- package/time/types.d.ts +57 -1
- package/views/2d/analysis/AreaMeasurement/AreaMeasurementTool.js +1 -1
- package/views/2d/analysis/AreaMeasurementAnalysisView2D.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/layers/GeospatialPDFLayerView2D.js +1 -1
- package/views/2d/layers/MediaLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/3d/GroundView3D.js +1 -1
- package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
- package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementController.js +1 -1
- package/views/3d/interactive/Manipulator3D.js +1 -1
- package/views/3d/interactive/Manipulator3DBase.js +2 -0
- package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
- package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
- package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbol.js +1 -1
- package/views/3d/layers/graphics/Graphics3DWebStyleSymbol.js +1 -1
- package/views/3d/layers/graphics/SymbolComplexity.js +1 -1
- package/views/3d/layers/graphics/webStyleUtils.js +1 -1
- package/views/3d/layers/i3s/I3SIntersectionHandler.js +1 -1
- package/views/3d/layers/i3s/I3SMaterialUtil.js +1 -1
- package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
- package/views/3d/layers/support/patternUtils.js +1 -1
- package/views/3d/state/controllers/GamepadKeyboardController.js +1 -1
- package/views/3d/support/GroundAndIMSurface.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/hitTest.js +1 -1
- package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
- package/views/3d/terrain/OverlayRenderer.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/terrain/PatchRenderDataWaterproofness.js +1 -1
- package/views/3d/terrain/SphericalPatch.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/webgl-engine/collections/Component/ComponentObject.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialInitParameters.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterialRepository.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
- package/views/3d/webgl-engine/core/renderPasses/RenderPassManager.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/EvaluateSceneLighting.glsl.js +2 -2
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ScreenSpaceRayMarching.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/WaterColor.glsl.js +6 -4
- package/views/3d/webgl-engine/core/shaderLibrary/util/BlendModes.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/CloudsParallaxShading.glsl.js +10 -9
- package/views/3d/webgl-engine/core/shaderLibrary/util/GaussianSplatUnpacking.glsl.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/util/cameraUniforms.js +1 -1
- package/views/3d/webgl-engine/effects/WeatherFader.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanApproximation.glsl.js +3 -3
- package/views/3d/webgl-engine/effects/atmosphere/{ChapmanAtmosphere.glsl.js → RealisticAtmosphere.glsl.js} +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphere.js +2 -0
- package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereCompositing.glsl.js +2 -0
- package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereCompositingTechnique.js +2 -0
- package/views/3d/webgl-engine/effects/atmosphere/RealisticAtmosphereTechnique.js +2 -0
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/glow/BlurEmission.glsl.js +1 -1
- package/views/3d/webgl-engine/effects/glow/applyEmissiveGlow.glsl.js +87 -41
- package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/EmissionComposite.glsl.js +1 -1
- package/views/3d/webgl-engine/lib/EmissionComposite.js +1 -1
- package/views/3d/webgl-engine/lib/ManagedTexture.js +1 -1
- package/views/3d/webgl-engine/lib/Octree.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
- package/views/3d/webgl-engine/lib/intersectorUtilsConversions.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/InstanceOctree.js +1 -1
- package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/parts/RenderView.js +1 -1
- package/views/3d/webgl-engine/shaders/Pattern.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternLayouts.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/PatternTechniqueConfiguration.js +1 -1
- package/views/SceneView.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/interactive/Tooltip.js +1 -1
- package/views/interactive/snapping/RightAngleTriangleSnapper.js +1 -1
- package/views/interactive/snapping/SnappingAlgorithm.js +1 -1
- package/views/interactive/tooltip/content/TooltipContent.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +3 -0
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/022565ef98a702ab952f.js +0 -1
- package/assets/esri/core/workers/chunks/163e97987e1f75610009.js +0 -1
- package/assets/esri/core/workers/chunks/1d57b1445afec89a7941.js +0 -1
- package/assets/esri/core/workers/chunks/3654672d772d11484883.js +0 -1
- package/assets/esri/core/workers/chunks/3af0ff5a0b82872aac38.js +0 -1
- package/assets/esri/core/workers/chunks/3b9415dfd7546aeec261.js +0 -1
- package/assets/esri/core/workers/chunks/5109b48666138df14038.js +0 -1
- package/assets/esri/core/workers/chunks/6b73dfc9252b32f1eae2.js +0 -1
- package/assets/esri/core/workers/chunks/6e4698879e7d8fbc4d12.js +0 -1
- package/assets/esri/core/workers/chunks/71295afd21fc5bc5ddbc.js +0 -1
- package/assets/esri/core/workers/chunks/794a9f116c4700bb1210.js +0 -1
- package/assets/esri/core/workers/chunks/8e0ecc7f55dd8bf2cf16.js +0 -1
- package/assets/esri/core/workers/chunks/9dece842ada6278c33ef.js +0 -1
- package/assets/esri/core/workers/chunks/a12e29f2cb78fdaa0753.js +0 -1
- package/assets/esri/core/workers/chunks/b70af9fb974ef9836efd.js +0 -1
- package/assets/esri/core/workers/chunks/c0f2b6a10bcc766318f5.js +0 -1
- package/assets/esri/core/workers/chunks/c248db5e4d92cfb3c4d1.js +0 -1
- package/assets/esri/core/workers/chunks/ce02adb527389b90223d.js +0 -1
- package/assets/esri/core/workers/chunks/d8eea5ffe05c620fac9e.js +0 -1
- package/assets/esri/core/workers/chunks/d997d81d0965c05447d4.js +0 -1
- package/assets/esri/core/workers/chunks/e1645882f54818c4036a.js +0 -1
- package/assets/esri/core/workers/chunks/e44679a0d271c1efb60d.js +0 -1
- package/assets/esri/core/workers/chunks/f11f40017ec97a2a6b5f.js +0 -29
- package/assets/esri/core/workers/chunks/f7f5d8256e63d303cbcb.js +0 -1
- package/assets/esri/core/workers/chunks/f87d5450190896e61ff8.js +0 -1
- package/assets/esri/core/workers/chunks/fdee2255f49b43056e9d.js +0 -1
- package/assets/esri/core/workers/chunks/ff1e614fde01781360fa.js +0 -1
- package/chunks/AtmosphereCompositing.glsl.js +0 -25
- package/views/3d/analysis/ShadowCast/sunlightUtils.js +0 -2
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +0 -2
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphereTechnique.js +0 -2
- package/views/3d/webgl-engine/shaders/AtmosphereCompositing.glsl.js +0 -2
- package/views/3d/webgl-engine/shaders/AtmosphereCompositingTechnique.js +0 -2
package/Ground.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"./Color.js";import n from"./core/Collection.js";import r from"./core/CollectionFlattener.js";import{referenceSetter as i}from"./core/collectionUtils.js";import{typeCast as a}from"./core/compilerUtils.js";import
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"./Color.js";import n from"./core/Collection.js";import r from"./core/CollectionFlattener.js";import{referenceSetter as i}from"./core/collectionUtils.js";import{typeCast as a}from"./core/compilerUtils.js";import{JSONSupportMixin as o}from"./core/JSONSupport.js";import{clone as s}from"./core/lang.js";import{Loadable as c}from"./core/Loadable.js";import{loadAll as l}from"./core/loadAll.js";import u from"./core/Logger.js";import{destroyMaybe as d}from"./core/maybe.js";import{isAbortError as f,throwIfAborted as p}from"./core/promiseUtils.js";import{property as m,subclass as h}from"./core/accessorSupport/decorators.js";import{Integer as g}from"./core/accessorSupport/ensureType.js";import _ from"./ground/NavigationConstraint.js";import{IntegratedMeshSemantics as v}from"./layers/support/IntegratedMeshSemantics.js";import{isIntegratedMeshLayer as y}from"./layers/support/layerUtils.js";import{GroundSymbol as b}from"./support/groundInstanceUtils.js";import{transparencyToOpacity as x,opacityToTransparency as S}from"./webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as C}from"./webdoc/support/unsupportedErrors.js";import{writer as w}from"./core/accessorSupport/decorators/writer.js";var T,E;let D=E=class extends o(c){static{T=b}constructor(e){super(e),this[T]=!0,this.parent=null,this.opacity=1,this.surfaceColor=null,this.undergroundColor=new t(`white`),this.navigationConstraint=null,this.layers=new n;let i=e=>{let t=e.item;t.parent===this?(u.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' already a ground layer, second add will be ignored.`),e.preventDefault()):t.type===`elevation`||t.type===`base-elevation`||v.allowIMInGround()&&(t.type===`integrated-mesh`||t.type===`integrated-mesh-3dtiles`)||(u.getLogger(this).error(`Layer '${t.title}, id:${t.id}' of type '${t.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation'${v.allowIMInGround()?`, 'integrated-mesh' and 'integrated-mesh-3dtiles'`:``} are supported.`),e.preventDefault())},a=e=>{let{parent:t}=e;t&&t!==this&&`remove`in t&&t.remove?.(e),e.parent=this},o=e=>{e.parent=null};this.addHandles([this.layers.on(`before-add`,i),this.layers.on(`after-add`,e=>a(e.item)),this.layers.on(`after-remove`,e=>o(e.item))]),this.allLayers=new r({getCollections:()=>[this.layers,this.parent?.basemap?.groundLayers]})}removeChildLayer(e){this.layers.remove(e)}initialize(){this.when().catch(e=>{f(e)||u.getLogger(this).error(`#load()`,`Failed to load ground`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}get allIntegratedMeshGround(){return this.allLayers.filter(e=>y(e))}destroy(){let e=this.layers.removeAll();for(let t of e)d(t);this.layers.destroy()}get loaded(){return super.loaded}get layers(){return this._get(`layers`)}set layers(e){this._set(`layers`,i(e,this._get(`layers`)))}writeLayers(e,t,n,r){let i=[];e&&(r={...r,layerContainerType:`ground`},e.forEach(e=>{if(`write`in e){let t=a(e)(),n={};t.write(n,r)&&i.push(n)}else C(r,e)})),t.layers=i}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return l(this,e=>e(this.layers))}async queryElevation(e,t){await this.load({signal:t?.signal});let{queryAll:n}=await import(`./layers/support/ElevationQuery.js`);return p(t),n(this.allLayers.toArray(),e,t)}async createElevationSampler(e,t){await this.load({signal:t?.signal});let{createSampler:n}=await import(`./layers/support/ElevationQuery.js`);return p(t),n(this.allLayers.filter(O).toArray(),e,t)}clone(){let e={opacity:this.opacity,surfaceColor:s(this.surfaceColor),undergroundColor:s(this.undergroundColor),navigationConstraint:s(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus=`loaded`),new E({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set(`resourceInfo`,{data:e,context:t}),super.read(e,t)}_loadFromSource(e){let t=this.resourceInfo;return t?this._loadLayersFromJSON(t.data,t.context,e):Promise.resolve()}async _loadLayersFromJSON(e,t,n){let r=t?.origin||`web-scene`,i=t?.portal||null,a=t?.url||null,{populateOperationalLayers:o}=await import(`./layers/support/layersCreator.js`);p(n);let s=[];if(e.layers&&Array.isArray(e.layers)){let t={context:{origin:r,url:a,portal:i,layerContainerType:`ground`},defaultLayerType:`ArcGISTiledElevationServiceLayer`};s.push(o(this.layers,e.layers,t))}await Promise.allSettled(s)}};e([m()],D.prototype,`parent`,void 0),e([m()],D.prototype,`allIntegratedMeshGround`,null),e([m({json:{read:!1,write:{isRequired:!0}}})],D.prototype,`layers`,null),e([m()],D.prototype,`allLayers`,void 0),e([w(`layers`)],D.prototype,`writeLayers`,null),e([m({constructOnly:!0})],D.prototype,`resourceInfo`,void 0),e([m({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:g,read:{reader:x,source:`transparency`},write:{writer:(e,t)=>{t.transparency=S(e)},target:`transparency`}}})],D.prototype,`opacity`,void 0),e([m({type:t,json:{type:[g],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],D.prototype,`surfaceColor`,void 0),e([m({type:t})],D.prototype,`undergroundColor`,void 0),e([m({type:_,json:{write:!0}})],D.prototype,`navigationConstraint`,void 0),D=E=e([h(`esri.Ground`)],D);function O(e){return e&&`createElevationSampler`in e}const k=D;export{k as default};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type Analysis from "./Analysis.js";
|
|
2
2
|
import type Polygon from "../geometry/Polygon.js";
|
|
3
|
-
import type { SystemOrAreaUnit } from "../core/units.js";
|
|
3
|
+
import type { SystemOrAreaUnit, SystemOrLengthUnit } from "../core/units.js";
|
|
4
4
|
import type { PolygonProperties } from "../geometry/Polygon.js";
|
|
5
5
|
import type { AnalysisProperties } from "./Analysis.js";
|
|
6
6
|
|
|
7
|
-
export interface AreaMeasurementAnalysisProperties extends AnalysisProperties, Partial<Pick<AreaMeasurementAnalysis, "unit">> {
|
|
7
|
+
export interface AreaMeasurementAnalysisProperties extends AnalysisProperties, Partial<Pick<AreaMeasurementAnalysis, "perimeterUnit" | "unit">> {
|
|
8
8
|
/**
|
|
9
9
|
* Polygon whose area is to be computed and displayed in the view.
|
|
10
10
|
*
|
|
@@ -116,18 +116,20 @@ export default class AreaMeasurementAnalysis extends Analysis {
|
|
|
116
116
|
*/
|
|
117
117
|
get geometry(): Polygon | null | undefined;
|
|
118
118
|
set geometry(value: PolygonProperties | null | undefined);
|
|
119
|
+
/**
|
|
120
|
+
* Unit system (imperial, metric) or specific unit used for displaying the computed perimeter in the view.
|
|
121
|
+
* When `null`, inherits [view.options.displayUnits.length](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/support/Units/#length)
|
|
122
|
+
* or uses the view's default measurement system.
|
|
123
|
+
*
|
|
124
|
+
* @since 6.0
|
|
125
|
+
*/
|
|
126
|
+
accessor perimeterUnit: SystemOrLengthUnit | null | undefined;
|
|
119
127
|
/** The type of analysis. For area measurement analysis, this is always "area-measurement". */
|
|
120
128
|
get type(): "area-measurement";
|
|
121
129
|
/**
|
|
122
130
|
* Unit system (imperial, metric) or specific unit used for displaying the computed area in the view.
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* When this property is `null`, the analysis uses `view.options.displayUnits.area` if configured.
|
|
127
|
-
* Otherwise, it uses the portal user's or portal's unit preference, or the view's spatial reference, to choose metric or imperial units,
|
|
128
|
-
* falling back to metric if no system can be determined.
|
|
129
|
-
*
|
|
130
|
-
* See [ViewOptions](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/options/ViewOptions/) for supported options and limitations.
|
|
131
|
+
* When `null`, inherits [view.options.displayUnits.area](https://developers.arcgis.com/javascript/latest/references/core/views/interactive/support/Units/#area)
|
|
132
|
+
* or uses the view's default measurement system.
|
|
131
133
|
*/
|
|
132
134
|
accessor unit: SystemOrAreaUnit | null | undefined;
|
|
133
135
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"./Analysis.js";import{equals as n}from"../core/arrayUtils.js";import r from"../core/Logger.js";import{equalsMaybe as i}from"../core/maybe.js";import{measurementAreaUnits as a}from"../core/units.js";import{property as
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"./Analysis.js";import{equals as n}from"../core/arrayUtils.js";import r from"../core/Logger.js";import{equalsMaybe as i}from"../core/maybe.js";import{measurementAreaUnits as a,measurementLengthUnits as o}from"../core/units.js";import{property as s,subclass as c}from"../core/accessorSupport/decorators.js";import l from"../geometry/Polygon.js";let u=class extends t{constructor(e){super(e),this.type=`area-measurement`,this.unit=null,this.perimeterUnit=null}set geometry(e){e?(e.rings.length>1&&r.getLogger(this).warn(`Measuring polygons with multiple rings is not supported.`),this._set(`geometry`,e.clone())):this._set(`geometry`,null)}get valid(){let{geometry:e}=this;if(e&&e.rings.length>0){let t=e.rings[0];if(t.length>3&&n(t.at(0),t.at(-1)))return!0}return!1}clear(){this.geometry=null}equals(e){return this===e||super.equals(e)&&this.unit===e.unit&&this.perimeterUnit===e.perimeterUnit&&i(this.geometry,e.geometry)}};e([s({type:[`area-measurement`],readOnly:!0})],u.prototype,`type`,void 0),e([s({value:null,type:l})],u.prototype,`geometry`,null),e([s({type:a,value:null})],u.prototype,`unit`,void 0),e([s({type:o,value:null})],u.prototype,`perimeterUnit`,void 0),e([s({readOnly:!0})],u.prototype,`valid`,null),u=e([c(`esri.analysis.AreaMeasurementAnalysis`)],u);const d=u;export{d as default};
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* @internal
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
import type Format from "../../
|
|
7
|
+
import type Format from "../../geometry/coordinateConversion/support/Format.js";
|
|
8
|
+
import type LegacyFormat from "../../widgets/CoordinateConversion/support/Format.js";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Given a format, return whether it has the properties needed for display
|
|
@@ -13,4 +14,4 @@ import type Format from "../../widgets/CoordinateConversion/support/Format.js";
|
|
|
13
14
|
* @internal
|
|
14
15
|
* @internal
|
|
15
16
|
*/
|
|
16
|
-
export function hasDisplayProperties(format: Format): boolean;
|
|
17
|
+
export function hasDisplayProperties(format: Format | LegacyFormat): boolean;
|
|
@@ -8,10 +8,13 @@ import type CSVLayer from "../../layers/CSVLayer.js";
|
|
|
8
8
|
import type FeatureLayer from "../../layers/FeatureLayer.js";
|
|
9
9
|
import type GeoJSONLayer from "../../layers/GeoJSONLayer.js";
|
|
10
10
|
import type ImageryLayer from "../../layers/ImageryLayer.js";
|
|
11
|
+
import type OrientedImageryLayer from "../../layers/OrientedImageryLayer.js";
|
|
11
12
|
import type SceneLayer from "../../layers/SceneLayer.js";
|
|
12
13
|
import type WFSLayer from "../../layers/WFSLayer.js";
|
|
13
14
|
import type CatalogFootprintLayer from "../../layers/catalog/CatalogFootprintLayer.js";
|
|
14
15
|
import type KnowledgeGraphSublayer from "../../layers/knowledgeGraph/KnowledgeGraphSublayer.js";
|
|
16
|
+
import type Sublayer from "../../layers/support/Sublayer.js";
|
|
17
|
+
import type SubtypeSublayer from "../../layers/support/SubtypeSublayer.js";
|
|
15
18
|
import type AttributeTableTemplate from "../../tables/AttributeTableTemplate.js";
|
|
16
19
|
import type TableTemplate from "../../widgets/FeatureTable/support/TableTemplate.js";
|
|
17
20
|
import type FeatureTable from "../../widgets/FeatureTable.js";
|
|
@@ -54,7 +57,7 @@ export interface CreateDefaultAttributeTableTemplateFromLayerOptions {
|
|
|
54
57
|
*
|
|
55
58
|
* @internal
|
|
56
59
|
*/
|
|
57
|
-
layer: CatalogFootprintLayer | CSVLayer | FeatureLayer | GeoJSONLayer | ImageryLayer | KnowledgeGraphSublayer | SceneLayer | WFSLayer;
|
|
60
|
+
layer: CatalogFootprintLayer | CSVLayer | FeatureLayer | GeoJSONLayer | ImageryLayer | KnowledgeGraphSublayer | OrientedImageryLayer | SceneLayer | Sublayer | SubtypeSublayer | WFSLayer;
|
|
58
61
|
/**
|
|
59
62
|
* Indicates 'attachment' columns should be excluded.
|
|
60
63
|
*
|
|
@@ -29,6 +29,7 @@ import type { ColorLike } from "../../Color.js";
|
|
|
29
29
|
import type { Unit } from "../../core/units.js";
|
|
30
30
|
import type { IdentityManagerBase } from "../../identity/IdentityManagerBase.js";
|
|
31
31
|
import type { Symbol3DEmissive } from "../../symbols/support/Symbol3DEmissive.js";
|
|
32
|
+
import type { LayerView3DFor } from "../../views/3d/types.js";
|
|
32
33
|
|
|
33
34
|
/**
|
|
34
35
|
* @internal
|
|
@@ -449,4 +450,14 @@ export function sceneVerifySaveAs(scene: WebScene, options: { strictSchemaValida
|
|
|
449
450
|
* @internal
|
|
450
451
|
* @internal
|
|
451
452
|
*/
|
|
452
|
-
export function sceneGetResourceInfo(scene: WebScene): object | null | undefined;
|
|
453
|
+
export function sceneGetResourceInfo(scene: WebScene): object | null | undefined;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Checks whether a scene layer view may have textures or vertex colors.
|
|
457
|
+
* Returns true while the loaded content is insufficient to determine this.
|
|
458
|
+
*
|
|
459
|
+
* @param layerView
|
|
460
|
+
* @internal
|
|
461
|
+
* @internal
|
|
462
|
+
*/
|
|
463
|
+
export function hasTexturesOrVertexColors(layerView: LayerView3DFor<SceneLayer>): boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../../core/Collection.js";import{getColorWithEmissiveStrength as t}from"../../core/colorUtils.js";import n from"../../core/Error.js";import r from"../../core/Logger.js";import{convertUnit as i}from"../../core/units.js";import{isBuildingGraphicOrigin as a}from"../../graphic/isBuildingGraphicOrigin.js";import{isHostedAgolService as o}from"../../layers/support/arcgisLayerUrl.js";import{registerLoader as s}from"../../layers/support/schemaValidatorLoader.js";import{schemaValidationErrorName as c}from"../../support/webSceneUtils.js";import{renderSVG as l}from"../../symbols/support/svgUtils.js";import{viewingModeFromString as u}from"../../views/ViewingMode.js";import{ZoomControllerGlobal as d}from"../../views/3d/state/controllers/ZoomControllerGlobal.js";import{ZoomControllerLocal as f}from"../../views/3d/state/controllers/ZoomControllerLocal.js";import{TilingScheme as p}from"../../views/3d/terrain/TilingScheme.js";import{isSpatialReferenceSupported as m}from"../../views/support/spatialReferenceSupport.js";import{checkWebGLRequirements as h}from"../../views/support/WebGLRequirements.js";import{registerLoader as g}from"../../webscene/support/schemaValidatorLoader.js";import{widgetMap as _}from"../../widgets/support/jsxWidgetSupport.js";import{widgetTestDataSymbol as v}from"../../widgets/support/symbols.js";function y(t,{defaultSpatialReference:n,isSpatialReferenceSupported:r,priorityLayers:i,required:a}){let o={...t.defaultsFromMapSettings};n&&(o.defaultSpatialReference=n),r&&(o.getSpatialReferenceSupport=(e,n)=>r(e,n)?t.getSpatialReferenceSupport(e,n):null),i&&(o.priorityCollection={layers:new e(i)}),a&&(o.required=a),t.defaultsFromMapSettings=o}function b(e){return e.back()}function x(e){return e.hasPendingEdits}function S(e,t){return r.getLogger(`sceneViewer.appState.saveState`).warn(e,t)}function C(e){return o(e)}function w(e,t,n,r){return l(e,t,n,r)}function T(e){return!e.canNotSaveAs()}function E(e,t){return m(e,u(t))}function D(e,t){return e.getCompatibleForVTL(t)}function O(e){return new p(e)}function ee(e){return p.checkUnsupported(e)==null}function k(){s(()=>import(`../../layers/support/schemaValidator.js`)),g(()=>import(`../../webscene/support/schemaValidator.js`))}function A(e){return e&&e.name===c}function j(e){let t=e.state.cameraController;return t instanceof d||t instanceof f?t.dragBeginPoint:null}function M(e){e.openedLayers.pop()}function N(e,t){return e&&`patchFeaturesForPopup`in e&&typeof e.patchFeaturesForPopup==`function`?e.patchFeaturesForPopup(t):Promise.reject(new n(`layerview:fetchPopupFeaturesFromGraphics`,`The input layerview does not support fetchPopupFeaturesFromGraphics`))}function P(e,t,n){return i(e,t,n)}function F(e){e.removeContainer()}function I(){return _}function L(){return v}function R(e){return h(e)}function z(e){if(a(e?.origin))return e.origin.sublayer;if(!e?.sourceLayer)return null;if(e.sourceLayer.type===`building-component`)return e.sourceLayer;throw new n(`getSourceLayerFromBuildingComponentSublayerGraphic`,`The input graphic source layer is not of type BuildingComponentSublayer`)}function B(e,t){e&&(e.origin=t.graphicOrigin,e.sourceLayer=t)}function V(e,n){return t(e,n)}function H(e){return e.basemapTerrain?e.basemapTerrain.tilingSchemeLocked?`locked`:`unlocked`:`unknown`}function U(e,t,n){return e.checkAppAccess(t,n)}function W(e,t){return e.hasCachedStatistics(t)}function G(e){return e.associatedLayer}function K(e){return e.displayName}function q(e){return e?.iconUrl}function J(e){return e?.userType}function Y(e,t){return e.disableExtraQuery=t,e}function X(e){return e?.getLabelExpressionSingleField()}function Z(e){return e?.getLabelExpressionArcade()}function Q(e,t){return e.verifySaveAs(t)}function $(e){return e.resourceInfo}export{T as canSaveAs,U as checkAppAccess,R as checkWebGLRequirements,M as closeCatalogLayer,P as convertToUnit,O as createTilingScheme,x as editorHasPendingEdits,b as editorNavigateBack,N as fetchPopupFeaturesFromGraphics,G as getAssociatedLayer,H as getBasemapTerrainTilingSchemeLocked,V as getColorWithEmissiveStrength,D as getCompatibleTileInfoForVTL,I as getJsxWidgetMap,Z as getLabelExpressionArcade,X as getLabelExpressionSingleField,K as getPortalItemDisplayName,q as getPortalItemIconUrl,J as getPortalUserType,z as getSourceLayerFromBuildingComponentSublayerGraphic,L as getWidgetTestDataSymbol,W as hasCachedStatistics,k as initializeSchemaValidators,C as isHostedAgolServiceUrl,A as isSchemaValidationError,E as isSpatialReferenceSupported,ee as isSupportedTileInfo,F as removeWidgetContainer,w as renderSVG,S as saveStateWarning,$ as sceneGetResourceInfo,Q as sceneVerifySaveAs,y as setDefaultsFromMapSettings,Y as setDisableExtraQuery,B as setSourceLayerOfBuildingComponentSublayerGraphic,j as zoomDragBeginPoint};
|
|
2
|
+
import e from"../../core/Collection.js";import{getColorWithEmissiveStrength as t}from"../../core/colorUtils.js";import n from"../../core/Error.js";import r from"../../core/Logger.js";import{convertUnit as i}from"../../core/units.js";import{isBuildingGraphicOrigin as a}from"../../graphic/isBuildingGraphicOrigin.js";import{isHostedAgolService as o}from"../../layers/support/arcgisLayerUrl.js";import{registerLoader as s}from"../../layers/support/schemaValidatorLoader.js";import{schemaValidationErrorName as c}from"../../support/webSceneUtils.js";import{renderSVG as l}from"../../symbols/support/svgUtils.js";import{viewingModeFromString as u}from"../../views/ViewingMode.js";import{ZoomControllerGlobal as d}from"../../views/3d/state/controllers/ZoomControllerGlobal.js";import{ZoomControllerLocal as f}from"../../views/3d/state/controllers/ZoomControllerLocal.js";import{TilingScheme as p}from"../../views/3d/terrain/TilingScheme.js";import{isSpatialReferenceSupported as m}from"../../views/support/spatialReferenceSupport.js";import{checkWebGLRequirements as h}from"../../views/support/WebGLRequirements.js";import{registerLoader as g}from"../../webscene/support/schemaValidatorLoader.js";import{widgetMap as _}from"../../widgets/support/jsxWidgetSupport.js";import{widgetTestDataSymbol as v}from"../../widgets/support/symbols.js";function y(t,{defaultSpatialReference:n,isSpatialReferenceSupported:r,priorityLayers:i,required:a}){let o={...t.defaultsFromMapSettings};n&&(o.defaultSpatialReference=n),r&&(o.getSpatialReferenceSupport=(e,n)=>r(e,n)?t.getSpatialReferenceSupport(e,n):null),i&&(o.priorityCollection={layers:new e(i)}),a&&(o.required=a),t.defaultsFromMapSettings=o}function b(e){return e.back()}function x(e){return e.hasPendingEdits}function S(e,t){return r.getLogger(`sceneViewer.appState.saveState`).warn(e,t)}function C(e){return o(e)}function w(e,t,n,r){return l(e,t,n,r)}function T(e){return!e.canNotSaveAs()}function E(e,t){return m(e,u(t))}function D(e,t){return e.getCompatibleForVTL(t)}function O(e){return new p(e)}function ee(e){return p.checkUnsupported(e)==null}function k(){s(()=>import(`../../layers/support/schemaValidator.js`)),g(()=>import(`../../webscene/support/schemaValidator.js`))}function A(e){return e&&e.name===c}function j(e){let t=e.state.cameraController;return t instanceof d||t instanceof f?t.dragBeginPoint:null}function M(e){e.openedLayers.pop()}function N(e,t){return e&&`patchFeaturesForPopup`in e&&typeof e.patchFeaturesForPopup==`function`?e.patchFeaturesForPopup(t):Promise.reject(new n(`layerview:fetchPopupFeaturesFromGraphics`,`The input layerview does not support fetchPopupFeaturesFromGraphics`))}function P(e,t,n){return i(e,t,n)}function F(e){e.removeContainer()}function I(){return _}function L(){return v}function R(e){return h(e)}function z(e){if(a(e?.origin))return e.origin.sublayer;if(!e?.sourceLayer)return null;if(e.sourceLayer.type===`building-component`)return e.sourceLayer;throw new n(`getSourceLayerFromBuildingComponentSublayerGraphic`,`The input graphic source layer is not of type BuildingComponentSublayer`)}function B(e,t){e&&(e.origin=t.graphicOrigin,e.sourceLayer=t)}function V(e,n){return t(e,n)}function H(e){return e.basemapTerrain?e.basemapTerrain.tilingSchemeLocked?`locked`:`unlocked`:`unknown`}function U(e,t,n){return e.checkAppAccess(t,n)}function W(e,t){return e.hasCachedStatistics(t)}function G(e){return e.associatedLayer}function K(e){return e.displayName}function q(e){return e?.iconUrl}function J(e){return e?.userType}function Y(e,t){return e.disableExtraQuery=t,e}function X(e){return e?.getLabelExpressionSingleField()}function Z(e){return e?.getLabelExpressionArcade()}function Q(e,t){return e.verifySaveAs(t)}function $(e){return e.resourceInfo}function te(e){return e.type!==`scene-layer-3d`||e.hasTexturesOrVertexColors!==`probably-not`}export{T as canSaveAs,U as checkAppAccess,R as checkWebGLRequirements,M as closeCatalogLayer,P as convertToUnit,O as createTilingScheme,x as editorHasPendingEdits,b as editorNavigateBack,N as fetchPopupFeaturesFromGraphics,G as getAssociatedLayer,H as getBasemapTerrainTilingSchemeLocked,V as getColorWithEmissiveStrength,D as getCompatibleTileInfoForVTL,I as getJsxWidgetMap,Z as getLabelExpressionArcade,X as getLabelExpressionSingleField,K as getPortalItemDisplayName,q as getPortalItemIconUrl,J as getPortalUserType,z as getSourceLayerFromBuildingComponentSublayerGraphic,L as getWidgetTestDataSymbol,W as hasCachedStatistics,te as hasTexturesOrVertexColors,k as initializeSchemaValidators,C as isHostedAgolServiceUrl,A as isSchemaValidationError,E as isSpatialReferenceSupported,ee as isSupportedTileInfo,F as removeWidgetContainer,w as renderSVG,S as saveStateWarning,$ as sceneGetResourceInfo,Q as sceneVerifySaveAs,y as setDefaultsFromMapSettings,Y as setDisableExtraQuery,B as setSourceLayerOfBuildingComponentSublayerGraphic,j as zoomDragBeginPoint};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t}from"tslib";import{neverAbortedSignal as n}from"../../arcadeEnvironment.js";import{getSpatialReferenceAsGxJson as r}from"../../geometry.js";import{throwIfCancelled as i,FeatureSetError as a}from"../support/errorsupport.js";import{FeatureSet as o}from"../support/FeatureSet.js";import{defaultMaxRecords as s}from"../support/shared.js";import{createRemoteGeometryReference as c,invokeRemoteGeometryOp as l}from"../../geometry/operatorsWorkerConnection.js";import{getGeometryExtent as u}from"../../../geometry/support/extentUtils.js";class d extends o{constructor(e){super(),this.declaredClass=`esri.arcade.featureset.actions.SpatialFilter`,this._maxProcessing=40,this._parent=e.parentfeatureset,this._relation=e.relation,this._relationString=e.relationString??``,this._relationGeom=e.relationGeom}get _spatialFilter(){return{relation:this._relation===`esriSpatialRelRelation`?`esriSpatialRelRelation:${this._relationString}`:this._relation,geometry:this._relationGeom.asAccessorGeometry()}}async _queryAll(){return(await this.query({abortSignal:n})).features}async query(e){await this._ensureLoaded();let t=await this._parent.query({...e,spatialFilter:this._spatialFilter,limit:e.spatialFilter==null?e.limit:null});return i(e.abortSignal),{...t,spatialFilterApplied:e.spatialFilter==null,features:t.spatialFilterApplied?t.features:this._applySpatialFilter(t.features,e.abortSignal)}}async*_applySpatialFilter(n,a){let o=r(this._relationGeom.spatialReference);if(this._relation===`esriSpatialRelEnvelopeIntersects`){let e=u(this._relationGeom.asJsonGeometry());if(e==null){await n.return?.();return}for await(let t of n){i(a);let n=t.map(e=>u(e.geometry)),r=await this._executeSpatialRelationTest(`esriSpatialRelIntersects`,``,e,n,o),s=t.filter((e,t)=>r[t]);s.length>0&&(yield s)}}else{let r={stack:[],error:void 0,hasError:!1};try{let t=e(r,await c(this._relationGeom.asJsonGeometry()),!0);for await(let e of n){i(a);let n=await this._executeSpatialRelationTest(this._relation,this._relationString,t.ref,e.map(e=>e.geometry),o),r=e.filter((e,t)=>n[t]);r.length>0&&(yield r)}}catch(e){r.error=e,r.hasError=!0}finally{let e=t(r);e&&await e}}}async queryStat(e){if(e.spatialFilter!=null)return{calculated:!1};let t=await this._parent.queryStat({...e,spatialFilter:this._spatialFilter});return t.calculated?t:e.where==null&&e.spatialFilter==null?this._manualStat(e.stat,e.field,e.limit??s,e.abortSignal):{calculated:!1}}async canQueryAggregate(e){return e.spatialFilter==null&&this._parent.canQueryAggregate({...e,spatialFilter:this._spatialFilter})}async queryAggregate(e){if(e.spatialFilter!=null)throw new a(`NeverReach`);return this._parent.queryAggregate({...e,spatialFilter:this._spatialFilter})}async _executeSpatialRelationTest(e,t,n,r,i){switch(e){case`esriSpatialRelIntersects`:return l(`intersects`,[n,r,i,!0]);case`esriSpatialRelContains`:return l(`contains`,[n,r,i,!0]);case`esriSpatialRelOverlaps`:return l(`overlaps`,[n,r,i,!0]);case`esriSpatialRelWithin`:return l(`within`,[n,r,i,!0]);case`esriSpatialRelTouches`:return l(`touches`,[n,r,i,!0]);case`esriSpatialRelCrosses`:return l(`crosses`,[n,r,i,!0]);case`esriSpatialRelRelation`:return l(`relate`,[n,r,i,t,!0]);default:return r.map(()=>!1)}}getFieldsIndex(){return this._parent.getFieldsIndex()}}export{d as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{ArcadeExecutionError as e}from"../executionError.js";import{getSpatialReferenceAsGxJson as t}from"../geometry.js";import{H as n,E as r,d as i,w as a,k as o}from"../../chunks/languageUtils.js";import s from"../featureset/actions/SpatialFilter.js";import c from"../featureset/sources/Empty.js";import{invokeRemoteGeometryOp as l}from"../geometry/operatorsWorkerConnection.js";import{getGeometryExtent as u}from"../../geometry/support/extentUtils.js";function d(a){return async(d,f,p)=>{if(r(p,2,2,f),p=n(p),p[0]===null&&p[1]===null)return!1;if(o(p[0])){if(i(p[1]))return new s({parentfeatureset:p[0],relation:a,relationGeom:p[1]});if(p[1]===null)return new c({parentfeatureset:p[0]});throw new e(`InvalidParameter`,f)}if(i(p[0])){if(i(p[1])){switch(a){case`esriSpatialRelEnvelopeIntersects`:{let e=u(p[0].asJsonGeometry()),n=u(p[1].asJsonGeometry());return e==null||n==null?!1:l(`intersects`,[e,n,t(p[0].spatialReference)])}case`esriSpatialRelIntersects`:return l(`intersects`,[p[0].asJsonGeometry(),p[1].asJsonGeometry(),t(p[0].spatialReference)]);case`esriSpatialRelContains`:return l(`contains`,[p[0].asJsonGeometry(),p[1].asJsonGeometry(),t(p[0].spatialReference)]);case`esriSpatialRelOverlaps`:return l(`overlaps`,[p[0].asJsonGeometry(),p[1].asJsonGeometry(),t(p[0].spatialReference)]);case`esriSpatialRelWithin`:return l(`within`,[p[0].asJsonGeometry(),p[1].asJsonGeometry(),t(p[0].spatialReference)]);case`esriSpatialRelTouches`:return l(`touches`,[p[0].asJsonGeometry(),p[1].asJsonGeometry(),t(p[0].spatialReference)]);case`esriSpatialRelCrosses`:return l(`crosses`,[p[0].asJsonGeometry(),p[1].asJsonGeometry(),t(p[0].spatialReference)])}throw new e(`InvalidParameter`,f)}if(o(p[1]))return new s({parentfeatureset:p[1],relation:a,relationGeom:p[0]});if(p[1]===null)return!1;throw new e(`InvalidParameter`,f)}if(p[0]===null){if(o(p[1]))return new c({parentfeatureset:p[1]});if(i(p[1])||p[1]===null)return!1}throw new e(`InvalidParameter`,f)}}function f(u){u.mode===`async`&&(u.functions.intersects=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelIntersects`))},u.functions.envelopeintersects=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelEnvelopeIntersects`))},u.signatures.push({name:`envelopeintersects`,min:2,max:2}),u.functions.contains=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelContains`))},u.functions.overlaps=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelOverlaps`))},u.functions.within=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelWithin`))},u.functions.touches=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelTouches`))},u.functions.crosses=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelCrosses`))},u.functions.relate=function(d,f){return u.standardFunctionAsync(d,f,async(u,d,p)=>{if(p=n(p),r(p,3,3,f),i(p[0])&&i(p[1]))return l(`relate`,[p[0].asJsonGeometry(),p[1].asJsonGeometry(),t(p[0].spatialReference),a(p[2])]);if(i(p[0])&&p[1]===null||i(p[1])&&p[0]===null)return!1;if(o(p[0])&&p[1]===null)return new c({parentfeatureset:p[0]});if(o(p[1])&&p[0]===null)return new c({parentfeatureset:p[1]});if(o(p[0])&&i(p[1]))return new s({parentfeatureset:p[0],relation:`esriSpatialRelRelation`,relationGeom:p[1],relationString:a(p[2])});if(o(p[1])&&i(p[0]))return new s({parentfeatureset:p[1],relation:`esriSpatialRelRelation`,relationGeom:p[0],relationString:a(p[2])});if(p[0]===null&&p[1]===null)return!1;throw new e(`InvalidParameter`,f)})})}export{f as registerFunctions};
|
|
2
|
+
import{ArcadeExecutionError as e}from"../executionError.js";import{getSpatialReferenceAsGxJson as t}from"../geometry.js";import{H as n,E as r,d as i,w as a,k as o}from"../../chunks/languageUtils.js";import s from"../featureset/actions/SpatialFilter.js";import c from"../featureset/sources/Empty.js";import{invokeRemoteGeometryOp as l}from"../geometry/operatorsWorkerConnection.js";import{getGeometryExtent as u}from"../../geometry/support/extentUtils.js";function d(a){return async(d,f,p)=>{if(r(p,2,2,f),p=n(p),p[0]===null&&p[1]===null)return!1;if(o(p[0])){if(i(p[1]))return new s({parentfeatureset:p[0],relation:a,relationGeom:p[1]});if(p[1]===null)return new c({parentfeatureset:p[0]});throw new e(`InvalidParameter`,f)}if(i(p[0])){if(i(p[1])){switch(a){case`esriSpatialRelEnvelopeIntersects`:{let e=u(p[0].asJsonGeometry()),n=u(p[1].asJsonGeometry());return e==null||n==null?!1:(await l(`intersects`,[e,[n],t(p[0].spatialReference)]))[0]}case`esriSpatialRelIntersects`:return(await l(`intersects`,[p[0].asJsonGeometry(),[p[1].asJsonGeometry()],t(p[0].spatialReference)]))[0];case`esriSpatialRelContains`:return(await l(`contains`,[p[0].asJsonGeometry(),[p[1].asJsonGeometry()],t(p[0].spatialReference)]))[0];case`esriSpatialRelOverlaps`:return(await l(`overlaps`,[p[0].asJsonGeometry(),[p[1].asJsonGeometry()],t(p[0].spatialReference)]))[0];case`esriSpatialRelWithin`:return(await l(`within`,[p[0].asJsonGeometry(),[p[1].asJsonGeometry()],t(p[0].spatialReference)]))[0];case`esriSpatialRelTouches`:return(await l(`touches`,[p[0].asJsonGeometry(),[p[1].asJsonGeometry()],t(p[0].spatialReference)]))[0];case`esriSpatialRelCrosses`:return(await l(`crosses`,[p[0].asJsonGeometry(),[p[1].asJsonGeometry()],t(p[0].spatialReference)]))[0]}throw new e(`InvalidParameter`,f)}if(o(p[1]))return new s({parentfeatureset:p[1],relation:a,relationGeom:p[0]});if(p[1]===null)return!1;throw new e(`InvalidParameter`,f)}if(p[0]===null){if(o(p[1]))return new c({parentfeatureset:p[1]});if(i(p[1])||p[1]===null)return!1}throw new e(`InvalidParameter`,f)}}function f(u){u.mode===`async`&&(u.functions.intersects=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelIntersects`))},u.functions.envelopeintersects=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelEnvelopeIntersects`))},u.signatures.push({name:`envelopeintersects`,min:2,max:2}),u.functions.contains=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelContains`))},u.functions.overlaps=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelOverlaps`))},u.functions.within=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelWithin`))},u.functions.touches=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelTouches`))},u.functions.crosses=function(e,t){return u.standardFunctionAsync(e,t,d(`esriSpatialRelCrosses`))},u.functions.relate=function(d,f){return u.standardFunctionAsync(d,f,async(u,d,p)=>{if(p=n(p),r(p,3,3,f),i(p[0])&&i(p[1]))return(await l(`relate`,[p[0].asJsonGeometry(),[p[1].asJsonGeometry()],t(p[0].spatialReference),a(p[2])]))[0];if(i(p[0])&&p[1]===null||i(p[1])&&p[0]===null)return!1;if(o(p[0])&&p[1]===null)return new c({parentfeatureset:p[0]});if(o(p[1])&&p[0]===null)return new c({parentfeatureset:p[1]});if(o(p[0])&&i(p[1]))return new s({parentfeatureset:p[0],relation:`esriSpatialRelRelation`,relationGeom:p[1],relationString:a(p[2])});if(o(p[1])&&i(p[0]))return new s({parentfeatureset:p[1],relation:`esriSpatialRelRelation`,relationGeom:p[0],relationString:a(p[2])});if(p[0]===null&&p[1]===null)return!1;throw new e(`InvalidParameter`,f)})})}export{f as registerFunctions};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import e from"../ArcadePortal.js";import{convertJsonValueToArcadeValue as t,convertJsonValueToImmutableArcadeValue as n}from"../containerUtils.js";import r from"../Dictionary.js";import{ArcadeExecutionError as i}from"../executionError.js";import{getSpatialReferenceAsGxJson as a}from"../geometry.js";import{H as o,E as s,d as c,f as l,r as u,q as d,w as f,g as p,J as m,K as h,k as g,L as _,v,M as y,N as b}from"../../chunks/languageUtils.js";import{getPortal as x}from"../portalUtils.js";import{autoCastArrayOfPointsToPolygon as S,autoCastArrayOfPointsToPolyline as C,autoCastArrayOfPointsToMultiPoint as w}from"../geometry/arrayOfPointsConversions.js";import{commonRelationsCheck as T,toGxCurveType as E,planarLength3D as D,toGxOffsetJoinType as O,toCentroidAlgorithm as k,measureToCoordinateFunc as A,pointToCoordinateFunc as j,distanceToCoordinateFunc as M}from"../geometry/functions.js";import{invokeRemoteGeometryOp as N}from"../geometry/operatorsWorkerConnection.js";import{createArcadeGeometryFromUnknownJsonGeometry as P,createArcadeGeometryFromJsonGeometry as F}from"../geometry/adapters/json.js";import{lookupUser as I}from"../../portal/support/utils.js";import{isArray as L}from"../../support/guards.js";function R(e){if(e==null)return e;switch(typeof e){case`string`:case`number`:return e;default:throw new i(`InvalidParameter`,null)}}function z(z){z.mode===`async`&&(z.functions.disjoint=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null||N(`disjoint`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)])))},z.functions.intersects=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:N(`intersects`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)])))},z.functions.touches=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:N(`touches`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)])))},z.functions.crosses=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:N(`crosses`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)])))},z.functions.within=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:N(`within`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)])))},z.functions.contains=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:N(`contains`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)])))},z.functions.overlaps=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:N(`overlaps`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)])))},z.functions.equals=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>(s(r,2,2,t),r[0]===r[1]?!0:c(r[0])&&c(r[1])?N(`equals`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)]):l(r[0])&&l(r[1])||u(r[0])&&u(r[1])||d(r[0])&&d(r[1])?r[0].equals(r[1]):!1))},z.functions.relate=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>{if(r=o(r),s(r,3,3,t),c(r[0])&&c(r[1]))return N(`relate`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference),f(r[2])]);if(c(r[0])&&r[1]===null||c(r[1])&&r[0]===null||r[0]===null&&r[1]===null)return!1;throw new i(`InvalidParameter`,t)})},z.functions.intersection=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?null:P(await N(`intersection`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)]),r[0].spatialReference)))},z.functions.union=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),r.length===0)throw new i(`WrongNumberOfParameters`,t);let s=[];if(r.length===1){if(L(r[0])){for(let e of o(r[0]))if(e!==null){if(!c(e))throw new i(`InvalidParameter`,t);s.push(e)}}else if(p(r[0])){for(let e of o(r[0].toArray()))if(e!==null){if(!c(e))throw new i(`InvalidParameter`,t);s.push(e)}}else if(c(r[0]))return r[0].clone();else if(r[0]===null)return null;else throw new i(`InvalidParameter`,t)}else for(let e of r)if(e!==null){if(!c(e))throw new i(`InvalidParameter`,t);s.push(e)}if(s.length===0)return null;let l=s[0].spatialReference;return P(await N(`union`,[s.map(e=>e.asJsonGeometry()),a(l)]),l)})},z.functions.difference=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null?null:r[1]===null?r[0].clone():P(await N(`difference`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)]),r[0].spatialReference)))},z.functions.symmetricdifference=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null&&r[1]===null?null:r[0]===null?r[1]?.clone()??null:r[1]===null?r[0]?.clone()??null:P(await N(`symmetricDifference`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)]),r[0].spatialReference)))},z.functions.clip=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,2,2,t),!m(r[1])&&r[1]!==null)throw new i(`InvalidParameter`,t);if(r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);return r[1]===null?null:P(await N(`clip`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)]),r[0].spatialReference)})},z.functions.cut=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,2,2,t),!h(r[1])&&r[1]!==null)throw new i(`InvalidParameter`,t);if(r[0]===null)return[];if(!c(r[0]))throw new i(`InvalidParameter`,t);if(r[1]===null)return[r[0].clone()];let l=r[0].spatialReference;return(await N(`cut`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)])).map(e=>P(e,l)).filter(e=>e!=null)})},z.functions.area=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{if(s(l,1,2,t),l=o(l),g(l[0])){let n=await l[0].sumArea(R(l[1]),null,e.abortSignal);if(e.abortSignal.aborted)throw new i(`Cancelled`,t);return n}let u=l[0];if((L(u)||p(u))&&(u=S(l[0],e.spatialReference)),u===null)return 0;if(!c(u))throw new i(`InvalidParameter`,t);return N(`area`,[u.asJsonGeometry(),a(u.spatialReference),R(l[1])])})},z.functions.areageodetic=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{s(l,1,3,t),l=o(l);let u=l[0];(L(u)||p(u))&&(u=S(u,e.spatialReference));let d=R(l[1]),f=E(l[2]);if(g(u)){let n=await u.sumArea(d,f,e.abortSignal);if(e.abortSignal.aborted)throw new i(`Cancelled`,t);return n}if(u==null)return 0;if(!c(u))throw new i(`InvalidParameter`,t);return N(`geodeticArea`,[u.asJsonGeometry(),a(u.spatialReference),d,f])})},z.functions.length=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{if(s(l,1,2,t),l=o(l),g(l[0])){let n=await l[0].sumLength(R(l[1]),null,e.abortSignal);if(e.abortSignal.aborted)throw new i(`Cancelled`,t);return n}let u=l[0];if((L(l[0])||p(l[0]))&&(u=C(l[0],e.spatialReference)),u===null)return 0;if(!c(u))throw new i(`InvalidParameter`,t);return N(`length`,[u.asJsonGeometry(),a(u.spatialReference),R(l[1])])})},z.functions.length3d=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{if(s(l,1,2,t),l=o(l),l[0]===null)return 0;let u=l[0];if((L(l[0])||p(l[0]))&&(u=C(l[0],e.spatialReference)),u===null)return 0;if(!c(u))throw new i(`InvalidParameter`,t);if(u.hasZ===!0){let{convertFromSpatialReferenceUnit:e,toLengthUnit:t}=await import(`../geometry/unitConversion.js`),n=D(u);return e(u.spatialReference,t(l[1]),n)}return N(`length`,[u.asJsonGeometry(),a(u.spatialReference),R(l[1])])})},z.functions.lengthgeodetic=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{s(l,1,3,t),l=o(l);let u=l[0];(L(l[0])||p(l[0]))&&(u=C(l[0],e.spatialReference));let d=R(l[1]),f=E(l[2]);if(g(u)){let n=await u.sumLength(d,f,e.abortSignal);if(e.abortSignal.aborted)throw new i(`Cancelled`,t);return n}if(u===null)return 0;if(!c(u))throw new i(`InvalidParameter`,t);return N(`geodeticLength`,[u.asJsonGeometry(),a(u.spatialReference),d,f])})},z.functions.distance=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{l=o(l),s(l,2,3,t);let u=l[0];if((L(l[0])||p(l[0]))&&(u=w(l[0],e.spatialReference)),!c(u))throw new i(`InvalidParameter`,t);let d=l[1];if((L(l[1])||p(l[1]))&&(d=w(l[1],e.spatialReference)),!c(d))throw new i(`InvalidParameter`,t);return N(`distance`,[u.asJsonGeometry(),d.asJsonGeometry(),a(u.spatialReference),R(l[2])])})},z.functions.distancegeodetic=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{r=o(r),s(r,2,4,t);let c=r[0];if(!_(c))throw new i(`InvalidParameter`,t);let l=r[1];if(!_(l))throw new i(`InvalidParameter`,t);return N(`geodeticDistance`,[c.asJsonGeometry(),l.asJsonGeometry(),a(c.spatialReference),R(r[2]),E(r[3])])})},z.functions.densify=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,2,3,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);let l=v(r[1]);if(isNaN(l)||l<=0)throw new i(`InvalidParameter`,t);switch(r[0].type){case`polygon`:case`polyline`:case`extent`:return P(await N(`densify`,[r[0].asJsonGeometry(),a(r[0].spatialReference),l,R(r[2])]),r[0].spatialReference);default:return r[0]}})},z.functions.densifygeodetic=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{r=o(r),s(r,2,4,t);let l=r[0];if(l==null)return null;if(!c(l))throw new i(`InvalidParameter`,t);let u=v(r[1]);if(isNaN(u)||u<=0)throw new i(`InvalidParameter`,t);let d=R(r[2]),f=E(r[3]);switch(l.type){case`polygon`:case`polyline`:case`extent`:return P(await N(`geodeticDensify`,[l.asJsonGeometry(),a(l.spatialReference),u,d,f]),l.spatialReference);default:return l}})},z.functions.generalize=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,2,4,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);let l=v(r[1]);if(isNaN(l))throw new i(`InvalidParameter`,t);let u=y(b(r[2],!0));return P(await N(`generalize`,[r[0].asJsonGeometry(),a(r[0].spatialReference),l,R(r[3]),u]),r[0].spatialReference)})},z.functions.buffer=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,2,3,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);let l=v(r[1]);if(isNaN(l))throw new i(`InvalidParameter`,t);return l===0?r[0].clone():P(await N(`buffer`,[r[0].asJsonGeometry(),a(r[0].spatialReference),l,R(r[2])]),r[0].spatialReference)})},z.functions.buffergeodetic=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{r=o(r),s(r,2,4,t);let l=r[0];if(l==null)return null;if(!c(l))throw new i(`InvalidParameter`,t);let u=v(r[1]);if(isNaN(u))throw new i(`InvalidParameter`,t);if(u===0)return l.clone();let d=R(r[2]),f=E(r[3]);return P(await N(`geodesicBuffer`,[l.asJsonGeometry(),a(l.spatialReference),u,d,f]),l.spatialReference)})},z.functions.offset=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{r=o(r),s(r,2,6,t);let l=r[0];if(l===null)return null;if(!c(l)||l.type!==`polygon`&&l.type!==`polyline`)throw new i(`InvalidParameter`,t);let u=v(r[1]);if(isNaN(u))throw new i(`InvalidParameter`,t);let d=r[2],f=O(r[3]),p=v(b(r[4],10));if(isNaN(p))throw new i(`InvalidParameter`,t);let m=v(b(r[5],0));if(isNaN(m))throw new i(`InvalidParameter`,t);return P(await N(`offset`,[l.asJsonGeometry(),a(l.spatialReference),u,R(d),f,p,m]),l.spatialReference)})},z.functions.rotate=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{r=o(r),s(r,2,3,t);let a=r[0];if(a===null)return null;if(!c(a))throw new i(`InvalidParameter`,t);let l=v(r[1]);if(!Number.isFinite(l))throw new i(`InvalidParameter`,t);let u=r[2];if(u!=null&&!_(u))throw new i(`InvalidParameter`,t);let d=u?.asJsonLikeGeometry();return P(await N(`rotate`,[a.asJsonGeometry(),l,d?.x,d?.y]),a.spatialReference)})},z.functions.centroid=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,a)=>{if(a=o(a),s(a,1,2,t),a[0]===null)return null;let l=k(a[1]),u=a[0];if((L(a[0])||p(a[0]))&&(u=l===`geometric`?w(a[0],e.spatialReference):S(a[0],e.spatialReference),u===null))return null;if(!c(u))throw new i(`InvalidParameter`,t);return l===`geometric`?F(`point`,await N(`centroid`,[u.asJsonGeometry()]),u.spatialReference):F(`point`,await N(`labelPoint`,[u.asJsonGeometry()]),u.spatialReference)})},z.functions.measuretocoordinate=function(e,t){return z.standardFunctionAsync(e,t,A)},z.functions.pointtocoordinate=function(e,t){return z.standardFunctionAsync(e,t,j)},z.functions.distancetocoordinate=function(e,t){return z.standardFunctionAsync(e,t,M)},z.functions.multiparttosinglepart=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,1,1,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);let l=r[0].spatialReference;return(await N(`multiPartToSinglePart`,[r[0].asJsonGeometry(),a(r[0].spatialReference)])).map(e=>P(e,l)).filter(e=>e!=null)})},z.functions.isselfintersecting=function(e,t){return z.standardFunctionAsync(e,t,async(e,t,n)=>{s(n,1,1,t),n=o(n);let r=n[0];if((L(n[0])||p(n[0]))&&(r=C(n[0],e.spatialReference)),r==null)return!1;if(c(r))return await N(`isSelfIntersecting`,[r.asJsonGeometry(),a(r.spatialReference)]);throw new i(`InvalidParameter`,t)})},z.functions.issimple=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>{if(r=o(r),s(r,1,1,t),r[0]===null)return!0;if(!c(r[0]))throw new i(`InvalidParameter`,t);return N(`isSimple`,[r[0].asJsonGeometry(),a(r[0].spatialReference)])})},z.functions.simplify=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,1,1,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);return P(await N(`simplify`,[r[0].asJsonGeometry(),a(r[0].spatialReference)]),r[0].spatialReference)})},z.functions.convexhull=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,1,1,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);return P(await N(`convexHull`,[r[0].asJsonGeometry()]),r[0].spatialReference)})},z.functions.getuser=function(r,a){return z.standardFunctionAsync(r,a,async(o,c,l)=>{s(l,0,2,a);let u=b(l[1],``),d=u===!0;if(u=u===!0||u===!1?``:f(u),l.length===0||l[0]instanceof e){let e=x(r,l.length>0?l[0]:null),n=await I(e,u,d);return n==null?null:t(JSON.parse(JSON.stringify(n)),!0,!1)}let p=null;if(g(l[0])&&(p=l[0]),p){if(d=!1,u)return null;await p.load();let i=await p.getOwningSystemUrl();if(!i){if(!u){let e=await p.getIdentityUser();return e==null?null:n({username:e})}return null}let a=x(r,new e(i)),o=await I(a,u,d);return o==null?null:t(JSON.parse(JSON.stringify(o)),!0,!1)}throw new i(`InvalidParameter`,a)})},z.functions.nearestcoordinate=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,a)=>{if(a=o(a),s(a,2,2,t),a[0]==null||a[1]==null)return null;if(!c(a[0])||!_(a[1]))throw new i(`InvalidParameter`,t);let l=await N(`getNearestCoordinate`,[a[0].asJsonGeometry(),a[1].asJsonGeometry()]);return l==null?null:r.createMutable({__proto__:null,coordinate:F(`point`,l.coordinate,a[0].spatialReference),distance:l.distance,sideOfLine:l.sideOfLine})})},z.functions.nearestvertex=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,a)=>{if(a=o(a),s(a,2,2,t),a[0]==null||a[1]==null)return null;if(!c(a[0])||!_(a[1]))throw new i(`InvalidParameter`,t);let l=await N(`getNearestVertex`,[a[0].asJsonGeometry(),a[1].asJsonGeometry()]);return l==null?null:r.createMutable({__proto__:null,coordinate:F(`point`,l.coordinate,a[0].spatialReference),distance:l.distance,sideOfLine:l.sideOfLine})})})}export{z as registerFunctions};
|
|
2
|
+
import e from"../ArcadePortal.js";import{convertJsonValueToArcadeValue as t,convertJsonValueToImmutableArcadeValue as n}from"../containerUtils.js";import r from"../Dictionary.js";import{ArcadeExecutionError as i}from"../executionError.js";import{getSpatialReferenceAsGxJson as a}from"../geometry.js";import{H as o,E as s,d as c,f as l,r as u,q as d,w as f,g as p,J as m,K as h,k as g,L as _,v,M as y,N as b}from"../../chunks/languageUtils.js";import{getPortal as x}from"../portalUtils.js";import{autoCastArrayOfPointsToPolygon as S,autoCastArrayOfPointsToPolyline as C,autoCastArrayOfPointsToMultiPoint as w}from"../geometry/arrayOfPointsConversions.js";import{commonRelationsCheck as T,toGxCurveType as E,planarLength3D as D,toGxOffsetJoinType as O,toCentroidAlgorithm as k,measureToCoordinateFunc as A,pointToCoordinateFunc as j,distanceToCoordinateFunc as M}from"../geometry/functions.js";import{invokeRemoteGeometryOp as N}from"../geometry/operatorsWorkerConnection.js";import{createArcadeGeometryFromUnknownJsonGeometry as P,createArcadeGeometryFromJsonGeometry as F}from"../geometry/adapters/json.js";import{lookupUser as I}from"../../portal/support/utils.js";import{isArray as L}from"../../support/guards.js";function R(e){if(e==null)return e;switch(typeof e){case`string`:case`number`:return e;default:throw new i(`InvalidParameter`,null)}}function z(z){z.mode===`async`&&(z.functions.disjoint=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null||N(`disjoint`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)])))},z.functions.intersects=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:(await N(`intersects`,[r[0].asJsonGeometry(),[r[1].asJsonGeometry()],a(r[0].spatialReference)]))[0]))},z.functions.touches=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:(await N(`touches`,[r[0].asJsonGeometry(),[r[1].asJsonGeometry()],a(r[0].spatialReference)]))[0]))},z.functions.crosses=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:(await N(`crosses`,[r[0].asJsonGeometry(),[r[1].asJsonGeometry()],a(r[0].spatialReference)]))[0]))},z.functions.within=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:(await N(`within`,[r[0].asJsonGeometry(),[r[1].asJsonGeometry()],a(r[0].spatialReference)]))[0]))},z.functions.contains=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:(await N(`contains`,[r[0].asJsonGeometry(),[r[1].asJsonGeometry()],a(r[0].spatialReference)]))[0]))},z.functions.overlaps=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?!1:(await N(`overlaps`,[r[0].asJsonGeometry(),[r[1].asJsonGeometry()],a(r[0].spatialReference)]))[0]))},z.functions.equals=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>(s(r,2,2,t),r[0]===r[1]?!0:c(r[0])&&c(r[1])?N(`equals`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)]):l(r[0])&&l(r[1])||u(r[0])&&u(r[1])||d(r[0])&&d(r[1])?r[0].equals(r[1]):!1))},z.functions.relate=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,3,3,t),c(r[0])&&c(r[1]))return(await N(`relate`,[r[0].asJsonGeometry(),[r[1].asJsonGeometry()],a(r[0].spatialReference),f(r[2])]))[0];if(c(r[0])&&r[1]===null||c(r[1])&&r[0]===null||r[0]===null&&r[1]===null)return!1;throw new i(`InvalidParameter`,t)})},z.functions.intersection=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null||r[1]===null?null:P(await N(`intersection`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)]),r[0].spatialReference)))},z.functions.union=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),r.length===0)throw new i(`WrongNumberOfParameters`,t);let s=[];if(r.length===1){if(L(r[0])){for(let e of o(r[0]))if(e!==null){if(!c(e))throw new i(`InvalidParameter`,t);s.push(e)}}else if(p(r[0])){for(let e of o(r[0].toArray()))if(e!==null){if(!c(e))throw new i(`InvalidParameter`,t);s.push(e)}}else if(c(r[0]))return r[0].clone();else if(r[0]===null)return null;else throw new i(`InvalidParameter`,t)}else for(let e of r)if(e!==null){if(!c(e))throw new i(`InvalidParameter`,t);s.push(e)}if(s.length===0)return null;let l=s[0].spatialReference;return P(await N(`union`,[s.map(e=>e.asJsonGeometry()),a(l)]),l)})},z.functions.difference=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null?null:r[1]===null?r[0].clone():P(await N(`difference`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)]),r[0].spatialReference)))},z.functions.symmetricdifference=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>(r=o(r),T(r,t),r[0]===null&&r[1]===null?null:r[0]===null?r[1]?.clone()??null:r[1]===null?r[0]?.clone()??null:P(await N(`symmetricDifference`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)]),r[0].spatialReference)))},z.functions.clip=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,2,2,t),!m(r[1])&&r[1]!==null)throw new i(`InvalidParameter`,t);if(r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);return r[1]===null?null:P(await N(`clip`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)]),r[0].spatialReference)})},z.functions.cut=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,2,2,t),!h(r[1])&&r[1]!==null)throw new i(`InvalidParameter`,t);if(r[0]===null)return[];if(!c(r[0]))throw new i(`InvalidParameter`,t);if(r[1]===null)return[r[0].clone()];let l=r[0].spatialReference;return(await N(`cut`,[r[0].asJsonGeometry(),r[1].asJsonGeometry(),a(r[0].spatialReference)])).map(e=>P(e,l)).filter(e=>e!=null)})},z.functions.area=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{if(s(l,1,2,t),l=o(l),g(l[0])){let n=await l[0].sumArea(R(l[1]),null,e.abortSignal);if(e.abortSignal.aborted)throw new i(`Cancelled`,t);return n}let u=l[0];if((L(u)||p(u))&&(u=S(l[0],e.spatialReference)),u===null)return 0;if(!c(u))throw new i(`InvalidParameter`,t);return N(`area`,[u.asJsonGeometry(),a(u.spatialReference),R(l[1])])})},z.functions.areageodetic=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{s(l,1,3,t),l=o(l);let u=l[0];(L(u)||p(u))&&(u=S(u,e.spatialReference));let d=R(l[1]),f=E(l[2]);if(g(u)){let n=await u.sumArea(d,f,e.abortSignal);if(e.abortSignal.aborted)throw new i(`Cancelled`,t);return n}if(u==null)return 0;if(!c(u))throw new i(`InvalidParameter`,t);return N(`geodeticArea`,[u.asJsonGeometry(),a(u.spatialReference),d,f])})},z.functions.length=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{if(s(l,1,2,t),l=o(l),g(l[0])){let n=await l[0].sumLength(R(l[1]),null,e.abortSignal);if(e.abortSignal.aborted)throw new i(`Cancelled`,t);return n}let u=l[0];if((L(l[0])||p(l[0]))&&(u=C(l[0],e.spatialReference)),u===null)return 0;if(!c(u))throw new i(`InvalidParameter`,t);return N(`length`,[u.asJsonGeometry(),a(u.spatialReference),R(l[1])])})},z.functions.length3d=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{if(s(l,1,2,t),l=o(l),l[0]===null)return 0;let u=l[0];if((L(l[0])||p(l[0]))&&(u=C(l[0],e.spatialReference)),u===null)return 0;if(!c(u))throw new i(`InvalidParameter`,t);if(u.hasZ===!0){let{convertFromSpatialReferenceUnit:e,toLengthUnit:t}=await import(`../geometry/unitConversion.js`),n=D(u);return e(u.spatialReference,t(l[1]),n)}return N(`length`,[u.asJsonGeometry(),a(u.spatialReference),R(l[1])])})},z.functions.lengthgeodetic=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{s(l,1,3,t),l=o(l);let u=l[0];(L(l[0])||p(l[0]))&&(u=C(l[0],e.spatialReference));let d=R(l[1]),f=E(l[2]);if(g(u)){let n=await u.sumLength(d,f,e.abortSignal);if(e.abortSignal.aborted)throw new i(`Cancelled`,t);return n}if(u===null)return 0;if(!c(u))throw new i(`InvalidParameter`,t);return N(`geodeticLength`,[u.asJsonGeometry(),a(u.spatialReference),d,f])})},z.functions.distance=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,l)=>{l=o(l),s(l,2,3,t);let u=l[0];if((L(l[0])||p(l[0]))&&(u=w(l[0],e.spatialReference)),!c(u))throw new i(`InvalidParameter`,t);let d=l[1];if((L(l[1])||p(l[1]))&&(d=w(l[1],e.spatialReference)),!c(d))throw new i(`InvalidParameter`,t);return N(`distance`,[u.asJsonGeometry(),d.asJsonGeometry(),a(u.spatialReference),R(l[2])])})},z.functions.distancegeodetic=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{r=o(r),s(r,2,4,t);let c=r[0];if(!_(c))throw new i(`InvalidParameter`,t);let l=r[1];if(!_(l))throw new i(`InvalidParameter`,t);return N(`geodeticDistance`,[c.asJsonGeometry(),l.asJsonGeometry(),a(c.spatialReference),R(r[2]),E(r[3])])})},z.functions.densify=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,2,3,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);let l=v(r[1]);if(isNaN(l)||l<=0)throw new i(`InvalidParameter`,t);switch(r[0].type){case`polygon`:case`polyline`:case`extent`:return P(await N(`densify`,[r[0].asJsonGeometry(),a(r[0].spatialReference),l,R(r[2])]),r[0].spatialReference);default:return r[0]}})},z.functions.densifygeodetic=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{r=o(r),s(r,2,4,t);let l=r[0];if(l==null)return null;if(!c(l))throw new i(`InvalidParameter`,t);let u=v(r[1]);if(isNaN(u)||u<=0)throw new i(`InvalidParameter`,t);let d=R(r[2]),f=E(r[3]);switch(l.type){case`polygon`:case`polyline`:case`extent`:return P(await N(`geodeticDensify`,[l.asJsonGeometry(),a(l.spatialReference),u,d,f]),l.spatialReference);default:return l}})},z.functions.generalize=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,2,4,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);let l=v(r[1]);if(isNaN(l))throw new i(`InvalidParameter`,t);let u=y(b(r[2],!0));return P(await N(`generalize`,[r[0].asJsonGeometry(),a(r[0].spatialReference),l,R(r[3]),u]),r[0].spatialReference)})},z.functions.buffer=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,2,3,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);let l=v(r[1]);if(isNaN(l))throw new i(`InvalidParameter`,t);return l===0?r[0].clone():P(await N(`buffer`,[r[0].asJsonGeometry(),a(r[0].spatialReference),l,R(r[2])]),r[0].spatialReference)})},z.functions.buffergeodetic=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{r=o(r),s(r,2,4,t);let l=r[0];if(l==null)return null;if(!c(l))throw new i(`InvalidParameter`,t);let u=v(r[1]);if(isNaN(u))throw new i(`InvalidParameter`,t);if(u===0)return l.clone();let d=R(r[2]),f=E(r[3]);return P(await N(`geodesicBuffer`,[l.asJsonGeometry(),a(l.spatialReference),u,d,f]),l.spatialReference)})},z.functions.offset=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{r=o(r),s(r,2,6,t);let l=r[0];if(l===null)return null;if(!c(l)||l.type!==`polygon`&&l.type!==`polyline`)throw new i(`InvalidParameter`,t);let u=v(r[1]);if(isNaN(u))throw new i(`InvalidParameter`,t);let d=r[2],f=O(r[3]),p=v(b(r[4],10));if(isNaN(p))throw new i(`InvalidParameter`,t);let m=v(b(r[5],0));if(isNaN(m))throw new i(`InvalidParameter`,t);return P(await N(`offset`,[l.asJsonGeometry(),a(l.spatialReference),u,R(d),f,p,m]),l.spatialReference)})},z.functions.rotate=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{r=o(r),s(r,2,3,t);let a=r[0];if(a===null)return null;if(!c(a))throw new i(`InvalidParameter`,t);let l=v(r[1]);if(!Number.isFinite(l))throw new i(`InvalidParameter`,t);let u=r[2];if(u!=null&&!_(u))throw new i(`InvalidParameter`,t);let d=u?.asJsonLikeGeometry();return P(await N(`rotate`,[a.asJsonGeometry(),l,d?.x,d?.y]),a.spatialReference)})},z.functions.centroid=function(e,t){return z.standardFunctionAsync(e,t,async(n,r,a)=>{if(a=o(a),s(a,1,2,t),a[0]===null)return null;let l=k(a[1]),u=a[0];if((L(a[0])||p(a[0]))&&(u=l===`geometric`?w(a[0],e.spatialReference):S(a[0],e.spatialReference),u===null))return null;if(!c(u))throw new i(`InvalidParameter`,t);return l===`geometric`?F(`point`,await N(`centroid`,[u.asJsonGeometry()]),u.spatialReference):F(`point`,await N(`labelPoint`,[u.asJsonGeometry()]),u.spatialReference)})},z.functions.measuretocoordinate=function(e,t){return z.standardFunctionAsync(e,t,A)},z.functions.pointtocoordinate=function(e,t){return z.standardFunctionAsync(e,t,j)},z.functions.distancetocoordinate=function(e,t){return z.standardFunctionAsync(e,t,M)},z.functions.multiparttosinglepart=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,1,1,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);let l=r[0].spatialReference;return(await N(`multiPartToSinglePart`,[r[0].asJsonGeometry(),a(r[0].spatialReference)])).map(e=>P(e,l)).filter(e=>e!=null)})},z.functions.isselfintersecting=function(e,t){return z.standardFunctionAsync(e,t,async(e,t,n)=>{s(n,1,1,t),n=o(n);let r=n[0];if((L(n[0])||p(n[0]))&&(r=C(n[0],e.spatialReference)),r==null)return!1;if(c(r))return await N(`isSelfIntersecting`,[r.asJsonGeometry(),a(r.spatialReference)]);throw new i(`InvalidParameter`,t)})},z.functions.issimple=function(e,t){return z.standardFunctionAsync(e,t,(e,n,r)=>{if(r=o(r),s(r,1,1,t),r[0]===null)return!0;if(!c(r[0]))throw new i(`InvalidParameter`,t);return N(`isSimple`,[r[0].asJsonGeometry(),a(r[0].spatialReference)])})},z.functions.simplify=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,1,1,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);return P(await N(`simplify`,[r[0].asJsonGeometry(),a(r[0].spatialReference)]),r[0].spatialReference)})},z.functions.convexhull=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,r)=>{if(r=o(r),s(r,1,1,t),r[0]===null)return null;if(!c(r[0]))throw new i(`InvalidParameter`,t);return P(await N(`convexHull`,[r[0].asJsonGeometry()]),r[0].spatialReference)})},z.functions.getuser=function(r,a){return z.standardFunctionAsync(r,a,async(o,c,l)=>{s(l,0,2,a);let u=b(l[1],``),d=u===!0;if(u=u===!0||u===!1?``:f(u),l.length===0||l[0]instanceof e){let e=x(r,l.length>0?l[0]:null),n=await I(e,u,d);return n==null?null:t(JSON.parse(JSON.stringify(n)),!0,!1)}let p=null;if(g(l[0])&&(p=l[0]),p){if(d=!1,u)return null;await p.load();let i=await p.getOwningSystemUrl();if(!i){if(!u){let e=await p.getIdentityUser();return e==null?null:n({username:e})}return null}let a=x(r,new e(i)),o=await I(a,u,d);return o==null?null:t(JSON.parse(JSON.stringify(o)),!0,!1)}throw new i(`InvalidParameter`,a)})},z.functions.nearestcoordinate=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,a)=>{if(a=o(a),s(a,2,2,t),a[0]==null||a[1]==null)return null;if(!c(a[0])||!_(a[1]))throw new i(`InvalidParameter`,t);let l=await N(`getNearestCoordinate`,[a[0].asJsonGeometry(),a[1].asJsonGeometry()]);return l==null?null:r.createMutable({__proto__:null,coordinate:F(`point`,l.coordinate,a[0].spatialReference),distance:l.distance,sideOfLine:l.sideOfLine})})},z.functions.nearestvertex=function(e,t){return z.standardFunctionAsync(e,t,async(e,n,a)=>{if(a=o(a),s(a,2,2,t),a[0]==null||a[1]==null)return null;if(!c(a[0])||!_(a[1]))throw new i(`InvalidParameter`,t);let l=await N(`getNearestVertex`,[a[0].asJsonGeometry(),a[1].asJsonGeometry()]);return l==null?null:r.createMutable({__proto__:null,coordinate:F(`point`,l.coordinate,a[0].spatialReference),distance:l.distance,sideOfLine:l.sideOfLine})})})}export{z as registerFunctions};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{fromGeometryToGXGeometry as e,toGeometry as t,fromSpatialReference as n}from"../../geometry/operators/support/jsonConverter.js";function r(e,t){let n;return{loaded:!1,load(){return n??=t().then(t=>{
|
|
2
|
+
import{fromGeometryToGXGeometry as e,toGeometry as t,fromSpatialReference as n}from"../../geometry/operators/support/jsonConverter.js";function r(e,t){let n;return{loaded:!1,load(){return n??=t().then(t=>{o[e]={loaded:!0,execute:t}})}}}let i=0;const a=new Map,o={createGeometryReference:r(`createGeometryReference`,async()=>t=>{let n=i++;return a.set(n,e(t)),n}),deleteGeometryReference:{loaded:!0,execute(e){a.delete(e)}},disjoint:r(`disjoint`,async()=>{let{OperatorDisjoint:t}=await import(`../../chunks/OperatorDisjoint.js`),r=new t;return(t,i,a)=>r.execute(e(t),e(i),n(a),null)}),intersects:r(`intersects`,async()=>{let{OperatorIntersects:t}=await import(`../../chunks/OperatorIntersects.js`),r=new t;return(t,i,o,s=!1)=>{let c=typeof t==`number`?a.get(t):e(t),l=n(o);return s&&r.accelerateGeometry(c,l,1),i.map(t=>t!=null&&r.execute(c,e(t),l,null))}}),touches:r(`touches`,async()=>{let{OperatorTouches:t}=await import(`../../chunks/OperatorTouches.js`),r=new t;return(t,i,o,s=!1)=>{let c=typeof t==`number`?a.get(t):e(t),l=n(o);return s&&r.accelerateGeometry(c,l,1),i.map(t=>t!=null&&r.execute(c,e(t),l,null))}}),crosses:r(`crosses`,async()=>{let{OperatorCrosses:t}=await import(`../../chunks/OperatorCrosses.js`),r=new t;return(t,i,o,s=!1)=>{let c=typeof t==`number`?a.get(t):e(t),l=n(o);return s&&r.accelerateGeometry(c,l,1),i.map(t=>t!=null&&r.execute(c,e(t),l,null))}}),within:r(`within`,async()=>{let{OperatorWithin:t}=await import(`../../chunks/OperatorWithin.js`),r=new t;return(t,i,o,s=!1)=>{let c=typeof t==`number`?a.get(t):e(t),l=n(o);return s&&r.accelerateGeometry(c,l,1),i.map(t=>t!=null&&r.execute(c,e(t),l,null))}}),contains:r(`contains`,async()=>{let{OperatorContains:t}=await import(`../../chunks/OperatorContains.js`),r=new t;return(t,i,o,s=!1)=>{let c=typeof t==`number`?a.get(t):e(t),l=n(o);return s&&r.accelerateGeometry(c,l,1),i.map(t=>t!=null&&r.execute(c,e(t),l,null))}}),overlaps:r(`overlaps`,async()=>{let{OperatorOverlaps:t}=await import(`../../chunks/OperatorOverlaps.js`),r=new t;return(t,i,o,s=!1)=>{let c=typeof t==`number`?a.get(t):e(t),l=n(o);return s&&r.accelerateGeometry(c,l,1),i.map(t=>t!=null&&r.execute(c,e(t),l,null))}}),equals:r(`equals`,async()=>{let{OperatorEquals:t}=await import(`../../chunks/OperatorEquals.js`),r=new t;return(t,i,a)=>r.execute(e(t),e(i),n(a),null)}),relate:r(`relate`,async()=>{let{OperatorRelate:t}=await import(`../../chunks/OperatorRelate.js`),r=new t;return(t,i,o,s,c=!1)=>{let l=typeof t==`number`?a.get(t):e(t),u=n(o);return c&&r.accelerateGeometry(l,u,1),i.map(t=>t!=null&&r.execute(l,e(t),u,s,null))}}),intersection:r(`intersection`,async()=>{let{execute:r}=await import(`../../geometry/operators/gx/operatorIntersection.js`);return(i,a,o)=>t(r(e(i),e(a),n(o)),null)}),union:r(`union`,async()=>{let{executeMany:r}=await import(`../../geometry/operators/gx/operatorUnion.js`);return(i,a)=>t(r(i.map(t=>e(t)),n(a)),null)}),difference:r(`difference`,async()=>{let{execute:r}=await import(`../../geometry/operators/gx/operatorDifference.js`);return(i,a,o)=>t(r(e(i),e(a),n(o)),null)}),symmetricDifference:r(`symmetricDifference`,async()=>{let{execute:r}=await import(`../../geometry/operators/gx/operatorSymmetricDifference.js`);return(i,a,o)=>t(r(e(i),e(a),n(o)),null)}),clip:r(`clip`,async()=>{let{execute:r}=await import(`../../geometry/operators/gx/operatorClip.js`);return(i,a,o)=>t(r(e(i),e(a).asEnvelope2D(),n(o)),null)}),cut:r(`cut`,async()=>{let{execute:r}=await import(`../../geometry/operators/gx/operatorCut.js`);return(i,a,o)=>r(e(i),e(a),n(o)).map(e=>t(e,null)).filter(e=>e!=null)}),area:r(`area`,async()=>{let{convertFromSpatialReferenceUnit:t,toAreaUnit:n}=await import(`./unitConversion.js`);return(r,i,a)=>{let o=e(r).calculateArea2D();return t(i,n(a),o)}}),geodeticArea:r(`geodeticArea`,async()=>{let{load:t,execute:r}=await import(`../../geometry/operators/gx/operatorGeodeticArea.js`),{convert:i,squareMeters:a,toAreaUnit:o}=await import(`./unitConversion.js`);return await t(),(t,s,c,l)=>{let u=r(e(t),n(s),l);return i(a,o(c),u)}}),length:r(`length`,async()=>{let{convertFromSpatialReferenceUnit:t,toLengthUnit:n}=await import(`./unitConversion.js`);return(r,i,a)=>{let o=e(r).calculateLength2D();return t(i,n(a),o)}}),geodeticLength:r(`geodeticLength`,async()=>{let{load:t,execute:r}=await import(`../../geometry/operators/gx/operatorGeodeticLength.js`),{convert:i,meters:a,toLengthUnit:o}=await import(`./unitConversion.js`);return await t(),(t,s,c,l)=>{let u=r(e(t),n(s),l);return i(a,o(c),u)}}),distance:r(`distance`,async()=>{let{OperatorDistance:t}=await import(`../../chunks/OperatorDistance.js`),{convertFromSpatialReferenceUnit:n,toLengthUnit:r}=await import(`./unitConversion.js`),i=new t;return(t,a,o,s)=>{let c=i.execute(e(t),e(a),null);return n(o,r(s),c)}}),geodeticDistance:r(`geodeticDistance`,async()=>{let{load:t,execute:r}=await import(`../../geometry/operators/gx/operatorGeodeticDistance.js`),{convert:i,meters:a,toLengthUnit:o}=await import(`./unitConversion.js`);return await t(),(t,s,c,l,u)=>{let d=r(e(t),e(s),n(c),u);return i(a,o(l),d)}}),densify:r(`densify`,async()=>{let{execute:n}=await import(`../../geometry/operators/gx/operatorDensify.js`),{convertToSpatialReferenceUnit:r,toLengthUnit:i}=await import(`./unitConversion.js`);return(a,o,s,c)=>(s=r(i(c),o,s),t(n(e(a),s,0,0),null))}),geodeticDensify:r(`geodeticDensify`,async()=>{let{load:r,execute:i}=await import(`../../geometry/operators/gx/operatorGeodeticDensify.js`),{convert:a,meters:o,toLengthUnit:s}=await import(`./unitConversion.js`);return await r(),(r,c,l,u,d)=>(l=a(s(u),o,l),t(i(e(r),l,n(c),d),null))}),generalize:r(`generalize`,async()=>{let{execute:n}=await import(`../../geometry/operators/gx/operatorGeneralize.js`),{convertToSpatialReferenceUnit:r,toLengthUnit:i}=await import(`./unitConversion.js`);return(a,o,s,c,l)=>(s=r(i(c),o,s),t(n(e(a),s,l),null))}),buffer:r(`buffer`,async()=>{let{execute:r}=await import(`../../geometry/operators/gx/operatorBuffer.js`),{convertToSpatialReferenceUnit:i,toLengthUnit:a}=await import(`./unitConversion.js`);return(o,s,c,l)=>(c=i(a(l),s,c),t(r(e(o),n(s),c),null))}),geodesicBuffer:r(`geodesicBuffer`,async()=>{let{load:r,execute:i}=await import(`../../geometry/operators/gx/operatorGeodesicBuffer.js`),{convert:a,meters:o,toLengthUnit:s}=await import(`./unitConversion.js`);return await r(),(r,c,l,u,d)=>(l=a(s(u),o,l),t(i(e(r),n(c),d,l,NaN),null))}),offset:r(`offset`,async()=>{let{execute:r}=await import(`../../geometry/operators/gx/operatorOffset.js`),{convertToSpatialReferenceUnit:i,toLengthUnit:a}=await import(`./unitConversion.js`);return(o,s,c,l,u,d,f)=>(c=i(a(l),s,c),t(r(e(o),n(s),c,u,d,f),null))}),rotate:r(`rotate`,async()=>{let{executeRotate:n}=await import(`./rotate.js`);return(r,i,a,o)=>t(n(e(r),i,a,o),null)}),centroid:r(`centroid`,async()=>{let{OperatorCentroid2D:t}=await import(`../../chunks/OperatorCentroid2D.js`),n=new t;return t=>{let r=n.execute(e(t),null);return r.isNAN()?null:{x:r.x,y:r.y}}}),labelPoint:r(`labelPoint`,async()=>{let{execute:n}=await import(`../../geometry/operators/gx/operatorLabelPoint.js`);return r=>t(n(e(r)),null)}),multiPartToSinglePart:r(`multiPartToSinglePart`,async()=>{let{executeMany:r}=await import(`../../geometry/operators/gx/operatorMultiPartToSinglePart.js`);return(i,a)=>r([e(i)],n(a)).map(e=>t(e,null)).filter(e=>e!=null)}),isSelfIntersecting:r(`isSelfIntersecting`,async()=>{let{executeIsSelfIntersecting:t}=await import(`./isSelfIntersecting.js`);return(r,i)=>t(e(r),n(i))}),isSimple:r(`isSimple`,async()=>{let{isSimpleAsFeature:t}=await import(`../../geometry/operators/gx/operatorSimplify.js`);return(r,i)=>t(e(r),n(i),!1)}),simplify:r(`simplify`,async()=>{let{execute:r}=await import(`../../geometry/operators/gx/operatorSimplify.js`);return(i,a)=>t(r(e(i),n(a),!1),null)}),convexHull:r(`convexHull`,async()=>{let{execute:n}=await import(`../../geometry/operators/gx/operatorConvexHull.js`);return r=>t(n(e(r)),null)}),getNearestCoordinate:r(`getNearestCoordinate`,async()=>{let{executeNearestCoordinate:n}=await import(`./nearestCoordinate.js`);return(r,i)=>{let a=n(e(r),e(i));return a==null?null:{...a,coordinate:t(a.coordinate,null)}}}),getNearestVertex:r(`getNearestVertex`,async()=>{let{executeNearestVertex:n}=await import(`./nearestVertex.js`);return(r,i)=>{let a=n(e(r),e(i));return a==null?null:{...a,coordinate:t(a.coordinate,null)}}})};function s(e,t){let n=o[e];return n.loaded?n.execute.apply(void 0,t):n.load().then(()=>s(e,t))}export{s as invokeGeometryOp};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
|
|
2
|
-
import{open as e}from"../../core/workers.js";let t,n=!1,r;function i(){return t??=e(`arcadeGeometryOperatorsWorker`).then(e=>{r=e,n=!0,t=void 0})}async function a(e,t){return n?r.apply(`invokeGeometryOp`,[e,t]):(await i(),a(e,t))}export{a as invokeRemoteGeometryOp};
|
|
2
|
+
import{open as e}from"../../core/workers.js";let t,n=!1,r;function i(){return t??=e(`arcadeGeometryOperatorsWorker`,{strategy:`dedicated`}).then(e=>{r=e,n=!0,t=void 0})}async function a(e,t){return n?r.apply(`invokeGeometryOp`,[e,t]):(await i(),a(e,t))}const o=new FinalizationRegistry(e=>void a(`deleteGeometryReference`,[e]));class s{constructor(e){this.ref=e,this._unregisterToken={},o.register(this,this.ref,this._unregisterToken)}async[Symbol.asyncDispose](){o.unregister(this._unregisterToken)&&await a(`deleteGeometryReference`,[this.ref])}}async function c(e){let t=await a(`createGeometryReference`,[e]);return new s(t)}export{s as RemoteGeometry,c as createRemoteGeometryReference,a as invokeRemoteGeometryOp};
|
package/arcgisGlobal.d.ts
CHANGED
|
@@ -223,6 +223,9 @@ export interface ArcgisImportModules {
|
|
|
223
223
|
"@arcgis/core/geometry/constructGeometryxFromFlat.js": typeof import("./geometry/constructGeometryxFromFlat.js");
|
|
224
224
|
"@arcgis/core/geometry/coordinateFormatter.js": typeof import("./geometry/coordinateFormatter.js");
|
|
225
225
|
"@arcgis/core/geometry/geometryEngine.js": typeof import("./geometry/geometryEngine.js");
|
|
226
|
+
"@arcgis/core/geometry/coordinateConversion/CoordinateConversionModel.js": typeof import("./geometry/coordinateConversion/CoordinateConversionModel.js").default;
|
|
227
|
+
"@arcgis/core/geometry/coordinateConversion/support/Conversion.js": typeof import("./geometry/coordinateConversion/support/Conversion.js").default;
|
|
228
|
+
"@arcgis/core/geometry/coordinateConversion/support/Format.js": typeof import("./geometry/coordinateConversion/support/Format.js").default;
|
|
226
229
|
"@arcgis/core/geometry/operators/affineTransformOperator.js": typeof import("./geometry/operators/affineTransformOperator.js");
|
|
227
230
|
"@arcgis/core/geometry/operators/alphaShapeOperator.js": typeof import("./geometry/operators/alphaShapeOperator.js");
|
|
228
231
|
"@arcgis/core/geometry/operators/areaOperator.js": typeof import("./geometry/operators/areaOperator.js");
|
|
@@ -1050,6 +1053,7 @@ export interface ArcgisImportModules {
|
|
|
1050
1053
|
"@arcgis/core/tables/support/templateUtils.js": typeof import("./tables/support/templateUtils.js");
|
|
1051
1054
|
"@arcgis/core/time/TimeExtent.js": typeof import("./time/TimeExtent.js").default;
|
|
1052
1055
|
"@arcgis/core/time/TimeInterval.js": typeof import("./time/TimeInterval.js").default;
|
|
1056
|
+
"@arcgis/core/time/daylightUtils.js": typeof import("./time/daylightUtils.js");
|
|
1053
1057
|
"@arcgis/core/versionManagement/VersionManagementService.js": typeof import("./versionManagement/VersionManagementService.js").default;
|
|
1054
1058
|
"@arcgis/core/versionManagement/VersionManager.js": typeof import("./versionManagement/VersionManager.js").default;
|
|
1055
1059
|
"@arcgis/core/versionManagement/VersioningState.js": typeof import("./versionManagement/VersioningState.js").default;
|