2.0.3 • Published 8 years ago

geopouch v2.0.3

Weekly downloads
4
License
Apache
Repository
github
Last release
8 years ago

Spatial Pouch Build Status

Spatial plugin from PouchDB extracted and supporting N dimensional coordinates.

Originally by @vmx with contribution by @daleharvey and @calvinmetcalf.

Test with npm test coverage report with npm test --coverage, build with npm run build.

API

PouchDB.plugin(require('geopouch'));

db.spatial(function (doc) {emit(doc.geometry);}, [xmin, ymin, xmax, ymax], options, callback);

db.spatial('ddoc/functionName', [xmin, ymin, xmax, ymax], options, callback);

db.spatial('ddoc/functionName', [[xmin, ymin], [xmax, ymax]], options, callback);

db.spatial('ddoc/functionName', [[xmin, ymin, zmin], [xmax, ymax, zmax]], options, callback);

db.spatial('ddoc/functionName', [xmin, ymin, zmin], [xmax, ymax, zmax], options, callback);

db.spatial('ddoc/functionName', [xmin, ymin, xmax, ymax], options).then(function (result) {}, function (err) {});

you may either give a function or a path to a ddoc, bounding boxes may be given in one of 3 formats

  • single array with 4 numbers, these are interpreted as [xmin, ymin, xmax, ymax]
  • single array with 2 arrays in it these are interpreted as [[mins], [maxs]]
  • 2 arrays with numbers in them, first one is interpreted as mins, second one as maxes

If the callback is omited then a promise is returned.

Options are optional and valid options are include_docs and stale

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

9 years ago

1.0.0

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

11 years ago