H3.jl icon indicating copy to clipboard operation
H3.jl copied to clipboard

kRing returns invalid indexes

Open mmpagani opened this issue 4 years ago • 2 comments

Thanks a lot for developing this package. While working with it I came across an issue that you can reproduce with the code below. It seems that kRing generates some invalid h3 indexes:

using H3.API
using Printf

idx = 0x85300537fffffff
idx = 0x8530158ffffffff
idx = 0x85301dc7fffffff

h3IsValid(idx)
geo = h3ToGeo(idx)
println(rad2deg(geo.lon))
println(rad2deg(geo.lat))

idxs = kRing(idx, 15);
println(length(idxs))

for i in idxs
    if !h3IsValid(i)
        print(@sprintf("wrong index 0x%08x \n", i))
        geo = h3ToGeo(i)
    end
end

mmpagani avatar Jan 20 '21 13:01 mmpagani