Cesium Language (CZML) is a JSON format for describing a time-dynamic graphical scene, primarily for display in a web browser running Cesium. It describes lines, points, billboards, models, and other graphical primitives, and specifies how they change with time.
Cesium Language (CZML)
CZML is a JSON format for describing a time-dynamic graphical scene, primarily for display in a web browser running Cesium. It describes lines, points, billboards, models, and other graphical primitives, and specifies how they change with time. In many ways, the relationship between Cesium and CZML is similar to the relationship between Google Earth and KML. Both CZML and KML are data formats for describing scenes in their respective clients and are meant to be generated by a wide variety of applications.
- CZML is based on JSON.
- CZML can accurately describe properties that change over time.
- CZML is structured for efficient, incremental streaming to a client.
- CZML is optimized for client consumption.
- CZML is extensible.
- CZML is an open format.
CZML is a subset of JSON, meaning that a valid CZML document is also a valid JSON document. Specifically, a CZML document contains a single JSON array where each object-literal element in the array is a CZML Packet. A CZML packet describes the graphical properties for a single object in the scene, such as a single aircraft.
Examples
Note: javascript comments in this example are for illustration purposes even though comments are not technically allowed in JSON.
[
// packet one
{
"id": "GroundControlStation"
"position": { "cartographicDegrees": [-75.5, 40.0, 0.0] },
"point": {
"color": { "rgba": [0, 0, 255, 255] },
}
},
// packet two
{
"id": "PredatorUAV",
// ...
}
]
There are additional examples online.
Demos
Cesium ships with several CZML demos.
References
- CZML Guide is a high-level overview of CZML.
- CZML Structure shows the structure of a CZML stream.
- CZML Packet shows the contents of a packet within a CZML stream.