Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bbox per polygon #218

Closed
DanielJDufour opened this issue Aug 26, 2023 · 1 comment
Closed

bbox per polygon #218

DanielJDufour opened this issue Aug 26, 2023 · 1 comment

Comments

@DanielJDufour
Copy link
Member

currently, we calculate a bbox for all the input polygons. If the polygons happen to be on opposite sides of the anti-meridian, then we will sample pixel values across the whole world.

this could become a problem if the raster is high resolution and all the values can't fit into memory or it takes a long time to decode all the pixel values

But we can't treat each polygon as separate because we need to account for any overlap between polygons

some options:

  • merge polygons and group by those that overlap; then run stats on each polygon, collect intersecting pixel values, then run calc-stats on those
  • calculate bounding boxes for every polygon, merge/reduce those bounding boxes, if percentage of subbbox pixels in total bbox is less than 25%, then treat each bbox separately, sample for each distinct bbox, still run intersections on whole, when pulling intersected values, use offset of each bbox source; this'll add another step to pulling values from intersections, but it'll be a lot more memory safe
@DanielJDufour
Copy link
Member Author

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

No branches or pull requests

1 participant