Skip to content

[codex] Add in-memory height above ground calculation#52

Merged
iosefa merged 2 commits into
mainfrom
codex/add-height-above-ground
Jun 28, 2026
Merged

[codex] Add in-memory height above ground calculation#52
iosefa merged 2 commits into
mainfrom
codex/add-height-above-ground

Conversation

@iosefa

@iosefa iosefa commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add add_height_above_ground(existing_points, method=None, dtm=None) for in-memory HAG calculation.
  • Support PDAL Delaunay HAG from classified ground points and DTM/raster HAG from a GeoTIFF.
  • Add tests for both methods and validation paths.
  • Document the required HeightAboveGround preprocessing workflow in the usage guide.

Why

Forest structure metrics require HeightAboveGround. This lets users add it after points are already loaded in memory instead of requiring all workflows to calculate HAG during read_lidar.

Impact

Users can normalize existing point arrays using classified ground points or a DTM raster before calculating canopy metrics.

Validation

  • /Users/iosefa/miniforge3/envs/pyforestscan-qgis/bin/python -m pytest tests/test_filters.py -q
  • /Users/iosefa/miniforge3/envs/pyforestscan-qgis/bin/python -m pytest -q

@codecov-commenter

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 88.88889% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pyforestscan/filters.py 75.43% 14 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Files with missing lines Coverage Δ
tests/test_filters.py 99.10% <100.00%> (+1.43%) ⬆️
pyforestscan/filters.py 53.09% <75.43%> (+21.51%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@iosefa iosefa marked this pull request as ready for review June 28, 2026 08:42
@iosefa iosefa merged commit 49a74c4 into main Jun 28, 2026
3 checks passed
@iosefa iosefa deleted the codex/add-height-above-ground branch June 28, 2026 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants