arcgis api for js length area measurement knowledge .txt

require(["esri/geometry/geometryEngine"], function(geometryEngine) { /* code goes here */ });
1.
geometryEngine.geodesicLength(geometry, unit) -> {Number}
This function is used to calculate the length of the input geometry.
With respect geometryEngine.planarLength (), geometryEngine.geodesicLength () when considering the curvature of the earth perform this calculation.
Therefore, when the spatial reference WGS84: input geometry (wkid 4326) or Web Mercator, the best practice is to use geodesicLength () calculated length.
If the input has a different geometry Web Mercator projection coordinate system, instead planarLength ().

This method applies only to WGS84 (wkid: 4326) and Web Mercator spatial reference.

2.
geometryEngine.geodesicArea(geometry, unit) -> {Number}
This function is used to calculate the area of ​​the input geometry.
With respect geometryEngine.planarArea (), geometryEngine.geodesicArea () when considering the curvature of the earth perform this calculation.
Therefore, when the spatial reference WGS84: input geometry (wkid 4326) or Web Mercator, the best practice is to use geodesicArea () to calculate the area.
If the input has a different geometry Web Mercator projection coordinate system, instead planarArea ().
This method applies only to WGS84 (wkid: 4326) and Web Mercator spatial reference.

Guess you like

Origin blog.csdn.net/weixin_42193179/article/details/90897895