Converting kml file to czml file - can't find CesiumLanguageConverter.exe

hello,

i am having a kml file that defines a location that i need to see in the cesium

globe. it works fine in google earth. but for cesium i need file in the format of czml. So need to convert my kml file to czml format. so i tried with the czml map-writter.I tried to convert as per the instructions given here https://github.com/AnalyticalGraphicsInc/czml-writer/wiki/Quick-Start but the CesiumLanguageConverter.exe is not found inside the bin directory.

However there is a file named CesiumLanguageWritter and I also tried with it .

Am i doing something wrong?? Thank you in advance.

Regards
Datta

Hello Datta,

You need to first build the solution on Github in either Visual Studio for .NET or Eclipse for Java. From there you can use the command line tool as described in the link you provided below or use the libraries to build your own converter/czml writer.

thank you for your information kevin. but i did the same on visual studio. But the CesiumLanguageConverter.exe is missing. one more thing can you give some ideas how to build my own converter/czml writer..

regards
datta

Hi Datta,

You can also try building the CesiumLanguageWriter.sln from the command line. Some good instructions for this can be found here:

http://stackoverflow.com/questions/498106/how-do-i-compile-a-visual-studio-project-from-the-command-line

For the java portion of the czml-writer you have to import the project into eclipse (or any editor of your choosing) and make your own methods that call the classes to write a czml file. The java one doesn’t have an executable, and cannot directly convert from kml to czml. I just finished a project using the java part, so if you decide to go that route I can definitely help you get started.

If you still have issues there is also a kml-build for Cesium that can render some kml files that can be found under the branches on the main Cesium github page.

Best,
Chris

thanks for you reply kevin.But there is no project called CesiumLanguageConverter in any of these. There is somthing called CesiumLanguageWriter.i am using intellij idea for the java one. i m building it.then also the command line tool exe file is not coming.Anything am i missing?please do tell.

with regards
datta

The CesiumLanguageConverter was removed some time ago because it was superseded by Cesium’s native KML support, which while still in development, can be used by cloning our Git repository and using the “kml” branch (https://github.com/AnalyticalGraphicsInc/cesium/tree/kml)

I’ll scrub the wiki to remove the outdated information and mention the state of KML.

thank you for your reply Matthew. But i have tried the kml version of the cesium. after building i tried to drag and drop my kml onto the cesiumViewer.but it is complaining that it is not a supported format. so i need to convert my kml to czml format.

thank you chris. yes i want to go in the java route. it will be very helpful if you help me on that.

thanks a lot in advance..

regards

datta

hello chris..

in the java way i am trying to convert.but the problem is there are a lot of classes. i can not understand which one to call for converting kml to czml. can you please help me regarding this?

regards
datta

if you speak python there are the
https://github.com/cleder/fastkml
and
https://github.com/cleder/czml
libraries which you can use for converting

Hi Datta,

Unfortunately the java way does not include a way to convert any files. It only provides a writer to generate a new czml from
scratch. The way the java one works is you need to instantiate a StringWriter that will be used as the input to a CesiumOutputStream.

From
this stream you can call the different methods in the CesiumOutputStreamClass to write czml properties to your StringWriter. For example if I use “writer” as my StringWriter, and “cos” as my CesiumOutputStream variable then to start I would write:

CesiumOutputStream cos = new CesiumOutputStream(writer);

``

I
would recommend starting with cos.setPrettyFormatting(true). This way you can write it to the console and it will be formatted in a way that is easy to troubleshoot. In order to use the other classes, such as the BillboardCesiumWriter you have to initialize them as follows:

//the input string is the property name BillboardCesiumWriter bcw = new BillboardCesiumWriter("");
bcw.open(cos);
bcw.write… //use the methods in each class to write the properties you want here

``

From
here you just have to go through the different methods available for each class and choose the one you need. There’s a lot of code in there, but once you start to understand how the writer works it goes much quicker.

When you’re done and want to write everything to the console to see if the formatting is correct, or write the czml to a file
you can return the writer to a string variable with:

String czml = cos.returnWriter().toString();

``

-Chris