Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
These functions convert H3 indexes to and from polygonal areas.
Synopsis
- polygonToCells :: GeoPolygon -> Int -> Word32 -> Either H3ErrorCodes [H3Index]
- cellsToLinkedMultiPolygon :: [H3Index] -> Either H3ErrorCodes [GeoPolygon]
Documentation
:: 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.