Skip to content

Bug plotting polygon of logical children of polygons #401

@ajfriend

Description

@ajfriend
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions