Cesium load geometry as GeoJSON

The z value in GeoJSON refers to the Height above the ground, so it is not a 3D file, you can store the polygon heights as attributes so that your properties are:

"id", "gmlid", "parent_is", "root_id", "cityobject_id", "building_height"

Run this code "the heights are based on "parent_id". (should all have the same height)

     var viewer = new Cesium.Viewer('cesiumContainer');

     var promise = Cesium.GeoJsonDataSource.load('../../SampleData/bina.gejson');
     promise.then(function(dataSource) {
     viewer.dataSources.add(dataSource);
     var entities = dataSource.entities.values;
     for (var i = 0; i < entities.length; i++) {
        var entity = entities[i];                       
        //Extrude the polygon based on any attribute you desire         
        entity.polygon.extrudedHeight = entity.properties.parent_id;
    }


    });

    viewer.zoomTo(promise);

Tags:

3D

Geojson

Cesium