-
-
Notifications
You must be signed in to change notification settings - Fork 275
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
Split non square tasks #1216
Split non square tasks #1216
Conversation
I will be reviewing this PR this week--thanks! |
Hi again @lesserj I have not forgotten about this--sorry for the silence. I want to test one more thing before the approval, but we are frozen on PRs for the time being anyway until we get the last cluster of changes merged into master. Thanks for your patience! |
Due to other PR merges, the database revision base was out-of-date. I also updated the date in case any routines use delta t for some reason.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this work @lesserj ! I tested everything and splitting worked well on projects. I think there needs to be one minor change to help in project creation. I tried importing a simple geometry (no properties) and kept the arbitrary task geometry instead of a square grid. Postgis failed trying to create it because the x
property was not found. I think this falls back to
needing to be defined--even if those properties are null for the case of the arbitrary geometries. I tested everything when adding those back in the PR and the project creation worked fine. The one issue is one test no longer succeeds, which is fixed by restoring
You're probably far moved past this PR, so I can fix these on my local version and push them (I had to upgrade the migrations due to the review delay), but I'm going to mull on this over lunch to make sure I'm not missing something.
Here is an example on the staging server showing the ability to split for edge cases! https://tasks-stage.hotosm.org/project/5532 Thank you again @lesserj ! 👏 |
Awesome. Thanks for making those changes @ethan-nelson . |
This allows non-square tasks to be split. Non square tasks are created when trimming a project by the AOI. This feature continues to track the x,y and zoom of a task, regardless of whether or not that task has been trimmed. When splitting the task, it calculates what the new x,y and zoom value would be, then uses that result to intersect with the current task. Resulting tasks will be based on the new x,y,zoom grid, so may not be equal in size, depending on how much area of the existing task falls within each quadrant of the new grid. If the task does not intersect with one of the quadrants at all, it will not be created, so you may end up with fewer than 4 new tasks when intersecting.
This will only split non square tasks on projects created after this is merged in. Existing projects will behave the same, without being able to split non-square tasks.
Addresses #1086
cc @TimuSumisu