# Get czml building at certain height

**URL:** <https://community.cesium.com/t/get-czml-building-at-certain-height/3573>\
**Category:** CesiumJS\
**Created:** [January 16, 2016, 1:39pm UTC](https://community.cesium.com/t/get-czml-building-at-certain-height/3573 "2016-01-16T13:39:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Parthesh](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/parthesh/32/6572_2.png) [@Parthesh](https://community.cesium.com/u/Parthesh)\
**Post date:** [January 16, 2016, 1:39pm UTC](https://community.cesium.com/t/get-czml-building-at-certain-height/3573/1 "2016-01-16T13:39:24Z")

</div>

I want to get 3D buildings on top of the terrain for which I have the Elevation data for the buildings.

I wrote czml code like following:

{

```
  "id": "1",

 "description": "Building Height:24.600(m)",

"polygon": {

       "extrudedHeight": {

                "number": 24.600

           },

         "outline": {

               "boolean": true

    },

         "outlineColor": {

                  "rgba": [0,

                0,

                 0,

                 255]

       },

         "material": {

              "solidColor": {

                    "color": {

                                 "rgba": [255,

                              0,

                                 0,

                                 163]

                       }

                  }

          },

         "positions": {

             "cartographicDegrees": [78.39464257000003,

                 17.477616975000046,

                527.72000000000116,

                78.394779279000034,

                17.477647653000076,

                527.72000000000116,

                78.394808867000052,

                17.477550339000061,

                527.72000000000116,

                78.39466662600006,

                 17.477517146000082,

                527.72000000000116,

                78.39464257000003,

                 17.477616975000046,

                527.72000000000116]

        }

  }

```

}

``

But I am not getting the building at given cartographic altitude(527.72). The building is still sticking to the ellipsoid.

I have tried “polygon.height”, “polygon.perPositionHeight” properties but didn’t find correct way.

Help needed !

---

<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:** [January 18, 2016, 3:00pm UTC](https://community.cesium.com/t/get-czml-building-at-certain-height/3573/2 "2016-01-18T15:00:05Z")

</div>

Hello,

You need to set both the height and extrudedHeight options. Try something like this:

…

“extrudedHeight”: 24.600 + 527.72,

“height”: 527.72,

…

And then for your positions.cartographicDegrees, just use the longitude and latitude coordinates.

Best,

Hannah

---

<div class="post-metadata">

**Author:** ![Parthesh](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/parthesh/32/6572_2.png) [@Parthesh](https://community.cesium.com/u/Parthesh)\
**Post date:** [January 18, 2016, 5:06pm UTC](https://community.cesium.com/t/get-czml-building-at-certain-height/3573/3 "2016-01-18T17:06:56Z")

</div>

Thanks Hannah… That worked. But I would like to say that it seems a bit illogical in itself. Documentation also is confusing for this task.

Following lines worked,  
…

“extrudedHeight”:{“number”:552.32},

“height”:{“number”:527.72},

…

---

<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:** [January 18, 2016, 6:52pm UTC](https://community.cesium.com/t/get-czml-building-at-certain-height/3573/4 "2016-01-18T18:52:15Z")

</div>

Thanks, I submitted a fix for the documentation here: [https://github.com/AnalyticalGraphicsInc/cesium/pull/3443](https://github.com/AnalyticalGraphicsInc/cesium/pull/3443)

-Hannah
