Skip to content

SDK: configurable CHM aggregation + spike filter - #204

Merged
amarcozzi merged 1 commit into
mainfrom
201-chm-aggregation-spike-filter
Aug 26, 2026
Merged

SDK: configurable CHM aggregation + spike filter#204
amarcozzi merged 1 commit into
mainfrom
201-chm-aggregation-spike-filter

Conversation

@amarcozzi

Copy link
Copy Markdown
Contributor

Exposes the CHM aggregation statistic and the spike filter (added API-side in #516/#517/#518) on create_canopy_height_grid_from_point_cloud.

Changes

  • aggregation"max", "mean", "median", or "percentile"; the percentile argument (0-100) carries the rank for the percentile method. Translated onto the generated Chm{Max,Mean,Median,Percentile}Aggregation union via _build_chm_aggregation.
  • spike_filterNone applies the API default filter, False disables it (keeps every return), True applies a default ChmSpikeFilter, and a mapping / ChmSpikeFilter sets custom thresholds. Translated via _build_chm_spike_filter.
  • Omitting both parameters preserves existing behavior (sends UNSET).

Tests

  • Request-building coverage for a percentile aggregation and the spike filter, plus the default-unset case.
  • Helper unit tests for _build_chm_aggregation and _build_chm_spike_filter (valid, edge, and error paths).
  • A live test that builds a CHM with aggregation="percentile", percentile=95, and a custom spike filter over a Bondurant, WY domain with stable 3DEP coverage.

Offline unit tests pass; black and flake8 clean. The live test was run against the API and passes.

Depends on #195 (merged into main).

Closes #201

Add aggregation (max/mean/median/percentile with a percentile
value) and spike_filter (bool, mapping, or ChmSpikeFilter) parameters to
create_canopy_height_grid_from_point_cloud, translating them onto the
generated union models via _build_chm_aggregation and
_build_chm_spike_filter. Omitting them preserves existing behavior by
sending UNSET.

Extend the point-cloud grid tests with request-building coverage for a
percentile aggregation and the spike filter, helper unit tests for both
translators, and a live test that builds a CHM with a non-default
aggregation and spike filter.
@amarcozzi
amarcozzi merged commit c0c1804 into main Aug 26, 2026
3 checks passed
@amarcozzi
amarcozzi deleted the 201-chm-aggregation-spike-filter branch August 26, 2026 18:04
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.

SDK: configurable CHM aggregation + spike filter

1 participant