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

**URL:** <https://community.cesium.com/t/25mb-geojson-file-related-rangeerror-invalid-array-length/35754>\
**Category:** CesiumJS\
**Created:** [October 11, 2024, 7:08pm UTC](https://community.cesium.com/t/25mb-geojson-file-related-rangeerror-invalid-array-length/35754 "2024-10-11T19:08:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yunusyurtturk](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/yunusyurtturk/32/27882_2.png) [@yunusyurtturk](https://community.cesium.com/u/yunusyurtturk)\
**Post date:** [October 11, 2024, 7:08pm UTC](https://community.cesium.com/t/25mb-geojson-file-related-rangeerror-invalid-array-length/35754/1 "2024-10-11T19:08:59Z")

</div>

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

```auto
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](https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:47:78030))  
> at DF (blob:[https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:47:206909](https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:47:206909))  
> at Ac.createGeometry (blob:[https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:47:211628](https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:47:211628))  
> at VF (blob:[https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:47:212371](https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:47:212371))  
> at blob:[https://localhost:7229/8d3c2f96-e733-4780-b7e2-8d7df92a9c5d:77:18851](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](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](https://community.cesium.com/uploads/short-url/3ppwIkDB0yS9es1zUoUduKh8YzO.geojson) (24.1 MB)

There is another thread almost identical from 2019: [Country JSON File](https://community.cesium.com/t/country-json-file/8387)

---

<div class="post-metadata">

**Author:** ![Marco13](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/marco13/32/2757_2.png) [@Marco13](https://community.cesium.com/u/Marco13)\
**Post date:** [October 13, 2024, 1:52pm UTC](https://community.cesium.com/t/25mb-geojson-file-related-rangeerror-invalid-array-length/35754/2 "2024-10-13T13:52:17Z")

</div>

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](https://github.com/CesiumGS/cesium/issues/12251) 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…)

---

<div class="post-metadata">

**Author:** ![Gabby\_Getz](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/gabby_getz/32/7838_2.png) [@Gabby\_Getz](https://community.cesium.com/u/Gabby_Getz)\
**Post date:** [October 14, 2024, 12:52pm UTC](https://community.cesium.com/t/25mb-geojson-file-related-rangeerror-invalid-array-length/35754/3 "2024-10-14T12:52:48Z")

</div>

Hi all,

Just wanted to chime in with one thought:

As per [#4801](https://github.com/CesiumGS/cesium/issues/4801), there’s a workaround where you can set `scene3DOnly` to `true` when creating the viewer to avoid this error.
