Closed lehecht closed 6 months ago
Is there any issue besides #763 associated with this PR?
I don't think so. Bug #770 is also located where changes of this PR were made, but it was not caused by these changes.
Will #770 be fixed by this PR? Then please add it to the "development" section on the right so it will be closed with this PR.
Will #770 be fixed by this PR? Then please add it to the "development" section on the right so it will be closed with this PR.
No, it won't.
@mzur Why can a line just contain one point in this test? Is it permissible for a polygon to be a line?
Why can a line just contain one point in this test?
I see no particular reason. This is probably one aspect of the validation that can be improved.
Is it permissible for a polygon to be a line?
No, the last point of a polygon must be equal to the first point. I think this is validated somewhere, too :thinking:
Edit: https://github.com/biigle/core/commit/cc75bb70d2d2abe53904b7219e20a205af3816cf
I guess with the current validation, you can make a line with three points (a, b, a). I'm not sure if we should disallow this.
@mzur I also found a test where a polygon can be a point. Should this be kept that way, too?
Should I leave it like it is?
If it's not too much effort, I think this should be rejected. Polygons with a zero size could cause all sorts of issues.
I also found a test where a polygon can be a point. Should this be kept that way, too?
No. Also not the "point-line" (in the test above).
Reject invalid annotation shapes by not saving them on frontend side and rejecting them on the backend side. Additionally extend tests.