I'm currently trying to use uber H3 library to replace S2, but at the moment and with a couples of test it seems that the golang bindings doesn't give me back the right coords from a h3 index ...
when using the cmd line binaries with the same data that i use in the go app i don't get the same results.
With the cmd line tools:
λ h3/bin master ✓ ./geoToH3 10
46.810944 -71.241730
8a2bac51621ffff
λ h3/bin master ✓ ./h3ToGeo
8a2bac51621ffff
46.8105012488 -71.2410520551
λ h3/bin master ✓ ./h3ToGeoBoundary
8a2bac51621ffff
8a2bac51621ffff
{
46.811170344 -71.240689900
46.811037324 -71.241737545
46.810368226 -71.242099684
46.809832156 -71.241414199
46.809965172 -71.240366583
46.810634262 -71.240004422
}
With Go:
cellLvl := 10
cellID := h3.FromGeo(h3.GeoCoord{Latitude: 46.810944, Longitude: -71.241730}, cellLvl)
I get this H3 index: 802bfffffffffff
And those GeoBoundries:
[lat:50.77050266836529 lng:296.79922600446486 lat:48.295316381881364 lng:278.0803730010917 lat:37.09958889681994 lng:275.4148329679119 lat:30.219492199828103 lng:285.35953183291997 lat:31.87788595636582 lng:297.9774744521555 lat:40.97555819925587 lng:305.1209872207507 ]
Is it a known bug or there's something i'm doing wrong ?
Thanks !
It's a known bug, https://github.com/uber/h3-go/issues/7, just substract 360 from the longitude returned from h3 to make it work properly.