大地测量计算一个或多个多边形的面积。
参数:
类型 说明 要为其计算面积的多边形。
unit String可选的 默认值:"square-meters"输出面积单位。
可能的值:"square-millimeters"|"square-centimeters"|"square-decimeters"|"square-meters"|"square-kilometers"|"square-inches"|"square-feet"|"square-yards"|"square-miles"|"square-us-feet"|"acres"|"ares"|"hectares"
返回:
类型 说明 Number[] 对应于源多边形的区域数组。 例子:
// Display the area 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 areas = geodesicUtils.geodesicAreas([polygon], "square-kilometers"); const area = Math.round(areas[0]); console.log("Area: ", area, " km²"); // Area: 1150498 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.geodesicAreas
函数(或属性)的定义如下:
相关用法
- JavaScript ArcGIS geodesicUtils.geodesicDensify用法及代码示例
- JavaScript ArcGIS geodesicUtils.geodesicDistance用法及代码示例
- JavaScript ArcGIS geodesicUtils.geodesicLengths用法及代码示例
- 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.geodesicAreas。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。