Skip to content

Commit

Permalink
don't pass no data values to calcstats
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielJDufour committed Jun 10, 2023
1 parent fab69e3 commit 049fee0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/stats/stats.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ const stats = (georaster, geometry, calcStatsOptions, test) => {
// runs for every pixel in the polygon. Here we add them to
// an array to run through the getMode function
const done = intersectPolygon(georaster, geometry, (value, bandIndex) => {
if (test === undefined || test(value)) {
if ((value !== noDataValue && test === undefined) || test(value)) {
if (values[bandIndex]) {
values[bandIndex].push(value);
} else {
Expand Down

0 comments on commit 049fee0

Please sign in to comment.