I’m trying to load a json file (.GeoJson), please see attached (change file from .txt to .json). I’m using Cesium 1.53, but the map crashes giving me a DeveloperError: EllipsoidRhumbLine must have distinct start and end set.
This file can be visualized correctly in QGIS for example, no errors.
As a workaround for now, you’ll need to add this snippet to take the loaded GeoJSON and change its arc type:
var geoJSON = Cesium.GeoJsonDataSource.load( ‘path_to_file’, {
stroke: Cesium.Color.HOTPINK,
fill: Cesium.Color.PINK.withAlpha(0.5),
strokeWidth: 3
});
geoJSON.then(function(data){
// Change the arcType to GEODESIC, which is what it was in CesiumJS 1.53.
for (var i = 0; i < data.entities.values.length; i++) {
var entity = data.entities.values[i];
if (Cesium.defined(entity.polygon)) {
// entity.polygon.arcType = Cesium.ArcType.GEODESIC;
}
}
viewer.dataSources.add(data);
That same code should work regardless of how you’re loading in CesiumJS, as long as you can get a reference to the loaded data source and to the viewer instance.
Update: Apparently the dataset (.json) had self-intersecting polygons. I have fixed this, so now Cesium doesn’t crash (it doesn’t show that error message), but it is not solved as Cesium doesn’t render the polygons correctly. Have a look at the attached picture. It draws artifacts. It could be related to that ArcType parameter as well. I don’t know.