# Viewing a geojson as 3D in cesium

**URL:** <https://community.cesium.com/t/viewing-a-geojson-as-3d-in-cesium/3984>\
**Category:** CesiumJS\
**Created:** [April 13, 2016, 7:10am UTC](https://community.cesium.com/t/viewing-a-geojson-as-3d-in-cesium/3984 "2016-04-13T07:10:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farook\_M](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/farook_m/32/3196_2.png) [@Farook\_M](https://community.cesium.com/u/Farook_M)\
**Post date:** [April 13, 2016, 7:10am UTC](https://community.cesium.com/t/viewing-a-geojson-as-3d-in-cesium/3984/1 "2016-04-13T07:10:18Z")

</div>

I had added a simple geojson which contains elevation information. I tried viewing as 3D with below code  
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);

When i run the above code i got the viewer as attached in snapshot. I dont get any 3D. Please tell me where am i wrong. Am new to cesium.

[![](https://lh3.googleusercontent.com/-wAa5nw-5Hek/Vw3wr-m_EnI/AAAAAAAAFXs/mEeRfJdsn8scViIxIvAeVhjgSXqgsKzMACLcB/s320/cesium_3d.png)](https://lh3.googleusercontent.com/-wAa5nw-5Hek/Vw3wr-m_EnI/AAAAAAAAFXs/mEeRfJdsn8scViIxIvAeVhjgSXqgsKzMACLcB/s1600/cesium_3d.png)

---

<div class="post-metadata">

**Author:** ![hannah](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/hannah/32/4509_2.png) [@hannah](https://community.cesium.com/u/hannah)\
**Post date:** [April 13, 2016, 2:11pm UTC](https://community.cesium.com/t/viewing-a-geojson-as-3d-in-cesium/3984/2 "2016-04-13T14:11:55Z")

</div>

Hello,

Cesium doesn’t handle the height automatically because it is not an official part of the GeoJSON spec. Instead, you can write a function that sets the extrudedHeight property after the geojson is processed. Take a look at the ‘custom styling’ part of this example:

> **[Cesium Sandcastle](https://sandcastle.cesium.com/index.html?src=GeoJSON%20and%20TopoJSON.html&label=DataSources)**
>
> The Cesium Sandcastle provides an interactive environment for testing Cesium code.

Best,

Hannah

---

<div class="post-metadata">

**Author:** ![Farook\_M](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/farook_m/32/3196_2.png) [@Farook\_M](https://community.cesium.com/u/Farook_M)\
**Post date:** [April 14, 2016, 5:22am UTC](https://community.cesium.com/t/viewing-a-geojson-as-3d-in-cesium/3984/3 "2016-04-14T05:22:14Z")

</div>

Thanks for the response. Yeah finally got it.
