A module for interfacing with .czml
files and data.
More info about the Cesium Ecosystem can be found on cesium.com
The spec for .czml
files seems to be maintained here.
import (
...
"github.com/cconcannon/czml"
)
var c czml.Czml
c.InitializeDocument("name")
packet := czml.CreateEmptyPacket("id", "name")
c.AddPacket(packet)
Note: Packet field types and sub-types are available, but constructors and schema-checking are not, so you must use some other means to validate your packet schema
json, err := czml.Marshal(c)
.czml
files are valid.json
- a
.czml
file is an array ofPacket
objects - the first
Packet
in a.czml
file must be thedocument
Packet
Most struct fields are references, and this is by design. The core of this reasoning is that default values of cesium properties are a mix of zero and non-zero values across numerical and boolean types. To preserve non-zero (i.e. 1.0
, true
) implied default values, all fields except for strings have been implemented as reference values so that non-presence does not equate to zero-value.
Most of the type implementations are untested. There's a lot of opportunity for further development here - add testing, implement constructors, etc.
The documentation about value formats for many of the .czml
properties, especially those around coordinates, is relatively unclear. Many of the types declared here could probably be updated to reflect valid data.
Yes, please.