leadtime and trailtime in simple.czml

Hi there

I was wondering if you guys could please clear up some confusion we are having with the simple.czml in the Sandcastle example.
My team and I are using Cesium to build a satellite orbit viewer for a university project and we are having some trouble
understanding the leadtime and trailtime. Our project generates CZML on a server and we are using Orekit to generate positions from TLE data.
We are making our own object to generate CZML but we are trying to understand the values in the leadtime and trailtime.

The example in simple.czml is

"leadTime":[
  {
    "interval":"2012-03-15T10:00:00Z/2012-03-15T10:44:56.1031157730031Z",
    "epoch":"2012-03-15T10:00:00Z",
    "number":[
      0,5537.546684141998,
      5537.546684141998,0
    ]
  },
  {
    "interval":"2012-03-15T10:44:56.1031157730031Z/2012-03-15T12:17:13.6497999150015Z",
    "epoch":"2012-03-15T10:44:56.1031157730031Z",
    "number":[
      0,5537.546684141998,
      5537.546684141998,0
    ]
  },
  ...
],
"trailTime":[
  {
    "interval":"2012-03-15T10:00:00Z/2012-03-15T10:44:56.1031157730031Z",
    "epoch":"2012-03-15T10:00:00Z",
    "number":[
      0,0,
      5537.546684141998,5537.546684141998
    ]
  },
  ...

So our question is, what are the values in "number"? We understand that it is [Time, Value, Time Value] but we aren't entirely sure what
time-value pairs are needed for the animation. How does one obtain this data for a particular interval?

Thanks. :slight_smile:

The leadTime and trailTime values are simply the number of seconds ahead or behind to draw the path. So if you always wanted to show an hour ahead, you would just simply specify:

leadTime : 3600

The way CZML is structured, you can specify that data changes over time. The array of intervals specified in simple.czml is specifying different properties for different intervals. For example, if you wanted leadTime to be 3600 on Jan 1st and 7200 on Jan 2nd and 1800 everywhere else

“leadTime”:[
{
“number”: 1800
},
{
“interval”:“2012-01-01T00:00:00Z/2012-01-01T24:00:00Z”,
“epoch”:“2012-01-01T00:00:00Z”,
“number”: 3600
},
{
“interval”:“2012-01-02T00:00:00Z/2012-02-01T24:00:00Z”,
“epoch”:“2012-01-02T00:00:00Z”,
“number”: 72
},
]

Finally, CZML also allows values to be interpolated so in the below block from simple,czml the value of leadTime at the epoch is 5537.546684141998 and it will be linear inteprolated to 0 by the end time of the interval (2012-03-15T10:44:56.1031157730031Z). So when you watch simple.czml in motion, each interval represents a Satellite pass and during each pass, the the trail time is constantly growing while the leadTime is constantly shrinking. At the end of each interval, a new pass starts.

{
“interval”:“2012-03-15T10:00:00Z/2012-03-15T10:44:56.1031157730031Z”,
“epoch”:“2012-03-15T10:00:00Z”,
“number”:[
0,5537.546684141998,
5537.546684141998,0
]
},

I hope that adequately explains what is going on. If you still have questions, please let me know.

hello, please tell me how is the interval be decided. and the number array’s meaning. and how to get the array. example: {
“interval”:“2012-03-15T10:00:00Z/2012-03-15T10:44:56.1031157730031Z”,
“epoch”:“2012-03-15T10:00:00Z”,
“number”:[
0,5537.546684141998,
5537.546684141998,0
]
}
thank you very much.