Skip to content

Commit

Permalink
Merge pull request #2 from iosefa/docs/essential-documentation
Browse files Browse the repository at this point in the history
Update LICENSE and README for 2024 and dependencies
  • Loading branch information
iosefa authored Sep 19, 2024
2 parents 4d99db5 + 4912749 commit f11c1e1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 28 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Iosefa Percival
Copyright (c) 2024 Joseph Emile Honour Percival

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
48 changes: 21 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Plant Area Index (PAI), Canopy Cover, Plant Area Density (PAD), and Foliage Heig

## Features

- **Forest Metrics**: Calculate and visualize key metrics like Canopy Height, PAI, Canopy Cover, PAD, and FHD.
- **Forest Metrics**: Calculate and visualize key metrics like Canopy Height, PAI, PAD, and FHD.
- **Airborne Data Compatibility**: Supports LiDAR and Structure from Motion (SfM) data from drones and UAVs.
- **Visualization**: Create 2D and 3D visualizations of forest structures.
- **Extensibility**: Easily add custom filters and visualization techniques to suit your needs.
Expand All @@ -22,49 +22,43 @@ Install PyForestScan using pip:
```bash
pip install pyforestscan
```
## Developer Dependencies
- PDAL and Python PDAL bindings
- GDAL
- Python
- Python requirements (requirements.txt)

### Dependencies

> [!IMPORTANT]
> You MUST have installed PDAL to use PyForestScan. If you use conda to install PDAL, make sure you install pyforestscan in the conda environment with PDAL. See https://pdal.io/en/latest/ for more information.
- PDAL >= 2.7
- Python >= 3.8

## Quick Start

### Derive Forest Metrics from Airborne Data

The following snipped shows how you can load a las file, create 25m by 25m by 5m voxels with points assigned to them, and generate plant area density at 5m layers and plant area index for each 25m grid cell before writing the resulting PAI layer to a geotiff.
```python
from pyforestscan.handlers import read_lidar
from pyforestscan.handlers import read_lidar, create_geotiff
from pyforestscan.calculate import assign_voxels, calculate_pad, calculate_pai

arrays = read_lidar("path/to/lidar/file.las", "EPSG:32605", hag=True)
voxels = assign_voxels(arrays[0], (25, 25, 5))
voxels, extent = assign_voxels(arrays[0], (25, 25, 5))
pad = calculate_pad(voxels, 5)
pai = calculate_pai(pad)
create_geotiff(pai, "output_pai.tiff", "EPSG:32605", extent)
```

### 2D Visualization of Forest Metrics

```python
from pyforestscan.visualize import plot_pai

# Define the spatial extent of your data
extent = [0, 100, 0, 100]

# Plot Plant Area Index (PAI)
plot_pai(pai, extent=extent)
```

### 3D Visualization of Airborne Canopy Structure
## Documentation

```python
from pyforestscan.visualize import plot_3d
For detailed instructions and examples, visit our [documentation](https://pyforestscan.readthedocs.io/).

plot_3d([array1, array2], z_dim='HeightAboveGround')
```
## Developer Guides

## Documentation
To build locally and contribute to PyForestScan, you will need the following dependencies:

For detailed instructions and examples, visit our [documentation](https://pyforestscan.readthedocs.io/).
- PDAL and Python PDAL bindings
- GDAL
- Python
- Python requirements (requirements.txt)

## Contributing

Expand Down

0 comments on commit f11c1e1

Please sign in to comment.