Metadata-Version: 2.2
Name: czml3-ext
Version: 0.11.0
Summary: Create packets of CZML3
Author-email: Daniel Stoops <google@gmail.com>
License: BSD-3-Clause license
        Copyright (c) 2015-2024, czml3-ext contributors
        All rights reserved.
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
          1. Redistributions of source code must retain the above copyright notice,
             this list of conditions and the following disclaimer.
          2. Redistributions in binary form must reproduce the above copyright
             notice, this list of conditions and the following disclaimer in the
             documentation and/or other materials provided with the distribution.
          3. Neither the name of the copyright holder nor the names of its
             contributors may be used to endorse or promote products derived from
             this software without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
        AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
        IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
        ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
        ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
        LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
        OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
        DAMAGE.
        
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 :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: numpy<3.0.0,>=1.0.0
Requires-Dist: shapely>=2.0.5
Requires-Dist: scikit-image>=0.24.0
Requires-Dist: czml3>=2.2.2
Requires-Dist: transforms84>=0.3.2
Requires-Dist: rasterio>=1.4.0
Provides-Extra: tests
Requires-Dist: ruff>=0.9.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"
Provides-Extra: dev
Requires-Dist: ruff>=0.9.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: marimo>=0.10.0; extra == "examples"
Requires-Dist: colourings>=0.2.0; extra == "examples"

# czml3-ext
![PyPI - Version](https://img.shields.io/pypi/v/czml3_ext)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/czml3_ext)
![build](https://img.shields.io/github/actions/workflow/status/Stoops-ML/czml3-ext/workflow.yml)

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/Stoops-ML/czml3) for more information about CZML properties.

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

## Installation
`pip install czml3-ext`

## Examples
See the [examples folder](https://github.com/Stoops-ML/czml3-ext/blob/main/examples/) 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, Packet, CZML_VERSION
from czml3.properties import (
    Color,
    Ellipsoid,
    EllipsoidRadii,
    Material,
    SolidColorMaterial,
)

from czml3_ext import packets
from czml3_ext.colours import RGBA_blue, RGBA_white

sensor = packets.sensor(
    np.array([[31.4], [34.7], [1000]]),
    10,
    30,
    100,
    20,
    10_000,
    5_000,
    name="A Sensor",
    ellipsoid=Ellipsoid(
        radii=EllipsoidRadii(cartesian=[0, 0, 0]),
        material=Material(
            solidColor=SolidColorMaterial(
                color=Color(rgbaf=Colour("blue", alpha=0.3).rgba)
            )
        ),
        outlineColor=Color(rgba=list(Colour("white").rgb)),
        fill=True,
        outline=True,
    ),
)

doc = Document(
    packets=[Packet(name="simple", id="document", version=CZML_VERSION)] + sensor
)
with open("example.czml", "w") as f:
    f.write(doc.dumps())
```

This produces the following view:
![Example](https://github.com/user-attachments/assets/c48709fe-652e-480b-a69a-ffccbe7b5ec1)




## Contributing
PRs are always welcome and appreciated!

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