美文网首页
cesium四至坐标如何转换成经纬度

cesium四至坐标如何转换成经纬度

作者: 姜治宇 | 来源:发表于2022-12-06 10:05 被阅读0次

    所谓四至坐标,也就是东西南北各有一个值,如何转换成经纬度坐标?

                    let coor = obj.rectangle.coordinates._value;
    
                    const northwest = Cesium.Rectangle.northwest(coor);
                    const southwest = Cesium.Rectangle.southwest(coor);
                    const northeast = Cesium.Rectangle.northeast(coor);
                    const southeast = Cesium.Rectangle.southeast(coor);
    
    
                    const leftTop = [Cesium.Math.toDegrees(northwest.longitude),Cesium.Math.toDegrees(northwest.latitude)]
                    const leftBottom = [Cesium.Math.toDegrees(southwest.longitude),Cesium.Math.toDegrees(southwest.latitude)]
                    
                    const rightTop = [Cesium.Math.toDegrees(northeast.longitude),Cesium.Math.toDegrees(northeast.latitude)]
                    
                    const rightBottom = [Cesium.Math.toDegrees(southeast.longitude),Cesium.Math.toDegrees(southeast.latitude)]
                
                    newObj = { rectangles:[leftTop.join(';'),leftBottom.join(';'),rightTop.join(';'),rightBottom.join(';')] };
                
    

    相关文章

      网友评论

          本文标题:cesium四至坐标如何转换成经纬度

          本文链接:https://www.haomeiwen.com/subject/ojywfdtx.html