Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PatrickHeneise/zeitraum
Spatio-temporal query library for Couchbase
https://github.com/PatrickHeneise/zeitraum
Last synced: 3 months ago
JSON representation
Spatio-temporal query library for Couchbase
- Host: GitHub
- URL: https://github.com/PatrickHeneise/zeitraum
- Owner: PatrickHeneise
- License: mit
- Created: 2013-08-17T12:04:12.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-08-17T12:13:58.000Z (over 11 years ago)
- Last Synced: 2024-10-29T05:42:14.884Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 109 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - PatrickHeneise/zeitraum - Spatio-temporal query library for Couchbase (others)
README
# ZeitRaum (Tempus Spatium)
ZeitRaum is a library to retrieve document ids filtered by time and geolocation.
# database spatial view
``` js
function (doc) {
if(doc.loc) {
var date_time = doc.eventStartDateTime.split(' ');
var date = date_time[0].split('-');
var time = date_time[1].split(':');
emit({type: "Point", coordinates: doc.loc}, date.concat(time));
}
}
```# usage
npm install zeitraum``` js
var zeitraum = require('./zeitraum'),
lat = 41.387,
lon = 2.170054,
server = '127.0.0.1:8092',
r = 50,
startDate = "2013-01-01 00:00:00",
endDate = "2013-01-31 23:59:59",
success = function (success) {
console.log('success', success);
},
error = function (error) {
console.log('error', error);
};zeitraum.query(error, success, server, 'spatiotemporal', 'index', lat, lon, r, startDate, endDate);
```# test
``` js
make test
```---------------------------------------
copyright (c) 2013 patrick heneiseMIT License (MIT)
**made with love in barcelona**