h3-hs-0.2.0.0: A Haskell binding for H3
Safe HaskellSafe-Inferred
LanguageHaskell2010

H3.Regions

Description

These functions convert H3 indexes to and from polygonal areas.

Synopsis

Documentation

polygonToCells Source #

Arguments

:: GeoPolygon

geoPolygon

-> Int

res

-> Word32

flags

-> Either H3ErrorCodes [H3Index] 

polygonToCells takes a given GeoJSON-like GeoPolygon data structure and fills it with the hexagons that are contained in the GeoPolygon. Containment is determined by the cells' centroids. An argument for flags is provided, which is reserved for future functionality, and should be taken to be 0 here.

cellsToLinkedMultiPolygon :: [H3Index] -> Either H3ErrorCodes [GeoPolygon] Source #

Creates GeoPolygon describing the outline(s) of a set of hexagons. Polygon outlines will have one outer loop and a list of loops representing holes. It is expected that all hexagons in the set have the same resolution and that the set contains no duplicates. Behavior is undefined if duplicates or multiple resolutions are present, and the algorithm may produce unexpected or invalid output.