Issue with visualization of KML/KMZ files

Hi Cesium Team,

our team is working very actively on KML branch of Cesium, particularly for the support of KML network links. We were earlier working on Cesium B29 and recently migrated to the latest version Cesium 1.5. After migration, we observe an unusual behaviour in visualization of the KML polygons. For each building, there are different colours for roof and wall surfaces and the colour on the wall surface appears to be mixed with the colour of roof surface. However, we did not face the same issue with Cesium B29. We have attached the screenshots visualizing the same file in the two versions (Cesium B29 and Cesium 1.5).

Screenshot1: Visualization with Cesium B29

Screenshot 2: Visualization with Cesium 1.5

Could you please suggest, how can we resolve this issue.

Best regards,

Kanishk

Can you please provide a simple KML file that reproduces the problem? If so, it should be an easy fix. Thanks.

Hi Matthew,

thank you - I have attached here the KMZ file, which we are using in the above screenshot.

Best regards,

Kanishk

London_Geometry_LOD2_Tile_6_16_geometry.kmz (21.6 KB)

I just tried this with the latest KML build and everything appears to work great. Let me know if you are still having problems when using the head of the kml branch.

Thank you very much! The issue appears to be resolved now.

Hi Kanishk,
Can you please tell me how on earth you got those 3D KMZ files to work? I haev been beating my head against the desk for days trying to get a 3D KMZ to draw up with no success....
Any hints or tips would be greatly appreciated!!
Nick

Nick, assuming they aren’t using network links, they should “just work”. If they are using NetworkLinks, it should still work as long as the server either has CORS enabled or you use a proxy. If you can share the KMZ, I can take a quick look for you and let you know what the problem may be.

Cesium 1.7 with KML/KMZ support will be out today. While there are still lots of features we need to implement (Full NetworkLink support, Regions, Screen Overlays, etc…) I’m pretty sure what we have is useful for a large amount of use cases.

Hi Matthew

Thanks for getting beck to me so quickly!! The kmz is here: http://dragons8mycat.co.uk/3D/Soton.kmz , I’ve been using it to demonstrate the Google Earth API for the renewables industry (should be a Vestas v60 wind turbine).

I’ve tried the online cesium “sandcastle” with no luck whatsoever, then tried the Cesium kml with no luck…I then took a copy of cesium onto my GitHub which looks more promising but I can’t even find the config script to put the kmz url into…getting a little frustrated & feeling real n00b!! LOL

Nick D

Sorry to give you bad news, but the reason this doesn’t work is because Models aren’t supported yet. When we do support models, there will still be a conversion step for the collada model (because it needs to be glTF for Cesium), but the KMZ you supplied should be easy to get up and running at that time.

I’m actually planning on putting up a blog post today or tomorrow that goes into the details of current KML support in Cesium, so hopefully that will alleviate any of the frustration you are having.

Ah…there goes the second problem…I tried the collada to glTF on the cesium website and that failed too.

I’ve got to be honest, I saw your 3D buildings and thought there was a real answer to Google Earth API

Don’t confuse KML support (which is brand new) with overall Cesium functionality. Here’s your model, properly geolocated in Cesium.

image.png

And the code:

var viewer = new Cesium.Viewer(‘cesiumContainer’);

var position = Cesium.Cartesian3.fromDegrees(-1.393339, 50.906726, 0);

var heading = Cesium.Math.toRadians(1.247240757065);

var orientation = Cesium.Transforms.headingPitchRollQuaternion(position, heading, 0, 0);

var entity = viewer.entities.add({

position : position,

orientation : orientation,

model : {

uri : ‘/untitled.gltf’

}

});

viewer.trackedEntity = entity;

You could also do it with CZML. Direct Google Earth compatibility (such as KML support) is still a work in progress. In some areas, Cesium already surpasses Google Earth functionality, in other areas we are still catching up. 3D buildings is definitely an area we are actively working and I expect big things in the coming months.