您现在的位置是:首页 > 前端会客厅 > GIS知识GIS知识

获取多边形polygon中心点与坐标系转换

YU到边2022-05-09【GIS知识】人已围观

简介获取多边形polygon中心点与坐标系转换

坐标之间相互转换
例:

{"x": -2549075.077926076,"y": 5147882.063692694,"z": 2763082.933634475}  
转换为
{"x": 116.33731040440217,"y": 25.829391134471972,"z": 349.34815788638934}
let arr = entity.polygon.hierarchy.getValue().positions;
var pCenter = Cesium.BoundingSphere.fromPoints(arr).center;
var cartographic = Cesium.Cartographic.fromCartesian(pCenter);
var xx = Cesium.Math.toDegrees(cartographic.longitude);
var yy = Cesium.Math.toDegrees(cartographic.latitude);
var z = cartographic.height

此处也可以作为面求中心点

Tags:

很赞哦! ()

文章评论