mourner / geokdbush

The fastest spatial index for geographic locations in JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix example: kdbush(...) → new kdbush(...)

tkafka opened this issue · comments

The code from example doesn't work for me, but when I add the new operator to kdbush, it starts working:

var index = kdbush(points, (p) => p.lon, (p) => p.lat);

should become

var index = new kdbush(points, (p) => p.lon, (p) => p.lat);

Hello,
Thanks for your hard work :)

In my case both do not work :

  let kdbush = require('kdbush');
  let geokdbush = require('geokdbush');

  const geo_index = kdbush(

gives me "TypeError: kdbush is not a function".

  let kdbush = require('kdbush');
  let geokdbush = require('geokdbush');

  const geo_index = new kdbush(

gives me "TypeError: kdbush is not a constructor".

Any upgrade of geokdbush to latest kdbush would be great :)

yes please provide an updated geokdbush to latest kdbush version. Rn the kdbush version used in geokdbush is 1.0.1 :(

Apologies for the delay. I'm now releasing geokdbush v2 that works with KDBush v4, and updated the readme example on how to use it.