[GIS] Viewing a geojson as 3D in cesium

3d modelcesiumjavascript

I have a geojson with height informations in it. I tried adding the geojson to the scene using

var viewer = new Cesium.Viewer('cesiumContainer', {
sceneMode : Cesium.SceneMode.SCENE3D,
timeline : false,
animation : false
});

var dataSource = Cesium.GeoJsonDataSource.load('../../SampleData/Buildings_3D_Elevation.geojson');
viewer.dataSources.add(dataSource);
viewer.zoomTo(dataSource);

I can view the data as below. What should be done to use the height information and view as 3D?
enter image description here

Best Answer

You need to extrude polygons:

entity.polygon.extrudedHeight = entity.properties.your_height_field

You may need to loop over records, for example:

    var p = dataSource.entities.values;   
    for (var i = 0; i < p.length; i++) {
         p.polygon.extrudedHeight = entity.properties.your_height_field