Java Example of generating a single Polyline to a CZML document using czml-writer?

I'm trying to understand the czml-writer library for Java:

We are trying to use it to create a Polyline onto a CZML basically.

Though I don't understand this library, the wiki goes into the structure of CZML and like what properties a Polyline has, but like how do I just create a new CZML document with a single Polyline? I'm reading the source code how there are PacketWriters, CesiumOutputStreams, it ties into StringWriter?

If anyone could just share a simple code snippet of generating a Polyline using czml-writer that would be very helpful!


There’s a basic example here:

This doesn’t generate a polyline, but CZML for various types of data is generally very similar.

Starting with the above example, generating a polyline would look something like:

try (PolylineCesiumWriter polyline = packet.openPolylineProperty()) {

List positions = Arrays.asList(new Cartographic(-75, 35, 0), new Cartographic(-125, 35, 0));



There are various ways to write the value of positions, e.g. cartesians, cartographics (radians or degrees), references, etc.

Ah thank you makes sense!