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

Compaction Algorithm / Perfect the hybridisation #2

Open
Rosspet opened this issue Jan 7, 2022 · 5 comments
Open

Compaction Algorithm / Perfect the hybridisation #2

Rosspet opened this issue Jan 7, 2022 · 5 comments

Comments

@Rosspet
Copy link
Collaborator

Rosspet commented Jan 7, 2022

After finding all cells (for overlaps or centroids strategies only), it is occasionally the case that a full set of subcells were included depsite a parent cell not fitting entirely (which initial criteria for coarser cells to be included). In this case, represent the subcells using the parent.

Add in after checks which will need to recurse upwards in the event a parent cell is created that possibly now complete a higher set of children.
A recursive algorithm as such would be able to hybridise a set of cells that only contains cells of the finest resolution.

@dr-shorthair
Copy link
Collaborator

Is this a bug in the algorithm?
Or is it a precision issue?

@Rosspet
Copy link
Collaborator Author

Rosspet commented Jan 7, 2022

Neither really, more an opportunity to save a tiny bit of memory space. If you're wondering how it happens...

A coarse cell is currently used only if it is entirely contained within the Polygon. Else, we will explore the subcells. If going by overlaps and at the finest resolution, all of the subcells may overlap with atleast one not being contained (since the parent wasnt fully contained of course). In this case, all the children will be appended anyway (fill_strategy=overlaps) and we could have represented them with the coarser cell. But we needed to check by children first.

@Rosspet
Copy link
Collaborator Author

Rosspet commented Jan 9, 2022

This is a good example. See the most coarse cell and the sub cells next to it which make up another coarse cell.
image

Another coarse cell was not used as it is not fully contained my the poly, so the algorithm seeks to used finer cells which will mostly result in better representation, but in this case, the finer cells are all included. ultimately, 17 cell SUID's are stored instead of potentially 1.

@Rosspet Rosspet changed the title Perfect the hybridisation Compaction Algorithm / Perfect the hybridisation Jan 10, 2022
@dr-shorthair
Copy link
Collaborator

Right - the algorithm tried to exclude some of it but found they all overlapped. If you had gone another level finer, some would have been excluded. So that is the difference. Whether it makes sense to merge some of them I'm not sure.

@Rosspet
Copy link
Collaborator Author

Rosspet commented Jan 18, 2022

Could maybe process children together and use recursive function calls rather then a stack as a list. it would be a stack of recursive fn calls. Depth first search style would be managable too.

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

No branches or pull requests

2 participants