mourner / geokdbush

The fastest spatial index for geographic locations in JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compatibility with kdbush 4.x

quarl opened this issue · comments

kdbush 4.x changed the internal interface so that index.points no longer exists, but the latest version of geokdbush still relies on it.

I was able to work around it by manually setting index.points to an array matching what I wanted (lng/lat points).

It might make sense to just return an index.

I forked the geokdbush and updated it to work with kdbush 4.x (and also to use ES6 and modules): https://www.npmjs.com/package/geokdbush-tk

Cc @mourner

@tkafka does your lib require ESM? I am getting the following error:

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/xxx/node_modules/geokdbush-tk/index.js from /home/xxx/file.ts not supported

@tkafka Thanks for the fork, works well. Would you be able to create a PR with the necessary changes to propagate it back here?