Skip to main content

Sylva

PyPI crates.io Documentation

Terrestrial and airborne laser scanning processing for forest ecology and remote sensing. A Rust core (the sylva-rs crate) holds every computation and file format; Python gets a numpy-friendly API (import sylva) and a sylva command over it.

NOTE: This software is still in ALPHA

Module What it does
sylva.io LAS/LAZ (typed extra bytes, CRS from and to the WKT or GeoTIFF records), PLY (incl. raycloudtools ray clouds), XYZ/CSV/PTS, RIEGL .rxp via RiVLib, RiSCAN project parsing
sylva.coords translation, rotation about any axis and point, recentring, reprojection between CRSs (EPSG codes, PROJ strings, WKT; pure Rust, no PROJ install), applying transform files (transforms.json, RiSCAN SOPs) to many scans
sylva.filters voxel / random / Poisson-disk subsampling, box & cylinder crops, statistical & radius outlier removal, PCA normals, planarity, Euclidean clustering, kNN
sylva.ground Cloth Simulation Filter and Progressive Morphological Filter ground classification, DTM (lowest point, or TIN, natural-neighbour or IDW), height normalisation, CHM
sylva.interpolate attributes carried between clouds (nearest, inverse distance, majority vote), grids from points (IDW, TIN, natural neighbour), rasters sampled onto points
sylva.masks point masks and crops by polygons (shapefile, GeoJSON, with holes), rasters, attribute expressions (cloud.where("height > 2 & classification != 2")) and distance to another cloud
sylva.trees RANSAC circle fitting, stem detection & DBH, basal area, taper profiles, graph-based tree segmentation, tree heights, crown metrics, crown shape (stacked-hull volume, asymmetry)
sylva.canopy voxel grids, contact-frequency PAD profiles, zenith-ring gap fraction, hinge/Miller LAI, ray-traced density grids from pulse data, Jupp gap-probability profiles with hinge / linear / weighted PAI, clumping index and canopy height
sylva.voxels AMAPVox-style ray-traced voxels (port of raycloudtools rayvoxel): echo-weighted free / potential path lengths, FPL / PPL / transmittance / Bailey attenuation, analytic or estimated leaf-angle G, PAD / LAD / WAD, occlusion, sub-voxel exploration, QSM wood volume, .vox export, occlusion profiles and per-tree sampling (is the top real?)
sylva.registration Kabsch, point-to-point / point-to-plane (trimmed) ICP, scan merging
sylva.coreg marker-free coregistration of scan positions from the trees: terrain model, stem maps, global stem-map and reflector matching, robust point-to-plane ICP, pose graph with outlier rejection, recovery of stragglers, joint multi-view refinement, stem agreement report; tilted scans levelled with the scanner attitude; scanner .PROJ projects
sylva.qsm cylinder fitting, geodesic skeletonisation, cylinder QSMs with volumes and branch orders, a QSM for every tree of a plot anchored on its measured DBH, buttress meshes, _trees.txt export, tree metrics (branch table, taper, lean, sweep, crown, share of the model fitted to points)
sylva.leaves leaf / wood labels, leaf angle distribution, leaf area density from points or voxels, leaf meshes placed on a QSM
sylva.quality scan quality from stems: range noise with the stem shape removed, per-scan registration offsets, mixed-pixel tails
sylva.change change between two epochs of a plot: epoch alignment on stems and ground, tree matching with increments and their uncertainty, plot summaries (growth, mortality, recruitment), point change (C2C, M3C2, DEM of difference, voxel occupancy with occlusion), QSM change by height and branch, each labelled trusted or not
sylva.als airborne lidar over tiled areas: catalogues and buffered chunks, ground, DTM, CHM, normalisation, filtering, retiling and thinning over whole areas
sylva.als_metrics area-based metrics (the lidR standard set, cover, gap fraction) as rasters or plot tables, or any user function
sylva.als_trees tree tops from local maxima, crowns by watershed, Dalponte 2016 or Li 2012, crown outlines and labelled tiles, each tree once across tiles
sylva.als_canopy ALS and UAV pulses from the flight trajectory (SBET or text, or estimated), gap-fraction and PAD profiles corrected for beam angle, ray-traced voxels
sylva.fusion TLS and ALS together: a plot registered on a survey (canopy and terrain search, robust ICP, residuals and uncertainty), TLS stems linked to ALS trees with the trees under each crown, merged clouds and plant area profiles weighted by sampling, plot values upscaled by regression with leave-one-out checks
sylva.waveform full waveforms: LAS 1.3/1.4 wave packets and PulseWaves read and written, Gaussian decomposition into echoes, waveforms to pulses
sylva.Shots pulse-centric data (origin, direction, CSR echoes) for ray-based metrics, with a compact Parquet file format that stores misses without far points and streams into the voxeliser; pulses that returned nothing rebuilt from the scan pattern or from the returns alone
sylva.synthetic synthetic trees, plots, scans, repeat surveys, airborne flights and waveforms with known answers, for examples and tests

Contributing

Feedback, issues, and PRs all welcome. For issues please use GitHub issues (not a personal message) so the community can benefit.

Install

Requires Python 3.10 or later. The package is on PyPI: pypi.org/project/sylva-rs.

pip install sylva-rs

The wheels carry the compiled core for Linux (x86-64 and arm64), macOS (Intel and Apple silicon) and Windows. The distribution is called sylva-rs because an unrelated project owns the name sylva on PyPI; the package you import is sylva, and the two cannot be installed in the same environment.

Using a dedicated environment:

conda create -n sylva python=3.12
conda activate sylva
pip install sylva-rs

Optional extras: pip install "sylva-rs[geotiff]" for GeoTIFF export (rasterio), "sylva-rs[examples]" for the notebooks. Reading RIEGL .rxp files needs RIEGL's RiVLib, which is proprietary and loaded at run time; see the install guide.

Rust

The core is on crates.io as sylva-rs, and the sylva command without Python as sylva-cli:

cargo add sylva-rs               # the library: use sylva_rs::...
cargo install sylva-cli          # the sylva command

From source

For development, or to build the extension yourself. A conda environment keeps the Python, the Rust toolchain and the C linker together:

git clone https://github.com/UQ-EORC/Sylva.git
cd Sylva
conda create -n sylva -c conda-forge python=3.12 rust maturin c-compiler
conda activate sylva
maturin develop --release        # builds the Rust core into the environment

c-compiler matters: rustc links through a program called cc, which conda's rust package does not provide, so without it the build stops at error: linker `cc` not found. The repository's environment.yml has the same list plus the test and notebook extras (conda env create -f environment.yml).

Without conda, any Python >= 3.10 with a Rust toolchain (rustup), a system C compiler (gcc, build-essential, or Xcode's command line tools) and pip install maturin does the same job.

A first look

import sylva
from sylva import ground, trees, voxels

cloud = ground.classify_ground_csf(sylva.read("plot.laz"))
cloud = ground.normalize_height(cloud, ground.make_dtm(cloud, resolution=0.5))
stems = trees.detect_stems(cloud)                        # positions and DBH
labels = trees.segment_trees(cloud, stems)               # tree_id per point

shots = sylva.Shots.load("plot.parquet")                 # pulses, misses included
grid = voxels.ray_voxelize(shots, 0.25, ground_class=2)  # ray-traced plant area density
from sylva import coords, interpolate, masks

cloud = coords.reproject(cloud, "EPSG:7855")                  # to GDA2020 / MGA zone 55
trees_only = cloud.where("height > 1.3 & tree_id >= 0")       # attribute expression
plot = masks.crop_polygons(cloud, masks.read_polygons("plot.shp"))
full = interpolate.transfer_attributes(thinned, full, ["tree_id"], method="majority")
sylva ground plot.laz plot_norm.laz --dtm dtm.asc
sylva trees plot_norm.laz -o trees.csv --segment plot_trees.laz
sylva coreg survey.PROJ -o survey_coreg/ --merged survey.laz
sylva voxel plot.parquet plot.vox --voxel 0.25 --ground-class 2
sylva reproject plot.laz plot_mga55.laz --to EPSG:7855
sylva transform scan.laz scan_project.laz --matrix ScanPos001.DAT
sylva als-ground tiles/ ground/ --method csf                  # airborne tiles
sylva als-metrics ground/ metrics/ --resolution 20 --metrics zq95,zmean,cover
sylva als-trees ground/ trees.csv --crowns crowns.geojson
from sylva import als, change

cat = als.catalog("ground/")                                  # ALS tiles
metrics = als.grid_metrics(cat, 20.0)                          # rasters, one per metric
found = als.find_trees(cat, method="dalponte2016")             # tops and crowns

m = change.match_trees(stems_2019, stems_2024)                 # two epochs of a plot
inc = change.tree_increments(m, cloud_2019, cloud_2024, labels_2019, labels_2024)

Documentation

The documentation is at uq-eorc.github.io/Sylva; its sources are in docs/:

Build the site with pip install -e '.[docs]' && mkdocs serve.

Authors

  • Tim Devereux, The University of Queensland

Citation

If Sylva contributed to your work, please cite it:

Devereux, T. (2026). Sylva: terrestrial and airborne laser scanning processing for forest ecology (version 0.2.1) [Computer software]. The University of Queensland. https://github.com/UQ-EORC/Sylva

@software{sylva,
  author       = {Devereux, Tim},
  title        = {Sylva: terrestrial and airborne laser scanning processing
                  for forest ecology},
  year         = {2026},
  version      = {0.2.1},
  organization = {The University of Queensland},
  url          = {https://github.com/UQ-EORC/Sylva}
}

Licence

GNU General Public License v3.0 or later; see LICENSE. Anything distributed that builds on Sylva carries the same licence.

Metadata

Release files for sylva-rs 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sylva-rs 0.2.1
File Size Uploaded Provenance
sylva_rs-0.2.1.tar.gz 1.0 MB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for sylva-rs 0.2.1
File
sylva_rs-0.2.1-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
sylva_rs-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
sylva_rs-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
sylva_rs-0.2.1-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
sylva_rs-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 32.9 MB

Release files / sylva_rs-0.2.1.tar.gz

Download URL sylva_rs-0.2.1.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
0e9eab5b2c3eacb2f2461669c2b5132da1868e057ba0500217a20d44c0c068e3
BLAKE2b-256 checksum
How to use checksums
80f850fc38e87220764f85615359600b8c827aa2d38a41714716ffce77c06574
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / sylva_rs-0.2.1-cp310-abi3-win_amd64.whl

Download URL sylva_rs-0.2.1-cp310-abi3-win_amd64.whl
Size 6.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
2c7b807e5b2d618571ec02ee8f9d6fa8207ec73da6c36bdfb5f44150f8724e34
BLAKE2b-256 checksum
How to use checksums
e3871c42a0b874bd70ca30209fa34d3006a42594f60097cb9636709b39de079a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / sylva_rs-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL sylva_rs-0.2.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 6.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
c0b9564c058ab64ea2637fd583578c1db431558da6b28d49225b75709c837c83
BLAKE2b-256 checksum
How to use checksums
e53faf416fd38cc2aba2af5e16d3c8b796be53613c4322b2ec4781dfc9d1259d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / sylva_rs-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL sylva_rs-0.2.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 6.4 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
6d2674b196e59ba6774ead1c808d81a00276ebaba99094aad1645612f8010a6d
BLAKE2b-256 checksum
How to use checksums
8cf9cb82004191126681644d68fffee966acbd28dd619c1f2910157b4db7f833
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / sylva_rs-0.2.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL sylva_rs-0.2.1-cp310-abi3-macosx_11_0_arm64.whl
Size 6.0 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7bb73b6d7376b945e6d1071c192c2db19230b7c1f1aeebba92911da2d2fe60d9
BLAKE2b-256 checksum
How to use checksums
efb6e8c86597039e3424fdff159c4ef05aecef9e8b82e8d2fd252c28d02b8e00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Release files / sylva_rs-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl

Download URL sylva_rs-0.2.1-cp310-abi3-macosx_10_12_x86_64.whl
Size 6.4 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
15d8740b2dc7f56dc728a82024973e2bdc047b0ce78abe2466fb957caa207f76
BLAKE2b-256 checksum
How to use checksums
0979563482daf736be129bccfe579a5f219fd94b5315509646b06f6488ea512d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

Security for sylva-rs 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for sylva_rs-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page