Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H3 Bug converting between geo and cell #376

Closed
qemtek opened this issue May 31, 2024 · 1 comment
Closed

H3 Bug converting between geo and cell #376

qemtek opened this issue May 31, 2024 · 1 comment

Comments

@qemtek
Copy link

qemtek commented May 31, 2024

import h3

hex1 = '877b9db55ffffff'

hex1_geo = h3.cell_to_latlng(hex1)

hex2 = h3.latlng_to_cell(lat=hex1_geo[1], lng=hex1_geo[0], res=h3.get_resolution(hex1))

assert hex1 == hex2

This is an obvious error right? Converting to geo and then back to cell give different cell IDs

@dfellis
Copy link
Collaborator

dfellis commented May 31, 2024

You've flipped the order of the lat and lng. it should be hex2 = h3.latlng_to_cell(lat=hex1_geo[0], lng=hex1_geo[1], res=h3.get_resolution(hex1))

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

No branches or pull requests

2 participants