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

--Region query tools #2336

Merged
merged 5 commits into from
Mar 14, 2024
Merged

--Region query tools #2336

merged 5 commits into from
Mar 14, 2024

Conversation

jturner65
Copy link
Contributor

@jturner65 jturner65 commented Mar 12, 2024

Motivation and Context

This PR adds functions to test for point-region membership and point collection-region membership with a weighting factor, to account for possibly nested regions. If a point is only found in a single region, its weighting in that region is 1.

Otherwise, each region is assigned a weighting that is inversely proportional to the area of a particular region containing the point. The weighting is calculated like so :
`

     1 - (region_area/total_region_area)

whereregion_area` is the area of a specific region the point is found in and total_region_area is the total area of all regions that point is found in.

For collections of points that are assumed to belong to the same construct, the region membership check has been modified to give a weighting value only to the innermost (i.e. smallest area) region in nested regions. In other words, in the case of nested regions, a point is only considered found in the innermost region. the same weighting value to all regions containing a particular point. In the case of nested regions, this may result in an object being fully contained within the containing region, while only partially contained within the nested internal region.

How Has This Been Tested

Locally c++ and python tests. Python test modified to verify that with non-nested regions it returns the same result as the non-weighted versions

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

To support nested regions, this check will provide weighted results, with the highest weighted region being the one with the smallest area.
…ions

The weighting is derived from the region area, where the smallest region a point is found in has the highest weighting.  If a point only resides in a single region, its weighting is 1.
@jturner65 jturner65 requested a review from aclegg3 March 12, 2024 15:22
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 12, 2024
In the case of a point being found inn nested regions, only the region with smallest area is considered as containing the point.
For nested regions, every containing region will get an equal vote for the multiple points
Copy link
Contributor

@aclegg3 aclegg3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@jturner65 jturner65 merged commit ab4b2c2 into main Mar 14, 2024
10 checks passed
@jturner65 jturner65 deleted the RegionQueryTools branch March 14, 2024 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants