~25MB Geojson file related: RangeError: Invalid array length

Hi.
I have 2 geojson files converted from .shp files. I’m able to load one of them with the command:

Cesium.GeoJsonDataSource.load("./data/usa.geojson").then(function (dataSource) {
    viewer.dataSources.add(dataSource);
    viewer.zoomTo(dataSource);
});

However, for the second one -ne_10m_admin_0_countries_tur.geojson, 25MB file- I get the error:

RangeError: Invalid array length

RangeError: Invalid array length
at On.subdivideRhumbLine (blob:https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:47:78030)
at DF (blob:https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:47:206909)
at Ac.createGeometry (blob:https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:47:211628)
at VF (blob:https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:47:212371)
at blob:https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:77:18851
at async Promise.all (index 224)
at async e (blob:https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:46:205)

I’m attaching the file that produces error.
Cesium Version 1.121

ne_10m_admin_0_countries_tur.geojson (24.1 MB)

There is another thread almost identical from 2019: Country JSON File

This is unrelated to the size of the file.
In fact, it also happens for a GeoJSON with a measly four points - for specific configurations of polyline points near the south pole.

I opened Rendering error for certain GeoJSON at south pole · Issue #12251 · CesiumGS/cesium · GitHub with smaller example data.

In that specific file, the points appear as part of “Antarctica”. As a … “pragmatic” (i.e. hacky) workaround, I just replaced all appearances of ", 90.0" with ", 89.99" and then the data can be rendered. (It seems to have a few other artifacts, but it does not longer cause that RangeError, at least…)

Hi all,

Just wanted to chime in with one thought:

As per #4801, there’s a workaround where you can set scene3DOnly to true when creating the viewer to avoid this error.