当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


JavaScript ArcGIS StatisticDefinition.statisticParameters用法及代码示例


基本信息

以下是所在类或对象的基本信息。

AMD: require(["esri/rest/support/StatisticDefinition"], (StatisticDefinition) => { /* code goes here */ });

ESM: import StatisticDefinition from "@arcgis/core/rest/support/StatisticDefinition";

类: esri/rest/support/StatisticDefinition

继承: StatisticDefinition > Accessor

自从:用于 JavaScript 4.0 的 ArcGIS API

用法说明

StatisticDefinition.statisticParameters函数(或属性)的定义如下:

statisticParameters Object


百分位数统计参数。当 statisticType 设置为 percentile-continuouspercentile-discrete 时,必须设置此属性。

属性:

类型说明
value Number

百分数值。这应该是 0 到 1 之间的十进制值。

orderBy String
可选的

指定ASC(升序)或DESC(降序)来控制数据的顺序。例如,在从 1 到 10 的 10 个值的数据集中,orderBy 设置为升序 (ASC) 的 0.9 的百分位值为 9,但当 orderBy 设置为降序 (DESC)结果为 2。默认值为 ASC

可能的值"ASC"|"DESC"

默认值:null

例子:

let query = layer.createQuery();
// find the median value in descending order for response_rate field
// for all features stored in the layer and order
query.outStatistics = [{
  statisticType: "percentile-continuous",
  statisticParameters: {
    value: 0.5,
    orderBy: "DESC"
  },
  onStatisticField: "response_rate",
  outStatisticFieldName: "Resp_rate_median"
}];
// query the features for the median value statistics against the values
// stored in the response_rate field
queryFeatures(query);
// Query the percentile for response time in descending order for all features in the layer
// group the percentile by Division and unit fields
let query = layer.createQuery();
query.orderByFields = ["Division, Unit"];
query.groupByFieldsForStatistics = ["Division, Unit"];
query.outStatistics = [{
  statisticType: "percentile-discrete",
  statisticParameters: {
    value: 0.67,
    orderBy: "DESC"
  },
  onStatisticField: "response_time",
  outStatisticFieldName: "response_time_percentile"
}];
queryFeatures(query);

相关用法


注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 StatisticDefinition.statisticParameters。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。