大地測量計算一個或多個幾何的多邊形周長或折線長度。
參數:
類型 說明 輸入折線或多邊形。
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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。