feat: report area, point density and pulse density in summarise() - #326
Open
agrigoriev wants to merge 1 commit into
Open
feat: report area, point density and pulse density in summarise()#326agrigoriev wants to merge 1 commit into
agrigoriev wants to merge 1 commit into
Conversation
Port lidR's scalar density() QC check into lasR. The summary stage now accumulates the coverage bounding-box area (sum of per-chunk core extents, buffer excluded) and exposes three new fields in its output: - area : processed bounding-box area - density : point density (npoints / area) - pulse_density : pulse density (first returns / area) Following lidR's print/summary convention, the number of pulses is the number of first returns (ReturnNumber == 1), not a gpstime-based pulse identification. Density is buffer-independent: buffer points are excluded from both npoints and area.
agrigoriev
force-pushed
the
feat/summarise-density
branch
from
May 27, 2026 08:06
dc586af to
cec3307
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #326 +/- ##
==========================================
+ Coverage 72.15% 72.27% +0.11%
==========================================
Files 230 230
Lines 17576 17657 +81
==========================================
+ Hits 12682 12761 +79
- Misses 4894 4896 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports lidR's scalar
density()quality-control check into lasR. Thesummarystage now computes the coverage area in a single streaming passand exposes three new fields in the
summarise()output list:area— processed bounding-box area (sum of per-chunk core extents,buffer excluded)
density— point density (npoints / area)pulse_density— pulse density (first returns /area)Semantics
lidR's
density(LAScatalog)(sum of per-file bounding boxes).count of first returns (
ReturnNumber == 1), already collected by thestage as
npoints_per_return[1]. It is not derived fromgpstime-based pulse identification (
retrieve_pulses).npointsandarea.Implementation
summary.h—double areamember +set_chunkoverride.summary.cpp— accumulate core-extent bbox area per chunk inset_chunk; sum inmerge; emitarea,density,pulse_densityinboth
to_R()andto_json().R/stages.R+man/summarise.Rd— document the new fields and the"pulses = first returns" convention.
Tests
Added to
tests/testthat/test-summarise.R:density == npoints/area,pulse_density == npoints_per_return["1"]/area)bcts) check that pulse density uses the first-return countVerified bbox
bctsvalues: 13.7 points/m², 9.6 pulses/m².