python 3.x - Unable to convert cell Id to lat lng using h3-py - Stack Overflow

admin2025-04-19  0

cell_id = 600090378170794000

the above cell is converted using h3-js successfully, in python it gives invalid cell ID error. I tried with all function of h3-py i.e. api functions(basic_int, basic_str etc).

also found that python hex output is different from javascript output. So created below function to match the output.

def _hex(num)
rounded = int(float(num))
return hex(rounded)[2:].lower()

I'm using below function to convert to lat lng. h3.cell_to_latlng

Still getting error of invalid cell ID.

Another Cell ID: 601803032887296000

h3-py version: 4.2.1

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745057737a282504.html

最新回复(0)