-
Notifications
You must be signed in to change notification settings - Fork 2
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
Merge polygons smaller than 35% of perfect square polygon to neighbouring polygon #74
Conversation
…ighbouring polygon
This is an excellent change, thanks @Sujanadh ! Obviously with using PostGIS, this puts a hard requirement on having a database for splitBySquare. So apologies once again @robsavoye ! This move to using PostGIS spatial queries is part of a longer term goal:
|
Also, I should note, for anyone wanting to use splitBySquare without a database, then pin the version We will increment the version to 2.0.0 here, as it's a breaking change in semver. |
You can probably drop #72, as I'll have to drop using fmtm-splitter. Personally adding postgres as a dependency to replace shapley is a bit overkill, but I understand the other functionality FMTM needs. I'm not building a website, so my task splitting needs are different. |
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.
Good stuff 🚀
In the future we can probably refactor out the shapely box() usage and do this in PostGIS too 👍
I will make a new release with this
Oops, forgot to check the tests! It makes sense the tests would have broken with this change, but let's try and keep them working 🙏 |
Okay 👍 |
I planned to fix the tests the other day, but I'm really running out of time before Christmas (have some other things being asked of me too). Sorry to ask @Sujanadh, but could you fix the tests here whenever you get a chance please? 🙏 Anuj could get involved if it helps |
Sorry, I totally forgot to fix the tests. I will fix it 👍. |
Hate to be pedantic 😂 but I know I will forget eventually too!! (was still in my github notifications for now) |
Issue:
Description:
Smaller polygons are detected based on their area, which is less than 35% of the area of the square. The neighbouring polygons are determined by who shares the larger boundary and is nearest to the small polygons. Then those smaller polygons are merged to their respective neighbouring polygons.
Screenshot:
Before:
After:
Those gaps within the tasks are because they do not contain any features within them.