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.
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);
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.write… //use the methods in each class to write the properties you want here
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();