"Quaternion is required" error when running a time-dynamic ellipsoid from czml

I’ve been having this error pop up when trying to create a time-dynamic ellipsoid in czml. I’ll include the czml source. The file works as expected between the two position points, but when it reaches the end of the data this quaternion error appears. Both position and orientation are available for the same length’s of time, so I’m not sure why it seems like Cesium is trying to continue reading positions when they should have stopped existing.

I’ve been doing the same thing with agi_rectangularsenors and there hasn’t been any problems with them.

The javascript error that appears in the console is:

uncaught exception: DeveloperError: quaternion is required



ellipsoid.czml (1.07 KB)

Thanks for the report Chris. This is or isn’t a bug depending on how you look at it.

1, Your test object does not specify availability, which indicates that the object is “always available”.

  1. Your ellipsoid has a constant value of show=true, which means the ellipsoid should always be visible.

  2. You only actually have a position and orientation for a limited timespan, once we go out of that timespace; the object becomes undefined, causing the error.

There are three ways to fix this on your end (any one of these will do the trick).

  1. Set an availability interval for your object so that all of your properties have data for that interval.

  2. Set your ellipsoid show to have an interval that matches the data.

  3. Set the extrapolation options on your position and quaternion properties so that they hold their first or last value when queried outside the bounds. (See the extrapolationType options in SampledProperty: http://cesiumjs.org/Cesium/Build/Documentation/SampledProperty.html ) The CZML properties share the same name and enum values.

The reason I say this may be a bug is because we will most likely change it so that if data is undefined when we need it (such as this case), we will simply hide the object rather than throw an exception (or use a default value if one is available). This is actually how most of the other CZML objects work right now (billboard, label, model, sensors, etc…) it’s only the shapes/volumes that need to be updated to match. Once we make this change, the current CZML would just cause the ellipsoid to disappear (which is probably what everyone expects anyway). I may get these changes into 1.5, but I can’t make any promises.



Setting an availability worked perfectly, thanks for the advice. I see what you mean with the bug/not-bug views since I never did explicitly specify the availability. I started my work using billboards and sensors, so the change in expectation did throw me off a bit. Thanks again for the help and I will keep an eye on the change-logs for when this gets updated.


Chris, I just opened this PR with the changes I mentioned: https://github.com/AnalyticalGraphicsInc/cesium/pull/2330

Using the CZML file you originally posted, the ellipsoid now simply disappears when outside of the data bounds, instead of crashing.