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

aggregate_polygon with multiple bands? #29

Closed
m-mohr opened this issue Feb 13, 2019 · 6 comments
Closed

aggregate_polygon with multiple bands? #29

m-mohr opened this issue Feb 13, 2019 · 6 comments
Labels
help wanted Extra attention is needed
Milestone

Comments

@m-mohr
Copy link
Member

m-mohr commented Feb 13, 2019

In API v0.3 we implicitly assumed that zonal_statistics() (now: aggregate_polygon()) works on a single band and the user must select one beforehand with filter_bands. This hasn't changed in 0.4 yet, but I think we should either document that it only works on a single band or allow multiple band and document how the results are returned. As I'm not so much into zonal_statistics: How should it work? Single Bands? Multiple Bands?
cc @jdries @mkadunc

@m-mohr m-mohr added this to the v0.4 milestone Feb 13, 2019
@edzer
Copy link
Member

edzer commented Feb 13, 2019

GIS world view: single band (layer). Spatial data cube world view: cube with two raster dimensions (x, y) reduced to single feature dimension (polygons).

@mkadunc
Copy link
Member

mkadunc commented Feb 13, 2019

What @edzer said. The ‘statistics’ part implies, i think, that we ‘ll aggregate over positions (i.e. compute statistics over all samples in a polygon) and leave other dimensions/axes intact - i.e. slice the cube in all other dimensions until you’re left with a 2D(x,y or lon,lat) raster of values, compute statistics over that raster with each polygon mask (to get a 1D array of stats objects - one stats per polygon) then combine these arrays into a new cube with layout consistent to the input cube : out[time,band,poly_idx,height] = stats(in[time,band,height, (ALL x,y where x,y inside polygon(poly_idx))])

@jdries
Copy link
Contributor

jdries commented Feb 14, 2019

For me this is coupled a bit with the issue about output formats:
#2
Supporting multiple bands is fine, as long as there is a decent (standardized) way to share the result. It looks like coverage json would be a good option for that, so I believe we can go ahead and allow it.
Perhaps it's also good to document what a backend should do if it does not support multi-band stats? (I believe that's the current state of my implementation.)

@m-mohr
Copy link
Member Author

m-mohr commented Feb 14, 2019

Yes, makes sense what @edzer said. Will add that to the documentation for now.
As we won't integrate CovJSON in 0.4 due to time constraints and probably need to change the process heavily for it anyway, we can introduce multi band stats together with CovJSON in 0.5 IMHO.

@m-mohr
Copy link
Member Author

m-mohr commented Feb 14, 2019

Improved the documentation and moved this issue to milestone v0.5 for further improvements as discussed above and in #2.

@m-mohr m-mohr modified the milestones: v0.4, v0.5 Feb 14, 2019
@m-mohr m-mohr added help wanted Extra attention is needed and removed documentation labels Dec 16, 2019
@m-mohr
Copy link
Member Author

m-mohr commented Dec 16, 2019

Is there still something to do here? Please leave a comment if you see further room for improvements.

@m-mohr m-mohr closed this as completed Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants