SymbolixAU / h3r

R-interface to {h3lib}
https://symbolixau.github.io/h3r/
Other
5 stars 0 forks source link

cellToChildren - range checks and crash #21

Closed dcooley closed 1 year ago

dcooley commented 1 year ago

Might need some error handling around issues where they dont' supply a vector of the required length. In these examples the resolution vector is only 1 element.

res0 <- h3r::getRes0Cells()
h3r::cellToChildren(res0, 1L) ## <- doestn' wrok
h3r::cellToChildren(res0, 15L) ## <- crashes
RayShao01010010 commented 1 year ago

Because of the vector length limitation, the first one should be h3r::cellToChildren(res0, rep(1L, length(res0)))

RayShao01010010 commented 1 year ago

I found that when the resolution difference is higher than 10, there will be an error: Error: vector memory exhausted (limit reached?). I now limited the childrensize to make sure it won't exceed the limitation

RayShao01010010 commented 1 year ago

This one is now finished and I submitted a PR