I have some problems in geojson visualization. some geojson are displayed with cuts or artifacts, like in this image:
You can check this behaviour in the cesium sandcastle pasting this lines:
var viewer = new Cesium.Viewer(‘cesiumContainer’);
var dataSource = Cesium.GeoJsonDataSource.load(‘https://dl.dropboxusercontent.com/u/14786571/test.json’);
viewer.dataSources.add(dataSource);
viewer.zoomTo(dataSource);
The geojson is valid, since it is correctly displayed in geojsonlint as you can see here:
The triangulation algorithm that Cesium uses to draw polygons occasionally fails when triangulating a polygon with holes. I believe that is what is happening in this case.
Since it happens so infrequently, I don’t think it’s something we’re going to look into in the immediate future, but it is a known issue. We chose the current implementation because it is very fast. We need to do some investigating to find a different algorithm that works just as quickly.
Is there anything we can do to avoid the failures? the polygons that we need to draw are like the ones in the pictures and the artifacts are very common. Could things like setting the alpha to 0 and only painting the border help the algorythm? or every geojson with polygons with holes may suffer it despite the visualization settings?
Also, we have another problem. If we make these polygons without holes to avoid the artifacts, since ones are on top of others, the colors get mixed. To avoid this, we thought of setting the alpha to 1, but then the geojson isnt displayed correctly. Maybe is there some way of telling cesium the z index of each feature in the featureCollection so we could use polygons without holes and alpha set to one?