valid GeoJSON FeatureCollection with holes not rendering correctly

Hello,

I have a GeoJSON FeatureCollection with holes that when added to the globe shows up with shards.

I’m adding it via:

Cesium.Math.setRandomNumberSeed(0);

var dataSource = new Cesium.GeoJsonDataSource();

viewer.dataSources.add(dataSource);

dataSource.loadUrl(’…/…/SampleData/predios_FeatureCollection.geojson’).then(function() {

var entities = dataSource.entities.entities;

console.log(entities);

var colorHash = {};

for (var i = 0; i < entities.length; i++) {

var entity = entities[i];

var id = entity.id;

var color = colorHash[id];

if (!color) {

color = Cesium.Color.fromRandom({

alpha : 1.0

});

colorHash[id] = color;

}

entity.polygon.material = Cesium.ColorMaterialProperty.fromColor(color);

}

});

Allowing the default color scheme to take over, it appears like this:

The larger polygon is rendering above the other polygons without taking into account the holes. In QGIS, it appears fine as shown below:

With changing the color example, the order is different but the rendering is odd (i.e. in Google Earth when there is something wrong with the KML).

My GeoJSON validates with flying colors at http://geojsonlint.com/

What can I do about correcting my GeoJSON (attached) so that it functions in Cesium?

BTW, great work on making Cesium awesome!

Thanks,

Zach

predios_FeatureCollection.geojson (1.94 MB)

Zach, thanks for the report and sample data. Unfortunately the bug is on our end; the GeoJSON provider doesn’t handle holes yet. The good news is that this is high on my to-do list and should be 1.5, which should be Jan 2nd or 5th, depending on the holiday. I’ll update this email as soon as I have a branch for those interested in early testing.

No problem! Thanks for the update.

Just to close the loop on this, holes are now supported and were part of 1.5. I loaded up the file you shared and it looks great! Thanks for sharing.