Issues with updateBatchTableBoundingSpheres()

Hi All,

I’m running into issues with rendering certain polygons which throws the following exception (v1.26):

An error occurred while rendering. Rendering has stopped.
TypeError: Cannot read property ‘center’ of undefined
TypeError: Cannot read property ‘center’ of undefined
at updateBatchTableBoundingSpheres (…/CesiumUnminified/Cesium.js:93495:40)
at Primitive.update (…/CesiumUnminified/Cesium.js:93890:13)
at PrimitiveCollection.update (…/CesiumUnminified/Cesium.js:157993:27)
at updatePrimitives (…/CesiumUnminified/Cesium.js:166212:27)
at executeCommandsInViewport (…/CesiumUnminified/Cesium.js:166122:9)
at updateAndExecuteCommands (…/CesiumUnminified/Cesium.js:165990:17)
at render (…/CesiumUnminified/Cesium.js:166420:9)
at Scene.render (…/CesiumUnminified/Cesium.js:166458:13)
at CesiumWidget.render (…/CesiumUnminified/Cesium.js:175280:25)
at render (…/CesiumUnminified/Cesium.js:174676:32)

``

What we do is streaming (event-stream) the data (testing with polygons - only using the exterior ring for now) in czml format (using cesium writer). The implementation works well, and don’t think there is an issue / problem with the way we are doing it. With smaller datasets, cesium renders the geometries correctly. However, increasing the volume to about 1000 polygons, we get the error above.

What I’ve found is that the boundingSpheres for some polygons are null / undefined.

Is there an easy way to identify the polygons causing the exception? Since we are using the CzmlDataSource() and the process function, as a packet becomes available, there is not much room for troubleshooting…

Any pointers / advice would greatly be appreciated.

Regards,

Andries

This is very strange. When I load the entire CZML file (attached a demo file with 100 polygons) once off as a CzmlDataSource() using the load() function, it works:

var demo = Cesium.CzmlDataSource.load(‘demo.json’);

viewer.dataSources.add(demo);

viewer.zoomTo(demo);

``

This means there is nothing wrong with the vertices / points of the polygons.

But, when I use streaming and flush all 100 polygons to the datasource with the process() function, I get the error mentioned earlier. I validated the packets individually in the event stream and the structure and content is 100% correct. I tried flushing / processing the packets individually (one by one), or as a single batch. Made no difference.

function foo() {

var source = new Cesium.CzmlDataSource();

viewer.dataSources.add(source);

var es = new EventSource(“Stream”);

var listener = function (event) {

var type = event.type;

switch (type) {

case “open”:

console.log(“opened.”);

break;

case “message”:

if (event.data !== “”) {

try {

var response = JSON.parse(event.data);

source.process(response);

}

catch (t) {

console.error(t);

}

}

break;

case “error”:

console.log(type);

break;

case “completed”:

es.close();

viewer.flyTo(source.entities);

break;

}

};

es.addEventListener(“open”, listener);

es.addEventListener(“message”, listener);

es.addEventListener(“error”, listener);

es.addEventListener(“completed”, listener);

}

``

Hmm?

demo.json (1.58 MB)

Thanks for the report.

The crash was a regression/bug in 1.26. It should be fixed in master and will be part of the 1.27 release on Nov 1st. See https://github.com/AnalyticalGraphicsInc/cesium/pull/4461 for details.

There may be another related bug that we are still tracking down, but that will also be fixed on the 1st.

Thanks again

Great! Thanks Matthew.