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

Bug plotting polygon of logical children of polygons #401

Open
ajfriend opened this issue Sep 26, 2024 · 5 comments
Open

Bug plotting polygon of logical children of polygons #401

ajfriend opened this issue Sep 26, 2024 · 5 comments

Comments

@ajfriend
Copy link
Contributor

import h3

def logical_poly(cell, res):
    """
    Return the polygon representing the geometric area covered
    by the children of `cell` at resolution `res`.

    Expectation: A single polygon with one outer loop and no holes.
    Currently: Getting multipolygons with holes (seems like a bug), or just errors for malformed polygons.
    """
    kids = h3.cell_to_children(cell, res)
    mpoly = h3.cells_to_h3shape(kids, tight=False)
    return mpoly

Demonstrated here: https://gist.github.com/ajfriend/dc33458c7cc0e0be88fbc8cee205ce6f

  • Generally, we only see the problem of getting multipolygons with odd resolutions.
  • However, we also get errors on res 2 and 7 from malformed polygons.
@ajfriend
Copy link
Contributor Author

This may have been fixed in v4.1 of the core library.

@ajfriend
Copy link
Contributor Author

Seeing issue in {'c': '4.0.0', 'python': '4.0.0b7'}

@ajfriend
Copy link
Contributor Author

Bumping to v4.1 we fix all the resolutions >=3, but we get malformed polygons at resolutions 1 and 2.

For example:

h3.cell_to_children('80ebfffffffffff', 1)
['81ea3ffffffffff',
 '81eabffffffffff',
 '81eafffffffffff',
 '81eb3ffffffffff',
 '81eb7ffffffffff',
 '81ebbffffffffff']

@ajfriend
Copy link
Contributor Author

Should be this bug: uber/h3#917

@ajfriend
Copy link
Contributor Author

Everything works in v4.1 except for resolutions 1 and 2: https://gist.github.com/ajfriend/5594157463b88eb8d4cae35705657d8d

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

1 participant