android计算多边形面积报错
我在计算面积的时候,GeometryEngine.areaGeodetic始终报有无效参数
private double getArea(Point... points) {
PointCollection pointCollection = new PointCollection(mMapView.getSpatialReference());
for (Point point : points) {
pointCollection.add(point);
}
PolygonBuilder polygon = new PolygonBuilder(pointCollection, mMapView.getSpatialReference());
return GeometryEngine.areaGeodetic(polygon.toGeometry(), new AreaUnit(AreaUnitId.SQUARE_METERS), GeodeticCurveType.NORMAL_SECTION);
}
随后我更换了计算方法,使用GeometryEngine.area计算出来的值只有0.0004这种,这是什么单位的,值是不是不对?
private double getArea(Point... points) {
PointCollection pointCollection = new PointCollection(mMapView.getSpatialReference());
for (Point point : points) {
pointCollection.add(point);
}
PolygonBuilder polygon = new PolygonBuilder(pointCollection, mMapView.getSpatialReference());
return GeometryEngine.areaGeodetic(polygon.toGeometry(), new AreaUnit(AreaUnitId.SQUARE_METERS), GeodeticCurveType.NORMAL_SECTION);
}
随后我更换了计算方法,使用GeometryEngine.area计算出来的值只有0.0004这种,这是什么单位的,值是不是不对?
0 个回复