@arcgis/core 4.32.0-next.20250105 → 4.32.0-next.20250107
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/AttributeBinsGraphic.js +5 -0
- package/README.md +1 -1
- package/applications/MapViewer/templateUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/000771f8eefcd6af0fda.js +1 -0
- package/assets/esri/core/workers/chunks/{9372d08ba8bf3342c48f.js → 011ccfd3acee83e7dc68.js} +1 -1
- package/assets/esri/core/workers/chunks/03af4a51043677ffcd0f.js +1 -0
- package/assets/esri/core/workers/chunks/{d07da8b63d83af179a2c.js → 05943caacfd28c383810.js} +1 -1
- package/assets/esri/core/workers/chunks/{9f495ad57cdbfa90c5b8.js → 095aeb19e2207c8361ca.js} +1 -1
- package/assets/esri/core/workers/chunks/{67c7bdc0c91a8f803ea8.js → 11cb25dfab7c8467897a.js} +1 -1
- package/assets/esri/core/workers/chunks/{42aa697b4718b75b8cb2.js → 1abeba63bf623a746d5c.js} +2 -2
- package/assets/esri/core/workers/chunks/{42aa697b4718b75b8cb2.js.LICENSE.txt → 1abeba63bf623a746d5c.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{a57cead317eb2fc9afd8.js → 206194cf069ad4bcc3ad.js} +1 -1
- package/assets/esri/core/workers/chunks/{0673d811c496143fc3d4.js → 2779cf112299b612a73a.js} +1 -1
- package/assets/esri/core/workers/chunks/{bd37c9cc720587665fd3.js → 304b88ade7551130ad3a.js} +1 -1
- package/assets/esri/core/workers/chunks/{aedff36d3fec86abb9fb.js → 30a84ddf0384bb52fdbe.js} +1 -1
- package/assets/esri/core/workers/chunks/{367af4aa7e170c8553e3.js → 33a13544b9e5f4f20bce.js} +1 -1
- package/assets/esri/core/workers/chunks/{dce55e7f76adecc055c3.js → 35d9457109d0631a1ca8.js} +1 -1
- package/assets/esri/core/workers/chunks/{00c0fbe19c12691cf2c3.js → 368a36be515e60e35154.js} +1 -1
- package/assets/esri/core/workers/chunks/{3a90163b76b0bc7f21d2.js → 3767defbd9c4b2e86886.js} +1 -1
- package/assets/esri/core/workers/chunks/3a3e9701e5d7b05f41b7.js +1 -0
- package/assets/esri/core/workers/chunks/{9a498f2c007f4d78d4dd.js → 4234539a9721104acafb.js} +1 -1
- package/assets/esri/core/workers/chunks/{76fa5c7c87831ad25cde.js → 435c037ccba71f1e22d3.js} +1 -1
- package/assets/esri/core/workers/chunks/4387c47ae1b36d770f1d.js +1 -0
- package/assets/esri/core/workers/chunks/{88c68881cbdf4e911832.js → 4423aac6e44c3dbf184e.js} +1 -1
- package/assets/esri/core/workers/chunks/44ec3c77339b9765aaa4.js +1 -0
- package/assets/esri/core/workers/chunks/4b77c8d994498899631a.js +1 -0
- package/assets/esri/core/workers/chunks/62f8949a2d9076f3c1ea.js +2 -0
- package/assets/esri/core/workers/chunks/{c8cd6ba5600d8ff8db0b.js.LICENSE.txt → 62f8949a2d9076f3c1ea.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{664aa401887b59abd7b7.js → 6400f39a965900f66ce7.js} +1 -1
- package/assets/esri/core/workers/chunks/{ddce265c46e4dfeb6c6d.js → 66d40a486aa3caa76106.js} +1 -1
- package/assets/esri/core/workers/chunks/6b3ee691646fbc39445c.js +1 -0
- package/assets/esri/core/workers/chunks/{533a7fd64b17bb294545.js → 6c58f792e2ae3736f662.js} +1 -1
- package/assets/esri/core/workers/chunks/{370b230fd2d7703d0698.js → 6efb36bc2205203ff44d.js} +2 -2
- package/assets/esri/core/workers/chunks/{370b230fd2d7703d0698.js.LICENSE.txt → 6efb36bc2205203ff44d.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{a90611cdc86190799560.js → 7a43fda8984549a084b8.js} +1 -1
- package/assets/esri/core/workers/chunks/7b753da3b8a6d75abf20.js +1 -0
- package/assets/esri/core/workers/chunks/{9b020c47ca9ff5de9bb8.js → 7db356976198c4df76c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{4c56698cf1c669371865.js → 81816410cb1453938593.js} +1 -1
- package/assets/esri/core/workers/chunks/{4ffaa2c5ab47a599ee9f.js → 82266ca8002554198208.js} +1 -1
- package/assets/esri/core/workers/chunks/{f19d3c855f6e93544918.js → 8be0151a24c9af76a976.js} +1 -1
- package/assets/esri/core/workers/chunks/{d9e396adf3354ee68339.js → 8f2b2d2dc9935b0d2039.js} +1 -1
- package/assets/esri/core/workers/chunks/907a91266e25cc4b9d42.js +1 -0
- package/assets/esri/core/workers/chunks/{a77aa86896bbb0e088df.js → 9857491cafa0278d9ae6.js} +1 -1
- package/assets/esri/core/workers/chunks/{993db7646a8fc60179eb.js → 98da074899c82f0ded0b.js} +1 -1
- package/assets/esri/core/workers/chunks/{3bb94da29dac3367ecc6.js → a1edd3f68e691ea39594.js} +1 -1
- package/assets/esri/core/workers/chunks/b07710e01494a6cda097.js +1 -0
- package/assets/esri/core/workers/chunks/{6a4305eb1e52b80ecb5c.js → b8ea84adff5619040494.js} +3 -3
- package/assets/esri/core/workers/chunks/{005727711cca0614c2ab.js → c05e0bd145a1c27d6857.js} +2 -2
- package/assets/esri/core/workers/chunks/{005727711cca0614c2ab.js.LICENSE.txt → c05e0bd145a1c27d6857.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/c4374b6bc5c8dc6435c7.js +1 -0
- package/assets/esri/core/workers/chunks/c49707b577f3805f0142.js +1 -0
- package/assets/esri/core/workers/chunks/c5a928dcff7dc8a8cc9f.js +2 -0
- package/assets/esri/core/workers/chunks/{f4e3db71d1adae717535.js.LICENSE.txt → c5a928dcff7dc8a8cc9f.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/cac79b64a7dade8bf486.js +2 -0
- package/assets/esri/core/workers/chunks/{bf0a0ca7fdac98f06a89.js.LICENSE.txt → cac79b64a7dade8bf486.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{2cccaf50134c65944e0a.js → d0876eed5249b029f9f0.js} +1 -1
- package/assets/esri/core/workers/chunks/{178f606c8896ae5f39de.js → d1dbbab4a4c6072c182f.js} +1 -1
- package/assets/esri/core/workers/chunks/{8e42fb623f56942958d8.js → d74b5dc60f02892d03e7.js} +1 -1
- package/assets/esri/core/workers/chunks/{9ad7d095e614e7e8d7f5.js → dca0eb66116e4b5403fc.js} +1 -1
- package/assets/esri/core/workers/chunks/e27b8674a3492db51f2e.js +1 -0
- package/assets/esri/core/workers/chunks/{756c2f7c8659deab6c96.js → e2d987c39a6ef318511c.js} +2 -2
- package/assets/esri/core/workers/chunks/{756c2f7c8659deab6c96.js.LICENSE.txt → e2d987c39a6ef318511c.js.LICENSE.txt} +1 -1
- package/assets/esri/core/workers/chunks/{943428cf643e87ccfaad.js → e7e26b71f9eb28421936.js} +1 -1
- package/assets/esri/core/workers/chunks/{f0adabf6d71a27f3183b.js → e80b0646a7e0e466ea65.js} +1 -1
- package/assets/esri/core/workers/chunks/e9c21907fabcedbd32ae.js +1 -0
- package/assets/esri/core/workers/chunks/{f9af0473878d960a02f2.js → f6d6bc43ac1c13892d44.js} +1 -1
- package/assets/esri/core/workers/chunks/{3ed7c8138231de3a3b96.js → f8c960df1dabab120c70.js} +1 -1
- package/assets/esri/core/workers/chunks/{fdd8a5eb07466541f1f9.js → fd95b19f02d8dfef2baf.js} +1 -1
- package/assets/esri/widgets/support/GridControls/t9n/GridControls_ja.json +1 -1
- package/chunks/bufferOperator.js +1 -1
- package/chunks/geodesicBufferOperator.js +1 -1
- package/chunks/terrainUtilsPlanar.js +1 -1
- package/chunks/terrainUtilsSpherical.js +1 -1
- package/core/MemCachePool.js +1 -1
- package/geometry/operators/graphicBufferOperator.js +1 -1
- package/geometry/support/meshVertexSpaceUtils.js +1 -1
- package/interfaces.d.ts +101 -5
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/graphics/data/queryUtils.js +1 -1
- package/layers/graphics/data/queryValidationUtils.js +1 -1
- package/layers/graphics/sources/WFSSource.js +1 -1
- package/layers/support/capabilities.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/package.json +2 -2
- package/renderers/RasterStretchRenderer.js +1 -1
- package/rest/query/executeAttributeBinsQuery.js +1 -1
- package/rest/support/AttributeBinsFeatureSet.js +5 -0
- package/rest/support/AttributeBinsQuery.js +1 -1
- package/rest/support/BinParametersAttributes.js +1 -1
- package/rest/support/BinParametersBase.js +1 -1
- package/rest/support/DateBinParameters.js +1 -1
- package/rest/support/FeatureSet.js +1 -1
- package/rest/support/NormalizationBinParametersMixin.js +1 -1
- package/rest/support/Query.js +1 -1
- package/rest/support/TopFeaturesQuery.js +1 -1
- package/smartMapping/renderers/dotDensity.js +1 -1
- package/smartMapping/renderers/pieChart.js +1 -1
- package/smartMapping/statistics/summaryStatisticsForAttributes.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/CIMSymbolDrawHelper.js +1 -1
- package/symbols/cim/cimAnalyzer.js +1 -1
- package/views/2d/engine/Bitmap.js +1 -1
- package/views/2d/engine/BitmapContainer.js +1 -1
- package/views/2d/engine/BitmapTileContainer.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js +1 -1
- package/views/2d/input/MapViewInputManager.js +1 -1
- package/views/2d/input/handlers/DragPan.js +1 -1
- package/views/2d/input/handlers/DragRotate.js +1 -1
- package/views/2d/input/handlers/MouseWheelZoom.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/3d/analysis/Dimension/lengthDimensionUtils.js +1 -1
- package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/input/handlers/DragRotate.js +1 -1
- package/views/3d/input/handlers/DragZoom.js +1 -1
- package/views/3d/input/handlers/MouseWheelZoom.js +1 -1
- package/views/3d/input/handlers/PinchAndPanNavigation.js +1 -1
- package/views/3d/layerViewModuleImportUtils.js +1 -1
- package/views/3d/layers/GroupLayerView3D.js +5 -0
- package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
- package/views/3d/state/NearFarHeuristic.js +1 -1
- package/views/3d/terrain/OverlayManager.js +1 -1
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/terrain/TerrainSurface.js +1 -1
- package/views/3d/terrain/terrainUtilsPlanar.js +1 -1
- package/views/3d/terrain/terrainUtilsSpherical.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/lib/Intersector.js +1 -1
- package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOID.glsl.js +4 -4
- package/views/View2D.js +1 -1
- package/views/draw/support/HighlightHelper.js +1 -1
- package/views/input/handlers/support.js +1 -1
- package/views/layers/DimensionLayerView.js +1 -1
- package/views/navigation/Navigation.js +1 -1
- package/views/navigation/NavigationActionMap.d.ts +4 -0
- package/views/navigation/NavigationActionMap.js +5 -0
- package/views/webgl/Texture.js +1 -1
- package/views/webgl/textureUtils.js +5 -0
- package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileLineView.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/Grid/Grid.js +1 -1
- package/widgets/FeatureTable/support/tableUtils.js +1 -1
- package/widgets/NavigationToggle/NavigationToggleViewModel.js +1 -1
- package/widgets/support/ColorPicker.js +1 -1
- package/assets/esri/core/workers/chunks/0a3bf1b74cce1b6b7ed8.js +0 -1
- package/assets/esri/core/workers/chunks/0d2411a941c42acb8cc2.js +0 -1
- package/assets/esri/core/workers/chunks/13720b1d97fb7d80e972.js +0 -1
- package/assets/esri/core/workers/chunks/14b87f3dd9942e6b19d0.js +0 -1
- package/assets/esri/core/workers/chunks/16530347bd78dc6c2fcd.js +0 -1
- package/assets/esri/core/workers/chunks/1a713cc601c6fcd97d2f.js +0 -1
- package/assets/esri/core/workers/chunks/3029354194f1a3030c5c.js +0 -1
- package/assets/esri/core/workers/chunks/318a39b56851e707edad.js +0 -1
- package/assets/esri/core/workers/chunks/53cd990b2c988518de6d.js +0 -1
- package/assets/esri/core/workers/chunks/5a0eb9dfe668cf290462.js +0 -1
- package/assets/esri/core/workers/chunks/9f0ebeae8a3ba360284b.js +0 -1
- package/assets/esri/core/workers/chunks/a3cef3837f4df9ab022e.js +0 -1
- package/assets/esri/core/workers/chunks/bf0a0ca7fdac98f06a89.js +0 -2
- package/assets/esri/core/workers/chunks/c8cd6ba5600d8ff8db0b.js +0 -2
- package/assets/esri/core/workers/chunks/ea250d66089967976c05.js +0 -1
- package/assets/esri/core/workers/chunks/ecf317c6c790b3cc83bf.js +0 -1
- package/assets/esri/core/workers/chunks/f4e3db71d1adae717535.js +0 -2
package/chunks/bufferOperator.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../core/arrayUtils.js";import{convertToSpatialReferenceUnit as r}from"../core/unitUtils.js";import{supportsCurves as t,execute as o,executeManyEx as s}from"../geometry/operators/gx/operatorBuffer.js";import{getSpatialReference as a,
|
|
5
|
+
import{isSome as e}from"../core/arrayUtils.js";import{convertToSpatialReferenceUnit as r}from"../core/unitUtils.js";import{supportsCurves as t,execute as o,executeManyEx as s}from"../geometry/operators/gx/operatorBuffer.js";import{getSpatialReference as a,toPolygon as n,fromSpatialReference as u,fromGeometry as i}from"../geometry/operators/support/apiConverter.js";function p(e,t,s={}){const{unit:p}=s,m=a(e);return p&&(t=r(t,p,m)),n(o(i(e),u(m),t),m)}function m(t,o,p={}){let{maxDeviation:m=NaN,maxVerticesInFullCircle:c=96,union:l=!1,unit:f}=p;const x=a(t);f&&(o=o.map((e=>r(e,f,x))),m&&(m=r(m,f,x)));const j=t.map(i);return s(j,u(x),o,m,c,l).map((e=>n(e,x))).filter(e)}const c=t(),l=Object.freeze(Object.defineProperty({__proto__:null,execute:p,executeMany:m,supportsCurves:c},Symbol.toStringTag,{value:"Module"}));export{m as a,l as b,p as e,c as s};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as e}from"../core/arrayUtils.js";import{convertUnit as t}from"../core/unitUtils.js";import{load as r,supportsCurves as o,execute as s,executeMany as a,isLoaded as i}from"../geometry/operators/gx/operatorGeodesicBuffer.js";import{geodeticCurveType as n}from"../geometry/operators/support/geodeticCurveType.js";let p,u,m,c,
|
|
5
|
+
import{isSome as e}from"../core/arrayUtils.js";import{convertUnit as t}from"../core/unitUtils.js";import{load as r,supportsCurves as o,execute as s,executeMany as a,isLoaded as i}from"../geometry/operators/gx/operatorGeodesicBuffer.js";import{geodeticCurveType as n}from"../geometry/operators/support/geodeticCurveType.js";let p,u,m,c,l;function f(){return!!p&&i()}async function y(){if(!f()){const[e]=await Promise.all([import("../geometry/operators/support/apiConverter.js"),r()]);p=e.fromGeometry,u=e.fromSpatialReference,m=e.getSpatialReference,c=e.toPolygon,l=o()}}function g(e,r,o={}){let{curveType:a="geodesic",maxDeviation:i=NaN,unit:l}=o;l&&(r=t(r,l,"meters"),i&&(i=t(i,l,"meters")));const f=m(e);return c(s(p(e),u(f),n[a],r,i),f)}function d(r,o,s={}){let{curveType:i="geodesic",maxDeviation:l=NaN,union:f=!1,unit:y}=s;y&&(o=o.map((e=>t(e,y,"meters"))),l&&(l=t(l,y,"meters")));const g=r.map(p),d=m(r);return a(g,u(d),n[i],o,l,f).map((e=>c(e,d))).filter(e)}const v=Object.freeze(Object.defineProperty({__proto__:null,execute:g,executeMany:d,isLoaded:f,load:y,get supportsCurves(){return l}},Symbol.toStringTag,{value:"Module"}));export{d as a,g as e,v as g,f as i,y as l,l as s};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../core/Error.js";import{
|
|
5
|
+
import e from"../core/Error.js";import{fromExtent as t,create as o}from"../geometry/support/aaBoundingRect.js";import{isSupportedEarthGCS as r}from"../views/3d/support/supportedSpatialReference.js";import{maxRootTiles as l}from"../views/3d/terrain/TerrainConst.js";import{getMissingTileInfoError as n,TilingScheme as i}from"../views/3d/terrain/TilingScheme.js";function s(t,o,l,s){if(null==t)return n();const a=t.spatialReference;if(a.isGeographic&&!r(a))return new e("tilingscheme:local-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in local scenes");const u=i.checkUnsupported(t);if(null!=u)return u;if(null==l)return new e("tilingscheme:extent-not-exist","The layer does not provide a layer extent.");const p=c(t,l);return p||(null==o||a.equals(o)||o.isWGS84&&a.isWebMercator?null:new e("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the local scene"))}function c(r,n){const s=r.lods,c=s[0].resolution*2**s[0].level,a=[c*r.size[0],c*r.size[1]],u=[r.origin.x,r.origin.y],p=t(n),f=o();i.computeRowColExtent(p,a,u,f);const m=(f[2]-f[0])*(f[3]-f[1]);if(m>l){const t=s[0].scale*2**s[0].level;let o=Math.max((p[3]-p[1])/r.size[1],(p[2]-p[0])/r.size[0])*t/c;const n=Math.floor(Math.log(o)/Math.log(10));return o=Math.ceil(o/10**n)*10**n,new e("tilingscheme:too-many-root-tiles","Scale of level 0 of the tiling scheme (1:"+Math.floor(t).toLocaleString()+") is too large for the layer's extent. Suggested scale: 1:"+o.toLocaleString()+".",{level0Scale:t,suggestedLevel0Scale:o,requiredNumRootTiles:m,allowedNumRootTiles:l})}return null}const a=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:s},Symbol.toStringTag,{value:"Module"}));export{s as c,a as t};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../core/Error.js";import{isSupportedGCSOnGlobe as i}from"../views/3d/support/supportedSpatialReference.js";import{getMissingTileInfoError as t,TilingScheme as
|
|
5
|
+
import e from"../core/Error.js";import{isSupportedGCSOnGlobe as i}from"../views/3d/support/supportedSpatialReference.js";import{getMissingTileInfoError as t,TilingScheme as l}from"../views/3d/terrain/TilingScheme.js";function n(n,r,c,o){if(null==n)return t();const s=n?.lods.length-1,a=n.spatialReference;if(a.isWebMercator){if(!l.makeWebMercatorAuxiliarySphere(s).compatibleWith(n,o))return new e("tilingscheme:incompatible-global-web-mercator","The tiling scheme is not compatible with the ArcGIS Online Web Mercator tiling scheme")}else{if(!i(a))return new e("tilingscheme:global-unsupported-spatial-reference","The tiling scheme spatial reference is not supported in global scenes");if(!l.makeGCSWithTileSize(n.spatialReference,n.size[0],s).compatibleWith(n,o))return n.spatialReference.isWGS84?new e("tilingscheme:incompatible-global-wgs84","The tiling scheme is not compatible with the ArcGIS Online WGS84 tiling scheme"):new e("tilingscheme:incompatible-global","The tiling scheme is not compatible with the ArcGIS Online tiling scheme")}return null==r||n.spatialReference.equals(r)?null:new e("tilingscheme:spatial-reference-mismatch","The tiling scheme does not match the spatial reference of the global scene")}const r=Object.freeze(Object.defineProperty({__proto__:null,checkIfTileInfoSupportedForViewSR:n},Symbol.toStringTag,{value:"Module"}));export{n as c,r as t};
|
package/core/MemCachePool.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{RemoveMode as
|
|
5
|
+
import e from"./Logger.js";import{RemoveMode as c,NoPriority as t}from"./MemCache.js";const h=()=>e.getLogger("esri/core/MemCachePool");class r{constructor(e,t){this._cache=e(t,((e,t,r)=>{switch(t){case c.ALL:return e.forEach((e=>e.dispose())),0;case c.SOME:{const c=e.shift();return c?(r-=Math.round(c.cachedMemory),c.dispose()):r>0&&(h().warn("Encountered empty MemCachePool with non-zero memory."),r=0),r}}}))}hitrate(){return this._cache.hitRate}destroy(){this._cache.destroy()}clear(){this._cache.clear()}getSize(e){return this._cache.getSize(e)}pop(e){const c=this._cache.peek(e);if(!c)return;const t=c.pop();return c.length>0?t&&(c.cachedMemory=this._cache.getSize(e)-Math.round(t.cachedMemory),this._cache.updateSize(e,c)):this._cache.pop(e),t}put(e,c,h=t){const r=this._cache.peek(e);if(r)r.push(c),r.cachedMemory=this._cache.getSize(e)+Math.round(c.cachedMemory),this._cache.updateSize(e,r);else{const t=new s(c);this._cache.put(e,t,h)}}}class s extends Array{constructor(e){super(),this.item=e,this.cachedMemory=e.cachedMemory,this.push(e)}}export{r as MemCachePool};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{isSome as r}from"../../core/arrayUtils.js";import{convertToSpatialReferenceUnit as t}from"../../core/unitUtils.js";import{supportsCurves as o,executeMany as e}from"./gx/operatorGraphicBuffer.js";import{fromGeometry as i,getSpatialReference as s,fromSpatialReference as a,
|
|
5
|
+
import{isSome as r}from"../../core/arrayUtils.js";import{convertToSpatialReferenceUnit as t}from"../../core/unitUtils.js";import{supportsCurves as o,executeMany as e}from"./gx/operatorGraphicBuffer.js";import{fromGeometry as i,getSpatialReference as s,fromSpatialReference as a,toPolygon as m}from"./support/apiConverter.js";const n={round:0,miter:1,bevel:2},p={round:0,butt:1,square:2};function u(o,u,c,f,l={}){let{maxDeviation:x=NaN,maxVerticesInFullCircle:j=96,miterLimit:v=10,union:C=!1,unit:b}=l;const d=o.map(i),y=s(o);return b&&(u=u.map((r=>t(r,b,y))),x&&(x=t(x,b,y))),e(d,a(y),u,n[c],p[f],v,x,j,C).map((r=>m(r,y))).filter(r)}const c=o();export{u as executeMany,c as supportsCurves};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{deprecated as e}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{p as n}from"../../chunks/vec32.js";import o from"../Point.js";import i from"./MeshGeoreferencedVertexSpace.js";import t from"./MeshLocalVertexSpace.js";function c(){return r.getLogger("esri.geometry.Mesh")}function p(e){return
|
|
5
|
+
import{deprecated as e}from"../../core/deprecate.js";import r from"../../core/Logger.js";import{p as n}from"../../chunks/vec32.js";import o from"../Point.js";import i from"./MeshGeoreferencedVertexSpace.js";import t from"./MeshLocalVertexSpace.js";function c(){return r.getLogger("esri.geometry.Mesh")}function p(e){return null==e.origin}function g(e){return null!=e.origin}function a(e){return g(e.vertexSpace)}function u(e,r){if(!g(e))return null;const[n,i,t]=e.origin;return new o({x:n,y:i,z:t,spatialReference:r})}function l(r,n){const{x:o,y:p,z:g,spatialReference:a}=r,u=[o,p,g??0];void 0!==n?.geographic&&(e(c(),"option: geographic",{replacement:"Use the `vertexSpace` option instead.",version:"4.29",warnOnce:!0}),n.vertexSpace&&c().warn("Deprecated geographic flag ignored since vertexSpace option is provided."));return"local"===(n?.vertexSpace??f(n?.geographic)??s(a))?new t({origin:u}):new i({origin:u})}function s(e){return e.isGeographic||e.isWebMercator?"local":"georeferenced"}function f(e){return null==e?void 0:e?"local":"georeferenced"}function m(e,r){return e.type===r.type&&(e.origin===r.origin||null!=e.origin&&null!=r.origin&&n(e.origin,r.origin))}export{p as isAbsoluteVertexSpace,a as isMeshWithRelativeVertexSpace,g as isRelativeVertexSpace,l as selectVertexSpace,m as vertexSpaceEquals,u as vertexSpaceOriginToPoint};
|
package/interfaces.d.ts
CHANGED
|
@@ -1636,6 +1636,7 @@ declare namespace __esri {
|
|
|
1636
1636
|
* @param options.layer Layer from which to generate a default template.
|
|
1637
1637
|
* @param options.excludeAttachments Indicates 'attachment' columns should be excluded.
|
|
1638
1638
|
* @param options.excludeRelationships Indicates 'relationship' columns should be excluded.
|
|
1639
|
+
* @param options.excludedFieldTypesOverride Indicates field types that should be excluded. Defaults to: ["geometry", "blob", "raster", "guid", "xml"].
|
|
1639
1640
|
*/
|
|
1640
1641
|
createDefaultAttributeTableTemplateFromLayer(options: templateUtilsCreateDefaultAttributeTableTemplateFromLayerOptions): Promise<AttributeTableTemplate>;
|
|
1641
1642
|
/**
|
|
@@ -1647,6 +1648,7 @@ declare namespace __esri {
|
|
|
1647
1648
|
* @param options.layer Layer from which to generate a default template.
|
|
1648
1649
|
* @param options.excludeAttachments Indicates 'attachment' columns should be excluded.
|
|
1649
1650
|
* @param options.excludeRelationships Indicates 'relationship' columns should be excluded.
|
|
1651
|
+
* @param options.excludedFieldTypesOverride Indicates field types that should be excluded. Defaults to: ["geometry", "blob", "raster", "guid", "xml"].
|
|
1650
1652
|
*/
|
|
1651
1653
|
createDefaultTableTemplateFromLayer(options: templateUtilsCreateDefaultTableTemplateFromLayerOptions): Promise<TableTemplate>;
|
|
1652
1654
|
/**
|
|
@@ -1658,6 +1660,7 @@ declare namespace __esri {
|
|
|
1658
1660
|
* @param options.layer Layer from which to generate a default template.
|
|
1659
1661
|
* @param options.template Instance of an AttributeTableTemplate used to configure a new TableTemplate.
|
|
1660
1662
|
* @param options.includeHiddenFields Indicates columns should be generated for fields without associated elements.
|
|
1663
|
+
* @param options.excludedFieldTypesOverride Indicates field types that should be excluded. Defaults to: ["geometry", "blob", "raster", "guid", "xml"].
|
|
1661
1664
|
*/
|
|
1662
1665
|
createTableTemplateFromAttributeTableTemplate(options: templateUtilsCreateTableTemplateFromAttributeTableTemplateOptions): Promise<TableTemplate>;
|
|
1663
1666
|
/**
|
|
@@ -1685,6 +1688,7 @@ declare namespace __esri {
|
|
|
1685
1688
|
| WFSLayer;
|
|
1686
1689
|
excludeAttachments?: boolean;
|
|
1687
1690
|
excludeRelationships?: boolean;
|
|
1691
|
+
excludedFieldTypesOverride?: any[];
|
|
1688
1692
|
}
|
|
1689
1693
|
|
|
1690
1694
|
export interface templateUtilsCreateDefaultTableTemplateFromLayerOptions {
|
|
@@ -1698,6 +1702,7 @@ declare namespace __esri {
|
|
|
1698
1702
|
| WFSLayer;
|
|
1699
1703
|
excludeAttachments?: boolean;
|
|
1700
1704
|
excludeRelationships?: boolean;
|
|
1705
|
+
excludedFieldTypesOverride?: any[];
|
|
1701
1706
|
}
|
|
1702
1707
|
|
|
1703
1708
|
export interface templateUtilsCreateTableTemplateFromAttributeTableTemplateOptions {
|
|
@@ -1711,6 +1716,7 @@ declare namespace __esri {
|
|
|
1711
1716
|
| WFSLayer;
|
|
1712
1717
|
template: AttributeTableTemplate;
|
|
1713
1718
|
includeHiddenFields?: boolean;
|
|
1719
|
+
excludedFieldTypesOverride?: any[];
|
|
1714
1720
|
}
|
|
1715
1721
|
|
|
1716
1722
|
/**
|
|
@@ -8595,7 +8601,7 @@ declare namespace __esri {
|
|
|
8595
8601
|
*
|
|
8596
8602
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-bufferOperator.html#execute Read more...}
|
|
8597
8603
|
*/
|
|
8598
|
-
execute(geometry: geometryGeometry, distance: number, options?: bufferOperatorExecuteOptions):
|
|
8604
|
+
execute(geometry: geometryGeometry, distance: number, options?: bufferOperatorExecuteOptions): geometryPolygon;
|
|
8599
8605
|
/**
|
|
8600
8606
|
* Creates a buffer around the input geometries.
|
|
8601
8607
|
*
|
|
@@ -8609,7 +8615,7 @@ declare namespace __esri {
|
|
|
8609
8615
|
*
|
|
8610
8616
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-bufferOperator.html#executeMany Read more...}
|
|
8611
8617
|
*/
|
|
8612
|
-
executeMany(geometries: geometryGeometry[], distances: number[], options?: bufferOperatorExecuteManyOptions):
|
|
8618
|
+
executeMany(geometries: geometryGeometry[], distances: number[], options?: bufferOperatorExecuteManyOptions): geometryPolygon[];
|
|
8613
8619
|
}
|
|
8614
8620
|
|
|
8615
8621
|
export const bufferOperator: bufferOperator;
|
|
@@ -9047,7 +9053,7 @@ declare namespace __esri {
|
|
|
9047
9053
|
*
|
|
9048
9054
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-geodesicBufferOperator.html#execute Read more...}
|
|
9049
9055
|
*/
|
|
9050
|
-
execute(geometry: geometryGeometry, distance: number, options?: geodesicBufferOperatorExecuteOptions):
|
|
9056
|
+
execute(geometry: geometryGeometry, distance: number, options?: geodesicBufferOperatorExecuteOptions): geometryPolygon;
|
|
9051
9057
|
/**
|
|
9052
9058
|
* Creates a geodesic buffer around the input geometries.
|
|
9053
9059
|
*
|
|
@@ -9061,7 +9067,7 @@ declare namespace __esri {
|
|
|
9061
9067
|
*
|
|
9062
9068
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-geodesicBufferOperator.html#executeMany Read more...}
|
|
9063
9069
|
*/
|
|
9064
|
-
executeMany(geometries: geometryGeometry[], distances: number[], options?: geodesicBufferOperatorExecuteManyOptions):
|
|
9070
|
+
executeMany(geometries: geometryGeometry[], distances: number[], options?: geodesicBufferOperatorExecuteManyOptions): geometryPolygon[];
|
|
9065
9071
|
/**
|
|
9066
9072
|
* Indicates if all dependencies of this module have been loaded.
|
|
9067
9073
|
*
|
|
@@ -9373,7 +9379,7 @@ declare namespace __esri {
|
|
|
9373
9379
|
*
|
|
9374
9380
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-operators-graphicBufferOperator.html#executeMany Read more...}
|
|
9375
9381
|
*/
|
|
9376
|
-
executeMany(geometries: geometryGeometry[], distances: number[], joins: "round" | "miter" | "bevel", caps: "round" | "butt" | "square", options?: graphicBufferOperatorExecuteManyOptions):
|
|
9382
|
+
executeMany(geometries: geometryGeometry[], distances: number[], joins: "round" | "miter" | "bevel", caps: "round" | "butt" | "square", options?: graphicBufferOperatorExecuteManyOptions): geometryPolygon[];
|
|
9377
9383
|
}
|
|
9378
9384
|
|
|
9379
9385
|
export const graphicBufferOperator: graphicBufferOperator;
|
|
@@ -92383,6 +92389,12 @@ declare namespace __esri {
|
|
|
92383
92389
|
}
|
|
92384
92390
|
|
|
92385
92391
|
export class Navigation extends Accessor {
|
|
92392
|
+
/**
|
|
92393
|
+
* The navigation action map defines the default behavior of the navigation controls.
|
|
92394
|
+
*
|
|
92395
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-Navigation.html#actionMap Read more...}
|
|
92396
|
+
*/
|
|
92397
|
+
actionMap: NavigationActionMap;
|
|
92386
92398
|
/**
|
|
92387
92399
|
* Indicates if single finger touch {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#event-drag drag} events are enabled or disabled.
|
|
92388
92400
|
*
|
|
@@ -92409,6 +92421,7 @@ declare namespace __esri {
|
|
|
92409
92421
|
* Indicates whether the view can be zoomed in or out with the mouse wheel.
|
|
92410
92422
|
*
|
|
92411
92423
|
* @default true
|
|
92424
|
+
* @deprecated since version 4.32. Use {@link module:esri/views/navigation/NavigationActionMap#mouseWheel actionMap.mouseWheel} instead.
|
|
92412
92425
|
*
|
|
92413
92426
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-Navigation.html#mouseWheelZoomEnabled Read more...}
|
|
92414
92427
|
*/
|
|
@@ -92422,6 +92435,12 @@ declare namespace __esri {
|
|
|
92422
92435
|
}
|
|
92423
92436
|
|
|
92424
92437
|
interface NavigationProperties {
|
|
92438
|
+
/**
|
|
92439
|
+
* The navigation action map defines the default behavior of the navigation controls.
|
|
92440
|
+
*
|
|
92441
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-Navigation.html#actionMap Read more...}
|
|
92442
|
+
*/
|
|
92443
|
+
actionMap?: NavigationActionMapProperties;
|
|
92425
92444
|
/**
|
|
92426
92445
|
* Indicates if single finger touch {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-View.html#event-drag drag} events are enabled or disabled.
|
|
92427
92446
|
*
|
|
@@ -92443,11 +92462,88 @@ declare namespace __esri {
|
|
|
92443
92462
|
/**
|
|
92444
92463
|
* Indicates whether the view can be zoomed in or out with the mouse wheel.
|
|
92445
92464
|
*
|
|
92465
|
+
* @deprecated since version 4.32. Use {@link module:esri/views/navigation/NavigationActionMap#mouseWheel actionMap.mouseWheel} instead.
|
|
92466
|
+
*
|
|
92446
92467
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-Navigation.html#mouseWheelZoomEnabled Read more...}
|
|
92447
92468
|
*/
|
|
92448
92469
|
mouseWheelZoomEnabled?: boolean;
|
|
92449
92470
|
}
|
|
92450
92471
|
|
|
92472
|
+
export class NavigationActionMap extends Accessor {
|
|
92473
|
+
/**
|
|
92474
|
+
* The primary drag navigation action.
|
|
92475
|
+
*
|
|
92476
|
+
* @default "pan"
|
|
92477
|
+
*
|
|
92478
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragPrimary Read more...}
|
|
92479
|
+
*/
|
|
92480
|
+
dragPrimary: DragAction;
|
|
92481
|
+
/**
|
|
92482
|
+
* The secondary drag navigation action.
|
|
92483
|
+
*
|
|
92484
|
+
* @default "rotate"
|
|
92485
|
+
*
|
|
92486
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragSecondary Read more...}
|
|
92487
|
+
*/
|
|
92488
|
+
dragSecondary: DragAction;
|
|
92489
|
+
/**
|
|
92490
|
+
* The tertiary drag navigation action.
|
|
92491
|
+
*
|
|
92492
|
+
* @default "zoom"
|
|
92493
|
+
*
|
|
92494
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragTertiary Read more...}
|
|
92495
|
+
*/
|
|
92496
|
+
dragTertiary: DragAction;
|
|
92497
|
+
/**
|
|
92498
|
+
* The mouse wheel zoom action.
|
|
92499
|
+
*
|
|
92500
|
+
* @default "zoom"
|
|
92501
|
+
*
|
|
92502
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#mouseWheel Read more...}
|
|
92503
|
+
*/
|
|
92504
|
+
mouseWheel: "zoom" | "none";
|
|
92505
|
+
/**
|
|
92506
|
+
* The navigation action map defines the default behavior of the navigation controls.
|
|
92507
|
+
*
|
|
92508
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html Read more...}
|
|
92509
|
+
*/
|
|
92510
|
+
constructor(properties?: NavigationActionMapProperties);
|
|
92511
|
+
}
|
|
92512
|
+
|
|
92513
|
+
interface NavigationActionMapProperties {
|
|
92514
|
+
/**
|
|
92515
|
+
* The primary drag navigation action.
|
|
92516
|
+
*
|
|
92517
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragPrimary Read more...}
|
|
92518
|
+
*/
|
|
92519
|
+
dragPrimary?: DragAction;
|
|
92520
|
+
/**
|
|
92521
|
+
* The secondary drag navigation action.
|
|
92522
|
+
*
|
|
92523
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragSecondary Read more...}
|
|
92524
|
+
*/
|
|
92525
|
+
dragSecondary?: DragAction;
|
|
92526
|
+
/**
|
|
92527
|
+
* The tertiary drag navigation action.
|
|
92528
|
+
*
|
|
92529
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#dragTertiary Read more...}
|
|
92530
|
+
*/
|
|
92531
|
+
dragTertiary?: DragAction;
|
|
92532
|
+
/**
|
|
92533
|
+
* The mouse wheel zoom action.
|
|
92534
|
+
*
|
|
92535
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#mouseWheel Read more...}
|
|
92536
|
+
*/
|
|
92537
|
+
mouseWheel?: "zoom" | "none";
|
|
92538
|
+
}
|
|
92539
|
+
|
|
92540
|
+
/**
|
|
92541
|
+
* Type of action to be performed when a drag gesture is performed.
|
|
92542
|
+
*
|
|
92543
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-navigation-NavigationActionMap.html#DragAction Read more...}
|
|
92544
|
+
*/
|
|
92545
|
+
export type DragAction = "pan" | "rotate" | "zoom" | "none";
|
|
92546
|
+
|
|
92451
92547
|
export class PopupView {
|
|
92452
92548
|
popup: Popup;
|
|
92453
92549
|
popupEnabled: boolean;
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as e}from"../../../core/lang.js";import{millisecondsPerTimeUnit as t}from"../../../core/timeUtils.js";import{polygonCentroid as i,extentCentroid as s}from"../../../geometry/support/centroid.js";import{getPolygonExtent as a,getGeometryExtent as n}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as r}from"../../../geometry/support/quantizationUtils.js";import{isValid as o,equals as l}from"../../../geometry/support/spatialReferenceUtils.js";import u from"./AttributesBuilder.js";import{cleanFromGeometryEngine as c,getGeometry as m,transformCentroid as d}from"./geometryUtils.js";import{project as h}from"./projectionSupport.js";import{getDateInNumber as f}from"./queryUtils.js";import{makeEdgeCandidate as p,makeVertexCandidate as g}from"./SnappingCandidate.js";import{isDateField as y,isDateOnlyField as x,isTimestampOffsetField as I,isStringField as T,isTimeOnlyField as F}from"../../support/fieldUtils.js";import _ from"../../../rest/support/AutoIntervalBinParameters.js";import V from"../../../rest/support/DateBinParameters.js";import v from"../../../rest/support/FixedBoundariesBinParameters.js";import S from"../../../rest/support/FixedIntervalBinParameters.js";import{isNullCountSupported as R,calculateStringStatistics as z,calculateStatistics as b,processSummaryStatisticsResult as B,calculateUniqueValuesCount as A,createUVResult as w,calculateClassBreaks as M,resolveCBResult as N,calculateHistogram as q,getAttributeComparator as P,calculatePercentile as D,binIndex as Z,getBinParams as j}from"../../../statistics/utils.js";class G{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new u(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:s}=this.query,a=t?.length;if(!!!a)return 1;const n=new Map,r=new Map,o=new Set;for(const l of s){const{statisticType:s}=l,a="exceedslimit"!==s?l.onStatisticField:void 0;if(!r.has(a)){const i=[];for(const s of t){const t=this._getAttributeValues(e,s,this.items,n);i.push(t)}r.set(a,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=r.get(a);for(const t in u){const{data:s,items:a}=u[t],n=s.join(",");i&&!e.validateItems(a,i)||o.add(n)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;o(this.query.outSR)&&!l(t.spatialReference,this.query.outSR)?e.queryGeometry=c({spatialReference:this.query.outSR,...h(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=c({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const i=this.featureAdapter,s=E(this.hasZ,this.hasM),{point:a,mode:n}=e,r="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c="esriGeometryPolyline"===this.geometryType,m=this._getPointCreator(n,this.spatialReference,t),d=new O(null,0),h=new O(null,0),f={x:0,y:0,z:0};for(const y of this.items){const t=i.getGeometry(y);if(null==t)continue;const{coords:n}=t,x=t.isPoint?H:t.lengths;if(d.coords=n,h.coords=n,e.returnEdge){let e=0;for(let t=0;t<x.length;t++){const n=x[t],c=e;for(let t=0;t<n;t++,e+=s){if(!u&&t===n-1)continue;const g=d;g.coordsIndex=e;const x=h;x.coordsIndex=t===n-1?c:e+s;const I=f;if(!C(f,a,g,x))continue;const T=(a.x-I.x)/r,F=(a.y-I.y)/o,_=T*T+F*F;_<=1&&l.candidates.push(p(i.getObjectId(y),m(I),Math.sqrt(_),m(g),m(x)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<x.length;t++){const n=x[t],c=e,f=h;f.coordsIndex=c;for(let t=0;t<n;t++,e+=s){const s=d;if(s.coordsIndex=e,u&&t===n-1&&s.x===f.x&&s.y===f.y)continue;const c=(a.x-s.x)/r,h=(a.y-s.y)/o,p=c*c+h*h;p<=1&&l.candidates.push(g(i.getObjectId(y),m(s),Math.sqrt(p)))}}}else if(c&&"ends"===e.vertexMode){let e=0;const t=[];for(let i=0;i<x.length;i++){t.push(e);const a=x[i];e+=a*s,!u&&a>1&&t.push(e-s)}for(const s of t){const e=d;e.coordsIndex=s;const t=(a.x-e.x)/r,n=(a.y-e.y)/o,u=t*t+n*n;u<=1&&l.candidates.push(g(i.getObjectId(y),m(e),Math.sqrt(u)))}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,i){const s=null==i||l(t,i)?e=>e:e=>h(e,t,i),{hasZ:a}=this,n=0;return"3d"===e?a?({x:e,y:t,z:i})=>s({x:e,y:t,z:i}):({x:e,y:t})=>s({x:e,y:t,z:n}):({x:e,y:t})=>s({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:n,minValue:r,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,m=this.fieldsIndex.get(t),d=y(m)||x(m)||I(m),h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:n,scale:l,timeZone:u},this.items),f=R({normalizationType:a,normalizationField:s,minValue:r,maxValue:o}),p={value:.5,fieldType:m?.type},g=T(m)?z({values:h,supportsNullCount:f,percentileParams:p,outStatisticTypes:c}):b({values:h,minValue:r,maxValue:o,useSampleStdDev:!a,supportsNullCount:f,percentileParams:p,outStatisticTypes:c});return B(g,c,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:s,returnAllCodedValues:a,scale:n,timeZone:r}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:n,timeZone:r},this.items,!1),l=A(o);return w(l,s,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:n,scale:m,timeZone:d},this.items),f=M(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return N(f,r)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:n,scale:m,timeZone:d},this.items);return q(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:n,classificationMethod:r,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const s of t.slice().reverse()){const t=s.split(" "),a=t[0],n=this.fieldsIndex.get(a),r=!!t[1]&&"desc"===t[1].toLowerCase(),o=P(n?.type,r);e.sort(((e,t)=>{const s=i(e,a,n),r=i(t,a,n);return o(s,r)}))}}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:s,hasZ:a,objectIdField:n,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:m,resultRecordCount:d,resultOffset:h,returnZ:f,returnM:p}=e,g=null!=d&&t.length>(h||0)+d,y=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:g,features:this._createFeatures(e,t),fields:y,geometryType:i,hasM:s&&p,hasZ:a&&f,objectIdFieldName:n,spatialReference:c(u||o),transform:m&&r(m)||null}}_createFeatures(e,t){const i=new u(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:a}=this,{orderByFields:n,quantizationParameters:o,returnGeometry:l,returnCentroid:c,maxAllowableOffset:h,resultOffset:f,resultRecordCount:p,returnZ:g=!1,returnM:y=!1}=e,x=a&&g,I=s&&y;let T=[],F=0;const _=[...t];if(this._sortFeatures(_,n,((e,t,s)=>i.getFieldValue(e,t,s))),this.geometryType&&(l||c)){const e=r(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!c)for(const s of _){const a=this.featureAdapter.getGeometry(s),n={attributes:i.getAttributes(s),geometry:m(this.geometryType,this.hasZ,this.hasM,a,h,e,x,I)};t&&a&&!n.geometry&&(n.centroid=d(this,this.featureAdapter.getCentroid(s,this),e)),T[F++]=n}else if(!l&&c)for(const s of _)T[F++]={attributes:i.getAttributes(s),centroid:d(this,this.featureAdapter.getCentroid(s,this),e)};else for(const s of _)T[F++]={attributes:i.getAttributes(s),centroid:d(this,this.featureAdapter.getCentroid(s,this),e),geometry:m(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(s),h,e,x,I)}}else for(const r of _){const e=i.getAttributes(r);e&&(T[F++]={attributes:e})}const V=f||0;if(null!=p){const e=V+p;T=T.slice(V,Math.min(T.length,e))}return T}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const a of this.query.outStatistics??[])if("exceedslimit"===a.statisticType){t=null!=a.maxPointCount?a.maxPointCount:Number.POSITIVE_INFINITY,i=null!=a.maxRecordCount?a.maxRecordCount:Number.POSITIVE_INFINITY,s=null!=a.maxVertexCount?a.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>i)e=!0;else{const t=E(this.hasZ,this.hasM),i=this.featureAdapter;e=this.items.reduce(((e,t)=>{const s=i.getGeometry(t);return e+(null!=s&&s.coords.length||0)}),0)/t>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const s=[],a=new Map,n=new Map,r=new Map,o=new Map,l=new u(e,this.featureAdapter,this.fieldsIndex),c=e.outStatistics,{groupByFieldsForStatistics:m,having:d,orderByFields:h,resultRecordCount:f}=e,p=m?.length,g=!!p,y=g?m[0]:null,x=g&&!this.fieldsIndex.get(y);for(const u of c??[]){const{outStatisticFieldName:e,statisticType:c}=u,h=u,f="exceedslimit"!==c?u.onStatisticField:void 0,I="percentile_disc"===c||"percentile_cont"===c,F="EnvelopeAggregate"===c||"CentroidAggregate"===c||"ConvexHullAggregate"===c,_=g&&1===p&&(f===y||x)&&"count"===c;if(g){if(!r.has(f)){const e=[];for(const i of m){const s=this._getAttributeValues(l,i,t,a);e.push(s)}r.set(f,this._calculateUniqueValues(e,t,!F&&l.returnDistinctValues))}const i=r.get(f);if(!i)continue;const s=Object.keys(i);for(const n of s){const{count:s,data:r,items:u,itemPositions:c}=i[n],p=r.join(",");if(!d||l.validateItems(u,d)){const i=o.get(p)||{attributes:{}};if(F){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(h,u);i.aggregateGeometries[t]=e}else{let n=null;if(_)n=s;else{const e=this._getAttributeValues(l,f,t,a),i=c.map((t=>e[t]));n=I&&"statisticParameters"in h?this._getPercentileValue(h,i):this._getStatisticValue(h,i,null,l.returnDistinctValues)}i.attributes[e]=n}let n=0;m.forEach(((e,t)=>i.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++n]=r[t])),o.set(p,i)}}}else if(F){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(h,t);i.aggregateGeometries[s]=e}else{const s=this._getAttributeValues(l,f,t,a);i.attributes[e]=I&&"statisticParameters"in h?this._getPercentileValue(h,s):this._getStatisticValue(h,s,n,l.returnDistinctValues)}const V="min"!==c&&"max"!==c||!T(this.fieldsIndex.get(f))&&!this._isAnyDateField(f)?null:this.fieldsIndex.get(f)?.type;s.push({name:e,alias:e,type:V||"esriFieldTypeDouble"})}const I=g?Array.from(o.values()):[i];return this._sortFeatures(I,h,((e,t)=>e.attributes[t])),f&&(I.length=Math.min(f,I.length)),{fields:s,features:I}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return y(t)||x(t)||I(t)||F(t)}async _getAggregateGeometry(e,t){const{convexHull:r,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:c,spatialReference:d,geometryType:h,hasZ:f,hasM:p}=this,g=t.map((e=>m(h,f,p,c.getGeometry(e)))),y=r(d,g,!0)[0],x={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=y?a(y):n(o(d,g));x.aggregateGeometries={...e,spatialReference:d},x.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=y?i(y):s(n(o(d,g)));x.aggregateGeometries={x:e[0],y:e[1],spatialReference:d},x.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(x.aggregateGeometries=y,x.outStatisticFieldName=u||"convexHull");return x}_getStatisticValue(e,t,i,s){const{onStatisticField:a,statisticType:n}=e;let r=null;r=i?.has(a)?i.get(a):T(this.fieldsIndex.get(a))||this._isAnyDateField(a)?z({values:t,returnDistinct:s}):b({values:s?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(a,r);return r["var"===n?"variance":n]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:s,statisticType:a}=e,{value:n,orderBy:r}=s,o=this.fieldsIndex.get(i);return D(t,{value:n,orderBy:r,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,i,s){if(s.has(t))return s.get(t);const a=this.fieldsIndex.get(t),n=i.map((i=>e.getFieldValue(i,t,a)));return s.set(t,n),n}_calculateUniqueValues(e,t,i){const s={},a=t.length;for(let n=0;n<a;n++){const a=t[n],r=[];for(const t of e)r.push(t[n]);const o=r.join(",");null==s[o]?s[o]={count:1,data:r,items:[a],itemPositions:[n]}:(i||s[o].count++,s[o].items.push(a),s[o].itemPositions.push(n))}return s}async _getDataValues(t,i,s=!0){const a=new u(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:n,scale:r,timeZone:o}=t;return n?a.getExpressionValues(i,n,{viewingMode:"map",scale:r,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):a.getDataValues(i,e(t),s)}async _calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const s=t.intervals,a=t.min??0,n=t.max??0,r=s.map((([e,t])=>({minValue:e,maxValue:t,count:0,items:[]})));for(let o=0;o<e.length;o++){const t=e[o],l=i[o];if(null!=t&&t>=a&&t<=n){const e=Z(s,t);e>-1&&(r[e].count++,r[e].items.push(l))}}return r}async createQueryBinsResponse(e){const t=e.bin;switch(t.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(_.fromJSON(t),e);case"dateBin":return this._createDateBinsResponse(V.fromJSON(t),e);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(v.fromJSON(t),e);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(S.fromJSON(t),e)}}async _createAutoIntervalBinsResponse(e,t){const{field:i,normalizationField:s,numBins:a,normalizationType:n,normalizationTotal:r,start:o,end:l}=e,u=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},this.items),c=j(u,{field:i,normalizationField:s,normalizationType:n,normalizationTotal:r,numBins:a,minValue:f(o,!1),maxValue:f(l,!1)}),m=await this._calculateHistogramBins(u,c,this.items);return this._createFeaturesFromHistogramBins(m,t)}async _createDateBinsResponse(e,i){const{field:s,interval:a,start:n,end:r}=e,o=a.unit,l="quarters"===o?3*t.months:t[o],u=a.value*l/t.milliseconds,c=await this._getDataValues({field:e.field,timeZone:i.outTimeReference?.ianaTimeZone},this.items),m=F(this.fieldsIndex.get(s)),d=j(c,{field:s,classificationMethod:"defined-interval",definedInterval:u,minValue:f(n,m),maxValue:f(r,m)},!0),h=await this._calculateHistogramBins(c,d,this.items);return this._createFeaturesFromHistogramBins(h,i)}async _createFixedBoundariesBinsResponse(e,t){const{field:i}=e,s=await this._getDataValues({field:i,timeZone:t.outTimeReference?.ianaTimeZone},this.items),a=F(this.fieldsIndex.get(i)),n=e.boundaries.map((e=>f(e,a))).sort(((e,t)=>e-t)),r=[];for(let u=0;u<n.length-1;u++)r.push([n[u],n[u+1]]);const o={intervals:r,min:n.at(0),max:n.at(-1)},l=await this._calculateHistogramBins(s,o,this.items);return this._createFeaturesFromHistogramBins(l,t)}async _createFixedIntervalBinsResponse(e,t){const{field:i,interval:s,start:a,end:n}=e,r=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},this.items),o=F(this.fieldsIndex.get(i)),l=j(r,{field:i,classificationMethod:"defined-interval",definedInterval:s,minValue:f(a,o),maxValue:f(n,o)},!0),u=await this._calculateHistogramBins(r,l,this.items);return this._createFeaturesFromHistogramBins(u,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:s}=t,a=s||"lowerBoundary",n=i||"upperBoundary",r=[],o=[];for(const l of e){const{minValue:e,maxValue:i,items:s}=l,u={attributes:{}};u.attributes[a]=e,u.attributes[n]=i;const c=await this._createStatisticsQueryResponse(t,s,u);r.push(u),c.fields&&o.push(...c.fields)}return"desc"===t.binOrder&&r.reverse(),{fields:o,features:r}}}function C(e,t,i,s){const a=s.x-i.x,n=s.y-i.y,r=t.x-i.x,o=t.y-i.y,l=a*a+n*n;if(0===l)return!1;const u=r*a+o*n,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+a*c,e.y=i.y+n*c,!0}function E(e,t){return e?t?4:3:t?3:2}class O{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const H=[1];export{G as QueryEngineResult};
|
|
5
|
+
import{clone as e}from"../../../core/lang.js";import{millisecondsPerTimeUnit as t}from"../../../core/timeUtils.js";import{polygonCentroid as i,extentCentroid as s}from"../../../geometry/support/centroid.js";import{getPolygonExtent as a,getGeometryExtent as r}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as n}from"../../../geometry/support/quantizationUtils.js";import{isValid as o,equals as l}from"../../../geometry/support/spatialReferenceUtils.js";import u from"./AttributesBuilder.js";import{cleanFromGeometryEngine as c,getGeometry as m,transformCentroid as d}from"./geometryUtils.js";import{project as h}from"./projectionSupport.js";import{getDateInNumber as p}from"./queryUtils.js";import{makeEdgeCandidate as f,makeVertexCandidate as y}from"./SnappingCandidate.js";import{isDateField as g,isDateOnlyField as x,isTimestampOffsetField as I,isStringField as T,isTimeOnlyField as F}from"../../support/fieldUtils.js";import _ from"../../../rest/support/AutoIntervalBinParameters.js";import V from"../../../rest/support/DateBinParameters.js";import v from"../../../rest/support/FixedBoundariesBinParameters.js";import b from"../../../rest/support/FixedIntervalBinParameters.js";import{isNullCountSupported as S,calculateStringStatistics as R,calculateStatistics as B,processSummaryStatisticsResult as z,calculateUniqueValuesCount as A,createUVResult as w,calculateClassBreaks as M,resolveCBResult as D,calculateHistogram as P,getAttributeComparator as q,calculatePercentile as N,binIndex as Z,getBinParams as j}from"../../../statistics/utils.js";const G="bin";class C{constructor(e,t,i){this.items=e,this.query=t,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const e=new u(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return e.countDistinctValues(this.items);const{groupByFieldsForStatistics:t,having:i,outStatistics:s}=this.query,a=t?.length;if(!!!a)return 1;const r=new Map,n=new Map,o=new Set;for(const l of s){const{statisticType:s}=l,a="exceedslimit"!==s?l.onStatisticField:void 0;if(!n.has(a)){const i=[];for(const s of t){const t=this._getAttributeValues(e,s,this.items,r);i.push(t)}n.set(a,this._calculateUniqueValues(i,this.items,e.returnDistinctValues))}const u=n.get(a);for(const t in u){const{data:s,items:a}=u[t],r=s.join(",");i&&!e.validateItems(a,i)||o.add(r)}}return o.size}async createQueryResponse(){let e;if(this.query.outStatistics){e=this.query.outStatistics.some((e=>"exceedslimit"===e.statisticType))?this._createExceedsLimitQueryResponse():await this._createStatisticsQueryResponse(this.query,this.items)}else e=this._createFeatureQueryResponse(this.query);if(this.query.returnQueryGeometry){const t=this.query.geometry;o(this.query.outSR)&&!l(t.spatialReference,this.query.outSR)?e.queryGeometry=c({spatialReference:this.query.outSR,...h(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=c({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t){const i=this.featureAdapter,s=O(this.hasZ,this.hasM),{point:a,mode:r}=e,n="number"==typeof e.distance?e.distance:e.distance.x,o="number"==typeof e.distance?e.distance:e.distance.y,l={candidates:[]},u="esriGeometryPolygon"===this.geometryType,c="esriGeometryPolyline"===this.geometryType,m=this._getPointCreator(r,this.spatialReference,t),d=new H(null,0),h=new H(null,0),p={x:0,y:0,z:0};for(const g of this.items){const t=i.getGeometry(g);if(null==t)continue;const{coords:r}=t,x=t.isPoint?Q:t.lengths;if(d.coords=r,h.coords=r,e.returnEdge){let e=0;for(let t=0;t<x.length;t++){const r=x[t],c=e;for(let t=0;t<r;t++,e+=s){if(!u&&t===r-1)continue;const y=d;y.coordsIndex=e;const x=h;x.coordsIndex=t===r-1?c:e+s;const I=p;if(!E(p,a,y,x))continue;const T=(a.x-I.x)/n,F=(a.y-I.y)/o,_=T*T+F*F;_<=1&&l.candidates.push(f(i.getObjectId(g),m(I),Math.sqrt(_),m(y),m(x)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<x.length;t++){const r=x[t],c=e,p=h;p.coordsIndex=c;for(let t=0;t<r;t++,e+=s){const s=d;if(s.coordsIndex=e,u&&t===r-1&&s.x===p.x&&s.y===p.y)continue;const c=(a.x-s.x)/n,h=(a.y-s.y)/o,f=c*c+h*h;f<=1&&l.candidates.push(y(i.getObjectId(g),m(s),Math.sqrt(f)))}}}else if(c&&"ends"===e.vertexMode){let e=0;const t=[];for(let i=0;i<x.length;i++){t.push(e);const a=x[i];e+=a*s,!u&&a>1&&t.push(e-s)}for(const s of t){const e=d;e.coordsIndex=s;const t=(a.x-e.x)/n,r=(a.y-e.y)/o,u=t*t+r*r;u<=1&&l.candidates.push(y(i.getObjectId(g),m(e),Math.sqrt(u)))}}}return l.candidates.sort(((e,t)=>e.distance-t.distance)),l}_getPointCreator(e,t,i){const s=null==i||l(t,i)?e=>e:e=>h(e,t,i),{hasZ:a}=this,r=0;return"3d"===e?a?({x:e,y:t,z:i})=>s({x:e,y:t,z:i}):({x:e,y:t})=>s({x:e,y:t,z:r}):({x:e,y:t})=>s({x:e,y:t})}async createSummaryStatisticsResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,minValue:n,maxValue:o,scale:l,timeZone:u,outStatisticTypes:c}=e,m=this.fieldsIndex.get(t),d=g(m)||x(m)||I(m),h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:l,timeZone:u},this.items),p=S({normalizationType:a,normalizationField:s,minValue:n,maxValue:o}),f={value:.5,fieldType:m?.type},y=T(m)?R({values:h,supportsNullCount:p,percentileParams:f,outStatisticTypes:c}):B({values:h,minValue:n,maxValue:o,useSampleStdDev:!a,supportsNullCount:p,percentileParams:f,outStatisticTypes:c});return z(y,c,d)}async createUniqueValuesResponse(e){const{field:t,valueExpression:i,domains:s,returnAllCodedValues:a,scale:r,timeZone:n}=e,o=await this._getDataValues({field:t,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,valueExpression:i,scale:r,timeZone:n},this.items,!1),l=A(o);return w(l,s,a,e.fieldDelimiter)}async createClassBreaksResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items),p=M(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return D(p,n)}async createHistogramResponse(e){const{field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c,scale:m,timeZone:d}=e,h=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items);return P(h,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numBins:c})}_sortFeatures(e,t,i){if(e.length>1&&t?.length)for(const s of t.slice().reverse()){const t=s.split(" "),a=t[0],r=this.fieldsIndex.get(a),n=!!t[1]&&"desc"===t[1].toLowerCase(),o=q(r?.type,n);e.sort(((e,t)=>{const s=i(e,a,r),n=i(t,a,r);return o(s,n)}))}}_createFeatureQueryResponse(e){const{items:t,geometryType:i,hasM:s,hasZ:a,objectIdField:r,spatialReference:o}=this,{outFields:l,outSR:u,quantizationParameters:m,resultRecordCount:d,resultOffset:h,returnZ:p,returnM:f}=e,y=null!=d&&t.length>(h||0)+d,g=l&&(l.includes("*")?[...this.fieldsIndex.fields]:l.map((e=>this.fieldsIndex.get(e))));return{exceededTransferLimit:y,features:this._createFeatures(e,t),fields:g,geometryType:i,hasM:s&&f,hasZ:a&&p,objectIdFieldName:r,spatialReference:c(u||o),transform:m&&n(m)||null}}_createFeatures(e,t){const i=new u(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:a}=this,{orderByFields:r,quantizationParameters:o,returnGeometry:l,returnCentroid:c,maxAllowableOffset:h,resultOffset:p,resultRecordCount:f,returnZ:y=!1,returnM:g=!1}=e,x=a&&y,I=s&&g;let T=[],F=0;const _=[...t];if(this._sortFeatures(_,r,((e,t,s)=>i.getFieldValue(e,t,s))),this.geometryType&&(l||c)){const e=n(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(l&&!c)for(const s of _){const a=this.featureAdapter.getGeometry(s),r={attributes:i.getAttributes(s),geometry:m(this.geometryType,this.hasZ,this.hasM,a,h,e,x,I)};t&&a&&!r.geometry&&(r.centroid=d(this,this.featureAdapter.getCentroid(s,this),e)),T[F++]=r}else if(!l&&c)for(const s of _)T[F++]={attributes:i.getAttributes(s),centroid:d(this,this.featureAdapter.getCentroid(s,this),e)};else for(const s of _)T[F++]={attributes:i.getAttributes(s),centroid:d(this,this.featureAdapter.getCentroid(s,this),e),geometry:m(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(s),h,e,x,I)}}else for(const n of _){const e=i.getAttributes(n);e&&(T[F++]={attributes:e})}const V=p||0;if(null!=f){const e=V+f;T=T.slice(V,Math.min(T.length,e))}return T}_createExceedsLimitQueryResponse(){let e=!1,t=Number.POSITIVE_INFINITY,i=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const a of this.query.outStatistics??[])if("exceedslimit"===a.statisticType){t=null!=a.maxPointCount?a.maxPointCount:Number.POSITIVE_INFINITY,i=null!=a.maxRecordCount?a.maxRecordCount:Number.POSITIVE_INFINITY,s=null!=a.maxVertexCount?a.maxVertexCount:Number.POSITIVE_INFINITY;break}if("esriGeometryPoint"===this.geometryType)e=this.items.length>t;else if(this.items.length>i)e=!0;else{const t=O(this.hasZ,this.hasM),i=this.featureAdapter;e=this.items.reduce(((e,t)=>{const s=i.getGeometry(t);return e+(null!=s&&s.coords.length||0)}),0)/t>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(e,t,i={attributes:{}}){const s=[],a=new Map,r=new Map,n=new Map,o=new Map,l=new u(e,this.featureAdapter,this.fieldsIndex),c=e.outStatistics,{groupByFieldsForStatistics:m,having:d,orderByFields:h,resultRecordCount:p}=e,f=m?.length,y=!!f,g=y?m[0]:null,x=y&&!this.fieldsIndex.get(g);for(const u of c??[]){const{outStatisticFieldName:e,statisticType:c}=u,h=u,p="exceedslimit"!==c?u.onStatisticField:void 0,I="percentile_disc"===c||"percentile_cont"===c,F="EnvelopeAggregate"===c||"CentroidAggregate"===c||"ConvexHullAggregate"===c,_=y&&1===f&&(p===g||x)&&"count"===c;if(y){if(!n.has(p)){const e=[];for(const i of m){const s=this._getAttributeValues(l,i,t,a);e.push(s)}n.set(p,this._calculateUniqueValues(e,t,!F&&l.returnDistinctValues))}const i=n.get(p);if(!i)continue;const s=Object.keys(i);for(const r of s){const{count:s,data:n,items:u,itemPositions:c}=i[r],f=n.join(",");if(!d||l.validateItems(u,d)){const i=o.get(f)||{attributes:{}};if(F){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(h,u);i.aggregateGeometries[t]=e}else{let r=null;if(_)r=s;else{const e=this._getAttributeValues(l,p,t,a),i=c.map((t=>e[t]));r=I&&"statisticParameters"in h?this._getPercentileValue(h,i):this._getStatisticValue(h,i,null,l.returnDistinctValues)}i.attributes[e]=r}let r=0;m.forEach(((e,t)=>i.attributes[this.fieldsIndex.get(e)?e:"EXPR_"+ ++r]=n[t])),o.set(f,i)}}}else if(F){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(h,t);i.aggregateGeometries[s]=e}else{const s=this._getAttributeValues(l,p,t,a);i.attributes[e]=I&&"statisticParameters"in h?this._getPercentileValue(h,s):this._getStatisticValue(h,s,r,l.returnDistinctValues)}const V="min"!==c&&"max"!==c||!T(this.fieldsIndex.get(p))&&!this._isAnyDateField(p)?null:this.fieldsIndex.get(p)?.type;s.push({name:e,alias:e,type:V||"esriFieldTypeDouble"})}const I=y?Array.from(o.values()):[i];return this._sortFeatures(I,h,((e,t)=>e.attributes[t])),p&&(I.length=Math.min(p,I.length)),{fields:s,features:I}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return g(t)||x(t)||I(t)||F(t)}async _getAggregateGeometry(e,t){const{convexHull:n,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:c,spatialReference:d,geometryType:h,hasZ:p,hasM:f}=this,y=t.map((e=>m(h,p,f,c.getGeometry(e)))),g=n(d,y,!0)[0],x={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=g?a(g):r(o(d,y));x.aggregateGeometries={...e,spatialReference:d},x.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=g?i(g):s(r(o(d,y)));x.aggregateGeometries={x:e[0],y:e[1],spatialReference:d},x.outStatisticFieldName=u||"centroid"}else"ConvexHullAggregate"===l&&(x.aggregateGeometries=g,x.outStatisticFieldName=u||"convexHull");return x}_getStatisticValue(e,t,i,s){const{onStatisticField:a,statisticType:r}=e;let n=null;n=i?.has(a)?i.get(a):T(this.fieldsIndex.get(a))||this._isAnyDateField(a)?R({values:t,returnDistinct:s}):B({values:s?[...new Set(t)]:t,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(a,n);return n["var"===r?"variance":r]}_getPercentileValue(e,t){const{onStatisticField:i,statisticParameters:s,statisticType:a}=e,{value:r,orderBy:n}=s,o=this.fieldsIndex.get(i);return N(t,{value:r,orderBy:n,fieldType:o?.type,isDiscrete:"percentile_disc"===a})}_getAttributeValues(e,t,i,s){if(s.has(t))return s.get(t);const a=this.fieldsIndex.get(t),r=i.map((i=>e.getFieldValue(i,t,a)));return s.set(t,r),r}_calculateUniqueValues(e,t,i){const s={},a=t.length;for(let r=0;r<a;r++){const a=t[r],n=[];for(const t of e)n.push(t[r]);const o=n.join(",");null==s[o]?s[o]={count:1,data:n,items:[a],itemPositions:[r]}:(i||s[o].count++,s[o].items.push(a),s[o].itemPositions.push(r))}return s}async _getDataValues(t,i,s=!0){const a=new u(this.query,this.featureAdapter,this.fieldsIndex),{valueExpression:r,scale:n,timeZone:o}=t;return r?a.getExpressionValues(i,r,{viewingMode:"map",scale:n,spatialReference:this.query.outSR||this.spatialReference},{geometryType:this.geometryType,hasZ:this.hasZ,hasM:this.hasM},o):a.getDataValues(i,e(t),s)}async _calculateHistogramBins(e,t,i){if(null==t.min&&null==t.max)return[];const s=t.intervals,a=t.min??0,r=t.max??0,n=s.map((([e,t])=>({minValue:e,maxValue:t,count:0,items:[]})));for(let o=0;o<e.length;o++){const t=e[o],l=i[o];if(null!=t&&t>=a&&t<=r){const e=Z(s,t);e>-1&&(n[e].count++,n[e].items.push(l))}}return n}async createQueryBinsResponse(e){const t=e.bin?.splitBy;if(!t)return this._createBinsResponse(e);const{value:i,outAlias:s,valueType:a}=t,r=[],n=[{name:s??i,alias:s??i,type:a??"esriFieldTypeString"},{name:G,alias:G,type:"esriFieldTypeInteger"}],o=new u(e,this.featureAdapter,this.fieldsIndex),l=new Map,c=[...this.items];this._sortFeatures(c,[i],((e,t,i)=>o.getFieldValue(e,t,i)));const m=this._getAttributeValues(o,i,c,l),d=this._calculateUniqueValues([m],c,o.returnDistinctValues);for(const u in d){const{items:t}=d[u],a=await this._createBinsResponse(e,t);if(r.push(...a.features.map((e=>({...e,attributes:{...e.attributes,[s??i]:u}})))),a.fields)for(const e of a.fields)n.some((t=>t.name===e.name))||n.push(e)}return{fields:n,features:r}}async _createBinsResponse(e,t){const i=e.bin;switch(t=t??this.items,i.type){case"autoIntervalBin":return this._createAutoIntervalBinsResponse(_.fromJSON(i),e,t);case"dateBin":return this._createDateBinsResponse(V.fromJSON(i),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(v.fromJSON(i),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(b.fromJSON(i),e,t)}}async _createAutoIntervalBinsResponse(e,t,i){const{field:s,normalizationField:a,numBins:r,normalizationType:n,normalizationTotal:o,start:l,end:u}=e,c=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),m=j(c,{field:s,normalizationField:a,normalizationType:n,normalizationTotal:o,numBins:r,minValue:p(l,!1),maxValue:p(u,!1)}),d=await this._calculateHistogramBins(c,m,i);return this._createFeaturesFromHistogramBins(d,t)}async _createDateBinsResponse(e,i,s){const{field:a,interval:r,start:n,end:o}=e,l=r.unit,u="quarters"===l?3*t.months:t[l],c=r.value*u/t.milliseconds,m=await this._getDataValues({field:e.field,timeZone:i.outTimeReference?.ianaTimeZone},s),d=F(this.fieldsIndex.get(a)),h=j(m,{field:a,classificationMethod:"defined-interval",definedInterval:c,minValue:p(n,d),maxValue:p(o,d)},!0),f=await this._calculateHistogramBins(m,h,s);return this._createFeaturesFromHistogramBins(f,i)}async _createFixedBoundariesBinsResponse(e,t,i){const{field:s}=e,a=await this._getDataValues({field:s,timeZone:t.outTimeReference?.ianaTimeZone},i),r=F(this.fieldsIndex.get(s)),n=e.boundaries.map((e=>p(e,r))).sort(((e,t)=>e-t)),o=[];for(let c=0;c<n.length-1;c++)o.push([n[c],n[c+1]]);const l={intervals:o,min:n.at(0),max:n.at(-1)},u=await this._calculateHistogramBins(a,l,i);return this._createFeaturesFromHistogramBins(u,t)}async _createFixedIntervalBinsResponse(e,t,i){const{field:s,interval:a,start:r,end:n}=e,o=await this._getDataValues({field:e.field,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal,timeZone:t.outTimeReference?.ianaTimeZone},i),l=F(this.fieldsIndex.get(s)),u=j(o,{field:s,classificationMethod:"defined-interval",definedInterval:a,minValue:p(r,l),maxValue:p(n,l)},!0),c=await this._calculateHistogramBins(o,u,i);return this._createFeaturesFromHistogramBins(c,t)}async _createFeaturesFromHistogramBins(e,t){const{upperBoundaryAlias:i,lowerBoundaryAlias:s}=t,a=s||"lowerBoundary",r=i||"upperBoundary",n=[],o=[{name:a,alias:a,type:"esriFieldTypeDouble"},{name:r,alias:r,type:"esriFieldTypeDouble"}],l=t.bin?.stackBy?.value,u=t.bin?.stackBy?.outAlias;l&&o.push({name:G,alias:G,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;for(const m of e){const{minValue:e,maxValue:i,items:s}=m,d={attributes:{}};let h;if(d.attributes[a]=e,d.attributes[r]=i,l?(h=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},s),d.attributes[G]=++c,"flat"===t.bin.jsonStyle?n.push(...h.features.map((({attributes:{EXPR_1:e,...t},...i})=>({...i,attributes:{...t,[u??e]:e,...d.attributes}})))):(d.stackedAttributes=h.features.map((({attributes:{EXPR_1:e,...t}})=>({...t,[u??e]:e}))),n.push(d))):(t.bin?.splitBy&&(d.attributes[G]=++c),h=await this._createStatisticsQueryResponse(t,s,d),n.push(d)),h.fields)for(const t of h.fields)o.some((e=>e.name===t.name))||o.push(t)}return"desc"===t.binOrder&&n.reverse(),{fields:o,features:n}}}function E(e,t,i,s){const a=s.x-i.x,r=s.y-i.y,n=t.x-i.x,o=t.y-i.y,l=a*a+r*r;if(0===l)return!1;const u=n*a+o*r,c=Math.min(1,Math.max(0,u/l));return e.x=i.x+a*c,e.y=i.y+r*c,!0}function O(e,t){return e?t?4:3:t?3:2}class H{constructor(e,t){this.coords=e,this.coordsIndex=t}get x(){return this.coords[this.coordsIndex]}get y(){return this.coords[this.coordsIndex+1]}get z(){return this.coords[this.coordsIndex+2]}}const Q=[1];export{C as QueryEngineResult};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{JSONMap as e}from"../../../core/jsonMap.js";import{getUnitString as
|
|
5
|
+
import t from"../../../core/Error.js";import{JSONMap as e}from"../../../core/jsonMap.js";import{getUnitString as i}from"../../../core/unitUtils.js";import{canProjectWithoutEngine as r}from"../../../geometry/projection.js";import{getGeometryExtent as n}from"../../../geometry/support/extentUtils.js";import{fromJSON as a,isExtent as o,isPolygon as s,isPolyline as l}from"../../../geometry/support/jsonUtils.js";import{normalizeCentralMeridian as m}from"../../../geometry/support/normalizeUtils.js";import{equals as u,isGeographic as c,isWebMercator as p,wgs84 as f}from"../../../geometry/support/spatialReferenceUtils.js";import{checkProjectionSupport as y,project as d}from"./projectionSupport.js";const g=new e({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),S=Object.freeze({}),R="frequency";async function w(t,e,i){const r=t.bin;return r.onField&&(r.onField=r.onField.trim()),r.onExpression?.value&&(r.onExpression.value=r.onExpression.value.trim()),r.splitBy&&(r.splitBy.value&&(r.splitBy.value=r.splitBy.value.trim()),r.splitBy.outAlias&&(r.splitBy.outAlias=r.splitBy.outAlias.trim())),r.stackBy&&(r.stackBy.value&&(r.stackBy.value=r.stackBy.value.trim()),r.stackBy.outAlias&&(r.stackBy.outAlias=r.stackBy.outAlias.trim())),"normalizationField"in r.parameters&&r.parameters.normalizationField&&(r.parameters.normalizationField=r.parameters.normalizationField.trim()),t.outStatistics?.length||(t.outStatistics=[{statisticType:"count",onStatisticField:"1",outStatisticFieldName:R}]),x(t,e,i)}async function x(t,e,i){const{outFields:r,orderByFields:n,groupByFieldsForStatistics:a,outStatistics:o}=t;if(r)for(let s=0;s<r.length;s++)r[s]=r[s].trim();if(n)for(let s=0;s<n.length;s++)n[s]=n[s].trim();if(a)for(let s=0;s<a.length;s++)a[s]=a[s].trim();if(o)for(let s=0;s<o.length;s++)o[s].onStatisticField&&(o[s].onStatisticField=o[s].onStatisticField.trim());return t.geometry&&!t.outSR&&(t.outSR=t.geometry.spatialReference),B(t,e,i)}async function B(t,e,i){if(!t)return null;let{where:r}=t;if(t.where=r=r?.trim(),(!r||/^1 *= *1$/.test(r)||e&&e===r)&&(t.where=null),!t.geometry)return t;let o=await v(t);if(t.distance=0,t.units=null,"esriSpatialRelEnvelopeIntersects"===t.spatialRel){const{spatialReference:e}=t.geometry;o=n(o),o.spatialReference=e}if(o){await y(o.spatialReference,i),o=j(o,i);const e=(await m(a(o)))[0];if(null==e)throw S;const r="quantizationParameters"in t&&t.quantizationParameters?.tolerance||"maxAllowableOffset"in t&&t.maxAllowableOffset||0,n=r&&F(o,i)?{densificationStep:8*r}:void 0,s=e.toJSON(),l=d(s,s.spatialReference,i,n);if(!l)throw S;l.spatialReference=i,t.geometry=l}return t}function F(t,e){if(!t)return!1;const i=t.spatialReference;return(o(t)||s(t)||l(t))&&!u(i,e)&&!r(i,e)}function j(t,e){const i=t.spatialReference;return F(t,e)&&o(t)?{spatialReference:i,rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]}:t}async function v(e){const{distance:r,units:n}=e,a=e.geometry;if(null==r||"vertexAttributes"in a)return a;const o=a.spatialReference,l=n?g.fromJSON(n):i(o),m=o&&(c(o)||p(o))?a:await y(o,f).then((()=>d(a,f))),u=await import("../../../geometry/operators/json/geodesicBufferOperator.js");await u.load();const S=u.execute(m,r,{unit:l})??void 0;if(!S||!s(S)||0===S.rings.length)throw new t("unsupported-query:invalid-parameters","Invalid parameters for query by distance");return S}function h(t,e){return null==t?null:"string"==typeof t?e?new Date(`1970-01-01T${t}Z`).getTime():new Date(t).getTime():t instanceof Date?t.getTime():t}export{h as getDateInNumber,w as normalizeAttributeBinsQuery,x as normalizeQuery,B as normalizeQueryLike,S as queryEngineEmptyResult,g as unitsKebabDict};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../../core/Error.js";import{numericFieldTypes as t,allDateAndTimeFieldTypes as i,validateFields as s,validateWhere as r,validateHaving as n}from"./attributeSupport.js";import{checkProjectionSupport as o}from"./projectionSupport.js";import{checkSpatialQuerySupport as a}from"./spatialQuerySupport.js";import{loadArcade as l}from"../../../support/arcadeOnDemand.js";const u="unsupported-query";async function p(t,i){const s=t.bin;if(!s.onField&&!s.
|
|
5
|
+
import e from"../../../core/Error.js";import{numericFieldTypes as t,allDateAndTimeFieldTypes as i,validateFields as s,validateWhere as r,validateHaving as n}from"./attributeSupport.js";import{checkProjectionSupport as o}from"./projectionSupport.js";import{checkSpatialQuerySupport as a}from"./spatialQuerySupport.js";import{loadArcade as l}from"../../../support/arcadeOnDemand.js";const u="unsupported-query";async function p(t,i){const s=t.bin;if(!s.onField&&!s.onExpression?.value||"autoIntervalBin"===s.type&&null==s.parameters.numberOfBins||"dateBin"===s.type&&(null==s.parameters.number||null==s.parameters.unit)||"fixedBoundariesBin"===s.type&&null==s.parameters.boundaries||"fixedIntervalBin"===s.type&&null==s.parameters.interval)throw new e(u,"Unsupported query options",{query:t});return c(t,i)}async function c(t,{fieldsIndex:i,geometryType:s,spatialReference:r,availableFields:n}){if(null!=t.geometryPrecision||t.multipatchOption&&"xyFootprint"!==t.multipatchOption||t.pixelSize||t.relationParam||t.text)throw new e(u,"Unsupported query options",{query:t});return d(i,n,t),m(i,n,t),Promise.all([a(t,s,r),o(r,t.outSR)]).then((()=>t))}function d(t,i,n){const{outFields:o,orderByFields:a,returnDistinctValues:l,outStatistics:p}=n,c=p?p.map((e=>e.outStatisticFieldName&&e.outStatisticFieldName.toLowerCase())).filter(Boolean):[];if(a&&a.length>0){const e=" asc",r=" desc",o=a.map((t=>{const i=t.toLowerCase();return i.includes(e)?i.split(e)[0]:i.includes(r)?i.split(r)[0]:t})).filter((e=>!c.includes(e)));s(t,i,o,{expressionName:"orderByFields",query:n})}if(o&&o.length>0)s(t,i,o,{expressionName:"outFields",query:n,allowedFieldTypes:"all"});else if(l)throw new e(u,"outFields should be specified for returnDistinctValues",{query:n});r(t,i,n.where,n)}const f=new Set([...t,...i]);function m(t,i,r){const{outStatistics:o,groupByFieldsForStatistics:a,having:l}=r,p=a?.length,c=o?.length;if(l){if(!p||!c)throw new e(u,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:r});n(t,i,l,o,r)}if(c){if(!F(o))return;const n=o.map((e=>e.onStatisticField)).filter(Boolean);s(t,i,n,{expressionName:"onStatisticFields",query:r}),p&&s(t,i,a,{expressionName:"groupByFieldsForStatistics",query:r});for(const a of o){const{onStatisticField:n,statisticType:o}=a;if(("percentile_disc"===o||"percentile_cont"===o)&&"statisticParameters"in a){const{statisticParameters:t}=a;if(!t)throw new e(u,"statisticParameters should be set for percentile type",{definition:a,query:r})}else t.get(n)&&"count"!==o&&"min"!==o&&"max"!==o&&s(t,i,[n],{expressionName:`outStatistics with '${o}' statistic type`,allowedFieldTypes:f,query:r})}}}async function y(t,i,{fieldsIndex:s,geometryType:r,spatialReference:n,availableFields:l}){if(null!=t.geometryPrecision||t.multipatchOption||t.pixelSize||t.relationParam||t.text||t.outStatistics||t.groupByFieldsForStatistics||t.having||t.orderByFields)throw new e(u,"Unsupported query options",{query:t});return d(s,l,t),Promise.all([h(s,l,i,t),a(t,r,n),o(n,t.outSR)]).then((()=>t))}async function h(t,i,r,n){let o=[];if(r.valueExpression){const{arcadeUtils:e}=await l();o=e.extractFieldNames(r.valueExpression)}if(r.field&&o.push(r.field),r.field2&&o.push(r.field2),r.field3&&o.push(r.field3),r.normalizationField&&o.push(r.normalizationField),!o.length&&!r.valueExpression)throw new e(u,"field or valueExpression is required",{params:r});s(t,i,o,{expressionName:"statistics",query:n})}function F(e){return null!=e&&e.every((e=>"exceedslimit"!==e.statisticType))}export{p as validateAttributeBinsQuery,c as validateQuery,y as validateStatisticsQuery};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import has from"../../../core/has.js";import r from"../../../core/Loadable.js";import o from"../../../core/Logger.js";import{debounce as a,eachAlways as s}from"../../../core/promiseUtils.js";import{open as i}from"../../../core/workers/workers.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{featureGeometryTypeKebabDictionary as
|
|
5
|
+
import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import t from"../../../core/Error.js";import has from"../../../core/has.js";import r from"../../../core/Loadable.js";import o from"../../../core/Logger.js";import{debounce as a,eachAlways as s}from"../../../core/promiseUtils.js";import{open as i}from"../../../core/workers/workers.js";import{property as n}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as l}from"../../../core/accessorSupport/decorators/subclass.js";import{featureGeometryTypeKebabDictionary as u}from"../../../geometry/support/typeUtils.js";import{createCapabilities as c,createDrawingInfo as p}from"./support/clientSideDefaults.js";import{getCapabilities as m,getWFSLayerInfo as d,prepareWFSLayerFields as y,findFeatureType as f}from"../../ogc/wfsUtils.js";import h from"../../../rest/support/AttributeBinsFeatureSet.js";import w from"../../../rest/support/FeatureSet.js";import{utc as g}from"../../../time/timeZoneUtils.js";import S from"../../../geometry/Extent.js";let F=class extends r{constructor(){super(...arguments),this._connection=null,this._workerHandler=null,this.capabilities=c(!1,!1),this.type="wfs",this.refresh=a((async()=>{await this.load();const e={customParameters:this.layer.customParameters,maxRecordCount:this.layer.maxRecordCount,maxTotalRecordCount:this.layer.maxTotalRecordCount,maxPageCount:this.layer.maxPageCount},{extent:t}=await this._workerHandler.refresh(e);return t&&(this.sourceJSON.extent=t),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}}))}load(e){const t=null!=e?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){this._connection?.close(),this._connection=null,this._workerHandler=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){const r=await this.queryFeaturesJSON(e,t);return w.fromJSON(r)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._workerHandler.queryFeatures(e?e.toJSON():void 0,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._workerHandler.queryFeatureCount(e?e.toJSON():void 0,t)}async queryObjectIds(e,t={}){return await this.load(t),this._workerHandler.queryObjectIds(e?e.toJSON():void 0,t)}async queryExtent(e,t={}){await this.load(t);const r=await this._workerHandler.queryExtent(e?e.toJSON():void 0,t);return{count:r.count,extent:S.fromJSON(r.extent)}}async querySnapping(e,t={}){return await this.load(t),this._workerHandler.querySnapping(e,t)}async queryAttributeBins(e,t={}){await this.load(t);const r=await this._workerHandler.queryAttributeBins(e?.toJSON(),t);return h.fromJSON(r)}async _createLoadOptions(e){const{url:r,customParameters:o,name:a,namespaceUri:s,fields:i,geometryType:n,maxRecordCount:l,maxPageCount:c,maxTotalRecordCount:p,swapXY:h}=this.layer,w="defaults"===this.layer.originOf("spatialReference")?void 0:this.layer.spatialReference;if(!r)throw new t("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await m(r,{customParameters:o,...e}));const g=["fields","geometryType","name","namespaceUri","swapXY"].some((e=>null==this.layer[e])),S=g?await d(this.wfsCapabilities,a,s,{spatialReference:w,customParameters:o,signal:e?.signal}):{...y(i??[]),geometryType:n,name:a,namespaceUri:s,spatialReference:w,swapXY:h},F=f(this.wfsCapabilities.readFeatureTypes(),S.name,S.namespaceUri),x=u.toJSON(S.geometryType),{operations:j}=this.wfsCapabilities,O=j.GetFeature.url,C=j.GetFeature.outputFormat;return{customParameters:o,featureType:F,fields:S.fields?.map((e=>e.toJSON()))??[],geometryField:S.geometryField,geometryType:x,getFeatureUrl:O,getFeatureOutputFormat:C,maxRecordCount:l,maxPageCount:c,maxTotalRecordCount:p,objectIdField:S.objectIdField,spatialReference:S.spatialReference?.toJSON(),swapXY:!!S.swapXY}}async _startWorker(e){const[t,r]=await s([this._createLoadOptions(e),i("WFSSourceWorker",{...e,strategy:has("feature-layers-workers")?"dedicated":"local",registryTarget:this})]),a=t.error||r.error||null,n=r.value||null;if(a)throw n&&n.close(),a;const l=t.value;this._connection=r.value,this._workerHandler=this._connection.createInvokeProxy();const u=await this._workerHandler.load(l,e);for(const s of u.warnings)o.getLogger(this.layer).warn("#load()",`${s.message} (title: '${this.layer.title||"no title"}', id: '${this.layer.id??"no id"}')`,{warning:s});this.sourceJSON={dateFieldsTimeReference:{timeZoneIANA:g},extent:u.extent,fields:l.fields,geometryType:l.geometryType,objectIdField:l.objectIdField,geometryField:l.geometryField,drawingInfo:p(l.geometryType),name:l.featureType.title,wfsInfo:{name:l.featureType.name,featureUrl:l.getFeatureUrl,maxFeatures:l.maxRecordCount,swapXY:l.swapXY,supportedSpatialReferences:l.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:l.featureType.namespaceUri}}}};e([n()],F.prototype,"capabilities",void 0),e([n({constructOnly:!0})],F.prototype,"layer",void 0),e([n()],F.prototype,"sourceJSON",void 0),e([n()],F.prototype,"type",void 0),e([n()],F.prototype,"wfsCapabilities",void 0),F=e([l("esri.layers.graphics.sources.WFSSource")],F);export{F as WFSSource};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
const s={supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportedStatistics:void 0},t={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsCurrentUser:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsTrueCurve:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};export{t as zeroCapabilities,s as zeroQueryBins};
|
|
5
|
+
const s={supportsDate:!1,supportsFixedInterval:!1,supportsAutoInterval:!1,supportsFixedBoundaries:!1,supportsStackBy:!1,supportsSplitBy:!1,supportsSnapToData:!1,supportsReturnFullIntervalBin:!1,supportsFirstDayOfWeek:!1,supportsNormalization:!1,supportedStatistics:void 0,supportedNormalizationTypes:void 0},t={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,isBranchVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1,supportsAsyncApplyEdits:!1,zDefault:void 0},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryBins:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1,supportsAsyncConvert3D:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},queryAttributeBins:s,query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsCurrentUser:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByAnonymous:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsReturnMesh:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsTrueCurve:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};export{t as zeroCapabilities,s as zeroQueryBins};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{id as e}from"../../kernel.js";import{symbolTypesRenderer as t}from"../../symbols.js";import{resultOrAbort as r}from"../../core/asyncUtils.js";import n from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import{parseWhereClause as i}from"../../core/sql.js";import{normalizeGlobalID as s}from"../../core/uuid.js";import{createTypeReader as a}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import{CodedValue as u}from"./CodedValue.js";import c from"./CodedValueDomain.js";import{queryAllJSON as l}from"./featureQueryAll.js";import{isStringField as p,isIntegerField as d}from"./fieldUtils.js";import{getOwningPortalUrl as f,isLayerWithFeatureCapabilities as y}from"./layerUtils.js";import m from"../../renderers/SimpleRenderer.js";import h from"../../renderers/UniqueValueRenderer.js";import w from"../../rest/support/AttachmentQuery.js";import b from"../../rest/support/Query.js";import g from"../../rest/support/RelationshipQuery.js";const I=new o({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function j(e,t,r,o){const i=await $(e);if(await F(e,t,o),!i.addAttachment)throw new n(o,"Layer source does not support addAttachment capability");return i.addAttachment(t,r)}function F(e,t,r){const{attributes:o}=t,{objectIdField:i}=e;return e.capabilities?.data?.supportsAttachment?t?o?i&&o[i]?Promise.resolve():Promise.reject(new n(r,`feature is missing the identifying attribute ${i}`)):Promise.reject(new n(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new n(r,"A feature is required to add/delete/update attachments")):Promise.reject(new n(r,"this layer doesn't support attachments"))}async function x(e,t,r,o,i){const s=await $(e);if(await F(e,t,i),!s.updateAttachment)throw new n(i,"Layer source does not support updateAttachment capability");return s.updateAttachment(t,r,o)}async function q(e,t,r){const{applyEdits:n}=await import("../graphics/editingSupport.js"),o=await e.load();let i=r;return"feature"===o.type&&o.infoFor3D&&null!=t.deleteFeatures&&null!=o.globalIdField&&(i={...i,globalIdToObjectId:await ee(o,t.deleteFeatures,o.globalIdField)}),n(o,o.source,t,r)}async function v(e,t,r){const{uploadAssets:n}=await import("../graphics/editingSupport.js"),o=await e.load();return n(o,o.source,t,r)}async function A(e,t,r,o){const i=await $(e);if(await F(e,t,o),!i.deleteAttachments)throw new n(o,"Layer source does not support deleteAttachments capability");return i.deleteAttachments(t,r)}async function S(e,t,r){const o=(await e.load({signal:t?.signal})).source;if(!o.fetchRecomputedExtents)throw new n(r,"Layer source does not support fetchUpdates capability");return o.fetchRecomputedExtents(t)}async function E(e,t,r,o){t=w.from(t),await e.load();const i=e.source,s=e.capabilities;if(!s?.data?.supportsAttachment)throw new n(o,"this layer doesn't support attachments");const{attachmentTypes:a,objectIds:u,globalIds:c,num:l,size:p,start:d,where:f}=t;if(!s?.operations?.supportsQueryAttachments){if(a?.length>0||c?.length>0||p?.length>0||l||d||f)throw new n(o,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t)}if(!(u?.length||c?.length||f))throw new n(o,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!i.queryAttachments)throw new n(o,"Layer source does not support queryAttachments capability",t);return i.queryAttachments(t)}async function O(e,t,r,o){const i=await $(e);if(!i.queryObjectIds)throw new n(o,"Layer source does not support queryObjectIds capability");return i.queryObjectIds(b.from(t)??e.createQuery(),r)}async function P(e,t,r,o){const i=await $(e);if(!i.queryFeatureCount)throw new n(o,"Layer source does not support queryFeatureCount capability");return i.queryFeatureCount(b.from(t)??e.createQuery(),r)}async function L(e,t,r,o){const i=await $(e);if(!i.queryExtent)throw new n(o,"Layer source does not support queryExtent capability");return i.queryExtent(b.from(t)??e.createQuery(),r)}async function C(e,t,r,o){const i=await $(e);if(!i.queryRelatedFeatures)throw new n(o,"Layer source does not support queryRelatedFeatures capability");return i.queryRelatedFeatures(g.from(t),r)}async function R(e,t,r,o){const i=await $(e);if(!i.queryRelatedFeaturesCount)throw new n(o,"Layer source does not support queryRelatedFeaturesCount capability");return i.queryRelatedFeaturesCount(g.from(t),r)}async function M(e){const t=e.source;if(t?.refresh)try{const{dataChanged:r,updates:n}=await t.refresh();if(null!=n&&(e.sourceJSON={...e.sourceJSON,...n},e.read(n,{origin:"service",url:e.parsedUrl})),r)return!0}catch{}if(e.definitionExpression)try{return(await i(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function D(e){const t=new b,r=e.capabilities?.data,n=e.capabilities?.query;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,n&&(t.compactGeometryEnabled=n.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&null!=e.returnZ&&(t.returnZ=e.returnZ),r.supportsM&&null!=e.returnM&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:o,timeExtent:i}=e;return t.timeExtent=null!=o&&null!=i?i.offset(-o.value,o.unit):i||null,t.multipatchOption="multipatch"===e.geometryType?"xyFootprint":null,t}function V(e){const{globalIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeGlobalID"===n.type)return n.name}function G(e){const{objectIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeOID"===n.type)return n.name}function Q(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}function U(e,t){const{subtypes:r,subtypeField:n}=e;if(!t?.attributes||!r?.length||!n)return null;const o=t.attributes[n];return null==o?null:r.find((e=>e.code===o))}function T(e,t){const{fieldsIndex:r,subtypeField:n}=e,{name:o,type:i}=r.get(t)??{};if(!o)return null;if((n&&r.get(n)?.name)===o&&e.subtypes?.length){const t=e.subtypes.map((e=>new u({code:N(e.code,i),name:e.name})));if(t?.length)return new c({codedValues:t})}return null}function k(e,t){const{fieldsIndex:r}=e,{name:n,type:o}=r.get(t)??{};if(!n)return null;if(("typeIdField"in e?r.get(e.typeIdField)?.name:null)===n&&"types"in e&&e.types?.length){const t=e.types.map((e=>new u({code:N(e.id,o),name:e.name})));return new c({codedValues:t})}return null}function N(e,t){return t?p({type:t})&&"number"==typeof e?`${e}`:d({type:t})&&"string"==typeof e?Number.parseInt(e,10):e:e}async function $(e){return(await e.load()).source}async function J(t,r){if(!e)return;if(e.findCredential(t))return;let n;try{const o=await f(t,r);o&&(n=await e.checkSignInStatus(`${o}/sharing`))}catch(o){}if(n)try{const n=null!=r?r.signal:null;await e.getCredential(t,{signal:n})}catch(o){}}async function Z(e,t,r){const n=e.parsedUrl?.path;n&&e.authenticationTriggerEvent===t&&await J(n,r)}async function H(e){const t=e.parsedUrl?.path;t&&z(e)&&await J(t)}function z(e){return B(e)&&("serviceDefinitionExpression"in e&&_(e.serviceDefinitionExpression)||"definitionExpression"in e&&_(e.definitionExpression))}function B(e){return!(!y(e)||!e.capabilities?.query.supportsCurrentUser)}function _(e){return!!e?.toLowerCase().includes("current_user")}function K(e){return!re(e)&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const W=a({types:t});function X(e,t){if(e.defaultSymbol)return e.types?.length?new h({defaultSymbol:W(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map((e=>({id:e.id,symbol:W(e.symbol,e,t)})))}):new m({symbol:W(e.defaultSymbol,e,t)})}function Y(e){let t=e.sourceJSON?.cacheMaxAge;if(!t)return!1;const r=e.editingInfo?.lastEditDate?.getTime();return null==r||(t*=1e3,Date.now()-r<t)}async function ee(e,t,n){if(null==t)return null;const o=[],{objectIdField:i}=e;if(t.forEach((e=>{let t=null;if("attributes"in e){const{attributes:r}=e;t={globalId:r[n],objectId:null!=r[i]&&-1!==r[i]?r[i]:null}}else t={globalId:e.globalId,objectId:null!=e.objectId&&-1!==e.objectId?e.objectId:null};null!=t.globalId&&(null!=t.objectId&&-1!==t.objectId||o.push(t.globalId))})),0===o.length)return null;const a=e.createQuery();a.where=o.map((e=>`${n}='${e}'`)).join(" OR "),a.returnGeometry=!1,a.outFields=[i,n],a.cacheHint=!1;const u=await r(l(e,a));if(!u.ok)return null;const c=new Map,p=u.value.features;for(const r of p){const e=r.attributes[n],t=r.attributes[i];null!=e&&null!=t&&-1!==t&&c.set(s(e),t)}return c}function te(e,t,r){if(!t||!r||!e)return null;const n=r.getAttribute(t);return null==n?null:e.find((e=>{const{id:t}=e;return null!=t&&t.toString()===n.toString()}))??null}function re(e){return e.sourceJSON?.isMultiServicesView||ne(e)}function ne(e){return!!e.sourceJSON?.capabilities?.toLowerCase().split(",").map((e=>e.trim())).includes("map")}function oe(e,t,r){const o=t?.queryAttributeBins;if(!o)throw new n(r,"Layer source does not support binning");switch(e.binParameters.type){case"auto-interval":if(!o.supportsAutoInterval)throw new n(r,"Layer source does not support auto-interval binning");break;case"date":if(!o.supportsDate)throw new n(r,"Layer source does not support date binning");break;case"fixed-boundaries":if(!o.supportsFixedBoundaries)throw new n(r,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!o.supportsFixedInterval)throw new n(r,"Layer source does not support fixed-interval binning")}const i=o?.supportedStatistics;if(e.outStatistics&&i){const t=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:o}of e.outStatistics){const e=t.get(o);if(e&&!i[e])throw new n(r,`Layer source does not support ${o} statistic type`)}}}export{j as addAttachment,q as applyEdits,H as checkCurrentUserSupport,T as computeDomainFromSubtypes,k as computeDomainFromTypes,K as computeEffectiveEditingEnabled,X as createDefaultRenderer,D as createQuery,A as deleteAttachments,J as ensureCredentialIfSignedIn,Z as ensureLayerCredential,S as fetchRecomputedExtents,I as geometryTypeKebabDict,U as getFeatureSubtype,te as getFeatureType,ee as getGlobalIdToObjectIdMap,_ as hasCurrentUser,M as hasDataChanged,Y as isLayerCacheStale,E as queryAttachments,L as queryExtent,P as queryFeatureCount,O as queryObjectIds,C as queryRelatedFeatures,R as queryRelatedFeaturesCount,V as readGlobalIdField,G as readObjectIdField,Q as readVersion,re as supportsQueryOnly,x as updateAttachment,v as uploadAssets,oe as validateBinsQuery};
|
|
5
|
+
import{id as e}from"../../kernel.js";import{symbolTypesRenderer as t}from"../../symbols.js";import{resultOrAbort as r}from"../../core/asyncUtils.js";import n from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import{parseWhereClause as i}from"../../core/sql.js";import{normalizeGlobalID as s}from"../../core/uuid.js";import{createTypeReader as a}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import{CodedValue as u}from"./CodedValue.js";import c from"./CodedValueDomain.js";import{queryAllJSON as l}from"./featureQueryAll.js";import{isStringField as p,isIntegerField as d}from"./fieldUtils.js";import{getOwningPortalUrl as f,isLayerWithFeatureCapabilities as y}from"./layerUtils.js";import m from"../../renderers/SimpleRenderer.js";import w from"../../renderers/UniqueValueRenderer.js";import h from"../../rest/support/AttachmentQuery.js";import{normalizationTypeJsonMap as b}from"../../rest/support/NormalizationBinParametersMixin.js";import g from"../../rest/support/Query.js";import I from"../../rest/support/RelationshipQuery.js";const j=new o({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function F(e,t,r,o){const i=await U(e);if(await x(e,t,o),!i.addAttachment)throw new n(o,"Layer source does not support addAttachment capability");return i.addAttachment(t,r)}function x(e,t,r){const{attributes:o}=t,{objectIdField:i}=e;return e.capabilities?.data?.supportsAttachment?t?o?i&&o[i]?Promise.resolve():Promise.reject(new n(r,`feature is missing the identifying attribute ${i}`)):Promise.reject(new n(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new n(r,"A feature is required to add/delete/update attachments")):Promise.reject(new n(r,"this layer doesn't support attachments"))}async function P(e,t,r,o,i){const s=await U(e);if(await x(e,t,i),!s.updateAttachment)throw new n(i,"Layer source does not support updateAttachment capability");return s.updateAttachment(t,r,o)}async function q(e,t,r){const{applyEdits:n}=await import("../graphics/editingSupport.js"),o=await e.load();let i=r;return"feature"===o.type&&o.infoFor3D&&null!=t.deleteFeatures&&null!=o.globalIdField&&(i={...i,globalIdToObjectId:await te(o,t.deleteFeatures,o.globalIdField)}),n(o,o.source,t,r)}async function v(e,t,r){const{uploadAssets:n}=await import("../graphics/editingSupport.js"),o=await e.load();return n(o,o.source,t,r)}async function S(e,t,r,o){const i=await U(e);if(await x(e,t,o),!i.deleteAttachments)throw new n(o,"Layer source does not support deleteAttachments capability");return i.deleteAttachments(t,r)}async function A(e,t,r){const o=(await e.load({signal:t?.signal})).source;if(!o.fetchRecomputedExtents)throw new n(r,"Layer source does not support fetchUpdates capability");return o.fetchRecomputedExtents(t)}async function L(e,t,r,o){t=h.from(t),await e.load();const i=e.source,s=e.capabilities;if(!s?.data?.supportsAttachment)throw new n(o,"this layer doesn't support attachments");const{attachmentTypes:a,objectIds:u,globalIds:c,num:l,size:p,start:d,where:f}=t;if(!s?.operations?.supportsQueryAttachments){if(a?.length>0||c?.length>0||p?.length>0||l||d||f)throw new n(o,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",t)}if(!(u?.length||c?.length||f))throw new n(o,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",t);if(!i.queryAttachments)throw new n(o,"Layer source does not support queryAttachments capability",t);return i.queryAttachments(t)}async function O(e,t,r,o){const i=await U(e);if(!i.queryObjectIds)throw new n(o,"Layer source does not support queryObjectIds capability");return i.queryObjectIds(g.from(t)??e.createQuery(),r)}async function E(e,t,r,o){const i=await U(e);if(!i.queryFeatureCount)throw new n(o,"Layer source does not support queryFeatureCount capability");return i.queryFeatureCount(g.from(t)??e.createQuery(),r)}async function D(e,t,r,o){const i=await U(e);if(!i.queryExtent)throw new n(o,"Layer source does not support queryExtent capability");return i.queryExtent(g.from(t)??e.createQuery(),r)}async function T(e,t,r,o){const i=await U(e);if(!i.queryRelatedFeatures)throw new n(o,"Layer source does not support queryRelatedFeatures capability");return i.queryRelatedFeatures(I.from(t),r)}async function C(e,t,r,o){const i=await U(e);if(!i.queryRelatedFeaturesCount)throw new n(o,"Layer source does not support queryRelatedFeaturesCount capability");return i.queryRelatedFeaturesCount(I.from(t),r)}async function R(e){const t=e.source;if(t?.refresh)try{const{dataChanged:r,updates:n}=await t.refresh();if(null!=n&&(e.sourceJSON={...e.sourceJSON,...n},e.read(n,{origin:"service",url:e.parsedUrl})),r)return!0}catch{}if(e.definitionExpression)try{return(await i(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function M(e){const t=new g,r=e.capabilities?.data,n=e.capabilities?.query;t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,n&&(t.compactGeometryEnabled=n.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&null!=e.returnZ&&(t.returnZ=e.returnZ),r.supportsM&&null!=e.returnM&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:o,timeExtent:i}=e;return t.timeExtent=null!=o&&null!=i?i.offset(-o.value,o.unit):i||null,t.multipatchOption="multipatch"===e.geometryType?"xyFootprint":null,t}function z(e){const{globalIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeGlobalID"===n.type)return n.name}function k(e){const{objectIdField:t,fields:r}=e;if(t)return t;if(r)for(const n of r)if("esriFieldTypeOID"===n.type)return n.name}function B(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}function N(e,t){const{subtypes:r,subtypeField:n}=e;if(!t?.attributes||!r?.length||!n)return null;const o=t.attributes[n];return null==o?null:r.find((e=>e.code===o))}function V(e,t){const{fieldsIndex:r,subtypeField:n}=e,{name:o,type:i}=r.get(t)??{};if(!o)return null;if((n&&r.get(n)?.name)===o&&e.subtypes?.length){const t=e.subtypes.map((e=>new u({code:Q(e.code,i),name:e.name})));if(t?.length)return new c({codedValues:t})}return null}function G(e,t){const{fieldsIndex:r}=e,{name:n,type:o}=r.get(t)??{};if(!n)return null;if(("typeIdField"in e?r.get(e.typeIdField)?.name:null)===n&&"types"in e&&e.types?.length){const t=e.types.map((e=>new u({code:Q(e.id,o),name:e.name})));return new c({codedValues:t})}return null}function Q(e,t){return t?p({type:t})&&"number"==typeof e?`${e}`:d({type:t})&&"string"==typeof e?Number.parseInt(e,10):e:e}async function U(e){return(await e.load()).source}async function J(t,r){if(!e)return;if(e.findCredential(t))return;let n;try{const o=await f(t,r);o&&(n=await e.checkSignInStatus(`${o}/sharing`))}catch(o){}if(n)try{const n=null!=r?r.signal:null;await e.getCredential(t,{signal:n})}catch(o){}}async function $(e,t,r){const n=e.parsedUrl?.path;n&&e.authenticationTriggerEvent===t&&await J(n,r)}async function Z(e){const t=e.parsedUrl?.path;t&&H(e)&&await J(t)}function H(e){return W(e)&&("serviceDefinitionExpression"in e&&_(e.serviceDefinitionExpression)||"definitionExpression"in e&&_(e.definitionExpression))}function W(e){return!(!y(e)||!e.capabilities?.query.supportsCurrentUser)}function _(e){return!!e?.toLowerCase().includes("current_user")}function K(e){return!ne(e)&&(e.userHasUpdateItemPrivileges||e.editingEnabled)}const X=a({types:t});function Y(e,t){if(e.defaultSymbol)return e.types?.length?new w({defaultSymbol:X(e.defaultSymbol,e,t),field:e.typeIdField,uniqueValueInfos:e.types.map((e=>({id:e.id,symbol:X(e.symbol,e,t)})))}):new m({symbol:X(e.defaultSymbol,e,t)})}function ee(e){let t=e.sourceJSON?.cacheMaxAge;if(!t)return!1;const r=e.editingInfo?.lastEditDate?.getTime();return null==r||(t*=1e3,Date.now()-r<t)}async function te(e,t,n){if(null==t)return null;const o=[],{objectIdField:i}=e;if(t.forEach((e=>{let t=null;if("attributes"in e){const{attributes:r}=e;t={globalId:r[n],objectId:null!=r[i]&&-1!==r[i]?r[i]:null}}else t={globalId:e.globalId,objectId:null!=e.objectId&&-1!==e.objectId?e.objectId:null};null!=t.globalId&&(null!=t.objectId&&-1!==t.objectId||o.push(t.globalId))})),0===o.length)return null;const a=e.createQuery();a.where=o.map((e=>`${n}='${e}'`)).join(" OR "),a.returnGeometry=!1,a.outFields=[i,n],a.cacheHint=!1;const u=await r(l(e,a));if(!u.ok)return null;const c=new Map,p=u.value.features;for(const r of p){const e=r.attributes[n],t=r.attributes[i];null!=e&&null!=t&&-1!==t&&c.set(s(e),t)}return c}function re(e,t,r){if(!t||!r||!e)return null;const n=r.getAttribute(t);return null==n?null:e.find((e=>{const{id:t}=e;return null!=t&&t.toString()===n.toString()}))??null}function ne(e){return e.sourceJSON?.isMultiServicesView||oe(e)}function oe(e){return!!e.sourceJSON?.capabilities?.toLowerCase().split(",").map((e=>e.trim())).includes("map")}function ie(e,t,r){const o=t?.queryAttributeBins;if(!o)throw new n(r,"Layer source does not support binning");switch(e.binParameters.type){case"auto-interval":if(!o.supportsAutoInterval)throw new n(r,"Layer source does not support auto-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!se(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new n(r,"Layer source does not support normalization binning");break;case"date":if(!o.supportsDate)throw new n(r,"Layer source does not support date binning");if(e.binParameters.snapToData&&!o.supportsSnapToData)throw new n(r,"Layer source does not support snapToData binning");if(e.binParameters.returnFullIntervalBin&&!o.supportsReturnFullIntervalBin)throw new n(r,"Layer source does not support returnFullIntervalBin binning");break;case"fixed-boundaries":if(!o.supportsFixedBoundaries)throw new n(r,"Layer source does not support fixed-boundaries binning");break;case"fixed-interval":if(!o.supportsFixedInterval)throw new n(r,"Layer source does not support fixed-interval binning");if(e.binParameters.normalizationType&&(!o.supportsNormalization||!se(e.binParameters.normalizationType,o.supportedNormalizationTypes)))throw new n(r,"Layer source does not support normalization binning")}if(e.binParameters.stackBy&&!o.supportsStackBy)throw new n(r,"Layer source does not support stackBy binning");if(e.binParameters.splitBy&&!o.supportsSplitBy)throw new n(r,"Layer source does not support splitBy binning");if(e.binParameters.firstDayOfWeek&&!o.supportsFirstDayOfWeek)throw new n(r,"Layer source does not support firstDayOfWeek binning");const i=o?.supportedStatistics;if(e.outStatistics&&i){const t=new Map([["count","count"],["sum","sum"],["min","min"],["max","max"],["avg","avg"],["stddev","stddev"],["var","var"],["percentile-continuous","percentileContinuous"],["percentile-discrete","percentileDiscrete"],["centroid-aggregate","centroid"],["convex-hull-aggregate","convexHull"],["envelope-aggregate","envelope"]]);for(const{statisticType:o}of e.outStatistics){const e=t.get(o);if(e&&!i[e])throw new n(r,`Layer source does not support ${o} statistic type`)}}}function se(e,t){return null!=e&&!!t?.[b.toJSON(e)]}export{F as addAttachment,q as applyEdits,Z as checkCurrentUserSupport,V as computeDomainFromSubtypes,G as computeDomainFromTypes,K as computeEffectiveEditingEnabled,Y as createDefaultRenderer,M as createQuery,S as deleteAttachments,J as ensureCredentialIfSignedIn,$ as ensureLayerCredential,A as fetchRecomputedExtents,j as geometryTypeKebabDict,N as getFeatureSubtype,re as getFeatureType,te as getGlobalIdToObjectIdMap,_ as hasCurrentUser,R as hasDataChanged,ee as isLayerCacheStale,L as queryAttachments,D as queryExtent,E as queryFeatureCount,O as queryObjectIds,T as queryRelatedFeatures,C as queryRelatedFeaturesCount,z as readGlobalIdField,k as readObjectIdField,B as readVersion,ne as supportsQueryOnly,P as updateAttachment,v as uploadAssets,ie as validateBinsQuery};
|