Let's have an aircraft, UAV, or terrestrial robot sending reports.
At date t0, position P0, I compute a predicted position Pr0 at t0+dt (using track, velocity...).
I process a first packet: [t0, P0, t0+dt, Pr0]
At date t1, I get a new position P1 and I compute a predicted position Pr1 at t1+dt.
I process this second packet: [t1, P1, t1+dt, Pr1]
When t1 is less than t0+dt (the second interval overlaps the first), my point follows the path:
P0 -> P1 -> Pr0 -> Pr1
when I would expect an updated path:
P0 -> P1 -> Pr1
From the wiki: AnalyticalGraphicsInc/czml-writer/wiki/CZML-Structure:
"When updating an existing interval, any provided sub-property value replaces the existing value, if any. The only exception is when both the previous property value and the new property value contain time-tagged samples. In that case, the samples are added to the list of samples for that interval."
Ok. That's it.
Digging into the code, I found a solution by updating the _times Array:
myTimes = czmlDataSource.entities.getById('point').position._property._times;
, removing the t1+dt time value.
What would be a cleaner way to delete not only the date, but also the data (position) attached to the sample, something like a deleteSample() ?