Skip to main content

CZML Format

Read and write Cesium CZML documents as one JSON packet per record.

Overview

PropertyValue
Format idczml
ClassCZMLIterable
Extensions.czml
ReadYes
WriteYes
Extranone (ijson optional for streaming arrays)
Maturityexperimental

Record shape

Each packet is a dict (document header, entities, etc.):

{"id": "document", "version": "1.0"}
{"id": "point-1", "position": {"cartographicDegrees": [...]}}

A bare JSON object is treated as a single-packet document. Writes emit a JSON array of packets.

Usage

from iterable import open_iterable

with open_iterable("scene.czml") as source:
for packet in source:
print(packet.get("id"))

with open_iterable("out.czml", mode="w", format="czml") as dest:
dest.write({"id": "document", "version": "1.0"})
dest.write({"id": "entity-1", "name": "Sample"})

See also