Repository navigation
fix: reject degenerate polygons in AOI area validation - #465
heathdutton wants to merge 1 commit into
Conversation
|
Thanks @heathdutton for the PR , we will be reviewing this soon ! |
|
Thank you for your contribution @heathdutton . The issue this PR intends to fix was happening before the latest development on fAIr. As of now, you can't experience the bug again because we now have a minimum size for drawing a polygon. See attached video for context. Screen.Recording.2026-01-18.at.17.22.34.movNevertheless, we'll have this PR opened for merging should such issue come up again in the future. Thank you! |
fe1753c to
435f1c2
Compare
Contributor Signature RequiredThank you for your contribution! Before we can accept your pull request, you need to sign our Contribution Policy. Why do I need to do this?
How to signTo sign the agreement, please comment on this PR with: I have read the CONTRIBUTING.md document and I hereby sign and agree with the guidelines You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
Fixes #228
When drawing an AOI at low zoom levels, the polygon coordinates can collapse to nearly identical points, resulting in a degenerate polygon with zero area. The
validateGeoJSONAreafunction was incorrectly returningfalse(valid) for these cases instead oftrue(invalid). Confused? So was I.This one-line fix correctly rejects polygons with zero, NaN, or invalid area values.