0
In ArcGIS MapServer, through the layer’s query interface, it is possible to achieve statistics such as the maximum, minimum, or average of a layer based on a specific category field and a statistic field. For example:
{server site address}/C6100002017111110145309_VectorProduct/MapServer/0/query?where=(1=1) AND (ksbm=‘C6100002017111110145309’) AND (dcpc=‘2023年7月18日至2023年8月29日’)&groupByFieldsForStatistics=yjlmc&outStatistics=[{“statisticType”:“sum”,“onStatisticField”:“tbmj”,“outStatisticFieldName”:“funId”}]&f=pjson
Here, where
represents the WHERE clause in SQL used to define the scope of the data for statistics; groupByFieldsForStatistics
is used to specify the classification field for the statistical results; outStatistics
is a parameter for specifying the statistical method (e.g., yjlmc
), the field to be statistically analyzed (tbmj
), and the name of the output statistical field (funId
). After making a GET request to this interface, the corresponding statistical results are returned.result is below:
yjlmc: 草地
sym: 2.7754578948E7
yjlmc: 工矿用地
sym: 2214546.842
yjlmc: 耕地
sym: 1.2288605132E7
yjlmc: 水域及水利设施用地
sym: 370459.813
yjlmc: 住宅用地
sym: 2852652.575
yjlmc: 其他土地
sym: 2169715.099
yjlmc: 特殊用地
sym: 138935.889
yjlmc: 公共管理与公共服务用地
sym: 19046.213
yjlmc: 林地
sym: 5.8148470369E7
yjlmc: 交通运输用地
sym: 2496411.692
yjlmc: 商业服务业用地
sym: 108624.266
This method achieves the total area statistics for each yjlmc.
I’m wondering if there’s a similar interface in GeoServer’s WMS to achieve the same functionality. I’ve already tried using CQL for statistical queries on the data, but currently, CQL only supports the WHERE clause.