Trouble loading a CZML converted from a KML with the CZML writer DOTnet project.

Hi,

I recently converted a KML file with the CZML writer you developped. (I got it from here : https://github.com/AnalyticalGraphicsInc/czml-writer). I used the command line tool provided to do so.

The producted czml file seems a valid JSON formatted file but when I try to load it in my Cesium project, my shapes are not printed at all.

So I was wondering if your command line tool was still properly working (if not it could be of great help to write down a big "DEPRECATED" in the Readme.md...)

Here is a fragment of the CZML file producted :

[
  {
    "id":"9b1a1e16-3003-4730-b2dc-5f3d9a51b98a",
    "label":{
      "show":false,
      "text":"Sensor1"
    },
    "position":{
      "cartographicRadians":[
        -0.03490658503988659,0.7853981633974483,100
      ]
    }
  },
  {
    "id":"13d8729f-929d-4c01-982d-bb3484e116b1",
    "polygon":{
      "material":{
        "solidColor":{
          "color":{
            "rgba":[
              1,1,254,191
            ]
          }
        }
      }
    },
    "vertexPositions":{
      "cartographicRadians":[
        -0.07016935687352018,0.7800553265846581,8172.971518,-0.07016935687352018,0.7821924648004328,5552.911972,-0.06803221865774566,0.7821924648004328,11564.441047,-0.06803221865774566,0.7800553265846581,8071.783921
      ]
    }
  }
]

According to what I found here (https://github.com/AnalyticalGraphicsInc/cesium/wiki/CZML-Content#position) the value of "cartographicRadians" should be like "[Time, Longitude, Latitude, Height, Time, Longitude, Latitude, Height, ...]" and in my file it seems more like "[ Longitude, Latitude, Height, Longitude, Latitude, Height, ...]" but I have no time informations in my KML so how am I supposed to construct my CZML?

If the CZML writer is obsolete, is your KML-branch mature enough to handle kml files properly?

Thanks,
Emmanuel

The online converter is largely obsolete and unmaintained. I’ve proposed getting rid of it altogether.

Cesium is in the process of adding native KML support (in the GitHub kml branch). I would recommend anyone who requires KML support to use that branch instead of the converter. The native support is already much better than the converter.

Your CZML loads correctly. It’s a very small area, so it will be hard to spot from a global view.

Try pasting this into Sandcastle:

http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=CZML.html&label=Showcases

require([‘Cesium’], function(Cesium) {

“use strict”;

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

var builtInCzml = [

{

“id”:“9b1a1e16-3003-4730-b2dc-5f3d9a51b98a”,

“label”:{

“show”:false,

“text”:“Sensor1”

},

“position”:{

“cartographicRadians”:[

-0.03490658503988659,0.7853981633974483,100

]

}

},

{

“id”:“13d8729f-929d-4c01-982d-bb3484e116b1”,

“polygon”:{

“material”:{

“solidColor”:{

“color”:{

“rgba”:[

1,1,254,191

]

}

}

}

},

“vertexPositions”:{

“cartographicRadians”:[

-0.07016935687352018,0.7800553265846581,8172.971518,-0.07016935687352018,0.7821924648004328,5552.911972,-0.06803221865774566,0.7821924648004328,11564.441047,-0.06803221865774566,0.7800553265846581,8071.783921

]

}

}

];

var czmlDataSource = new Cesium.CzmlDataSource();

czmlDataSource.load(builtInCzml, ‘Built-in CZML’);

viewer.dataSources.add(czmlDataSource);

var rectangle = new Cesium.Rectangle(-0.0701,0.7800, -0.0702,0.7821);

viewer.scene.camera.viewRectangle(rectangle);

Sandcastle.finishedLoading();

});

Thanks for your answers. I switched for the KML branch and everything is working good except for big kml files (i.e. exceeding 20 mo)

To be honest I hadn't tried to load the small fragment I provided you, it didn't work with the whole file I have. I managed to figure out that an error was raised by the parser : "scalar is required and must be a number.". Apparently some decimal values for the height attribute were converted by the CZML writer with a coma instead of a dot... I fixed those values with a regexp and my shapes were printed but in 2D...

Anyway thank you for your help, I will go with the kml branch for now. If you have any clue on how to improve the performance let me know please!

Hi,

I come back to you because I am having major performances issues and I would like to know if you could give me some advices.

I am using the kml branch to import some heavy kml files which are a representation of complex geometric shapes. These shapes are made of many simples shapes put together (many small Quadrilaterals).
In my kml files quadrilaterals are described like this :

<Placemark>
  <styleUrl>#Altitude00500m</styleUrl>
  <Polygon>
    <altitudeMode>relativeToGround</altitudeMode>
    <outerBoundaryIs><LinearRing><coordinates>
    -4.020408,44.693878,8172.971518 -4.020408,44.816327,5552.911972 -3.897959,44.816327,11564.441047 -3.897959,44.693878,8071.783921
    </coordinates></LinearRing></outerBoundaryIs>
  </Polygon>
</Placemark>

and there are 2500 of this.
With 2500 it is loading fast enough but moves on the globe are not very fluid... and I have another file to load with 62k+ shapes and this one is not loading at all...
Would you think of a better way to load kml files or to write them better to represent such a shape?

Thank you,
Emmanuel