-
Notifications
You must be signed in to change notification settings - Fork 124
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
Add a new method that filters by geometry #414
Comments
Hi @framunoz! Thanks for the proposal 😃 We should discuss if:
What do you think @12rambau ? |
I think |
I would also vote for Coming back to filtering, the first thing to do would be to identify whether it's a native filter ( |
Hi! Thank you very much for discussing my proposal. With respect to the discussion, it also makes a lot of sense to me that the new proposal is part of a filter rather than an extension of a collection of images. Regarding for the question:
I don't think it's that uncommon to have a method that doesn't modify the object. Most of the methods in In that case, a tentative implementation (inspired in the original implementation) would be: from abc import staticmethod
ErrorMargin = ... # Typing for error mrgin, maybe inspired in ee._arg_types
class FilterAccessor:
...
@staticmethod
def filterContained(geometry: ee.Geometry, maxMargin: ErrorMargin | None = None) -> ee.Filter:
return ee.Filter.isContained('.geo', geometry, maxMargin=maxMargin) I include the ic = (
ee.ImageCollection(...)
# Concatenate any filter or pre-process
.filter(ee.Filter.geetools.filterContained(geometry))
) In this case, would it still be convenient to call it |
In this case, your solution could (and should) work because the custom filter returns an Regarding the question on the name, I see your point. I think we should specify that it's working on geometries, so, IMO |
On my end I think you can drop the |
You're right @12rambau, since it'll be in the |
makes sense to me, I like |
I would like to include a new method for the
ImageCollectionAccessor
class that filters by geometry.Unlike the method
filterBounds(geometry, errorMargin)
, this one filters the collection if thegeometry
parameter intersects with an image. My proposal is to include thefilterByGeometry(geometry)
method, which will include the image to the image collection ifgeometry
is contained in the image. To summarize, the difference between the two filters is that the first one is an intersection, while the second one is an inclusion.The text was updated successfully, but these errors were encountered: