cesium icon indicating copy to clipboard operation
cesium copied to clipboard

Geometry.splitLongitude crashing for polygon that crosses the poles

Open hpinkos opened this issue 9 years ago • 3 comments

Reported on the forum: https://groups.google.com/forum/?hl=en#!topic/cesium-dev/O_LaBx1_1wg

ne_10m_admin_0_countries2.json.txt

For some reason this crashes in Sandcastle but not in the CesiumViewer. It also doesn't crash when scene3DOnly = true

var viewer = new Cesium.Viewer('cesiumContainer');

viewer.dataSources.add(Cesium.GeoJsonDataSource.load('../../SampleData/ne_10m_admin_0_countries2.json'));
DeveloperError: normalized result is not a number
Error
    at new DeveloperError (http://localhost:8080/Source/Core/DeveloperError.js:44:19)
    at Function.Cartesian3.normalize (http://localhost:8080/Source/Core/Cartesian3.js:422:19)
    at computeTriangleAttributes (http://localhost:8080/Source/Core/GeometryPipeline.js:1901:24)
    at splitLongitudeTriangles (http://localhost:8080/Source/Core/GeometryPipeline.js:2058:17)
    at Object.GeometryPipeline.splitLongitude (http://localhost:8080/Source/Core/GeometryPipeline.js:2482:17)
    at geometryPipeline (http://localhost:8080/Source/Scene/PrimitivePipeline.js:135:38)
    at Object.PrimitivePipeline.combineGeometry (http://localhost:8080/Source/Scene/PrimitivePipeline.js:278:26)
    at combineGeometry (http://localhost:8080/Source/Workers/combineGeometry.js:12:41)
    at http://localhost:8080/Source/Workers/createTaskProcessorWorker.js:56:42

hpinkos avatar Jan 03 '17 16:01 hpinkos

It also doesn't crash when scene3DOnly = true

That's because we don't need to split the geometry in 3D so this code path never gets calls.

mramato avatar Jan 03 '17 16:01 mramato

Reported again in https://community.cesium.com/t/geojsondatasource-crash/25540/2.

ggetz avatar Jul 24 '23 18:07 ggetz

Also reported in https://github.com/CesiumGS/cesium/issues/12251 / https://community.cesium.com/t/25mb-geojson-file-related-rangeerror-invalid-array-length/35754

ggetz avatar Oct 14 '24 12:10 ggetz