centroid接口
URL: |
http:// <ProcessingServer-URL> /centroid |
父资源: |
ProcessingServer |
[ 服务说明 ]
centroid接口计算几何对象的中心点。
[ 参数说明 ]
参数 | 参数说明 |
---|---|
geo |
参数作用:点,线,面等几何对象的geojson结构描述 参数说明: { "type": "LineString"|"Point"|"Polygon", "coordinates":[<geometry>] } 参数示例: { "type": "Polygon", "coordinates": [ [ [ -337207.615772, 4462405.973350 ], [ -1340024.554159, 4162613.546414 ], [ -358350.096039, 3269020.029282 ], [ -337207.615772, 4462405.973350 ] ] ] } |
format |
参数作用:指定返回结果的格式 取值范围:html | json,该参数默认值为json |
callback |
参数作用:Ajax客户端使用JSONP方式进行跨域处理时所指定的回调函数名称 参数说明:可选参数,该参数仅在format参数值为json时有效 |
[ 示例 ]
URL地址示例:
http://127.0.0.1:8099/newmap/rest/services/utilities/Geometry/ProcessingServer/centroid?&geo={ "type": "Polygon", "coordinates": [ [ [ -337207.615772, 4462405.973350 ], [ -1340024.554159, 4162613.546414 ], [ -358350.096039, 3269020.029282 ], [ -337207.615772, 4462405.973350 ] ] ] }&format=json
[ 返回结果 ]
centroid操作成功时的返回结果示例 :
{
"type":"Point",
"coordinates": [ -678527.421990, 3964679.849682 ]
}
"type":"Point",
"coordinates": [ -678527.421990, 3964679.849682 ]
}
centroid操作失败时的返回结果示例 :
{
"error":"无法解析传入的Geometry"
}
"error":"无法解析传入的Geometry"
}