Read and write CZML in Python
Project description
This is an open source python library to read and write CZML files for Cesium, the WebGL Earth modeling engine.
Requirements
Tests
To run the tests (in the czml directory):
> python setup.py test
czml is continually tested with Travis CI
Usage and Examples
The general approach to writing CZML with this python library is to define a document object, define packets and append them to the document, and then write the document to a file using the data() method passed to json.dump().:
# Import the library from czml import czml # Initialize a document doc = czml.czml() # Create and append the document packet packet1 = czml.CZMLPacket(id='document',version='1.0') doc.packets.append(packet1) # Create and append a billboard packet packet2 = czml.CZMLPacket(id='billboard') bb = czml.Billboard(scale=0.7, show=True) bb.image = 'http://localhost/img.png' bb.color = {'rgba': [0, 255, 127, 55]} packet2.billboard = bb doc.packets.append(packet2) # Write the CZML document to a file filename = "example.czml" with open(filename, 'w') as file: json.dump(doc.data(), file)
Supported CZML Components
The components in this library are developed to follow the CZML Content documentation. Supported components and subcomponents are listed in docs/COMPONENTS.md.
v 0.3.1 (2015/03/19)
Added usage example to README
Added docs/COMPONENTS.md
Minor cleanup from 0.3 release
v 0.3 (2015/03/09)
Replace VertexPositions with Positions [Christopher Clark (Frencil)]
Rebuild two-dimensional object classes and tests for current CZML [Christopher Clark (Frencil)]
Add/update all documented material subclasses (Grid, Image, Stripe, SolidColor, PolylineGlow, PolylineOutline) [Christopher Clark (Frencil)]
Add document object support (including version and Clock) [Christopher Clark (Frencil)]
Restrict support to Python 2.7 and 3.3+ [Christopher Clark (Frencil)]
v 0.2 (unreleased)
Fixed bug in the Number class [Carl Fischer (Carl4)]
Add Radii, Orientation, Path, Ellipsoid, Cone, Ellipse [Carl Fischer (Carl4)]
v 0.1 (2013/04/05)
Initial release [Christian Lederman (cleder)]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file czml-0.3.1-py3.3.egg
.
File metadata
- Download URL: czml-0.3.1-py3.3.egg
- Upload date:
- Size: 46.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 826fe0520902cb786b92cf7daa7098091e7f94f30f099a8e122d77e67ff5cc45 |
|
MD5 | 45bb7d8f2c8611962754968fb935913d |
|
BLAKE2b-256 | be5fa02d16ea33006882a70fda44ff49f619cbd191260341e60df12ce067c006 |
File details
Details for the file czml-0.3.1-py2.7.egg
.
File metadata
- Download URL: czml-0.3.1-py2.7.egg
- Upload date:
- Size: 45.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4fa810c20d4efad472f569c6c6611b584c877f5d7da50c77111f53d4f869d73b |
|
MD5 | 262e42ab1173f53b5f20ff65ac7ec472 |
|
BLAKE2b-256 | 7466e34bcb930c93fa33c929c50eca59be7e0331488d8bfec94957391644798f |