数据源是sde发布的服务。在query.outStatistics输入SHAPE.AREA字段无法统计

已邀请:

AriaGIS

赞同来自:

This option was added at 10.1.

The definitions for one or more field-based statistics to be calculated.
  • outStatistics is supported on only those layers/tables that indicate supportsStatistics is true.
  • If outStatisticFieldName is empty or missing, the map server would assign a field name to the returned statistic field. A valid field name can only contain alphanumeric characters and an underscore.
  • When outStatistics, the only other parameters that will be used are groupByFieldsForStatistics, orderByFields, text, time, and where.
  • At version 10.1, specifying geometry, objectIds, or gdbVersion parameters would return an error.
  • At version 10.1 SP1, support for the geometry parameter was added.
  • At version 10.2, support for the gdbVersion parameter was added.

Values: An array of statistic definitions. A statistic definition specifies the type of statistic, the field on which it is to be calculated, and the resulting output field name.

Syntax:

[ { "statisticType": "<count | sum | min | max | avg | stddev | var>", "onStatisticField": "Field1", "outStatisticFieldName": "Out_Field_Name1" }, { "statisticType": "<count | sum | min | max | avg | stddev | var>", "onStatisticField": "Field2", "outStatisticFieldName": "Out_Field_Name2" } ]

jiangwy280

赞同来自:

你检查一下是不是有空面积,要repair一下数据再查询看看。repair前备份!
其次可能是不支持SHAPE.AREA的写法

张佳期

赞同来自:

如果是SHAPE.LEN有这个bug,链接中也有绕行方法,
在arcgis10.9以及更高版本得到解决。
https://support.esri.com/en/bugs/nimbus/QlVHLTAwMDA4Njg4OA==
 
如果是SHAPE.AREA无法统计查询的话,可以看看SHAPE.LEN是不是也不行,如果不行,那试试链接中的绕行方法。
 
例如:

可以考虑新建一个字段,然后将shape.len的属性值赋值过去,如果后期有更新要素的需求,可以通过geometryengine的计算长度或者面积方法来更新要素的长度属性值,这个可以在前端来完成。

要回复问题请先登录注册