mourner / kdbush

A fast static index for 2D points
ISC License
638 stars 69 forks source link

add index from objects #11

Closed orlv closed 7 years ago

orlv commented 7 years ago

Hello! I added the ability to create an index from an associative array. Maybe you will find it useful.

mourner commented 7 years ago

Thanks! I don't think there's a need to duplicate code for supporting objects in the library. Since the keys are not used, you could get the same result by converting an object to an array before passing to kdbush.

orlv commented 7 years ago

I use the library to create an index many times per second, so I can't avoid duplicating the code.

Nevertheless, thank you very much for the superfast lib!

Upd: You're right. Converting object is fast enough.