How to project satellite orbit onto Earth from existing satellite objects?

Hi guys.

My team and I are trying to implement a function that will take our current satellite orbits and project the image onto the Earth's surface. However, our current attempt only displays wavy lines somewhere near Africa.

Our current implementation is as follows:

drawGroundTrack : function(viewer, dataSourceObject)
    var pos = ;

    var satPositions = dataSourceObject.position.cartesian;

    var latLongPos = null;

    for (var i = 1; i < satPositions.length; i += 4)
        latLongPos = Cesium.Ellipsoid.WGS84.cartesianToCartographic(new Cesium.Cartesian3(satPositions[i], satPositions[i + 1], satPositions[i + 2]));

        pos.push(Cesium.Cartesian3.fromDegrees(latLongPos.longitude, latLongPos.latitude));

        latLongPos = null;


         polyline : {
    positions : pos,
    width : 1.0,
    material : new Cesium.PolylineGlowMaterialProperty({
                     color : Cesium.Color.DEEPSKYBLUE,
         glowPower : 0.25


The data for satellites are generated on a backend server and the positions are sent via CZML. A sample of the data:


We also tried using EllipsoidGeodesic but with no luck. Could you guys please give us some advice on how to solve this problem?

Thanks. :slight_smile:

I think you just have a radians vs. degrees error. In the for loop, try replacing Cesium.Cartesian3.fromDegrees with Cesium.Cartesian3.fromRadians.


Thank you so much! Damn, I feel rather foolish for missing that haha. It now renders across the globe.

The only issue I have now is that the orbits and the lines on the Earth do not match, even though it is from the same data. Do I need to set an original position?