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

646 views
Skip to first unread message

devid...@gmail.com

unread,
Oct 14, 2014, 3:09:15 AM10/14/14
to cesiu...@googlegroups.com
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

Kevin Ten Eyck

unread,
Oct 14, 2014, 7:46:22 AM10/14/14
to cesiu...@googlegroups.com, devid...@gmail.com
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.

devid...@gmail.com

unread,
Oct 14, 2014, 8:55:17 AM10/14/14
to cesiu...@googlegroups.com, devid...@gmail.com
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

Chris M.

unread,
Oct 14, 2014, 9:23:59 AM10/14/14
to cesiu...@googlegroups.com, devid...@gmail.com
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

devid...@gmail.com

unread,
Oct 14, 2014, 9:24:26 AM10/14/14
to cesiu...@googlegroups.com, devid...@gmail.com
On Tuesday, 14 October 2014 17:16:22 UTC+5:30, Kevin Ten Eyck wrote:
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

Matthew Amato

unread,
Oct 14, 2014, 9:29:22 AM10/14/14
to cesiu...@googlegroups.com
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.

datta

--
You received this message because you are subscribed to the Google Groups "cesium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

devid...@gmail.com

unread,
Oct 15, 2014, 12:25:42 AM10/15/14
to cesiu...@googlegroups.com
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

devid...@gmail.com

unread,
Oct 15, 2014, 1:31:35 AM10/15/14
to cesiu...@googlegroups.com, devid...@gmail.com

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

Christian Ledermann

unread,
Oct 15, 2014, 4:14:56 AM10/15/14
to cesiu...@googlegroups.com, devid...@gmail.com
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
> --
> You received this message because you are subscribed to the Google Groups "cesium-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to cesium-dev+...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
Best Regards,

Christian Ledermann

London - UK
Mobile : +44 7474997517

<*)))>{

If you save the living environment, the biodiversity that we have left,
you will also automatically save the physical environment, too. But If
you only save the physical environment, you will ultimately lose both.

1) Don’t drive species to extinction

2) Don’t destroy a habitat that species rely on.

3) Don’t change the climate in ways that will result in the above.

}<(((*>

Chris M.

unread,
Oct 15, 2014, 8:26:45 AM10/15/14
to cesiu...@googlegroups.com, devid...@gmail.com
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
Reply all
Reply to author
Forward
Message has been deleted
0 new messages