[GIS] WFS height/extrusion in OL3 cesium

cesiumopenlayerswfs

I am making a web application with OL3 and have integrated a 3d viewer with cesium. I have two data sets that are being loaded with GeoJSON as vector WFS. Both data sets have height information contained and are published as such in GeoServer (Elevation is set).

I am trying to give one WFS an extrusion (building locations) and the other a height (aircraft elevation). Everything I have found seems to be based off of cesium geometry. Is it possible to do this? Do I need to convert to primitives first?

** EDIT **
Here is the buildingSource script:

var geojsonFormat2 = new ol.format.GeoJSON();
var buildingSource = new ol.source.Vector({ 
    loader: function(extent, resolution, projection) {
    var url = 'http://local:58088/geoserver/wfs?service=WFS&' +
    'version=1.1.0&request=GetFeature&typename=Thunderbirds:Nevada&' +
    'outputFormat=text/javascript&format_options=callback:loadFeatures2' +
    '&srsname=EPSG:3857&bbox=' + extent.join(',') + ',EPSG:3857';

$.ajax({
    url: url,
    dataType: 'jsonp',
    jsonp: true
    }).done(function(response) {
        WFSformat = new ol.format.WFS(),
        sourceVector.addFeatures(WFSformat.readFeatures(response)) }); },
strategy: ol.loadingstrategy.tile(ol.tilegrid.createXYZ({
    maxZoom: 19 })) });

Best Answer

Load the GeoJSON Sandcastle Demo and click the Custom styling button in the top of the 3D window. The code on the left shows how the GeoJSON is being assigned extrusion heights.

Once the dataSource has (asynchronously) loaded, a for-loop iterates over all the entities in the dataSource, and in this example assigns entity.polygon.extrudedHeight based on population. You can assign any property you like to be the extruded height value here.

You can also assign entity.polygon.height for the ones where you want altitude but not extrusion.