module H3.Indexing
( latLngToCell
, cellToLatLng
, cellToBoundary
) where
import H3.Internal.H3Api
( LatLng
, H3ErrorCodes
, H3Index
, c2hs_latLngToCell
, c2hs_cellToLatLng
, c2hs_cellToBoundary )
import H3.Internal.Utils (toEither)
latLngToCell :: LatLng -> Int -> Either H3ErrorCodes H3Index
latLngToCell :: LatLng -> Int -> Either H3ErrorCodes H3Index
latLngToCell LatLng
coords = (H3Error, H3Index) -> Either H3ErrorCodes H3Index
forall a. (H3Error, a) -> Either H3ErrorCodes a
toEither ((H3Error, H3Index) -> Either H3ErrorCodes H3Index)
-> (Int -> (H3Error, H3Index))
-> Int
-> Either H3ErrorCodes H3Index
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LatLng -> Int -> (H3Error, H3Index)
c2hs_latLngToCell LatLng
coords
cellToLatLng :: H3Index -> Either H3ErrorCodes LatLng
cellToLatLng :: H3Index -> Either H3ErrorCodes LatLng
cellToLatLng = (H3Error, LatLng) -> Either H3ErrorCodes LatLng
forall a. (H3Error, a) -> Either H3ErrorCodes a
toEither ((H3Error, LatLng) -> Either H3ErrorCodes LatLng)
-> (H3Index -> (H3Error, LatLng))
-> H3Index
-> Either H3ErrorCodes LatLng
forall b c a. (b -> c) -> (a -> b) -> a -> c
. H3Index -> (H3Error, LatLng)
c2hs_cellToLatLng
cellToBoundary :: H3Index -> Either H3ErrorCodes [LatLng]
cellToBoundary :: H3Index -> Either H3ErrorCodes [LatLng]
cellToBoundary = (H3Error, [LatLng]) -> Either H3ErrorCodes [LatLng]
forall a. (H3Error, a) -> Either H3ErrorCodes a
toEither ((H3Error, [LatLng]) -> Either H3ErrorCodes [LatLng])
-> (H3Index -> (H3Error, [LatLng]))
-> H3Index
-> Either H3ErrorCodes [LatLng]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. H3Index -> (H3Error, [LatLng])
c2hs_cellToBoundary