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

RoI should be able to determine if points lie within them #408

Open
willGraham01 opened this issue Feb 10, 2025 · 0 comments
Open

RoI should be able to determine if points lie within them #408

willGraham01 opened this issue Feb 10, 2025 · 0 comments
Assignees
Labels
enhancement New optional feature

Comments

@willGraham01
Copy link
Contributor

willGraham01 commented Feb 10, 2025

Subtask of #377.

A region of interest should be able to determine whether a point (x, y) lies within the region. I had a go with this in #390 before the scope drift, so there's some relevant code here to start from.

Key things to bear in mind are how the underlying shapely objects treat the terms "inside", "on", and "contains". In particular, the shapely is_inside method does not include the boundary, but I imagine most of our users will want the boundary included by default, or at least the option to toggle it off.

As such, I envision a method being added to the BaseRegionOfInterest class that has the following signature:

class BaseRegionOfInterest:

    def point_is_inside(self, xy_position, include_boundary=True) -> bool:
        # Likely some calls to shapely commands

Once the broadcasting decorator #397 is added, this method can be decorated with the broadcastable_classmethod decorator too. (Whether we do this in the same PR that introduces the point_is_inside method will depend on if #397 is merged beforehand).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New optional feature
Projects
Status: 📝 Todo
Development

No branches or pull requests

2 participants