-
aggregateGeometries
Object
- 自從:ArcGIS 適用於 JavaScript 4.23 的 API
當使用
envelope-aggregate
、centroid-aggregate
和/或convex-hull-aggregate
統計類型執行 statistics 查詢時,aggregateGeometries 包含空間聚合幾何。 aggregateGeometries 上的每個屬性都填充有statistics field,其中包含與聚合統計類型匹配的聚合幾何。例子:
// average of age fields by regions const ageStatsByRegion = new StatisticDefinition({ onStatisticField: field, outStatisticFieldName: "avgAge", statisticType: "avg" }); // extent encompassing all features by region const aggregatedExtent = new StatisticDefinition({ statisticType: "envelope-aggregate", outStatisticFieldName: "aggregateExtent", }); // group the statistics by Region field // get avg age by Regions and extent of each region const query = layer.createQuery(); query.groupByFieldsForStatistics = ["Region"]; query.outStatistics = [consumeStatsByRegion, aggregatedExtent]; layer.queryFeatures(query).then((results) => { results.features.forEach((feature) => { if (feature.attributes.Region === "Midwest") { view.goTo(feature.aggregateGeometries.aggregateExtent); } }); });
基本信息
以下是所在類或對象的基本信息。
AMD:
require(["esri/Graphic"], (Graphic) => { /* code goes here */ });
ESM:
import Graphic from "@arcgis/core/Graphic";
類:
esri/Graphic
繼承: Graphic > Accessor
自從:用於 JavaScript 4.0 的 ArcGIS API
用法說明
Graphic.aggregateGeometries
函數(或屬性)的定義如下:
相關用法
- JavaScript ArcGIS Graphic.attributes用法及代碼示例
- JavaScript ArcGIS Graphic.symbol用法及代碼示例
- JavaScript ArcGIS Graphic.popupTemplate用法及代碼示例
- JavaScript ArcGIS Graphic.geometry用法及代碼示例
- JavaScript ArcGIS GraphicsLayer.opacity用法及代碼示例
- JavaScript ArcGIS GraphicsLayer用法及代碼示例
- JavaScript ArcGIS Graphic用法及代碼示例
- JavaScript ArcGIS GraphicsLayer.on用法及代碼示例
- JavaScript ArcGIS GraphicsLayerView.when用法及代碼示例
- JavaScript ArcGIS GraphicsLayer.fullExtent用法及代碼示例
- JavaScript ArcGIS GraphicsLayer.maxScale用法及代碼示例
- JavaScript ArcGIS GraphicsLayer.visible用法及代碼示例
- JavaScript ArcGIS GraphicsLayer layerview-create-error事件用法及代碼示例
- JavaScript ArcGIS GraphicsLayer.effect用法及代碼示例
- JavaScript ArcGIS GraphicsLayer.graphics用法及代碼示例
- JavaScript ArcGIS GraphicsLayerView.queryGraphics用法及代碼示例
- JavaScript ArcGIS GraphicsLayerView.highlight用法及代碼示例
- JavaScript ArcGIS GraphicsLayer.when用法及代碼示例
- JavaScript ArcGIS GraphicsLayer.minScale用法及代碼示例
- JavaScript ArcGIS GraphicsLayer layerview-create事件用法及代碼示例
- JavaScript ArcGIS Ground.loadAll用法及代碼示例
- JavaScript ArcGIS GroupLayer.portalItem用法及代碼示例
- JavaScript ArcGIS GroupLayer layerview-create事件用法及代碼示例
- JavaScript ArcGIS GroupLayer.minScale用法及代碼示例
- JavaScript ArcGIS GroupLayer.layers用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 Graphic.aggregateGeometries。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。