Allow n-dimensional arrays into polygonize in DD#253
Open
asinghvi17 wants to merge 1 commit intoddfrom
Open
Conversation
rafaqz
reviewed
Jan 25, 2025
| else | ||
| map(eachslice(A; dims = DD.otherdims(A, dims))) do a | ||
| ap = PermutedDimsArray(a, dims) | ||
| GO.polygonize(bounds_vecs..., a; crs, kw...) |
Member
There was a problem hiding this comment.
Can we just pass through the dims kw instead of permuting?
Member
Author
There was a problem hiding this comment.
The x and y dims need to be in the same order as the lookups though, so I'm not sure how we'd do this...
Member
There was a problem hiding this comment.
Doesn't it already fix that with dims ordering? It probably should...
Maybe it's counter intuitive but reordering dims in the inner loop is essentially free, so usually faster than array wrappers that have a runtime Indirection
(Ohh right it's not a DD alg internally so it has to be slow... unfortunate why would I write something like that 😭)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows polygonize over an n-dimensional datacube to generate an n-2 dimensional datacube of geometries / featurecollections...kind of like R style vector data cubes.
Maybe we should allow the values to be unpacked into an n-1th dimension so we can unpack the polygons too.
This is particularly useful when polygonizing datacubes.