How to use the lazrs.compress_points function in lazrs

To help you get started, we’ve selected a few lazrs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tmontaigu / pylas / pylas / compression.py View on Github external
def lazrs_compress_points(points_data, parallel=True):
    try:
        import lazrs
    except Exception as e:
        raise LazError("lazrs is not installed") from e

    try:
        vlr = lazrs.LazVlr.new_for_compression(
            points_data.point_format.id, points_data.point_format.num_extra_bytes)

        compressed_data = lazrs.compress_points(
            vlr,
            np.frombuffer(points_data.array, np.uint8),
            parallel
        )
    except lazrs.LazrsError as e:
        raise LazError("lazrs error: {}".format(e)) from e
    else:
        return compressed_data, vlr.record_data()

lazrs

Python bindings for laz-rs

Apache-2.0
Latest version published 29 days ago

Package Health Score

87 / 100
Full package analysis

Similar packages