Metadata-Version: 2.1
Name: czml3-ext
Version: 0.5.0
Summary: Create packets of CZML3
Author-email: Daniel Stoops <google@gmail.com>
Project-URL: Homepage, https://github.com/Stoops-ML/czml3-ext
Project-URL: Repository, https://github.com/Stoops-ML/czml3-ext
Project-URL: Issues, https://github.com/Stoops-ML/czml3-ext/issues
Classifier: Intended Audience :: Education
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: numpy>=2.0.0
Requires-Dist: shapely>=2.0.5
Requires-Dist: scikit-image>=0.24.0
Requires-Dist: czml3>=1.0.2
Requires-Dist: transforms84>=0.3.2
Provides-Extra: dev
Requires-Dist: ruff>=0.5.1; extra == "dev"
Requires-Dist: pytest>=8.2.2; extra == "dev"
Requires-Dist: mypy>=1.10.1; extra == "dev"
Requires-Dist: tox>=4.16.0; extra == "dev"
Requires-Dist: pytest-cov>=5.0.0; extra == "dev"
Requires-Dist: build; extra == "dev"
Provides-Extra: examples
Requires-Dist: jupyterlab>=4.2.3; extra == "examples"
Requires-Dist: shapely>=2.0.4; extra == "examples"
Requires-Dist: rasterio>=1.3.11; extra == "examples"
Provides-Extra: tests
Requires-Dist: ruff>=0.5.1; extra == "tests"
Requires-Dist: pytest>=8.2.2; extra == "tests"
Requires-Dist: mypy>=1.10.1; extra == "tests"
Requires-Dist: tox>=4.16.0; extra == "tests"
Requires-Dist: pytest-cov>=5.0.0; extra == "tests"

# czml3-ext
![PyPI - Version](https://img.shields.io/pypi/v/czml3_ext)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/czml3_ext)
![PyPI - License](https://img.shields.io/pypi/l/czml3_ext)

This library is a collection of functions that outputs `list`s of `czml3.packet`s for various items, as shown in the table below. See [CZML3](https://github.com/poliastro/czml3) for more information about CZML properties.

| Item     | Function in `czml3_ext.packets`        |
| -------- | -------------------------------------- |
| Sensor   | `sensor_polyline` and `sensor_polygon` |
| Grid     | `grid`                                 |
| Border   | `border`                               |
| Coverage | `coverage`                             |

## Installation
`pip install czml3-ext`

## Examples
See the example [notebook](examples/examples.ipynb) for a full demo of the package. Run `pip install czml3_ext[examples]` to run the examples locally.

The following code produces a CZML file with a single sensor:
```
import numpy as np
from czml3 import Document, Preamble
from czml3.properties import Color, Material, Polygon, SolidColorMaterial

from czml3_ext import packets
from czml3_ext.colours import RGBA

blue = RGBA.blue.copy()
blue[-1] = 100

sensor_polyline = packets.sensor_polyline(
    np.array([[31.8], [34.68], [0]]), 90, 30, 50, 20, 20_000, 5_000
)
sensor_polygon = packets.sensor_polygon(
    np.array([[31.8], [34.68], [0]]),
    90,
    30,
    50,
    20,
    20_000,
    5_000,
    polygon=Polygon(
        positions=[],
        material=Material(solidColor=SolidColorMaterial(color=Color(rgba=blue))),
    ),
)

doc = Document([Preamble(name="simple")] + sensor_polygon + sensor_polyline)
with open("example.czml", "w") as f:
    doc.dump(f)
```

This produces the following view:
![Example](https://github.com/user-attachments/assets/3127699f-5235-4acd-b218-c6e43f6595d4)



## Contributing
PRs are always welcome and appreciated!

After forking the repo install the dev requirements: `pip install -e .[dev]`.
