大地测量计算一个或多个几何的多边形周长或折线长度。
参数:
类型 说明 输入折线或多边形。
unit String可选的 默认值:"meters"输出线性单位。
可能的值:"millimeters"|"centimeters"|"decimeters"|"meters"|"kilometers"|"inches"|"feet"|"yards"|"miles"|"nautical-miles"|"us-feet"
返回:
类型 说明 Number[] 对应于输入几何的长度/周长数组。 例子:
// Display the perimeter of the Bermuda Triangle. const MIAMI = { lat: 25.775278, lon: -80.208889 }; // Florida const HAMILTON = { lat: 32.293, lon: -64.782 }; // Bermuda const SANJUAN = { lat: 18.406389, lon: -66.063889 }; // Puerto Rico const polygon = new Polygon({ rings: [[ [MIAMI.lon, MIAMI.lat], [HAMILTON.lon, HAMILTON.lat], [SANJUAN.lon, SANJUAN.lat], [MIAMI.lon, MIAMI.lat] ]] }); const perimeters = geodesicUtils.geodesicLengths([polygon], "kilometers"); const perimeter = Math.round(perimeters[0]); console.log("Perimeter: ", perimeter, " km"); // Perimeter: 4879 km
基本信息
以下是所在类或对象的基本信息。
AMD:
require(["esri/geometry/support/geodesicUtils"], (geodesicUtils) => { /* code goes here */ });
ESM:
import * as geodesicUtils from "@arcgis/core/geometry/support/geodesicUtils";
对象:
esri/geometry/support/geodesicUtils
自从:用于 JavaScript 4.12 的 ArcGIS API
用法说明
geodesicUtils.geodesicLengths
函数(或属性)的定义如下:
相关用法
- JavaScript ArcGIS geodesicUtils.geodesicDensify用法及代码示例
- JavaScript ArcGIS geodesicUtils.geodesicAreas用法及代码示例
- JavaScript ArcGIS geodesicUtils.geodesicDistance用法及代码示例
- JavaScript ArcGIS geodesicUtils.pointFromDistance用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.overlaps用法及代码示例
- JavaScript ArcGIS geometryEngine.buffer用法及代码示例
- JavaScript ArcGIS geometryEngine.equals用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.geodesicBuffer用法及代码示例
- JavaScript ArcGIS geometryEngine.touches用法及代码示例
- JavaScript ArcGIS geometryEngine.generalize用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.intersects用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.symmetricDifference用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.distance用法及代码示例
- JavaScript ArcGIS geometryEngine.union用法及代码示例
- JavaScript ArcGIS geometryEngine.within用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.intersect用法及代码示例
- JavaScript ArcGIS geometryEngine.geodesicLength用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.planarArea用法及代码示例
- JavaScript ArcGIS geometryEngine.symmetricDifference用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.crosses用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.flipHorizontal用法及代码示例
- JavaScript ArcGIS geometryService.cut用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.rotate用法及代码示例
- JavaScript ArcGIS geometryEngine.intersects用法及代码示例
- JavaScript ArcGIS geometryEngineAsync.generalize用法及代码示例
注:本文由纯净天空筛选整理自arcgis.com大神的英文原创作品 geodesicUtils.geodesicLengths。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。