你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!
输入关键字进行搜索
张赛
赞同来自:
Polygon polygon = new Polygon(pointCollection); Polyline polyline = polygon.toPolyline(); double length = GeometryEngine.length(polyline)
PointCollection pointCollection = new PointCollection(SpatialReference.create(4326)); pointCollection.add(7850120.01, 442638.01); pointCollection.add(7850120.01, 442739.01); pointCollection.add(7851121.01, 442739.01); pointCollection.add(7851121.01, 442638.01); double length = GeometryEngine.lengthGeodetic(polygon, new LinearUnit(LinearUnitId.METERS), GeodeticCurveType.SHAPE_PRESERVING);
要回复问题请先登录或注册
1 个回复
张赛
赞同来自:
对于面要素计算周长,可根据需要选择调用GeometryEngine提供的length(Polyline polyline)和lengthGeodetic(Geometry geometry, LinearUnit lengthUnit, GeodeticCurveType curveType)两个方法。
这两个方法的基本用法示例如下:
1 length(Polyline polyline)
注意:length方法返回的周长单位是由几何本身的空间参考决定的,因此,这一方法更适合平面坐标系下的几何对象。
2 lengthGeodetic(Geometry geometry, LinearUnit lengthUnit, GeodeticCurveType curveType)
注意:1) 这里更加建议将几何转换为平面坐标系后再进行计算。
2) LinearUnitId和GeodeticCurveType请根据计算需要进行选取:
https://developers.arcgis.com/ ... .html
https://developers.arcgis.com/ ... .html
要回复问题请先登录或注册