level-tree
RTree for leveldb
Last updated 6 years ago by cwmma .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install level-tree 
SYNC missed versions from official npm registry.

Level Tree Build Status

An RTree index for levelup, usage

npm install --save level-tree
var level = require('level');
var sublevel = require('level-sublevel');
var levelTree = require('level-tree');
var db = levelTree(sublevel(level('./name')));
// load in some geojson
db.treeQuery([xmin, ymin, xmax, ymax]).pipe();
db.treeQuery([xmin, ymin, xmax, ymax], callback);
// nonstrict query
db.treeQuery([xmin, ymin, xmax, ymax], false).pipe();
db.treeQuery([xmin, ymin, xmax, ymax], false, callback);

adds a treeQuery method, which either takes a bbox and returns a stream, or a bbox and a callback.

you can also pass false as the second argument to treeQuery, this turns off checks to make sure that the bbox you query actually intersects the feature that is returned and not just it's bbox. These checks can be very expensive especially for polygons so turning them off when you have mostly rectangular features or when you just don't care will speed things up.

Current Tags

  • 1.0.0                                ...           latest (6 years ago)

10 Versions

  • 1.0.0                                ...           6 years ago
  • 0.3.0                                ...           7 years ago
  • 0.2.0                                ...           7 years ago
  • 0.1.4                                ...           7 years ago
  • 0.1.3                                ...           7 years ago
  • 0.1.2                                ...           7 years ago
  • 0.1.1                                ...           7 years ago
  • 0.1.0                                ...           7 years ago
  • 0.0.1                                ...           7 years ago
  • 0.0.0                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (5)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |