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

apply, but preserve feature values #121

Open
asinghvi17 opened this issue Apr 23, 2024 · 4 comments
Open

apply, but preserve feature values #121

asinghvi17 opened this issue Apr 23, 2024 · 4 comments
Labels
enhancement New feature or request low priority Low priority issue, someone can get to it whenever they feel like it!

Comments

@asinghvi17
Copy link
Member

It would be useful to have an apply_as_feature function, which acts just like apply, but passes geometries to f as Feature objects, that have all the attributes of the parent feature. This would help with analyses where the user is trying to compute something on a feature collection.

@asinghvi17 asinghvi17 added enhancement New feature or request low priority Low priority issue, someone can get to it whenever they feel like it! labels Apr 23, 2024
@asinghvi17 asinghvi17 changed the title Apply as feature apply, but preserve feature values Apr 23, 2024
@rafaqz
Copy link
Member

rafaqz commented Apr 24, 2024

This doesnt just work with apply and a FeatureTrait target? It should...

(Or maybe I dont understand the idea...)

@asinghvi17
Copy link
Member Author

The idea would be that apply_as_feature(f, geom, PolygonTrait()) actually does the decomposition from e.g. geometrycollection or multipolygon to polygon, but wraps that polygon in a GI.Feature.

@rafaqz
Copy link
Member

rafaqz commented Apr 24, 2024

And the properties are passed down from the parent? So grab a feature on the way down the rewrap with it when we hit the target?

@asinghvi17
Copy link
Member Author

asinghvi17 commented Apr 24, 2024

Yep! I was experimenting with area to area interpolation and it struck me that this kind of thing could be useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority Low priority issue, someone can get to it whenever they feel like it!
Projects
None yet
Development

No branches or pull requests

2 participants