Raster stats - #140
Merged
Merged
Raster stats#140
Conversation
noisyneuron
marked this pull request as ready for review
September 9, 2026 17:41
noisyneuron
added a commit
that referenced
this pull request
Sep 10, 2026
* Raster stats methods (cherry picked from commit 30e756b)
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.

Add raster statistics methods
Raster layers hold bands rather than attributes, so the existing statistics
methods can't answer anything about them. Four new methods summarize one band
of a raster layer over the whole raster, a bounding box, a polygon, or a line:
a set of statistics, a histogram, counts per distinct value, and values sampled
along a line. Bands on a raster layer now carry the identifier those methods
take, plus a display name.
Ground area is exposed rather than a pixel count, since the pixel count depends
on how far the read was downsampled and the product already calls that number
"Area". Nothing here exposes how the read was budgeted, which stays internal
until the product decides to show users which numbers are approximate.
Handlers are in felt/felt#21889.
Test plan
run
felt.getRasterAggregates({ layerId, band: "band:1", aggregation: { methods: ["min", "max", "area"] } }).Observe a value for each requested statistic.
boundaryset to a GeoJSON LineString. Observe that itthrows, naming
areaas unanswerable for a line boundary.