Skip to content

CZML Export

Build a CZML document from entities and save or serialize it for any CesiumJS application.

import cesiumkit

doc = cesiumkit.CzmlDocument()
doc.add_entity(
    cesiumkit.Entity(
        name="Marker",
        position=cesiumkit.Cartesian3.from_degrees(-74.006, 40.7128, 100),
        point=cesiumkit.PointGraphics(pixel_size=8, color=cesiumkit.Color.RED),
    )
)
doc.save("output.czml")

czml

CZML export module for cesiumkit.

Classes:

Name Description
CzmlDocument

Builds a CZML document from cesiumkit entities.

CzmlDocument

CzmlDocument(name: str = 'cesiumkit', clock: ClockConfig | None = None)

Builds a CZML document from cesiumkit entities.

Methods:

Name Description
add_packet

Add a raw CZML packet dict.

add_entity

Add a cesiumkit Entity, converting it to a CZML packet.

to_list

Return the complete CZML document as a list of packets.

to_json

Return the CZML document as a formatted JSON string.

save

Save the CZML document to a file.

add_packet

add_packet(packet: dict) -> None

Add a raw CZML packet dict.

add_entity

add_entity(entity: Any) -> None

Add a cesiumkit Entity, converting it to a CZML packet.

to_list

to_list() -> list[dict]

Return the complete CZML document as a list of packets.

to_json

to_json(indent: int = 2) -> str

Return the CZML document as a formatted JSON string.

save

save(path: str) -> None

Save the CZML document to a file.