length接口
URL: |
http:// <ProcessingServer-URL> / length |
父资源: |
ProcessingServer |
[ 服务说明 ]
length接口 计算线,面等几何对象的长度。
[ 参数说明 ]
参数 | 参数说明 |
---|---|
srs |
参数作用:输入几何对象的投影信息 参数说明:使用国际惯用的EPSG代码指定,如EPSG:4326 |
geo |
参数作用:线,面等几何对象的geojson结构描述 参数说明: { "type": "LineString"|"Polygon", "coordinates":[<geometry>] } 参数示例: { "type": "LineString", "coordinates": [ [ 105.475843, 39.002044 ], [ 99.938734, 35.222747 ], [ 111.803968, 32.058685 ], [ 105.475843, 39.002044 ] ] } |
format |
参数作用:指定返回结果的格式 取值范围:html | json,该参数默认值为json |
callback |
参数作用:Ajax客户端使用JSONP方式进行跨域处理时所指定的回调函数名称 参数说明:可选参数,该参数仅在format参数值为json时有效 |
[ 示例 ]
URL地址示例:
http://127.0.0.1:8099/newmap/rest/services/utilities/Geometry/ProcessingServer/length?srs=EPSG:4326&geo={ "type": "LineString", "coordinates": [ [ 105.475843, 39.002044 ], [ 99.938734, 35.222747 ], [ 111.803968, 32.058685 ], [ 105.475843, 39.002044 ] ] }&format=json
[ 返回结果 ]
length操作成功时的返回结果示例 :
{"result":"28.378227633085"}
length操作失败时的返回结果示例 :
{
"error":"无法解析传入的Geometry"
}
"error":"无法解析传入的Geometry"
}