Skip to content

v2.7.0

Compare
Choose a tag to compare
@DanielJDufour DanielJDufour released this 19 Jun 14:34
· 10 commits to master since this release

v2.7.0 (2024-06-19)

πŸ’₯ Breaking Changes

  • 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
  • added frequency to expected test result ae55519
  • trying to fix weird ci issue with fetching file by using readFileSync instead 4faff44
  • changed debug level f53c595
  • try to fix ci testing issues 63b1e90
  • removed debug logging 2101fa4
  • added frequency to test expectation 846cb74
  • removed frequency from stats tests c8475fb
  • added scaled valid values to stats test 25f5fdb
  • updated flug dfb76b6
  • removed old code climate links 49371f0
  • updated stats to return valid by default 8b5035f
  • serve more files in median test 56c9e16
  • added virtual resampling test files 4017f1f
  • updated flug 9f2d7f1
  • updated flug and added 1 sec gap time between tests f601b6b
  • increased served requests in intersect-polygon.test.js bcfa92f
  • fixed lint issue 70c3297
  • cleaned up more virtual resampling code and added resampling support to georasters fully loaded into memory d4a1d39
  • refactored intersect-polygon 4fcae79
  • added modes to the package.json 5191d49
  • WORK IN PROGRESS 5208f9d

v2.6.1...v2.7.0