You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
geoblaze.sum now applies automatic virtual resampling by default. When a geometry is smaller the one pixel, this will trigger automatic resampling to get the geometry extent to take up half a pixel. This can lead to potentially confusing results. For example, if a geometry takes up 44% of a pixel and the pixel's value is 100, calling geoblaze.sum could return 25 (with the pixel automatically divided into quarters). Troubleshooting or debugging results could be difficult, because the sum result wouldn't appear in the histogram of pixel values for the dataset. Future releases will require users to explicitly ask for virtual resampling to be applied when calling geoblaze.sum.
π New Feature / Improvement
Added virtual resampling to src/intersect-polygon/intersect-polygon.module.js. You can now call intersectPolygon with an optional vrm param (representing "virtual raster multiplier") like intersectPolygon(georaster, geometry, () => {...}, { vrm: [3,2] }). vrm is by default [1,1] and represents how many times to divide each pixel horizontally and vertically. So vrm=[3,2] will lead to 6 virtual pixels with the original divided 3 times horizontally and 2 time vertically. You can also pass { vrm: "minimal" } and the pixel will only be divided enough to avoid the "no pixels found" error. Minimal virtual resampling also has a sanity threshold, so it won't divide a pixel more than 10k times.
Added a few options to the geoblaze.stats function, of type like { include_meta: Boolean, rescale: Boolean, vrm: [Number, Number] }. (include_meta and rescale are described immediately below)
include_meta will attach additional metadata to the array returned by stats and should be treated as an internal function currently used for development purposes only and is subject to change. Information currently includes vrm (virtual resampling multiplier), vph (virtual pixel height) and vpw (virtual pixel width).
rescale is whether we should rescale area-based statistics according to virtual resampling multipliers. For example if you sum up 100 virtual subpixels with a value of 8, but they all come from an original pixel of value 8. The sum should be 8, not 800. Otherwise dividing a pixel increases the sum results. The specific statistics that are rescaled are: count, histogram, invalid, product, sum, and valid
π Bug Fix
Calling any of the following functions geoblaze.max, geoblaze.mean, geoblaze.median, geoblaze.min, geoblaze.mode, geoblaze.modes, or geoblaze.range should now return an answer, fixing a previous bug where an error "No Values were found in the given geometry" was thrown when the geometry was smaller than a pixel.
π Internal
added test commands for individual statistical functions, so calling npm run test:median will only run the median tests. This was mainly done for convenience during development.
updated development dependency flug
added isBboxObj to utils to detect bounding box in form { xmin: Number, ymin: Number, xmax: Number, ymax: Number }
Minimal virtual resampling has been turned on by default when calling geoblaze.max, geoblaze.mean, geoblaze.median, geoblaze.min, geoblaze.mode, geoblaze.modes, geoblaze.range, and geoblaze.sum
π Documentation
No changes
Commits
added documentation for virtual resampling and rescaling 6d9d308
Merge pull request #228 from GeoTIFF/issue-56-virtual-resampling 032d074
fix linting issue by removing unused import in src/sum/index.js 9645c69
add support for simple bbox obj resampling bf45190