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

Split non square tasks #1216

Merged
merged 5 commits into from
Dec 7, 2018
Merged

Conversation

lesserj
Copy link
Contributor

@lesserj lesserj commented Oct 8, 2018

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.

split-non-square-tasks 2

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

@ethan-nelson
Copy link
Contributor

I will be reviewing this PR this week--thanks!

@ethan-nelson
Copy link
Contributor

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.
Copy link
Contributor

@ethan-nelson ethan-nelson left a 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

https://github.com/hotosm/tasking-manager/blob/develop/server/services/grid/grid_service.py#L76-L78

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

https://github.com/hotosm/tasking-manager/blob/develop/tests/server/helpers/test_files/tasks_from_aoi_features.json?short_path=644e9c0#L31-L33

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.

@ethan-nelson ethan-nelson merged commit 086233f into hotosm:develop Dec 7, 2018
@ethan-nelson
Copy link
Contributor

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 ! 👏

@lesserj
Copy link
Contributor Author

lesserj commented Dec 18, 2018

Awesome. Thanks for making those changes @ethan-nelson .

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