1. 简单空间查询
1.1 点
请求地址:
http://192.168.1.9:6080/arcgis/rest/services/wuzhi/%E5%BB%BA%E8%AE%BE%E7%94%A8%E5%9C%B0%E7%AE%A1%E5%88%B6%E5%8C%BA/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=113.349191%2C35.030719&geometryType=esriGeometryPoint&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&f=html
1.2 线
请求地址:
http://192.168.1.9:6080/arcgis/rest/services/wuzhi/%E5%BB%BA%E8%AE%BE%E7%94%A8%E5%9C%B0%E7%AE%A1%E5%88%B6%E5%8C%BA/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=%7B%22paths%22%3A+%5B%5B%5B113.239442%2C+35.033137%5D%2C+%5B113.245072%2C+35.033231%5D%2C+%5B113.239442%2C+35.033137%5D%5D%5D%7D&geometryType=esriGeometryPolyline&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&f=html
1.3 面
请求地址:
http://192.168.1.9:6080/arcgis/rest/services/wuzhi/%E5%BB%BA%E8%AE%BE%E7%94%A8%E5%9C%B0%E7%AE%A1%E5%88%B6%E5%8C%BA/MapServer/0/query?where=1%3D1&text=&objectIds=&time=&geometry=%7B%22rings%22%3A+%5B%5B%5B113.34602%2C+35.03168%5D%2C+%5B113.348694%2C+35.031535%5D%2C+%5B113.349159%2C+35.029863%5D%2C+%5B113.347173%2C+35.029863%5D%2C+%5B113.34538%2C+35.030402%5D%2C+%5B113.34602%2C+35.03168%5D%5D%5D%7D&geometryType=esriGeometryPolygon&inSR=&spatialRel=esriSpatialRelIntersects&relationParam=&outFields=&returnGeometry=true&maxAllowableOffset=&geometryPrecision=&outSR=&returnIdsOnly=false&returnCountOnly=false&orderByFields=&groupByFieldsForStatistics=&outStatistics=&returnZ=false&returnM=false&gdbVersion=&returnDistinctValues=false&f=html
2. 简单统计查询
单个字段
多个字段
outStatistics
描述:要计算的一个或多个基于字段的统计信息的定义。
语法:
[
{
"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"
}
]
- statisticType:统计类型
- onStatisticField:统计字段
- outStatisticFieldName:别名,为空或缺失,则地图服务器将为返回的统计字段分配字段名称。有效的字段名称只能包含字母数字字符和下划线。
注意:
1.outStatistics 仅在那些指示 upppportsStatistics 为真的图层/表上受支持。
2.当 outStatistics 时,将使用的唯一其他参数是 groupByFieldsForStatistics、orderByFields、text、time 和 where。
常见错误:Unable to complete operation
导致这个错误的原因可能是字段类型不适合统计(不是数字类型)或字段不对
参考:https://blog.csdn.net/undealablebug/article/details/128444590