question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integer value of h3Index

See original GitHub issue

Hi, I know that since Js does not support BigInteger this library is returning hex results as index, but is there any safe way to use BigInt object in js to handle these numbers? since in my case I need to manipulate the indexes.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13

github_iconTop GitHub Comments

1reaction
ajfriendcommented, Apr 26, 2020

numpy should be able to handle things up to a few million pretty easily.

Here’s an example with numpy and a Python set for 100 million 64-bit integers. Both seem fast.

The set approach looks a bit faster for testing membership, and would definitely be more flexible and efficient around adding/removing members than the numpy sorted array.

Screen Shot 2020-04-25 at 10 39 54 PM
1reaction
ajfriendcommented, Apr 26, 2020

If you’re going the Python route, would a normal python dict or set solve your problem? You might also look at the bisect module, or numpy.searchsorted.

Getting a little more sophisticated, you might look at cykhash, which should be quite fast, and can be called from pure Python directly, or from compiled Cython code.

Or, I might be completely missing the point, and there’s a good reason to use a tree over a hash table. 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

H3 Index
An H3Index is the 64-bit integer representation of an H3 index, which may be one of multiple modes to indicate the concept being...
Read more >
API reference — h3-py - Uber Open Source
Converts an H3 64-bit integer index to a hexadecimal string. ... The base cell number and the H3Index are two different representations of...
Read more >
Encoding Specification - Placekey API Docs
The integer value of the H3 index is modified so that fewer bits (and therefore fewer characters) are required to represent the index...
Read more >
Functions for Working with H3 Indexes | ClickHouse Docs
h3kRing(h3index, k). Arguments. h3index — Hexagon index number. Type: UInt64. k — Radius. Type: integer. Returned values. Array of H3 indexes.
Read more >
h3_string_to_int: Convert an H3 index string to 64 bit integer
h3_string_to_int takes an h3 index represented as a hexadecimal string and returns the integer format.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found