Skip to content

Adding h3 functions for working with hexes#25

Open
zer0stars wants to merge 3 commits intomainfrom
feature/h3support
Open

Adding h3 functions for working with hexes#25
zer0stars wants to merge 3 commits intomainfrom
feature/h3support

Conversation

@zer0stars
Copy link
Copy Markdown
Member

Added functions:
h3_lat_lng_to_hex(lat,lon,resolution) -> hexId: string
h3_hex_to_geo(hexId) -> lat:float64, lng: float64
h3_valid_hex(hexId) -> boolean
h3_get_resolution(hexId) -> integer(0-15)
h3_hex_parent_id(hexId,resolution) -> hexId: string
h3_hex_parent_to_geo(hexId, resolution) -> lat:float64, lng: float64

Description("Returns lat,lon for given hex.").
Param(bloblang.NewStringParam("hex_id"))

err = bloblang.RegisterFunctionV2("h3_hex_to_geo", hexLatLonSpec, func(args *bloblang.ParsedParams) (bloblang.Function, error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool staff overall!!! Nit - extracting those anonymous functions to separate ones for readability might be good.

@zer0stars zer0stars requested a review from KevinJoiner May 7, 2024 21:54
Copy link
Copy Markdown
Contributor

@KevinJoiner KevinJoiner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need to run go mod tidy and your tests lat and long have a rounding error.

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

Successfully merging this pull request may close these issues.

3 participants