27/5000 How do I load all the satellite debris data (TLE) into Cesium?

Converting 2W + TLE data to CZML felt unrealistic, reaching 600 + MB, and loading the transformed files reported errors. I don’t know if there’s any other way, Refer to the CelesTrak Orbit Visualization, I wonder how they solved this whole data loading problem

help me

Would streaming the czml incrementally help resolve the issue?

The TLE data of CelesTrak were all obtained in the form of TXT. Do you mean that after the completion of TXT acquisition, CZML is gradually converted and then append? The final file is still very large, I really don’t understand, I hope to make it clear, thank you

Does anyone know how to implement this :rofl:

Well, looking at the source code of the site, there’s two text files that are loaded; one for debris, and one for satellites. My guess is that they read and parse the text files, and create Cesium entities using the primitives API for speed, and then apply callbackProperties() to their positions to calculate their orbit. I didn’t check if they use CZML, not sure there’s enough initial data (no historic data, only orbital data). That’s what it looked like without digging too far into it.

Is there anything beyond that you’re wondering about?

Cheers,

Alex

Thank you for your reply. I’m trying to use Satellite.js to achieve this. The current problem is to calculate the real-time position of each fragment in real time. :hugs:

Hi!Using satellitejs can solve this problem
This is a tle data

VANGUARD 1              
1 00005U 58002B   22048.60497048  .00000295  00000-0  35416-3 0  9992
2 00005  34.2513 148.6678 1844076 218.1613 127.3116 10.84862082271524

First, you need to use satellite to calculate the coordinates you need to obtain
What I calculate here is the coordinates in 24 hours

const SampledPosition = new Cesium.SampledPositionProperty(Cesium.ReferenceFrame.INERTIAL)
const second = parseInt(Cesium.JulianDate.secondsDifference(stopTime, startTime) / 300) + 5
const start = new Date(startTime)
const satrec = satellite.twoline2satrec(tle1, tle2)

let time_step = 0
let current_time = null

for (let i = 0; i < second; i++) {

  current_time = new Date(start.getTime() + time_step)

  const positionAndVelocity = satellite.propagate(satrec, current_time)
  const positionEci = positionAndVelocity.position

  const position = Cesium.Cartesian3.fromElements(positionEci.x*1000, positionEci.y*1000, positionEci.z*1000)

  if (position) {

    SampledPosition.addSample(Cesium.JulianDate.fromDate(current_time), position)
    time_step += 300 * 1000

}

const interpolationOptions = {
    interpolationDegree: 5,
    interpolationAlgorithm: Cesium.LagrangePolynomialApproximation
}

SampledPosition.setInterpolationOptions(interpolationOptions)

}

Sampledposition is the coordinate sampling set we need
Next, we need to create an entity

      const period = 1440 / tle[2].substring(52, 63) 

      const minutesperiod = period * 60

      const number_of_full_orbits = Math.floor(minutes / period) 

      const left_over_minutes = minutes % period
      const leadTimecomposite = new Cesium.CompositeProperty()
      const trailTimecomposite = new Cesium.CompositeProperty()

      let clonestart = Cesium.JulianDate.clone(start)

      for (let j = 0; j < number_of_full_orbits + 1; j++) {

        let endtime = new Cesium.JulianDate()

        if (j === 0) {

          Cesium.JulianDate.addMinutes(clonestart, left_over_minutes, endtime)

        } else {

          Cesium.JulianDate.addMinutes(clonestart, period, endtime)

        }

        const leadTimeTimeInterval = new Cesium.TimeInterval({
          start: clonestart,
          stop: endtime,
        })

        const trailTimeTimeInterval = new Cesium.TimeInterval({
          start: clonestart,
          stop: endtime,
        })

        leadTimeTimeInterval.data = new Cesium.SampledProperty(Number)

        trailTimeTimeInterval.data = new Cesium.SampledProperty(Number)

        leadTimeTimeInterval.data.addSamplesPackedArray([0, minutesperiod, minutesperiod, 0], clonestart)

        trailTimeTimeInterval.data.addSamplesPackedArray([0, 0, minutesperiod, minutesperiod], clonestart)

        leadTimecomposite.intervals.addInterval(leadTimeTimeInterval)

        trailTimecomposite.intervals.addInterval(trailTimeTimeInterval)

        clonestart = endtime

      }

      let intervals = new Cesium.TimeIntervalCollection()
      intervals.addInterval(new Cesium.TimeInterval({
        start: start,
        stop: stop,
      }))

      const showpath = new Cesium.TimeIntervalCollectionProperty();
      showpath.intervals.addInterval(new Cesium.TimeInterval({
        start: start,
        stop: stop,
        data: true
      }))

      const width = new Cesium.CompositeProperty(6)

      const resolution = new Cesium.CompositeProperty(120)

      viewer.entities.add({
        availability: intervals,
        path: new Cesium.PathGraphics({
          material: Cesium.Color.AQUAMARINE,
          leadTime: leadTimecomposite,
          trailTime: trailTimecomposite,
          width: width,
          resolution: resolution,
          show: showpath
        }),
        point:{
          pixelSize: 8,
          color: new Cesium.Color.fromCssColorString(color)
        },
        orientation: new Cesium.VelocityOrientationProperty(SampledPosition),
        position: SampledPosition,
      })

This entity is the satellite and orbit we need
The above code is transformed from tle data to czml data according to Python code
I hope these can help you solve the problem :champagne: :champagne: :champagne:

3 Likes

Wow, you are great. You solved a problem that had been bothering me for a long time. Thank you very muc!! :kissing_cat: :kissing_cat: :kissing_cat:

Hello~ I’m here. I use primitive to draw points, and now i want to draw line, how to set position to the line? I want to draw an ellipse by it , but i don’t know how to describe it. a polyline or a ellipse?

Hello, thank you very much for your guidance, at present I can achieve more than 20,000 satellites to display. But if the timeline is extended to several months or even years with 20,000 satellites running, then your code will be severely timed out, do you have a solution for this? Thank you very much!

Using this calculation method can help you solve the problem.