@arcgis/core 4.34.0-next.18 → 4.34.0-next.19
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/EULA.pdf +0 -0
- package/applications/MapViewer/templateUtils.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{fa894be8cfb6ed485df9.js → 025891f445869e33252b.js} +1 -1
- package/assets/esri/core/workers/chunks/{827919fe23e06e40a330.js → 1a82f903b442a3856bfa.js} +1 -1
- package/assets/esri/core/workers/chunks/22206d13a75d61d77023.js +1 -0
- package/assets/esri/core/workers/chunks/227d25fcbb5f590c4581.js +1 -0
- package/assets/esri/core/workers/chunks/{2ad538440cfb3ab94787.js → 2c0c97acb7714b1e0e01.js} +1 -1
- package/assets/esri/core/workers/chunks/3e07de009d5febd62b19.js +1 -0
- package/assets/esri/core/workers/chunks/{4325fdd96d9ea344132e.js → 4072ab8378c235a268ca.js} +1 -1
- package/assets/esri/core/workers/chunks/52410198c4b2eccfeadd.js +1 -0
- package/assets/esri/core/workers/chunks/{04e558a970c6a77f243e.js → 5cbaf4ff688aafa6643e.js} +1 -1
- package/assets/esri/core/workers/chunks/5e53c7e29bb6d43d08be.js +1 -0
- package/assets/esri/core/workers/chunks/606782a94adcce6975af.js +1 -0
- package/assets/esri/core/workers/chunks/{53e43798d08ad2075c1f.js → 758776e841fd370e3353.js} +1 -1
- package/assets/esri/core/workers/chunks/764e505f2bafdf5afaf9.js +1 -0
- package/assets/esri/core/workers/chunks/{68374cf42a069436830d.js → 8656c145ff0ca2e51ea6.js} +1 -1
- package/assets/esri/core/workers/chunks/903c7a0a47c14442d3c1.js +1 -0
- package/assets/esri/core/workers/chunks/933d4a3b0cee82cc80fe.js +1 -0
- package/assets/esri/core/workers/chunks/{66c8816e91e3f9e214d4.js → a92a344763fbc3cec71e.js} +1 -1
- package/assets/esri/core/workers/chunks/{2d89e354eeadadca4f7f.js → b421986cb4e45c632f7c.js} +1 -1
- package/assets/esri/core/workers/chunks/{872f151a3a2bc9052be0.js → c1822b03302c3db71b1f.js} +1 -1
- package/assets/esri/core/workers/chunks/d568070513f2b98fd9b5.js +1 -0
- package/assets/esri/core/workers/chunks/{5bfccd5dffda74740aa4.js → df811b31e0446de5d322.js} +1 -1
- package/assets/esri/core/workers/chunks/{85753105268aeff84e69.js → ec339075bb4faeec1413.js} +1 -1
- package/assets/esri/themes/base/widgets/_Legend.scss +2 -2
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/config.js +1 -1
- package/geometry/support/coordsUtils.js +1 -1
- package/interfaces.d.ts +63 -16
- package/kernel.js +1 -1
- package/layers/OrientedImageryLayer.js +1 -1
- package/layers/graphics/data/QueryEngineResult.js +1 -1
- package/layers/mixins/FeatureLayerBase.js +1 -1
- package/layers/orientedImagery/core/utils.js +1 -1
- package/layers/support/arcgisLayers.js +1 -1
- package/layers/support/fetchService.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/package.json +1 -1
- package/portal/support/layersLoader.js +1 -1
- package/portal/support/loadUtils.js +1 -1
- package/portal/support/portalLayers.js +1 -1
- package/request.js +1 -1
- package/rest/support/DateBinParameters.js +1 -1
- package/smartMapping/renderers/size.js +1 -1
- package/support/requestUtils.js +1 -1
- package/support/revision.js +1 -1
- package/symbols/cim/effects/EffectRadial.js +1 -1
- package/symbols/cim/utils.js +1 -1
- package/views/3d/analysis/DimensionAnalysisView3D.js +1 -1
- package/views/3d/analysis/LineOfSightAnalysisView3D.js +1 -1
- package/views/3d/analysis/SliceAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/layers/BuildingSceneLayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/support/popupHitTest.js +1 -1
- package/views/3d/webgl-engine/collections/Component/SourceGeometry.js +1 -1
- package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechnique.js +1 -1
- package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/analysis/analysisViewUtils.js +1 -1
- package/views/layers/DimensionLayerView.js +1 -1
- package/views/layers/LineOfSightLayerView.js +1 -1
- package/views/layers/ViewshedLayerView.js +1 -1
- package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
- package/widgets/FeatureTable/support/templateUtils.js +1 -1
- package/widgets/Legend/support/sizeRampUtils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/components/OrientedImageryVideoViewModel.js +1 -1
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/Print/PrintViewModel.js +1 -1
- package/widgets/Print.js +1 -1
- package/assets/esri/core/workers/chunks/1443520c9fb23381f8d5.js +0 -1
- package/assets/esri/core/workers/chunks/3f8cc157b65a9d570921.js +0 -1
- package/assets/esri/core/workers/chunks/513dc2467e9b8b8c6df4.js +0 -1
- package/assets/esri/core/workers/chunks/5ef1095842e21090f1f4.js +0 -1
- package/assets/esri/core/workers/chunks/7716a9fb380d66ba7292.js +0 -1
- package/assets/esri/core/workers/chunks/7c56740cac444419e5b4.js +0 -1
- package/assets/esri/core/workers/chunks/8855f1a6224ffbd0bb66.js +0 -1
- package/assets/esri/core/workers/chunks/885e8e90dfe5dbd5053d.js +0 -1
- package/assets/esri/core/workers/chunks/cc1328cacc4ac07eb548.js +0 -1
- package/assets/esri/core/workers/chunks/f3e179b48bca50c94538.js +0 -1
package/config.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.
|
|
5
|
+
import"./core/has.js";import{deepMerge as e}from"./core/object.js";const s={apiKey:void 0,apiKeys:{scopes:[]},applicationName:"",applicationUrl:globalThis.location?.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",userPrivilegesApplied:!0,portalUrl:"https://www.arcgis.com",respectPrefersReducedMotion:!0,routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],internalInterceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:62e3,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(e(s,globalThis.esriConfig,!0),delete s.has),!s.assetsPath){{const e="4.34.0-next.19";s.assetsPath=`https://cdn.jsdelivr.net/npm/@arcgis/core@${e}/assets`}s.defaultAssetsPath=s.assetsPath}export{s as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{equals as n}from"../../core/arrayUtils.js";import{Axis as t}from"./Axis.js";import{getInfo as r}from"./spatialReferenceUtils.js";function e(n){if(!n)return null;if(Array.isArray(n))return n;const t=n.hasZ,r=n.hasM;if("point"===n.type)return r&&t?[n.x,n.y,n.z,n.m]:t?[n.x,n.y,n.z]:r?[n.x,n.y,n.m]:[n.x,n.y];if("polygon"===n.type)return n.rings.slice();if("polyline"===n.type)return n.paths.slice();if("multipoint"===n.type)return n.points.slice();if("extent"===n.type){const t=n.clone().normalize();if(!t)return null;let r=!1,e=!1;return t.forEach((n=>{n.hasZ&&(r=!0),n.hasM&&(e=!0)})),t.map((n=>{const t=[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]];if(r&&n.hasZ){const r=.5*(n.zmax-n.zmin);for(let n=0;n<t.length;n++)t[n].push(r)}if(e&&n.hasM){const r=.5*(n.mmax-n.mmin);for(let n=0;n<t.length;n++)t[n].push(r)}return t}))}return null}function i(n,t){const r=t[0]-n[0],e=t[1]-n[1];if(n.length>2&&t.length>2){const i=n[2]-t[2];return Math.sqrt(r*r+e*e+i*i)}return Math.sqrt(r*r+e*e)}function o(n,t,r){const e=n[0]+r*(t[0]-n[0]),i=n[1]+r*(t[1]-n[1]);return n.length>2&&t.length>2?[e,i,n[2]+r*(t[2]-n[2])]:[e,i]}function s(n,t,r,e){return f(n,t,r[e],r[e+1])}function f(n,t,r,e){const[i,o]=t,[s,f]=r,[u,l]=e,c=u-s,h=l-f,p=c*c+h*h,a=(i-s)*c+(o-f)*h,y=Math.min(1,Math.max(0,a/p));return n[0]=s+c*y,n[1]=f+h*y,n}function u(n,t,r){let e,i,o,s,f=!1,u=1/0;for(r.reset();r.nextPath();)if(r.nextPoint())for(e=r.x,i=r.y;r.nextPoint();)o=r.x,s=r.y,i>t!=s>t&&n<(o-e)*(t-i)/(s-i)+e&&(f=!f),u=Math.min(u,l(n,t,e,i,o,s)),e=o,i=s;return 0===u?0:(f?1:-1)*Math.sqrt(u)}function l(n,t,r,e,i,o){let s=r,f=e,u=i-s,l=o-f;if(0!==u||0!==l){const r=((n-s)*u+(t-f)*l)/(u*u+l*l);r>1?(s=i,f=o):r>0&&(s+=u*r,f+=l*r)}return u=n-s,l=t-f,u*u+l*l}function c(n,t){return o(n,t,.5)}function h(n){const t=n.length;let r=0;for(let e=0;e<t-1;++e)r+=i(n[e],n[e+1]);return r}function p(n,t){if(t<=0)return n[0];const r=n.length;let e=0;for(let s=0;s<r-1;++s){const r=i(n[s],n[s+1]);if(t-e<r){const i=(t-e)/r;return o(n[s],n[s+1],i)}e+=r}return n[r-1]}function a(n,r=t.X,e=t.Y){let i=0;const o=n.length;let s=n[0];for(let t=1;t<o;t++){const o=n[t];i+=(o[r]-s[r])*(o[e]+s[e]),s=o}if(
|
|
5
|
+
import{equals as n}from"../../core/arrayUtils.js";import{Axis as t}from"./Axis.js";import{getInfo as r}from"./spatialReferenceUtils.js";function e(n){if(!n)return null;if(Array.isArray(n))return n;const t=n.hasZ,r=n.hasM;if("point"===n.type)return r&&t?[n.x,n.y,n.z,n.m]:t?[n.x,n.y,n.z]:r?[n.x,n.y,n.m]:[n.x,n.y];if("polygon"===n.type)return n.rings.slice();if("polyline"===n.type)return n.paths.slice();if("multipoint"===n.type)return n.points.slice();if("extent"===n.type){const t=n.clone().normalize();if(!t)return null;let r=!1,e=!1;return t.forEach((n=>{n.hasZ&&(r=!0),n.hasM&&(e=!0)})),t.map((n=>{const t=[[n.xmin,n.ymin],[n.xmin,n.ymax],[n.xmax,n.ymax],[n.xmax,n.ymin],[n.xmin,n.ymin]];if(r&&n.hasZ){const r=.5*(n.zmax-n.zmin);for(let n=0;n<t.length;n++)t[n].push(r)}if(e&&n.hasM){const r=.5*(n.mmax-n.mmin);for(let n=0;n<t.length;n++)t[n].push(r)}return t}))}return null}function i(n,t){const r=t[0]-n[0],e=t[1]-n[1];if(n.length>2&&t.length>2){const i=n[2]-t[2];return Math.sqrt(r*r+e*e+i*i)}return Math.sqrt(r*r+e*e)}function o(n,t,r){const e=n[0]+r*(t[0]-n[0]),i=n[1]+r*(t[1]-n[1]);return n.length>2&&t.length>2?[e,i,n[2]+r*(t[2]-n[2])]:[e,i]}function s(n,t,r,e){return f(n,t,r[e],r[e+1])}function f(n,t,r,e){const[i,o]=t,[s,f]=r,[u,l]=e,c=u-s,h=l-f,p=c*c+h*h,a=(i-s)*c+(o-f)*h,y=Math.min(1,Math.max(0,a/p));return n[0]=s+c*y,n[1]=f+h*y,n}function u(n,t,r){let e,i,o,s,f=!1,u=1/0;for(r.reset();r.nextPath();)if(r.nextPoint())for(e=r.x,i=r.y;r.nextPoint();)o=r.x,s=r.y,i>t!=s>t&&n<(o-e)*(t-i)/(s-i)+e&&(f=!f),u=Math.min(u,l(n,t,e,i,o,s)),e=o,i=s;return 0===u?0:(f?1:-1)*Math.sqrt(u)}function l(n,t,r,e,i,o){let s=r,f=e,u=i-s,l=o-f;if(0!==u||0!==l){const r=((n-s)*u+(t-f)*l)/(u*u+l*l);r>1?(s=i,f=o):r>0&&(s+=u*r,f+=l*r)}return u=n-s,l=t-f,u*u+l*l}function c(n,t){return o(n,t,.5)}function h(n){const t=n.length;let r=0;for(let e=0;e<t-1;++e)r+=i(n[e],n[e+1]);return r}function p(n,t){if(t<=0)return n[0];const r=n.length;let e=0;for(let s=0;s<r-1;++s){const r=i(n[s],n[s+1]);if(t-e<r){const i=(t-e)/r;return o(n[s],n[s+1],i)}e+=r}return n[r-1]}function a(n,r=t.X,e=t.Y){let i=0;const o=n.length;let s=n[0];for(let t=1;t<o;t++){const o=n[t];i+=(o[r]-s[r])*(o[e]+s[e]),s=o}if(y(n)){const t=n[0];i+=(t[r]-s[r])*(t[e]+s[e])}return i>=0}function y(t){const r=t.length;return r>0&&!n(t[0],t[r-1])}function m(n){"rings"in n&&(g(n),x(n))}function g(n){if("rings"in n)for(const t of n.rings)y(t)&&t.push(t[0].slice())}function x(n){if(!("rings"in n))return!1;if(0===n.rings.length||a(n.rings[0]))return!1;for(const t of n.rings)t.reverse();return!0}function M(n){if("polygon"!==n.type&&"polyline"!==n.type)return n;return z("polygon"===n.type?n.rings:n.paths,n.spatialReference),n}function z(n,t){const e=r(t);if(!e)return;const i=e.valid[0],o=e.valid[1],s=o-i;for(const r of n){let n=1/0,t=-1/0;for(const s of r){const r=v(s[0],i,o);n=Math.min(n,r),t=Math.max(t,r),s[0]=r}const e=t-n;s-e<e&&r.forEach((n=>{n[0]<0&&(n[0]+=s)}))}}function v(n,t,r){const e=r-t;return n<t?r-(t-n)%e:n>r?t+(n-t)%e:n}function j(n,t){if(n===t)return!0;if(n.type!==t.type)return!1;if("point"===n.type||"mesh"===n.type||"extent"===n.type)return!0;if("multipoint"===n.type)return n.points.length===t.points.length;const[r,e]="polyline"===n.type?[n.paths,t.paths]:[n.rings,t.rings];return r.length===e.length&&r.every(((n,t)=>n.length===e[t].length))}export{g as closeRings,m as closeRingsAndFixWinding,u as distanceFromPointToPolygon,l as distanceToSegmentSquared,e as geometryToCoordinates,i as getLength,c as getMidpoint,h as getPathLength,p as getPointOnPath,j as hasCompatibleTopology,a as isClockwise,s as projectPointOnLine,f as projectPointOnLineSeg,M as unnormalizeGeometryOnDatelineCrossing,z as unnormalizeVerticesOnDatelineCrossing,v as unnormalizedCoordinate};
|
package/interfaces.d.ts
CHANGED
|
@@ -61044,7 +61044,7 @@ declare namespace __esri {
|
|
|
61044
61044
|
addAttachmentResults: any[];
|
|
61045
61045
|
updateAttachmentResults: any[];
|
|
61046
61046
|
deleteAttachmentResults: any[];
|
|
61047
|
-
|
|
61047
|
+
editedFeatures?: any;
|
|
61048
61048
|
editMoment?: number;
|
|
61049
61049
|
}
|
|
61050
61050
|
|
|
@@ -68867,9 +68867,11 @@ declare namespace __esri {
|
|
|
68867
68867
|
/**
|
|
68868
68868
|
* Indicates whether the last bin should match the specified interval size exactly.
|
|
68869
68869
|
*
|
|
68870
|
+
* @default false
|
|
68871
|
+
*
|
|
68870
68872
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DateBinParameters.html#returnFullIntervalBin Read more...}
|
|
68871
68873
|
*/
|
|
68872
|
-
returnFullIntervalBin: boolean
|
|
68874
|
+
returnFullIntervalBin: boolean;
|
|
68873
68875
|
/**
|
|
68874
68876
|
* This property determines how the bins are aligned relative to the data points.
|
|
68875
68877
|
*
|
|
@@ -69001,7 +69003,7 @@ declare namespace __esri {
|
|
|
69001
69003
|
*
|
|
69002
69004
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-rest-support-DateBinParameters.html#returnFullIntervalBin Read more...}
|
|
69003
69005
|
*/
|
|
69004
|
-
returnFullIntervalBin?: boolean
|
|
69006
|
+
returnFullIntervalBin?: boolean;
|
|
69005
69007
|
/**
|
|
69006
69008
|
* This property determines how the bins are aligned relative to the data points.
|
|
69007
69009
|
*
|
|
@@ -81285,7 +81287,6 @@ declare namespace __esri {
|
|
|
81285
81287
|
colorScheme?: ColorScheme;
|
|
81286
81288
|
valueExpression?: string;
|
|
81287
81289
|
valueExpressionTitle?: string;
|
|
81288
|
-
sqlExpression?: string;
|
|
81289
81290
|
sqlWhere?: string;
|
|
81290
81291
|
filter?: FeatureFilter;
|
|
81291
81292
|
outlineOptimizationEnabled?: boolean;
|
|
@@ -82194,7 +82195,6 @@ declare namespace __esri {
|
|
|
82194
82195
|
sizeScheme?: SizeScheme;
|
|
82195
82196
|
valueExpression?: string;
|
|
82196
82197
|
valueExpressionTitle?: string;
|
|
82197
|
-
sqlExpression?: string;
|
|
82198
82198
|
sqlWhere?: string;
|
|
82199
82199
|
filter?: FeatureFilter;
|
|
82200
82200
|
outlineOptimizationEnabled?: boolean;
|
|
@@ -82873,7 +82873,6 @@ declare namespace __esri {
|
|
|
82873
82873
|
maxValue?: number;
|
|
82874
82874
|
numClasses?: number;
|
|
82875
82875
|
valueExpression?: string;
|
|
82876
|
-
sqlExpression?: string;
|
|
82877
82876
|
sqlWhere?: string;
|
|
82878
82877
|
view?: MapView | SceneView;
|
|
82879
82878
|
filter?: FeatureFilter;
|
|
@@ -92981,7 +92980,7 @@ declare namespace __esri {
|
|
|
92981
92980
|
*
|
|
92982
92981
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-AreaMeasurementAnalysisView3D.html#place Read more...}
|
|
92983
92982
|
*/
|
|
92984
|
-
place(options?: AreaMeasurementAnalysisView3DPlaceOptions | nullish): Promise<
|
|
92983
|
+
place(options?: AreaMeasurementAnalysisView3DPlaceOptions | nullish): Promise<AreaMeasurementPlacementResult>;
|
|
92985
92984
|
}
|
|
92986
92985
|
|
|
92987
92986
|
/**
|
|
@@ -92999,6 +92998,9 @@ declare namespace __esri {
|
|
|
92999
92998
|
signal?: AbortSignal | nullish;
|
|
93000
92999
|
}
|
|
93001
93000
|
|
|
93001
|
+
export interface AreaMeasurementPlacementResult {
|
|
93002
|
+
}
|
|
93003
|
+
|
|
93002
93004
|
export class DimensionAnalysisView3D extends Accessor {
|
|
93003
93005
|
/**
|
|
93004
93006
|
* The dimension analysis object associated with the analysis view.
|
|
@@ -93060,7 +93062,7 @@ declare namespace __esri {
|
|
|
93060
93062
|
*
|
|
93061
93063
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-DimensionAnalysisView3D.html#place Read more...}
|
|
93062
93064
|
*/
|
|
93063
|
-
place(options?: DimensionAnalysisView3DPlaceOptions | nullish): Promise<
|
|
93065
|
+
place(options?: DimensionAnalysisView3DPlaceOptions | nullish): Promise<DimensionPlacementResult>;
|
|
93064
93066
|
}
|
|
93065
93067
|
|
|
93066
93068
|
interface DimensionAnalysisView3DProperties {
|
|
@@ -93092,6 +93094,9 @@ declare namespace __esri {
|
|
|
93092
93094
|
signal?: AbortSignal | nullish;
|
|
93093
93095
|
}
|
|
93094
93096
|
|
|
93097
|
+
export interface DimensionPlacementResult {
|
|
93098
|
+
}
|
|
93099
|
+
|
|
93095
93100
|
export class DirectLineMeasurementAnalysisView3D {
|
|
93096
93101
|
/**
|
|
93097
93102
|
* The direct line measurement analysis object associated with the analysis view.
|
|
@@ -93133,7 +93138,7 @@ declare namespace __esri {
|
|
|
93133
93138
|
*
|
|
93134
93139
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-DirectLineMeasurementAnalysisView3D.html#place Read more...}
|
|
93135
93140
|
*/
|
|
93136
|
-
place(options?: DirectLineMeasurementAnalysisView3DPlaceOptions | nullish): Promise<
|
|
93141
|
+
place(options?: DirectLineMeasurementAnalysisView3DPlaceOptions | nullish): Promise<DirectLineMeasurementPlacementResult>;
|
|
93137
93142
|
}
|
|
93138
93143
|
|
|
93139
93144
|
/**
|
|
@@ -93152,6 +93157,9 @@ declare namespace __esri {
|
|
|
93152
93157
|
signal?: AbortSignal | nullish;
|
|
93153
93158
|
}
|
|
93154
93159
|
|
|
93160
|
+
export interface DirectLineMeasurementPlacementResult {
|
|
93161
|
+
}
|
|
93162
|
+
|
|
93155
93163
|
export class LineOfSightAnalysisResult {
|
|
93156
93164
|
/**
|
|
93157
93165
|
* The first {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html Graphic} intersected by the line of sight.
|
|
@@ -93223,13 +93231,16 @@ declare namespace __esri {
|
|
|
93223
93231
|
*
|
|
93224
93232
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-LineOfSightAnalysisView3D.html#place Read more...}
|
|
93225
93233
|
*/
|
|
93226
|
-
place(options?: LineOfSightAnalysisView3DPlaceOptions | nullish): Promise<
|
|
93234
|
+
place(options?: LineOfSightAnalysisView3DPlaceOptions | nullish): Promise<LineOfSightPlacementResult>;
|
|
93227
93235
|
}
|
|
93228
93236
|
|
|
93229
93237
|
export interface LineOfSightAnalysisView3DPlaceOptions {
|
|
93230
93238
|
signal?: AbortSignal | nullish;
|
|
93231
93239
|
}
|
|
93232
93240
|
|
|
93241
|
+
export interface LineOfSightPlacementResult {
|
|
93242
|
+
}
|
|
93243
|
+
|
|
93233
93244
|
export class SliceAnalysisView3D {
|
|
93234
93245
|
/**
|
|
93235
93246
|
* Only one {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-analysis-SliceAnalysis.html SliceAnalysis} at a time can be active in a {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-SceneView.html SceneView}.
|
|
@@ -93276,7 +93287,7 @@ declare namespace __esri {
|
|
|
93276
93287
|
*
|
|
93277
93288
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-SliceAnalysisView3D.html#place Read more...}
|
|
93278
93289
|
*/
|
|
93279
|
-
place(options?: SliceAnalysisView3DPlaceOptions | nullish): Promise<
|
|
93290
|
+
place(options?: SliceAnalysisView3DPlaceOptions | nullish): Promise<SlicePlacementResult>;
|
|
93280
93291
|
}
|
|
93281
93292
|
|
|
93282
93293
|
export interface SliceAnalysisView3DPickLayerToExcludeOptions {
|
|
@@ -93287,6 +93298,9 @@ declare namespace __esri {
|
|
|
93287
93298
|
signal?: AbortSignal | nullish;
|
|
93288
93299
|
}
|
|
93289
93300
|
|
|
93301
|
+
export interface SlicePlacementResult {
|
|
93302
|
+
}
|
|
93303
|
+
|
|
93290
93304
|
export class ViewshedAnalysisView3D {
|
|
93291
93305
|
/**
|
|
93292
93306
|
* The viewshed analysis object associated with the analysis view.
|
|
@@ -93336,7 +93350,7 @@ declare namespace __esri {
|
|
|
93336
93350
|
*
|
|
93337
93351
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-3d-analysis-ViewshedAnalysisView3D.html#place Read more...}
|
|
93338
93352
|
*/
|
|
93339
|
-
place(options?: ViewshedAnalysisView3DPlaceOptions | nullish): Promise<
|
|
93353
|
+
place(options?: ViewshedAnalysisView3DPlaceOptions | nullish): Promise<ViewshedPlacementResult>;
|
|
93340
93354
|
}
|
|
93341
93355
|
|
|
93342
93356
|
export interface ViewshedAnalysisView3DCreateViewshedsOptions {
|
|
@@ -93347,6 +93361,9 @@ declare namespace __esri {
|
|
|
93347
93361
|
signal?: AbortSignal | nullish;
|
|
93348
93362
|
}
|
|
93349
93363
|
|
|
93364
|
+
export interface ViewshedPlacementResult {
|
|
93365
|
+
}
|
|
93366
|
+
|
|
93350
93367
|
export class CloudyWeather extends Accessor {
|
|
93351
93368
|
/**
|
|
93352
93369
|
* Specifies the amount of cloud cover in the sky for a certain weather type.
|
|
@@ -95952,7 +95969,7 @@ declare namespace __esri {
|
|
|
95952
95969
|
*
|
|
95953
95970
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-DimensionLayerView.html#place Read more...}
|
|
95954
95971
|
*/
|
|
95955
|
-
place(options?: DimensionLayerViewPlaceOptions | nullish): Promise<
|
|
95972
|
+
place(options?: DimensionLayerViewPlaceOptions | nullish): Promise<DimensionPlacementResult>;
|
|
95956
95973
|
}
|
|
95957
95974
|
|
|
95958
95975
|
interface DimensionLayerViewProperties extends LayerViewProperties {
|
|
@@ -96889,7 +96906,7 @@ declare namespace __esri {
|
|
|
96889
96906
|
*
|
|
96890
96907
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-LineOfSightLayerView.html#place Read more...}
|
|
96891
96908
|
*/
|
|
96892
|
-
place(options?: LineOfSightLayerViewPlaceOptions | nullish): Promise<
|
|
96909
|
+
place(options?: LineOfSightLayerViewPlaceOptions | nullish): Promise<LineOfSightPlacementResult>;
|
|
96893
96910
|
}
|
|
96894
96911
|
|
|
96895
96912
|
interface LineOfSightLayerViewProperties extends LayerViewProperties {
|
|
@@ -97908,7 +97925,7 @@ declare namespace __esri {
|
|
|
97908
97925
|
*
|
|
97909
97926
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-views-layers-ViewshedLayerView.html#place Read more...}
|
|
97910
97927
|
*/
|
|
97911
|
-
place(options?: ViewshedLayerViewPlaceOptions | nullish): Promise<
|
|
97928
|
+
place(options?: ViewshedLayerViewPlaceOptions | nullish): Promise<ViewshedPlacementResult>;
|
|
97912
97929
|
}
|
|
97913
97930
|
|
|
97914
97931
|
interface ViewshedLayerViewProperties extends LayerViewProperties {
|
|
@@ -125636,7 +125653,10 @@ declare namespace __esri {
|
|
|
125636
125653
|
scaleBar?: any | nullish;
|
|
125637
125654
|
}
|
|
125638
125655
|
|
|
125639
|
-
export
|
|
125656
|
+
export interface PrintViewModel extends Accessor, Evented {
|
|
125657
|
+
}
|
|
125658
|
+
|
|
125659
|
+
export class PrintViewModel {
|
|
125640
125660
|
/**
|
|
125641
125661
|
* Specify the print output file format(s) that the user can select based on the options available from the print service.
|
|
125642
125662
|
*
|
|
@@ -125833,6 +125853,15 @@ declare namespace __esri {
|
|
|
125833
125853
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#createExportedFileLink Read more...}
|
|
125834
125854
|
*/
|
|
125835
125855
|
createExportedFileLink(fileName: string): FileLink;
|
|
125856
|
+
/**
|
|
125857
|
+
* Emits an event on the instance.
|
|
125858
|
+
*
|
|
125859
|
+
* @param type The name of the event.
|
|
125860
|
+
* @param event The event payload.
|
|
125861
|
+
*
|
|
125862
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#emit Read more...}
|
|
125863
|
+
*/
|
|
125864
|
+
emit(type: string, event?: any): boolean;
|
|
125836
125865
|
/**
|
|
125837
125866
|
* Exports the current print template to a file.
|
|
125838
125867
|
*
|
|
@@ -125849,12 +125878,30 @@ declare namespace __esri {
|
|
|
125849
125878
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#getLayoutTemplateById Read more...}
|
|
125850
125879
|
*/
|
|
125851
125880
|
getLayoutTemplateById(id: string): CustomTemplate | nullish;
|
|
125881
|
+
/**
|
|
125882
|
+
* Indicates whether there is an event listener on the instance that matches
|
|
125883
|
+
* the provided event name.
|
|
125884
|
+
*
|
|
125885
|
+
* @param type The name of the event.
|
|
125886
|
+
*
|
|
125887
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#hasEventListener Read more...}
|
|
125888
|
+
*/
|
|
125889
|
+
hasEventListener(type: string): boolean;
|
|
125852
125890
|
/**
|
|
125853
125891
|
* This method should be called to load the view model's printing resources.
|
|
125854
125892
|
*
|
|
125855
125893
|
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#load Read more...}
|
|
125856
125894
|
*/
|
|
125857
125895
|
load(): Promise<any>;
|
|
125896
|
+
/**
|
|
125897
|
+
* Registers an event handler on the instance.
|
|
125898
|
+
*
|
|
125899
|
+
* @param type An {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#events-summary event} or an array of events to listen for.
|
|
125900
|
+
* @param listener The function to call when the event fires.
|
|
125901
|
+
*
|
|
125902
|
+
* {@link https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Print-PrintViewModel.html#on Read more...}
|
|
125903
|
+
*/
|
|
125904
|
+
on(type: string | string[], listener: EventHandler): IHandle;
|
|
125858
125905
|
/**
|
|
125859
125906
|
* Prints (exports) the current MapView according to selected options.
|
|
125860
125907
|
*
|
package/kernel.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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.
|
|
5
|
+
import has from"./core/has.js";import{addQueryParameter as o}from"./core/urlUtils.js";export{buildDate,commitHash as revision}from"./support/revision.js";Symbol.dispose??=Symbol("Symbol.dispose"),Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");const e="4.34";let s,r=e;function i(o){s=o}function t(e){const r=s?.findCredential(e);return r?.token?o(e,"token",r.token):e}r="4.34.0-next.19",has("host-webworker")||globalThis.$arcgis||Object.defineProperty(globalThis,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),has("host-webworker");export{t as addTokenParameter,r as fullVersion,s as id,i as setId,e as version};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"./FeatureLayer.js";import{useViewTimeProperty as s}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as p,orientedImageryTypeMap as m,timeIntervalUnitTypeMap as l,verticalMeasurementTypeMap as d,isOrientationAccuracy as
|
|
5
|
+
import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/Error.js";import{clone as i}from"../core/lang.js";import{setDeepValue as r}from"../core/object.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import{subclass as a}from"../core/accessorSupport/decorators/subclass.js";import n from"./FeatureLayer.js";import{useViewTimeProperty as s}from"./mixins/TemporalLayer.js";import{getEffectiveElevationSource as p,orientedImageryTypeMap as m,timeIntervalUnitTypeMap as l,verticalMeasurementTypeMap as d,padAccuracyArray as y,isOrientationAccuracy as u}from"./orientedImagery/core/utils.js";import c from"../tables/AttributeTableTemplate.js";import{T as h}from"../chunks/TimeExtent.js";import{SaveOperationType as f}from"../webdoc/interfaces.js";const g=new Set(["demPathPrefix","demPathSuffix","depthImagePathPrefix","depthImagePathSuffix","elevationSource","horizontalMeasurementUnit","imageGeometryField","imageReferenceField","referenceIDField","sequenceOrderField","verticalMeasurementUnit","videoPathPrefix","videoPathSuffix","timeAnimation","visibilityTimeExtent"]),v=(e,t)=>!g.has(t)&&e,j=(e,t,i)=>{const r=`orientedImageryProperties.${e}`;return{name:r,write:t?{ignoreOrigin:!0,target:r,writer:t}:{ignoreOrigin:!0},read:i?{ignoreOrigin:!0,source:r,reader:i}:{ignoreOrigin:!0}}};function P(e){return e.json?(e.json.origins=e.json.origins??{},e.json.origins["web-scene"]={write:!1,read:!1},e):e}function S(e,t,i,r){const{name:o,write:a,read:n}=j(e,t,i),s={name:o,write:a,read:n,origins:{service:{name:`orientedImageryInfo.${o}`,write:t,read:i},"web-scene":{name:o,write:v(a,e),read:v(n,e)},"web-map":{name:o,write:a,read:n}}};return r&&s.origins?(s.type=r,s.origins["web-map"].type=r,s.origins["web-scene"].type=r,s):s}let x=class extends n{constructor(){super(...arguments),this.attributeTableTemplate=null,this.cameraHeading=null,this.cameraHeight=null,this.cameraPitch=null,this.cameraRoll=null,this.coveragePercent=null,this.demPathPrefix=null,this.demPathSuffix=null,this.depthImagePathPrefix=null,this.depthImagePathSuffix=null,this.elevationSource=null,this.farDistance=null,this.geometryType="point",this.horizontalFieldOfView=null,this.horizontalMeasurementUnit=null,this.imageGeometryField="ImageGeometry",this.imagePathPrefix=null,this.imagePathSuffix=null,this.imageReferenceField="OIObjectID",this.imageRotation=null,this.maximumDistance=null,this.nearDistance=null,this.operationalLayerType="OrientedImageryLayer",this.orientationAccuracy=null,this.orientedImageryType=null,this.referenceIDField="OBJECTID",this.sequenceOrderField="SequenceOrder",this.supportedSourceTypes=new Set(["Oriented Imagery Layer"]),this.type="oriented-imagery",this.timeIntervalUnit="days",this.useViewTime=!0,this.verticalFieldOfView=null,this.verticalMeasurementUnit=null,this.videoPathPrefix=null,this.videoPathSuffix=null,this.visibilityTimeExtent=null}get effectiveElevationSource(){const{elevationSource:e,demPathPrefix:t,demPathSuffix:i}=this;return p(e,t,i)}async save(e){return this._debouncedSaveOperations(f.SAVE,e)}async saveAs(e,t){return this._debouncedSaveOperations(f.SAVE_AS,t,e)}findFirstValidLayerId(e){return e.layers?.find((e=>this.supportedSourceTypes.has(e.type)))?.id}_verifySource(){if(super._verifySource(),"point"!==this.geometryType)throw new t("oriented-imagery-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};e([o({type:c,json:{write:!1,read:!1}})],x.prototype,"attributeTableTemplate",void 0),e([o({type:Number,json:S("cameraHeading")})],x.prototype,"cameraHeading",void 0),e([o({type:Number,json:S("cameraHeight")})],x.prototype,"cameraHeight",void 0),e([o({type:Number,json:S("cameraPitch")})],x.prototype,"cameraPitch",void 0),e([o({type:Number,json:S("cameraRoll")})],x.prototype,"cameraRoll",void 0),e([o({type:Number,json:S("coveragePercent")})],x.prototype,"coveragePercent",void 0),e([o({type:String,json:S("demPathPrefix")})],x.prototype,"demPathPrefix",void 0),e([o({type:String,json:S("demPathSuffix")})],x.prototype,"demPathSuffix",void 0),e([o({type:String,json:S("depthImagePathPrefix")})],x.prototype,"depthImagePathPrefix",void 0),e([o({type:String,json:S("depthImagePathSuffix")})],x.prototype,"depthImagePathSuffix",void 0),e([o({type:Object,json:S("elevationSource")})],x.prototype,"elevationSource",void 0),e([o({readOnly:!0})],x.prototype,"effectiveElevationSource",null),e([o({type:Number,json:S("farDistance")})],x.prototype,"farDistance",void 0),e([o()],x.prototype,"geometryType",void 0),e([o({type:Number,json:S("horizontalFieldOfView")})],x.prototype,"horizontalFieldOfView",void 0),e([o({type:String,json:S("horizontalMeasurementUnit")})],x.prototype,"horizontalMeasurementUnit",void 0),e([o({type:String,json:{...S("imageGeometryField"),default:"ImageGeometry"}})],x.prototype,"imageGeometryField",void 0),e([o({type:String,json:S("imagePathPrefix")})],x.prototype,"imagePathPrefix",void 0),e([o({type:String,json:S("imagePathSuffix")})],x.prototype,"imagePathSuffix",void 0),e([o({type:String,json:{...S("imageReferenceField"),default:"OIObjectID"}})],x.prototype,"imageReferenceField",void 0),e([o({type:Number,json:S("imageRotation")})],x.prototype,"imageRotation",void 0),e([o({type:Number,json:S("maximumDistance")})],x.prototype,"maximumDistance",void 0),e([o({type:Number,json:S("nearDistance")})],x.prototype,"nearDistance",void 0),e([o({type:["OrientedImageryLayer"],json:{origins:{"portal-item":{name:"layerType",write:{enabled:!0,ignoreOrigin:!0}}}}})],x.prototype,"operationalLayerType",void 0),e([o({json:{...S("orientationAccuracy",((e,t,i)=>{r(i,e.join(";"),t)}),(e=>{const t=e?.split(";")?.map(Number);return u(t)?y(t):[0,0,0,0,0,0,0,0]}),String)}})],x.prototype,"orientationAccuracy",void 0),e([o({json:{...S("orientedImageryType",m.write,m.read,m.jsonValues.slice(1))}})],x.prototype,"orientedImageryType",void 0),e([o({type:String,json:{...S("referenceIDField"),default:"OBJECTID"}})],x.prototype,"referenceIDField",void 0),e([o({type:String,json:{...S("sequenceOrderField"),default:"SequenceOrder"}})],x.prototype,"sequenceOrderField",void 0),e([o({json:{read:!1},value:"oriented-imagery",readOnly:!0})],x.prototype,"type",void 0),e([o({type:l.apiValues,json:{...S("timeIntervalUnit",l.write,l.read,l.jsonValues)}})],x.prototype,"timeIntervalUnit",void 0),e([o(P(i(s)))],x.prototype,"useViewTime",void 0),e([o({type:Number,json:S("verticalFieldOfView")})],x.prototype,"verticalFieldOfView",void 0),e([o({type:d.apiValues,json:{...S("verticalMeasurementUnit",d.write,d.read,d.jsonValues)}})],x.prototype,"verticalMeasurementUnit",void 0),e([o({type:String,json:S("videoPathPrefix")})],x.prototype,"videoPathPrefix",void 0),e([o({type:String,json:S("videoPathSuffix")})],x.prototype,"videoPathSuffix",void 0),e([o({type:h,json:{origins:{"web-scene":{write:!1,read:!1}}}})],x.prototype,"visibilityTimeExtent",void 0),x=e([a("esri.layers.OrientedImageryLayer")],x);const b=x;export{b as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{clone as e}from"../../../core/lang.js";import{polygonCentroid as t,extentCentroid as i}from"../../../geometry/support/centroid.js";import{getPolygonExtent as s,getGeometryExtent as a}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as r}from"../../../geometry/support/quantizationUtils.js";import{isValid as n,equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import l from"./AttributesBuilder.js";import{cleanFromGeometryEngine as u,getGeometry as c,transformCentroid as m}from"./geometryUtils.js";import{project as d}from"./projectionSupport.js";import{getDateInNumber as h}from"./queryUtils.js";import{makeEdgeCandidate as p,makeVertexCandidate as f}from"./SnappingCandidate.js";import{isDateField as y,isDateOnlyField as g,isTimestampOffsetField as x,isStringField as T,isTimeOnlyField as I}from"../../support/fieldUtils.js";import F from"../../../rest/support/AutoIntervalBinParameters.js";import _ from"../../../rest/support/DateBinParameters.js";import{unitsDict as V}from"../../../rest/support/DateBinUtils.js";import b from"../../../rest/support/FixedBoundariesBinParameters.js";import v from"../../../rest/support/FixedIntervalBinParameters.js";import{isNullCountSupported as S,calculateStringStatistics as R,calculateStatistics as B,processSummaryStatisticsResult as z,calculateUniqueValuesCount as A,createUVResult as M,calculateClassBreaks as w,resolveCBResult as D,calculateHistogram as P,getAttributeComparator as N,calculatePercentile as q,binIndex as Z,getBinParams as j}from"../../../statistics/utils.js";import{DateTime as G}from"luxon";const C="bin";class E{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 l(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;n(this.query.outSR)&&!o(t.spatialReference,this.query.outSR)?e.queryGeometry=u({spatialReference:this.query.outSR,...d(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=u({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,i){const s=this.featureAdapter,a=H(this.hasZ,this.hasM),{point:r,mode:n}=e,o="number"==typeof e.distance?e.distance:e.distance.x,l="number"==typeof e.distance?e.distance:e.distance.y,u={candidates:[]},c="esriGeometryPolygon"===this.geometryType,m="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,d=this._getPointCreator(n,t,this.spatialReference,i),h=new U(null,0),y=new U(null,0),g={x:0,y:0,z:0};for(const x of this.items){const t=s.getGeometry(x);if(null==t)continue;const{coords:i}=t,n=t.isPoint?Q:t.lengths;if(h.coords=i,y.coords=i,e.returnEdge){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e;for(let t=0;t<i;t++,e+=a){if(!c&&t===i-1)continue;const n=h;n.coordsIndex=e;const f=y;f.coordsIndex=t===i-1?m:e+a;const T=g;if(!O(g,r,n,f))continue;const I=(r.x-T.x)/o,F=(r.y-T.y)/l,_=I*I+F*F;_<=1&&u.candidates.push(p(s.getObjectId(x),d(T),Math.sqrt(_),d(n),d(f)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e,p=y;p.coordsIndex=m;for(let t=0;t<i;t++,e+=a){const a=h;if(a.coordsIndex=e,c&&t===i-1&&a.x===p.x&&a.y===p.y)continue;const n=(r.x-a.x)/o,m=(r.y-a.y)/l,y=n*n+m*m;y<=1&&u.candidates.push(f(s.getObjectId(x),d(a),Math.sqrt(y)))}}}else if(m&&"ends"===e.vertexMode){let e=0;const t=[];for(let i=0;i<n.length;i++){t.push(e);const s=n[i];e+=s*a,!c&&s>1&&t.push(e-a)}for(const i of t){const e=h;e.coordsIndex=i;const t=(r.x-e.x)/o,a=(r.y-e.y)/l,n=t*t+a*a;n<=1&&u.candidates.push(f(s.getObjectId(x),d(e),Math.sqrt(n)))}}}return u.candidates.sort(((e,t)=>e.distance-t.distance)),u}_getPointCreator(e,t,i,s){const a=null==s||o(i,s)?e=>e:e=>d(e,i,s),{hasZ:r}=this,n=0;return"3d"===e?r&&t?({x:e,y:t,z:i})=>a({x:e,y:t,z:i}):({x:e,y:t})=>a({x:e,y:t,z:n}):({x:e,y:t})=>a({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=y(m)||g(m)||x(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},I=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(I,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 M(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=w(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=N(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:n,spatialReference:o}=this,{outFields:l,outSR:c,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:n,spatialReference:u(c||o),transform:m&&r(m)||null}}_createFeatures(e,t){const i=new l(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:a}=this,{orderByFields:n,quantizationParameters:o,returnGeometry:u,returnCentroid:d,maxAllowableOffset:h,resultOffset:p,resultRecordCount:f,returnZ:y=!1,returnM:g=!1}=e,x=a&&y,T=s&&g;let I=[],F=0;const _=[...t];if(this._sortFeatures(_,n,((e,t,s)=>i.getFieldValue(e,t,s))),this.geometryType&&(u||d)){const e=r(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(u&&!d)for(const s of _){const a=this.featureAdapter.getGeometry(s),r={attributes:i.getAttributes(s),geometry:c(this.geometryType,this.hasZ,this.hasM,a,h,e,x,T),metadata:this.featureAdapter.getMetadata?.(s)};t&&a&&!r.geometry&&(r.centroid=m(this,this.featureAdapter.getCentroid(s,this),e)),I[F++]=r}else if(!u&&d)for(const s of _)I[F++]={attributes:i.getAttributes(s),centroid:m(this,this.featureAdapter.getCentroid(s,this),e)};else for(const s of _)I[F++]={attributes:i.getAttributes(s),centroid:m(this,this.featureAdapter.getCentroid(s,this),e),geometry:c(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(s),h,e,x,T),metadata:this.featureAdapter.getMetadata?.(s)}}else for(const r of _){const e=i.getAttributes(r);e&&(I[F++]={attributes:e})}const V=p||0;if(null!=f){const e=V+f;I=I.slice(V,Math.min(I.length,e))}return I}_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=H(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,u=new l(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 l of c??[]){const{outStatisticFieldName:e,statisticType:c}=l,h=l,p="exceedslimit"!==c?l.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(u,i,t,a);e.push(s)}n.set(p,this._calculateUniqueValues(e,t,!F&&u.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:l,itemPositions:c}=i[r],f=n.join(",");if(!d||u.validateItems(l,d)){const i=o.get(f)||{attributes:{}};if(F){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(h,l);i.aggregateGeometries[t]=e}else{let r=null;if(_)r=s;else{const e=this._getAttributeValues(u,p,t,a),i=c.map((t=>e[t]));r=I&&"statisticParameters"in h?this._getPercentileValue(h,i):this._getStatisticValue(h,i,null,u.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(u,p,t,a);i.attributes[e]=I&&"statisticParameters"in h?this._getPercentileValue(h,s):this._getStatisticValue(h,s,r,u.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 y(t)||g(t)||x(t)||I(t)}async _getAggregateGeometry(e,r){const{convexHull:n,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:m,spatialReference:d,geometryType:h,hasZ:p,hasM:f}=this,y=r.map((e=>c(h,p,f,m.getGeometry(e)))),g=n(d,y,!0)[0],x={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=g?s(g):a(o(d,y));x.aggregateGeometries={...e,spatialReference:d},x.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=g?t(g):i(a(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 q(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 l(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:C,alias:C,type:"esriFieldTypeInteger"}],o=new l(e,this.featureAdapter,this.fieldsIndex),u=new Map,c=[...this.items];this._sortFeatures(c,[i],((e,t,i)=>o.getFieldValue(e,t,i)));const m=this._getAttributeValues(o,i,c,u),d=this._calculateUniqueValues([m],c,o.returnDistinctValues);for(const l in d){const{items:t}=d[l],a=await this._createBinsResponse(e,t);if(r.push(...a.features.map((e=>({...e,attributes:{...e.attributes,[s??i]:l}})))),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(F.fromJSON(i),e,t);case"dateBin":return this._createDateBinsResponse(_.fromJSON(i),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(b.fromJSON(i),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(v.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:h(l,!1),maxValue:h(u,!1)}),d=await this._calculateHistogramBins(c,m,i);return this._createFeaturesFromHistogramBins(d,t)}async _createDateBinsResponse(e,t,i){const{field:s,interval:a,start:r,end:n}=e,o=a.unit,l=await this._getDataValues({field:e.field,timeZone:t.outTimeReference?.ianaTimeZone},i),u=I(this.fieldsIndex.get(s)),c=V.toJSON(o),m=l.filter(Boolean).sort(((e,t)=>e-t)),d=null!=r?h(r,u):m[0],p=null!=n?h(n,u):m[m.length-1],f=t.outTimeReference?.ianaTimeZone??"UTC";let y=G.fromMillis(d,{zone:f}).startOf(c);const g=G.fromMillis(p,{zone:f}),x=[];for(;y<g;){const e=y.plus({[c]:a.value});if(e>g){x.push([y.toMillis(),g.toMillis()]);break}x.push([y.toMillis(),e.toMillis()]),y=e}const T=await this._calculateHistogramBins(l,{intervals:x,min:d,max:p},i);return this._createFeaturesFromHistogramBins(T,t)}async _createFixedBoundariesBinsResponse(e,t,i){const{field:s}=e,a=await this._getDataValues({field:s,timeZone:t.outTimeReference?.ianaTimeZone},i),r=I(this.fieldsIndex.get(s)),n=e.boundaries.map((e=>h(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=I(this.fieldsIndex.get(s)),u=j(o,{field:s,classificationMethod:"defined-interval",definedInterval:a,minValue:h(r,l),maxValue:h(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:C,alias:C,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const m="dateBin"===t.bin.type,d=t.outTimeReference?.ianaTimeZone;for(const h of e){const{minValue:e,maxValue:i,items:s}=h,p={attributes:{}};let f;if(p.attributes[a]=m&&d&&null!=e?G.fromMillis(e,{zone:d}).toISO():e,p.attributes[r]=m&&d&&null!=i?G.fromMillis(i,{zone:d}).toISO():i,l?(f=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},s),p.attributes[C]=++c,"flat"===t.bin.jsonStyle?n.push(...f.features.map((({attributes:{EXPR_1:e,...t},...i})=>({...i,attributes:u??e?{...t,[u??e]:e,...p.attributes}:{...t,...p.attributes}})))):(p.stackedAttributes=f.features.map((({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t)),n.push(p))):(t.bin?.splitBy&&(p.attributes[C]=++c),f=await this._createStatisticsQueryResponse(t,s,p),n.push(p)),f.fields)for(const t of f.fields)o.some((e=>e.name===t.name))||o.push(t)}return"desc"===t.binOrder&&n.reverse(),{fields:o,features:n}}}function O(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 H(e,t){return e?t?4:3:t?3:2}class U{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{E as QueryEngineResult};
|
|
5
|
+
import{clone as e}from"../../../core/lang.js";import{polygonCentroid as t,extentCentroid as i}from"../../../geometry/support/centroid.js";import{getPolygonExtent as s,getGeometryExtent as a}from"../../../geometry/support/extentUtils.js";import{toQuantizationTransform as r}from"../../../geometry/support/quantizationUtils.js";import{isValid as n,equals as o}from"../../../geometry/support/spatialReferenceUtils.js";import l from"./AttributesBuilder.js";import{cleanFromGeometryEngine as u,getGeometry as c,transformCentroid as m}from"./geometryUtils.js";import{project as d}from"./projectionSupport.js";import{getDateInNumber as f}from"./queryUtils.js";import{makeEdgeCandidate as h,makeVertexCandidate as p}from"./SnappingCandidate.js";import{isDateField as y,isDateOnlyField as g,isTimestampOffsetField as x,isStringField as T,isTimeOnlyField as I}from"../../support/fieldUtils.js";import F from"../../../rest/support/AutoIntervalBinParameters.js";import _ from"../../../rest/support/DateBinParameters.js";import{unitsDict as V}from"../../../rest/support/DateBinUtils.js";import b from"../../../rest/support/FixedBoundariesBinParameters.js";import v from"../../../rest/support/FixedIntervalBinParameters.js";import{isNullCountSupported as S,calculateStringStatistics as R,calculateStatistics as B,processSummaryStatisticsResult as z,calculateUniqueValuesCount as M,createUVResult as A,calculateClassBreaks as w,resolveCBResult as D,calculateHistogram as P,getAttributeComparator as N,calculatePercentile as q,binIndex as Z,getBinParams as j}from"../../../statistics/utils.js";import{utc as G}from"../../../time/constants.js";import{DateTime as C}from"luxon";const E="bin";class O{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 l(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;n(this.query.outSR)&&!o(t.spatialReference,this.query.outSR)?e.queryGeometry=u({spatialReference:this.query.outSR,...d(t,t.spatialReference,this.query.outSR)}):e.queryGeometry=u({spatialReference:this.query.outSR,...t})}return e}createSnappingResponse(e,t,i){const s=this.featureAdapter,a=Q(this.hasZ,this.hasM),{point:r,mode:n}=e,o="number"==typeof e.distance?e.distance:e.distance.x,l="number"==typeof e.distance?e.distance:e.distance.y,u={candidates:[]},c="esriGeometryPolygon"===this.geometryType,m="esriGeometryPolyline"===this.geometryType||"esriGeometryPoint"===this.geometryType,d=this._getPointCreator(n,t,this.spatialReference,i),f=new U(null,0),y=new U(null,0),g={x:0,y:0,z:0};for(const x of this.items){const t=s.getGeometry(x);if(null==t)continue;const{coords:i}=t,n=t.isPoint?k:t.lengths;if(f.coords=i,y.coords=i,e.returnEdge){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e;for(let t=0;t<i;t++,e+=a){if(!c&&t===i-1)continue;const n=f;n.coordsIndex=e;const p=y;p.coordsIndex=t===i-1?m:e+a;const T=g;if(!H(g,r,n,p))continue;const I=(r.x-T.x)/o,F=(r.y-T.y)/l,_=I*I+F*F;_<=1&&u.candidates.push(h(s.getObjectId(x),d(T),Math.sqrt(_),d(n),d(p)))}}}if("all"===e.vertexMode){let e=0;for(let t=0;t<n.length;t++){const i=n[t],m=e,h=y;h.coordsIndex=m;for(let t=0;t<i;t++,e+=a){const a=f;if(a.coordsIndex=e,c&&t===i-1&&a.x===h.x&&a.y===h.y)continue;const n=(r.x-a.x)/o,m=(r.y-a.y)/l,y=n*n+m*m;y<=1&&u.candidates.push(p(s.getObjectId(x),d(a),Math.sqrt(y)))}}}else if(m&&"ends"===e.vertexMode){let e=0;const t=[];for(let i=0;i<n.length;i++){t.push(e);const s=n[i];e+=s*a,!c&&s>1&&t.push(e-a)}for(const i of t){const e=f;e.coordsIndex=i;const t=(r.x-e.x)/o,a=(r.y-e.y)/l,n=t*t+a*a;n<=1&&u.candidates.push(p(s.getObjectId(x),d(e),Math.sqrt(n)))}}}return u.candidates.sort(((e,t)=>e.distance-t.distance)),u}_getPointCreator(e,t,i,s){const a=null==s||o(i,s)?e=>e:e=>d(e,i,s),{hasZ:r}=this,n=0;return"3d"===e?r&&t?({x:e,y:t,z:i})=>a({x:e,y:t,z:i}):({x:e,y:t})=>a({x:e,y:t,z:n}):({x:e,y:t})=>a({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=y(m)||g(m)||x(m),f=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:l,timeZone:u},this.items),h=S({normalizationType:a,normalizationField:s,minValue:n,maxValue:o}),p={value:.5,fieldType:m?.type},I=T(m)?R({values:f,supportsNullCount:h,percentileParams:p,outStatisticTypes:c}):B({values:f,minValue:n,maxValue:o,useSampleStdDev:!a,supportsNullCount:h,percentileParams:p,outStatisticTypes:c});return z(I,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=M(o);return A(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,f=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items),h=w(f,{field:t,normalizationField:s,normalizationType:a,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:l,maxValue:u,numClasses:c});return D(h,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,f=await this._getDataValues({field:t,valueExpression:i,normalizationField:s,normalizationType:a,normalizationTotal:r,scale:m,timeZone:d},this.items);return P(f,{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=N(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:n,spatialReference:o}=this,{outFields:l,outSR:c,quantizationParameters:m,resultRecordCount:d,resultOffset:f,returnZ:h,returnM:p}=e,y=null!=d&&t.length>(f||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&&p,hasZ:a&&h,objectIdFieldName:n,spatialReference:u(c||o),transform:m&&r(m)||null}}_createFeatures(e,t){const i=new l(e,this.featureAdapter,this.fieldsIndex),{hasM:s,hasZ:a}=this,{orderByFields:n,quantizationParameters:o,returnGeometry:u,returnCentroid:d,maxAllowableOffset:f,resultOffset:h,resultRecordCount:p,returnZ:y=!1,returnM:g=!1}=e,x=a&&y,T=s&&g;let I=[],F=0;const _=[...t];if(this._sortFeatures(_,n,((e,t,s)=>i.getFieldValue(e,t,s))),this.geometryType&&(u||d)){const e=r(o)??void 0,t="esriGeometryPolygon"===this.geometryType||"esriGeometryPolyline"===this.geometryType;if(u&&!d)for(const s of _){const a=this.featureAdapter.getGeometry(s),r={attributes:i.getAttributes(s),geometry:c(this.geometryType,this.hasZ,this.hasM,a,f,e,x,T),metadata:this.featureAdapter.getMetadata?.(s)};t&&a&&!r.geometry&&(r.centroid=m(this,this.featureAdapter.getCentroid(s,this),e)),I[F++]=r}else if(!u&&d)for(const s of _)I[F++]={attributes:i.getAttributes(s),centroid:m(this,this.featureAdapter.getCentroid(s,this),e)};else for(const s of _)I[F++]={attributes:i.getAttributes(s),centroid:m(this,this.featureAdapter.getCentroid(s,this),e),geometry:c(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(s),f,e,x,T),metadata:this.featureAdapter.getMetadata?.(s)}}else for(const r of _){const e=i.getAttributes(r);e&&(I[F++]={attributes:e})}const V=h||0;if(null!=p){const e=V+p;I=I.slice(V,Math.min(I.length,e))}return I}_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=Q(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,u=new l(e,this.featureAdapter,this.fieldsIndex),c=e.outStatistics,{groupByFieldsForStatistics:m,having:d,orderByFields:f,resultRecordCount:h}=e,p=m?.length,y=!!p,g=y?m[0]:null,x=y&&!this.fieldsIndex.get(g);for(const l of c??[]){const{outStatisticFieldName:e,statisticType:c}=l,f=l,h="exceedslimit"!==c?l.onStatisticField:void 0,I="percentile_disc"===c||"percentile_cont"===c,F="EnvelopeAggregate"===c||"CentroidAggregate"===c||"ConvexHullAggregate"===c,_=y&&1===p&&(h===g||x)&&"count"===c;if(y){if(!n.has(h)){const e=[];for(const i of m){const s=this._getAttributeValues(u,i,t,a);e.push(s)}n.set(h,this._calculateUniqueValues(e,t,!F&&u.returnDistinctValues))}const i=n.get(h);if(!i)continue;const s=Object.keys(i);for(const r of s){const{count:s,data:n,items:l,itemPositions:c}=i[r],p=n.join(",");if(!d||u.validateItems(l,d)){const i=o.get(p)||{attributes:{}};if(F){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:t}=await this._getAggregateGeometry(f,l);i.aggregateGeometries[t]=e}else{let r=null;if(_)r=s;else{const e=this._getAttributeValues(u,h,t,a),i=c.map((t=>e[t]));r=I&&"statisticParameters"in f?this._getPercentileValue(f,i):this._getStatisticValue(f,i,null,u.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(p,i)}}}else if(F){i.aggregateGeometries||(i.aggregateGeometries={});const{aggregateGeometries:e,outStatisticFieldName:s}=await this._getAggregateGeometry(f,t);i.aggregateGeometries[s]=e}else{const s=this._getAttributeValues(u,h,t,a);i.attributes[e]=I&&"statisticParameters"in f?this._getPercentileValue(f,s):this._getStatisticValue(f,s,r,u.returnDistinctValues)}const V="min"!==c&&"max"!==c||!T(this.fieldsIndex.get(h))&&!this._isAnyDateField(h)?null:this.fieldsIndex.get(h)?.type;s.push({name:e,alias:e,type:V||"esriFieldTypeDouble"})}const I=y?Array.from(o.values()):[i];return this._sortFeatures(I,f,((e,t)=>e.attributes[t])),h&&(I.length=Math.min(h,I.length)),{fields:s,features:I}}_isAnyDateField(e){const t=this.fieldsIndex.get(e);return y(t)||g(t)||x(t)||I(t)}async _getAggregateGeometry(e,r){const{convexHull:n,union:o}=await import("../../../geometry/geometryEngineJSON.js"),{statisticType:l,outStatisticFieldName:u}=e,{featureAdapter:m,spatialReference:d,geometryType:f,hasZ:h,hasM:p}=this,y=r.map((e=>c(f,h,p,m.getGeometry(e)))),g=n(d,y,!0)[0],x={aggregateGeometries:null,outStatisticFieldName:null};if("EnvelopeAggregate"===l){const e=g?s(g):a(o(d,y));x.aggregateGeometries={...e,spatialReference:d},x.outStatisticFieldName=u||"extent"}else if("CentroidAggregate"===l){const e=g?t(g):i(a(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 q(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 l(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:E,alias:E,type:"esriFieldTypeInteger"}],o=new l(e,this.featureAdapter,this.fieldsIndex),u=new Map,c=[...this.items];this._sortFeatures(c,[i],((e,t,i)=>o.getFieldValue(e,t,i)));const m=this._getAttributeValues(o,i,c,u),d=this._calculateUniqueValues([m],c,o.returnDistinctValues);for(const l in d){const{items:t}=d[l],a=await this._createBinsResponse(e,t);if(r.push(...a.features.map((e=>({...e,attributes:{...e.attributes,[s??i]:l}})))),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(F.fromJSON(i),e,t);case"dateBin":return this._createDateBinsResponse(_.fromJSON(i),e,t);case"fixedBoundariesBin":return this._createFixedBoundariesBinsResponse(b.fromJSON(i),e,t);case"fixedIntervalBin":return this._createFixedIntervalBinsResponse(v.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:f(l,!1),maxValue:f(u,!1)}),d=await this._calculateHistogramBins(c,m,i);return this._createFeaturesFromHistogramBins(d,t)}async _createDateBinsResponse(e,t,i){const{field:s,interval:a,start:r,end:n,snapToData:o,returnFullIntervalBin:l}=e,u=a.unit,c=await this._getDataValues({field:e.field,timeZone:t.outTimeReference?.ianaTimeZone},i),m=I(this.fieldsIndex.get(s)),d=V.toJSON(u),h=c.filter(Boolean).sort(((e,t)=>e-t)),p=null!=r?f(r,m):h[0],y=null!=n?f(n,m):h[h.length-1],g={zone:t.outTimeReference?.ianaTimeZone??G},x=C.fromMillis(p,g),T=C.fromMillis(y,g),F=[];if("last"===o){let e=T;for(;e>x;){const t=e.minus({[d]:a.value});if(t<x){F.unshift([l?t.toMillis():x.toMillis(),e.toMillis()]);break}F.unshift([t.toMillis(),e.toMillis()]),e=t}}else{let e="first"===o?x:x.startOf(d);for(;e<=T;){const t=e.plus({[d]:a.value});if(t>T){F.push([e.toMillis(),l?t.toMillis():T.toMillis()]);break}F.push([e.toMillis(),t.toMillis()]),e=t}}const _=await this._calculateHistogramBins(c,{intervals:F,min:p,max:y},i);return this._createFeaturesFromHistogramBins(_,t)}async _createFixedBoundariesBinsResponse(e,t,i){const{field:s}=e,a=await this._getDataValues({field:s,timeZone:t.outTimeReference?.ianaTimeZone},i),r=I(this.fieldsIndex.get(s)),n=e.boundaries.map((e=>f(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=I(this.fieldsIndex.get(s)),u=j(o,{field:s,classificationMethod:"defined-interval",definedInterval:a,minValue:f(r,l),maxValue:f(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:E,alias:E,type:"esriFieldTypeInteger"},{name:u??l,alias:u??l,type:"esriFieldTypeString"});let c=0;const m="dateBin"===t.bin.type,d=t.outTimeReference?.ianaTimeZone;for(const f of e){const{minValue:e,maxValue:i,items:s}=f,h={attributes:{}};let p;if(h.attributes[a]=m&&d&&null!=e?C.fromMillis(e,{zone:d}).toISO():e,h.attributes[r]=m&&d&&null!=i?C.fromMillis(i,{zone:d}).toISO():i,l?(p=await this._createStatisticsQueryResponse({...t,groupByFieldsForStatistics:[l],orderByFields:[l]},s),h.attributes[E]=++c,"flat"===t.bin.jsonStyle?n.push(...p.features.map((({attributes:{EXPR_1:e,...t},...i})=>({...i,attributes:u??e?{...t,[u??e]:e,...h.attributes}:{...t,...h.attributes}})))):(h.stackedAttributes=p.features.map((({attributes:{EXPR_1:e,...t}})=>u??e?{...t,[u??e]:e}:t)),n.push(h))):(t.bin?.splitBy&&(h.attributes[E]=++c),p=await this._createStatisticsQueryResponse(t,s,h),n.push(h)),p.fields)for(const t of p.fields)o.some((e=>e.name===t.name))||o.push(t)}return"desc"===t.binOrder&&n.reverse(),{fields:o,features:n}}}function H(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 Q(e,t){return e?t?4:3:t?3:2}class U{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 k=[1];export{O 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.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{hasSameOrigin as o,getHost as s,changeHost as n}from"../../core/urlUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as u}from"../../core/accessorSupport/layerContainerType.js";import{OriginId as c,idToName as y}from"../../core/accessorSupport/PropertyOrigin.js";import f from"../../geometry/Extent.js";import m from"../../geometry/HeightModelInfo.js";import h from"../../geometry/SpatialReference.js";import{sanitizeUrlWithLayerId as v,writeUrlWithLayerId as g}from"../support/arcgisLayerUrl.js";import{elevationInfo as I,maxScale as F,minScale as S,url as j}from"../support/commonProperties.js";import b from"../support/EditFieldsInfo.js";import{FeatureIndex as E}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as U,hasCurrentUser as x,isLayerCacheStale as O,supportsQueryOnly as D,readGlobalIdField as M,readObjectIdField as T,readVersion as w}from"../support/featureLayerUtils.js";import R from"../support/GeometryFieldsInfo.js";import C from"../support/LayerFloorInfo.js";import{isPreferredUrlApplicable as B,getPreferredUrl as H,applyPreferredHostToPortalItem as A,getPreferredHost as Q}from"../support/layerUtils.js";import P from"../support/Relationship.js";import{getFeatureLayerCapabilities as q}from"../support/serviceCapabilitiesUtils.js";import V from"../support/Subtype.js";import{hasTypeKeyword as _,typeKeyword as G}from"../../portal/support/portalItemUtils.js";import{timeZoneProperty as Z}from"../../time/timeZoneUtils.js";const k=k=>{let L=class extends k{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.fieldsIndex=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(E)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=h.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.uniqueIdFields=null,this.version=void 0,this._isUrlHostModified=!1}getFieldDomain(){throw new Error("Not implemented")}getField(e){return this.fieldsIndex.get(e)}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:r,editing:i}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(r.supportsEditing&&!(i.supportsUpdateByOthers&&i.supportsUpdateByAnonymous&&i.supportsDeleteByOthers&&i.supportsDeleteByAnonymous))return"load"}if(x(this.serviceDefinitionExpression)||x(this.definitionExpression))return"load";if(this.userHasUpdateItemPrivileges){if(O(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return q(t,this.url)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=r(e),{operations:i,editing:o}=t;return D(this)?(this.userHasUpdateItemPrivileges&&(i.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(i.supportsAdd=i.supportsDelete=i.supportsEditing=i.supportsQuery=i.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&i.supportsEditing&&(i.supportsAdd=i.supportsDelete=i.supportsUpdate=o.supportsGeometryUpdate=!0),t)}get effectiveEditingEnabled(){return!1}readGlobalIdFieldFromService(e,t){return M(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||D(this))return!1;const{operations:t,editing:r}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:r}=e;return D(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return T(t)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readUniqueIdFields(e,t){return t.uniqueIdInfo?.OIDFieldContainsHashValue?t.uniqueIdInfo.fields:null}set url(e){if(null==e)return void this._set("url",e);const t=v({layer:this,url:e,nonStandardUrlAllowed:!0,logger:i.getLogger(this)});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){g(this,e,null,t,i)}readVersion(e,t){return w(t)}get isUrlHostModified(){const{loaded:e,url:t,_isUrlHostModified:r}=this;if(r)return!0;if(!e||!t)return!1;if(this.originIdOf("url")<c.USER)return!1;const i=this.sourceJSON?.preferredHost;if(!i)return!1;if(!o(t,`https://${i}`,!0))return!1;for(let s=c.USER-1;s>=c.PORTAL_ITEM;s--){const e=this.getAtOrigin("url",y(s));if(e)return!o(t,e,!0)}return!1}applyPreferredHost(e){const{url:t,portalItem:r}=this;if(!t||!B(r))return;const i=H(t,e);i&&(this._set("url",i),this._isUrlHostModified=!0,r&&A(r,Q(e)))}applyHostFromPortalItem(){const{url:e,portalItem:t}=this;if(!e||this.originIdOf("url")===c.USER||!t?.url||!B(t)||!_(t,G.HOSTED_SERVICE)||o(e,t.url,!0))return;const r=s(t.url);this._set("url",n(e,r)),this._isUrlHostModified=!0}};return e([p({readOnly:!0})],L.prototype,"authenticationTriggerEvent",null),e([p({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],L.prototype,"copyright",void 0),e([p({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","maxUniqueIDCount","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],L.prototype,"capabilities",void 0),e([l("service","capabilities")],L.prototype,"readCapabilitiesFromService",null),e([p(Z("dateFieldsTimeReference"))],L.prototype,"dateFieldsTimeZone",void 0),e([p({type:Boolean})],L.prototype,"datesInUnknownTimezone",void 0),e([p({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],L.prototype,"definitionExpression",void 0),e([p({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],L.prototype,"displayField",void 0),e([p({readOnly:!0,type:b})],L.prototype,"editFieldsInfo",void 0),e([p({readOnly:!0})],L.prototype,"editingInfo",void 0),e([l("editingInfo")],L.prototype,"readEditingInfo",null),e([p({readOnly:!0})],L.prototype,"effectiveCapabilities",null),e([p()],L.prototype,"effectiveEditingEnabled",null),e([p((()=>{const e=r(I),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],L.prototype,"elevationInfo",void 0),e([p()],L.prototype,"fieldsIndex",void 0),e([p({type:C,json:{name:"layerDefinition.floorInfo",write:{layerContainerTypes:u}}})],L.prototype,"floorInfo",void 0),e([p({type:f,json:{origins:{service:{read:{source:"extent"}}}}})],L.prototype,"fullExtent",void 0),e([p()],L.prototype,"gdbVersion",void 0),e([p({readOnly:!0,type:R,json:{read:{source:"geometryProperties"}}})],L.prototype,"geometryFieldsInfo",void 0),e([p({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:U.read}}}})],L.prototype,"geometryType",void 0),e([p({type:String})],L.prototype,"globalIdField",void 0),e([l("service","globalIdField",["globalIdField","fields"])],L.prototype,"readGlobalIdFieldFromService",null),e([p({readOnly:!0})],L.prototype,"hasFullEditingRestrictions",null),e([p({type:Boolean,json:{origins:{service:{read:!0}}}})],L.prototype,"hasM",void 0),e([p({readOnly:!0})],L.prototype,"hasUpdateItemRestrictions",null),e([p({type:Boolean,json:{origins:{service:{read:!0}}}})],L.prototype,"hasZ",void 0),e([p({readOnly:!0,type:m})],L.prototype,"heightModelInfo",void 0),e([p({type:Date})],L.prototype,"historicMoment",void 0),e([p({type:t.ofType(E),readOnly:!0})],L.prototype,"indexes",void 0),e([p({readOnly:!0})],L.prototype,"isTable",void 0),e([l("service","isTable",["type"])],L.prototype,"readIsTableFromService",null),e([p({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],L.prototype,"layerId",void 0),e([p(F)],L.prototype,"maxScale",void 0),e([l("service","maxScale",["maxScale","effectiveMaxScale"])],L.prototype,"readMaxScale",null),e([p(S)],L.prototype,"minScale",void 0),e([l("service","minScale",["minScale","effectiveMinScale"])],L.prototype,"readMinScale",null),e([p({type:String})],L.prototype,"objectIdField",void 0),e([l("service","objectIdField",["objectIdField","fields"])],L.prototype,"readObjectIdFieldFromService",null),e([p(Z("preferredTimeReference"))],L.prototype,"preferredTimeZone",void 0),e([p({type:[P],readOnly:!0})],L.prototype,"relationships",void 0),e([p({type:Boolean})],L.prototype,"returnM",void 0),e([p({type:Boolean})],L.prototype,"returnZ",void 0),e([p({readOnly:!0,json:{write:!1}})],L.prototype,"serverGens",void 0),e([p({readOnly:!0})],L.prototype,"serviceDefinitionExpression",void 0),e([l("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],L.prototype,"readServiceDefinitionExpression",null),e([p({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],L.prototype,"serviceItemId",void 0),e([p()],L.prototype,"sourceJSON",void 0),e([p({type:h,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],L.prototype,"spatialReference",void 0),e([p({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],L.prototype,"subtypeField",void 0),e([p({type:[V],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],L.prototype,"subtypes",void 0),e([p({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],L.prototype,"trackIdField",void 0),e([p({type:[String],readOnly:!0})],L.prototype,"uniqueIdFields",void 0),e([l("service","uniqueIdFields",["uniqueIdInfo.OIDFieldContainsHashValue","uniqueIdInfo.fields"])],L.prototype,"readUniqueIdFields",null),e([p(j)],L.prototype,"url",null),e([a("url")],L.prototype,"writeUrl",null),e([p({json:{origins:{service:{read:!0}},read:!1}})],L.prototype,"version",void 0),e([l("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],L.prototype,"readVersion",null),e([p({readOnly:!0})],L.prototype,"isUrlHostModified",null),L=e([d("esri.layers.mixins.FeatureLayerBase")],L),L};export{k as FeatureLayerBase};
|
|
5
|
+
import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{clone as i}from"../../core/lang.js";import r from"../../core/Logger.js";import{hasSameOrigin as o,getHost as s,changeHost as n}from"../../core/urlUtils.js";import{property as p}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as l}from"../../core/accessorSupport/decorators/reader.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as u}from"../../core/accessorSupport/layerContainerType.js";import{OriginId as c,idToName as y}from"../../core/accessorSupport/PropertyOrigin.js";import f from"../../geometry/Extent.js";import m from"../../geometry/HeightModelInfo.js";import h from"../../geometry/SpatialReference.js";import{sanitizeUrlWithLayerId as v,writeUrlWithLayerId as g}from"../support/arcgisLayerUrl.js";import{elevationInfo as I,maxScale as F,minScale as S,url as j}from"../support/commonProperties.js";import b from"../support/EditFieldsInfo.js";import{FeatureIndex as E}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as U,hasCurrentUser as x,isLayerCacheStale as O,supportsQueryOnly as M,readGlobalIdField as D,readObjectIdField as T,readVersion as w}from"../support/featureLayerUtils.js";import R from"../support/GeometryFieldsInfo.js";import H from"../support/LayerFloorInfo.js";import{isPreferredUrlApplicable as C,getPreferredUrl as B,applyPreferredHostToPortalItem as A,getPreferredHost as Q}from"../support/layerUtils.js";import _ from"../support/Relationship.js";import{getFeatureLayerCapabilities as P}from"../support/serviceCapabilitiesUtils.js";import q from"../support/Subtype.js";import{hasTypeKeyword as V,typeKeyword as G}from"../../portal/support/portalItemUtils.js";import{timeZoneProperty as Z}from"../../time/timeZoneUtils.js";const k=k=>{let L=class extends k{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.fieldsIndex=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(E)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=h.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.uniqueIdFields=null,this.version=void 0,this._isUrlHostModified=!1,this._isUrlHostModificationEnabled=!1}getFieldDomain(){throw new Error("Not implemented")}getField(e){return this.fieldsIndex.get(e)}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:i,editing:r}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(i.supportsEditing&&!(r.supportsUpdateByOthers&&r.supportsUpdateByAnonymous&&r.supportsDeleteByOthers&&r.supportsDeleteByAnonymous))return"load"}if(x(this.serviceDefinitionExpression)||x(this.definitionExpression))return"load";if(this.userHasUpdateItemPrivileges){if(O(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return P(t,this.url)}readEditingInfo(e,t){const{editingInfo:i}=t;return i?{lastEditDate:null!=i.lastEditDate?new Date(i.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=i(e),{operations:r,editing:o}=t;return M(this)?(this.userHasUpdateItemPrivileges&&(r.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(r.supportsAdd=r.supportsDelete=r.supportsEditing=r.supportsQuery=r.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&r.supportsEditing&&(r.supportsAdd=r.supportsDelete=r.supportsUpdate=o.supportsGeometryUpdate=!0),t)}get effectiveEditingEnabled(){return!1}readGlobalIdFieldFromService(e,t){return D(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||M(this))return!1;const{operations:t,editing:i}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&i.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:i}=e;return M(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&i.supportsDeleteByOthers&&i.supportsGeometryUpdate&&i.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return T(t)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}readUniqueIdFields(e,t){return t.uniqueIdInfo?.OIDFieldContainsHashValue?t.uniqueIdInfo.fields:null}set url(e){if(null==e)return void this._set("url",e);const t=v({layer:this,url:e,nonStandardUrlAllowed:!0,logger:r.getLogger(this)});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,i,r){g(this,e,null,t,r)}readVersion(e,t){return w(t)}get isUrlHostModified(){const{loaded:e,url:t,_isUrlHostModified:i}=this;if(i)return!0;if(!e||!t)return!1;if(this.originIdOf("url")<c.USER)return!1;const r=this.sourceJSON?.preferredHost;if(!r)return!1;if(!o(t,`https://${r}`,!0))return!1;for(let s=c.USER-1;s>=c.PORTAL_ITEM;s--){const e=this.getAtOrigin("url",y(s));if(e)return!o(t,e,!0)}return!1}applyPreferredHost(e){const{url:t,portalItem:i}=this;if(!t||!C(i))return;const r=B();r&&this._isUrlHostModificationEnabled&&(this._set("url",r),this._isUrlHostModified=!0,i&&A(i,Q()))}applyHostFromPortalItem(){const{url:e,portalItem:t}=this;if(!e||this.originIdOf("url")===c.USER||!t?.url||!C(t)||!V(t,G.HOSTED_SERVICE)||o(e,t.url,!0)||!this._isUrlHostModificationEnabled)return;const i=s(t.url);this._set("url",n(e,i)),this._isUrlHostModified=!0}};return e([p({readOnly:!0})],L.prototype,"authenticationTriggerEvent",null),e([p({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],L.prototype,"copyright",void 0),e([p({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","isDataBranchVersioned","isDataVersioned","maxRecordCount","maxRecordCountFactor","maxUniqueIDCount","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],L.prototype,"capabilities",void 0),e([l("service","capabilities")],L.prototype,"readCapabilitiesFromService",null),e([p(Z("dateFieldsTimeReference"))],L.prototype,"dateFieldsTimeZone",void 0),e([p({type:Boolean})],L.prototype,"datesInUnknownTimezone",void 0),e([p({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],L.prototype,"definitionExpression",void 0),e([p({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],L.prototype,"displayField",void 0),e([p({readOnly:!0,type:b})],L.prototype,"editFieldsInfo",void 0),e([p({readOnly:!0})],L.prototype,"editingInfo",void 0),e([l("editingInfo")],L.prototype,"readEditingInfo",null),e([p({readOnly:!0})],L.prototype,"effectiveCapabilities",null),e([p()],L.prototype,"effectiveEditingEnabled",null),e([p((()=>{const e=i(I),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],L.prototype,"elevationInfo",void 0),e([p()],L.prototype,"fieldsIndex",void 0),e([p({type:H,json:{name:"layerDefinition.floorInfo",write:{layerContainerTypes:u}}})],L.prototype,"floorInfo",void 0),e([p({type:f,json:{origins:{service:{read:{source:"extent"}}}}})],L.prototype,"fullExtent",void 0),e([p()],L.prototype,"gdbVersion",void 0),e([p({readOnly:!0,type:R,json:{read:{source:"geometryProperties"}}})],L.prototype,"geometryFieldsInfo",void 0),e([p({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:U.read}}}})],L.prototype,"geometryType",void 0),e([p({type:String})],L.prototype,"globalIdField",void 0),e([l("service","globalIdField",["globalIdField","fields"])],L.prototype,"readGlobalIdFieldFromService",null),e([p({readOnly:!0})],L.prototype,"hasFullEditingRestrictions",null),e([p({type:Boolean,json:{origins:{service:{read:!0}}}})],L.prototype,"hasM",void 0),e([p({readOnly:!0})],L.prototype,"hasUpdateItemRestrictions",null),e([p({type:Boolean,json:{origins:{service:{read:!0}}}})],L.prototype,"hasZ",void 0),e([p({readOnly:!0,type:m})],L.prototype,"heightModelInfo",void 0),e([p({type:Date})],L.prototype,"historicMoment",void 0),e([p({type:t.ofType(E),readOnly:!0})],L.prototype,"indexes",void 0),e([p({readOnly:!0})],L.prototype,"isTable",void 0),e([l("service","isTable",["type"])],L.prototype,"readIsTableFromService",null),e([p({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],L.prototype,"layerId",void 0),e([p(F)],L.prototype,"maxScale",void 0),e([l("service","maxScale",["maxScale","effectiveMaxScale"])],L.prototype,"readMaxScale",null),e([p(S)],L.prototype,"minScale",void 0),e([l("service","minScale",["minScale","effectiveMinScale"])],L.prototype,"readMinScale",null),e([p({type:String})],L.prototype,"objectIdField",void 0),e([l("service","objectIdField",["objectIdField","fields"])],L.prototype,"readObjectIdFieldFromService",null),e([p(Z("preferredTimeReference"))],L.prototype,"preferredTimeZone",void 0),e([p({type:[_],readOnly:!0})],L.prototype,"relationships",void 0),e([p({type:Boolean})],L.prototype,"returnM",void 0),e([p({type:Boolean})],L.prototype,"returnZ",void 0),e([p({readOnly:!0,json:{write:!1}})],L.prototype,"serverGens",void 0),e([p({readOnly:!0})],L.prototype,"serviceDefinitionExpression",void 0),e([l("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],L.prototype,"readServiceDefinitionExpression",null),e([p({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],L.prototype,"serviceItemId",void 0),e([p()],L.prototype,"sourceJSON",void 0),e([p({type:h,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],L.prototype,"spatialReference",void 0),e([p({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],L.prototype,"subtypeField",void 0),e([p({type:[q],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],L.prototype,"subtypes",void 0),e([p({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],L.prototype,"trackIdField",void 0),e([p({type:[String],readOnly:!0})],L.prototype,"uniqueIdFields",void 0),e([l("service","uniqueIdFields",["uniqueIdInfo.OIDFieldContainsHashValue","uniqueIdInfo.fields"])],L.prototype,"readUniqueIdFields",null),e([p(j)],L.prototype,"url",null),e([a("url")],L.prototype,"writeUrl",null),e([p({json:{origins:{service:{read:!0}},read:!1}})],L.prototype,"version",void 0),e([l("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],L.prototype,"readVersion",null),e([p({readOnly:!0})],L.prototype,"isUrlHostModified",null),L=e([d("esri.layers.mixins.FeatureLayerBase")],L),L};export{k as FeatureLayerBase};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import{geographicToWebMercator as r}from"../../../geometry/support/webMercatorUtils.js";import n from"./cameraOrientationRegistry.js";import{isConstantElevation as i,ConstantElevation as o,ElevationSource as s}from"./ElevationSourceDefinitions.js";import{CameraOrientationType as l}from"../enums/CameraOrientationType.js";function a(e,t,r){return t&&(e=`${t}${e}`),r&&(e+=`${r}`),e}function u(e,t,r){let{url:n}=e;return n?(n=a(n,t,r),new s({...e,url:n})):null}function c(e,t,r){return e?i(e)?new o(e):u(e,t,r):e}const f=new e({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),p=new e({Feet:"feet",Meter:"meter"}),m=new e({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique",Terrestrial360Video:"terrestrial-360-video",TerrestrialFrameVideo:"terrestrial-frame-video",Aerial360Video:"aerial-360-video",AerialFrameVideo:"aerial-frame-video","":null}),h=new Map;function g(e){const[t,r,n,i,o,s,l,a,u,c,f,p,m,h,g,d,w,v,D,z,$,j]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,omega:s,phi:l,kappa:a,...y([u,c,f,p,m,h],[d,w],[v,D,z],[$,j],g)}}h.set(`${l.HPR}`,w),h.set(`${l.YPR}`,v),h.set(`${l.OPK}`,g),h.set(`${l.LTP}`,D);const d=e=>{const t=e.map((e=>parseFloat(e))).filter((e=>!isNaN(e)));if(t.length===e.length)return t};function y(e,t,r,n,i){const o=d(e),s=d(t),l=d(r),a=d(n);return{affineTransformations:6===o?.length?o:void 0,focalLength:6===o?.length?parseFloat(i):void 0,principalOffsetPoint:2!==s?.length?[0,0]:s,radialDistortionCoefficients:3!==l?.length?[0,0,0]:l,tangentialDistortionCoefficients:2!==a?.length?[0,0]:a}}function w(e){const[t,r,n,i,o,s,l,a,u,c,f,p,m,h,g,d,w,v,D,z,$,j]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,heading:s,pitch:l,roll:a,...y([u,c,f,p,m,h],[d,w],[v,D,z],[$,j],g)}}function v(e){const[t,r,n,i,o,s,l,a,u,c,f,p,m,h,g,d,w,v,D,z,$,j]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,yaw:s,pitch:l,roll:a,...y([u,c,f,p,m,h],[d,w],[v,D,z],[$,j],g)}}function D(e){const[t,r,i,o,s,...l]=e.slice(1),a=h.get(s),u=n.get(s)?.constructor;if(!a||!u)return null;return{latitude:t,longitude:r,ellipsoidRadius:i,squaredEccentricity:o,properties:new u(a([s,"",...l]))}}function z(e){if(!e)return null;const t=`${e}`.split("|");if(0===t.length)return null;const r=n.get(t[0]);if(!r)return null;const i=h.get(t[0]);if(!i)return null;return new(0,r.constructor)(i(t))}function $(e){return Array.isArray(e)&&
|
|
5
|
+
import{JSONMap as e}from"../../../core/jsonMap.js";import{getMetersPerUnitForSR as t}from"../../../core/unitUtils.js";import{geographicToWebMercator as r}from"../../../geometry/support/webMercatorUtils.js";import n from"./cameraOrientationRegistry.js";import{isConstantElevation as i,ConstantElevation as o,ElevationSource as s}from"./ElevationSourceDefinitions.js";import{CameraOrientationType as l}from"../enums/CameraOrientationType.js";function a(e,t,r){return t&&(e=`${t}${e}`),r&&(e+=`${r}`),e}function u(e,t,r){let{url:n}=e;return n?(n=a(n,t,r),new s({...e,url:n})):null}function c(e,t,r){return e?i(e)?new o(e):u(e,t,r):e}const f=new e({Minutes:"minutes",Hours:"hours",Days:"days",Weeks:"weeks",Months:"months",Years:"years"}),p=new e({Feet:"feet",Meter:"meter"}),m=new e({360:"360",Horizontal:"horizontal",Inspection:"inspection",Nadir:"nadir",Oblique:"oblique",Terrestrial360Video:"terrestrial-360-video",TerrestrialFrameVideo:"terrestrial-frame-video",Aerial360Video:"aerial-360-video",AerialFrameVideo:"aerial-frame-video","":null}),h=new Map;function g(e){const[t,r,n,i,o,s,l,a,u,c,f,p,m,h,g,d,w,v,D,z,$,j]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,omega:s,phi:l,kappa:a,...y([u,c,f,p,m,h],[d,w],[v,D,z],[$,j],g)}}h.set(`${l.HPR}`,w),h.set(`${l.YPR}`,v),h.set(`${l.OPK}`,g),h.set(`${l.LTP}`,D);const d=e=>{const t=e.map((e=>parseFloat(e))).filter((e=>!isNaN(e)));if(t.length===e.length)return t};function y(e,t,r,n,i){const o=d(e),s=d(t),l=d(r),a=d(n);return{affineTransformations:6===o?.length?o:void 0,focalLength:6===o?.length?parseFloat(i):void 0,principalOffsetPoint:2!==s?.length?[0,0]:s,radialDistortionCoefficients:3!==l?.length?[0,0,0]:l,tangentialDistortionCoefficients:2!==a?.length?[0,0]:a}}function w(e){const[t,r,n,i,o,s,l,a,u,c,f,p,m,h,g,d,w,v,D,z,$,j]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,heading:s,pitch:l,roll:a,...y([u,c,f,p,m,h],[d,w],[v,D,z],[$,j],g)}}function v(e){const[t,r,n,i,o,s,l,a,u,c,f,p,m,h,g,d,w,v,D,z,$,j]=e.slice(1);return{horizontalWKID:t,verticalWKID:r,x:n,y:i,z:o,yaw:s,pitch:l,roll:a,...y([u,c,f,p,m,h],[d,w],[v,D,z],[$,j],g)}}function D(e){const[t,r,i,o,s,...l]=e.slice(1),a=h.get(s),u=n.get(s)?.constructor;if(!a||!u)return null;return{latitude:t,longitude:r,ellipsoidRadius:i,squaredEccentricity:o,properties:new u(a([s,"",...l]))}}function z(e){if(!e)return null;const t=`${e}`.split("|");if(0===t.length)return null;const r=n.get(t[0]);if(!r)return null;const i=h.get(t[0]);if(!i)return null;return new(0,r.constructor)(i(t))}function $(e){return Array.isArray(e)&&e?.length>5&&!e.some(isNaN)}function j(e){for(e=e.slice(0,8);e.length<8;)e.push(0);return e}function I(e){return e.spatialReference.isGeographic?r(e):e.clone()}function K(e){return e.isGeographic?1:t(e)}export{a as appendPrefixAndSuffix,I as convertGeographicToWebMercator,z as createCameraOrientation,c as getEffectiveElevationSource,K as getMetersPerUnitOfSR,$ as isOrientationAccuracy,m as orientedImageryTypeMap,j as padAccuracyArray,u as processElevationSource,f as timeIntervalUnitTypeMap,h as transformersRegistry,p as verticalMeasurementTypeMap};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import e from"../../core/Error.js";import{urlToObject as r,getFilename as a}from"../../core/urlUtils.js";import{parse as t,parseNonStandardSublayerUrl as s}from"./arcgisLayerUrl.js";import{findAssociatedFeatureService as l}from"./associatedFeatureServiceUtils.js";import{getLayerModuleType as o,fetchFeatureService as n}from"./fetchService.js";import{getPreferredUrl as c,sceneServiceLayerTypeToClassName as i}from"./layerUtils.js";import{layerLookupMap as u}from"./lazyLayerLoader.js";import{fetchArcGISServiceJSON as y}from"../../support/requestPresets.js";const f={FeatureLayer:!0,SceneLayer:!0,VideoLayer:!0};async function p(e){const{properties:r,url:a}=e,t={...r,url:a},s=await v(a,r?.customParameters),{Constructor:l,layerId:o,sourceJSON:n,parsedUrl:c,
|
|
5
|
+
import e from"../../core/Error.js";import{urlToObject as r,getFilename as a}from"../../core/urlUtils.js";import{parse as t,parseNonStandardSublayerUrl as s}from"./arcgisLayerUrl.js";import{findAssociatedFeatureService as l}from"./associatedFeatureServiceUtils.js";import{getLayerModuleType as o,fetchFeatureService as n}from"./fetchService.js";import{getPreferredUrl as c,sceneServiceLayerTypeToClassName as i}from"./layerUtils.js";import{layerLookupMap as u}from"./lazyLayerLoader.js";import{fetchArcGISServiceJSON as y}from"../../support/requestPresets.js";const f={FeatureLayer:!0,SceneLayer:!0,VideoLayer:!0};async function p(e){const{properties:r,url:a}=e,t={...r,url:a},s=await v(a,r?.customParameters),{Constructor:l,layerId:o,sourceJSON:n,parsedUrl:c,layers:i,tables:u}=s;if(i.length+u.length===0)return null!=o&&(t.layerId=o),null!=n&&(t.sourceJSON=n),new l(t);const y=new(0,(await import("../GroupLayer.js")).default)({title:c.title});return await w(y,s,t),y}function m(e,r){return e?e.find((({id:e})=>e===r)):null}function d(e,r,a,t,s){const l={...s,layerId:r};return null!=e&&(l.url=e),null!=a&&(l.sourceJSON=a),"sublayerTitleMode"in t.prototype&&(l.sublayerTitleMode="service-name"),new t(l)}async function w(e,r,a){const t=r.sublayerConstructorProvider;for(const{id:s,serverUrl:l}of r.layers){const o=m(r.sublayerInfos,s),n=d(l,s,o,(o&&t?.(o))??r.Constructor,a);e.add(n)}if(r.tables.length){const t=await L("FeatureLayer");r.tables.forEach((({id:s,serverUrl:l})=>{const o=d(l,s,m(r.tableInfos,s),t,a);e.tables.add(o)}))}}async function v(r,a){let s=t(r);if(null==s&&(s=await S(r,a)),null==s)throw new e("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:r});const{serverType:l,sublayer:n}=s;let u;const p={FeatureServer:"FeatureLayer",KnowledgeGraphServer:"KnowledgeGraphLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer",VideoServer:"VideoLayer"},m="FeatureServer"===l,d="SceneServer"===l,w={parsedUrl:s,Constructor:null,layerId:m||d?n??void 0:void 0,layers:[],tables:[]};switch(l){case"MapServer":if(null!=n){const{type:t}=await y(r,{customParameters:a});switch(u="FeatureLayer",t){case"Catalog Layer":u="CatalogLayer";break;case"Catalog Dynamic Group Layer":throw new e("arcgis-layers:unsupported",`fromUrl() not supported for "${t}" layers`)}}else{u=await g(r,a)?"TileLayer":"MapImageLayer"}break;case"ImageServer":{const e=await y(r,{customParameters:a}),{tileInfo:t,cacheType:s}=e;u=t?"LERC"!==t?.format?.toUpperCase()||s&&"elevation"!==s.toLowerCase()?"ImageryTileLayer":"ElevationLayer":"ImageryLayer";break}case"SceneServer":{const e=await y(s.url.path,{customParameters:a});if(u="SceneLayer",e){const r=e?.layers;if("Voxel"===e?.layerType)u="VoxelLayer";else if(r?.length){const e=r[0]?.layerType;null!=e&&null!=i[e]&&(u=i[e])}}break}case"3DTilesServer":throw new e("arcgis-layers:unsupported","fromUrl() not supported for 3DTiles layers");case"FeatureServer":if(u="FeatureLayer",null!=n){const e=await y(r,{customParameters:a});w.sourceJSON=e,w.preferredUrl=c(),u=o(e.type)}break;default:u=p[l]}if(f[u]&&null==n){const e=await h(r,l,a);m&&(w.preferredUrl=e.preferredUrl,w.sublayerInfos=e.layerInfos,w.tableInfos=e.tableInfos);if(1!==e.layers.length+e.tables.length)w.layers=e.layers,w.tables=e.tables,m&&e.layerInfos?.length&&(w.sublayerConstructorProvider=await P(e.layerInfos));else if(m||d){const r=e.layerInfos?.[0]??e.tableInfos?.[0];if(w.layerId=e.layers[0]?.id??e.tables[0]?.id,w.sourceJSON=r,m){const e=r?.type;u=o(e)}}}return w.Constructor=await L(u),w}async function S(e,t){const l=await y(e,{customParameters:t});let o=null,n=null;const c=l.type;if("Feature Layer"===c||"Table"===c?(o="FeatureServer",n=l.id??null):"indexedVector"===c?o="VectorTileServer":l.hasOwnProperty("mapName")?o="MapServer":l.hasOwnProperty("bandCount")&&l.hasOwnProperty("pixelSizeX")?o="ImageServer":l.hasOwnProperty("maxRecordCount")&&l.hasOwnProperty("allowGeometryUpdates")?o="FeatureServer":l.hasOwnProperty("streamUrls")?o="StreamServer":b(l)?(o="SceneServer",n=l.id):l.hasOwnProperty("layers")&&b(l.layers?.[0])&&(o="SceneServer"),!o)return null;const i=null!=n?s(e):null;return{title:null!=i&&l.name||a(e),serverType:o,sublayer:n,url:{path:null!=i?i.serviceUrl:r(e).path}}}function b(e){return null!=e&&e.hasOwnProperty("store")&&e.hasOwnProperty("id")&&"number"==typeof e.id}async function h(e,r,a){let t,s,l,o=!1;switch(r){case"FeatureServer":{const r=await n(e,{customParameters:a});l=c(e,{preferredHost:r.preferredHost}),o=!!r.layersJSON,t=r.layersJSON||r.serviceJSON;break}case"SceneServer":{const r=await I(e,a);t=r.serviceInfo,s=r.tableServerUrl;break}default:t=await y(e,{customParameters:a})}const i=t?.layers,u=t?.tables;return{preferredUrl:l,layers:i?.map((e=>({id:e.id}))).reverse()||[],tables:u?.map((e=>({serverUrl:s,id:e.id}))).reverse()||[],layerInfos:o?i:[],tableInfos:o?u:[]}}async function I(e,r){const a=await y(e,{customParameters:r}),t=a.layers?.[0];if(!t)return{serviceInfo:a};try{const{serverUrl:t}=await l(e),s=await y(t,{customParameters:r}).catch((()=>null));return s&&(a.tables=s.tables),{serviceInfo:a,tableServerUrl:t}}catch{return{serviceInfo:a}}}async function L(e){return(0,u[e])()}async function g(e,r){return(await y(e,{customParameters:r})).tileInfo}async function P(e){if(!e.length)return;const r=new Set,a=[];for(const{type:l}of e)r.has(l)||(r.add(l),a.push(L(o(l))));const t=await Promise.all(a),s=new Map;return Array.from(r).forEach(((e,r)=>{s.set(e,t[r])})),e=>s.get(e.type)}export{p as fromUrl};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{getPreferredHost as e,getPreferredUrl as r}from"./layerUtils.js";import{fetchArcGISServiceJSON as t}from"../../support/requestPresets.js";const a=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function n(a,n){const{loadContext:s,...o}=n||{},y=s?await s.fetchServiceMetadata(a,o):await t(a,o),i=e(
|
|
5
|
+
import{getPreferredHost as e,getPreferredUrl as r}from"./layerUtils.js";import{fetchArcGISServiceJSON as t}from"../../support/requestPresets.js";const a=new Set(["Catalog Layer","Feature Layer","Oriented Imagery Layer"]);async function n(a,n){const{loadContext:s,...o}=n||{},y=s?await s.fetchServiceMetadata(a,o):await t(a,o),i=e();u(y),c(y);const l={serviceJSON:y,preferredHost:i};if((y.currentVersion??0)<10.5)return l;const f=`${r()??a}/layers`,L=s?await s.fetchServiceMetadata(f,o):await t(f,o);return u(L),c(L),l.layersJSON={layers:L.layers,tables:L.tables},l}function s(e){const{type:r}=e;return!!r&&a.has(r)}function o(e){return"Table"===e.type}function c(e){e.layers=e.layers?.filter(s),e.tables=e.tables?.filter(o)}function y(e){e.type||="Feature Layer"}function i(e){e.type||="Table"}function u(e){e.layers?.forEach(y),e.tables?.forEach(i)}function l(e){switch(e){case"Feature Layer":case"Table":return"FeatureLayer";case"Oriented Imagery Layer":return"OrientedImageryLayer";case"Catalog Layer":return"CatalogLayer"}return"FeatureLayer"}export{n as fetchFeatureService,l as getLayerModuleType};
|