Skip to content

feat(intersect-by-area-percentage): add new module #2877

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Gerion9
Copy link

@Gerion9 Gerion9 commented May 2, 2025

Please provide the following when creating a PR:

  • Meaningful title, including the name of the package being modified. (Title: feat(intersect-by-area-percentage): add new module)
  • Summary of the changes.
    • Adds a new module @turf/intersect-by-area-percentage.
    • Exports the function intersectByAreaPercentage(targetPolygon, testPolygon, threshold).
    • This function calculates the area of intersection between targetPolygon and testPolygon.
    • It returns true if the intersection area is greater than or equal to threshold percent of the testPolygon's own area.
    • Handles Polygon and MultiPolygon inputs (as Features or raw Geometries).
    • Includes input validation and handles edge cases (zero-area polygons, non-intersecting polygons).
    • Added unit tests (test.ts) and JSDoc comments (index.ts).
  • Heads up if this is a breaking change. (Not a breaking change)
  • Inclusion of your details in the contributors field of package.json - you've earned it! 👏 (Added "Gairo Peralta <@Gerion9>")
  • Confirmation you've read the steps for preparing a pull request.

@smallsaucepan
Copy link
Member

Thanks for proposing this PR @Gerion9. Could you please run us through some potential use cases? Is it likely to be generally useful for a particular type of problem, for example?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants