https://github.com/oss/placesindex
Indexes data about buildings & places at Rutgers
https://github.com/oss/placesindex
Last synced: 10 months ago
JSON representation
Indexes data about buildings & places at Rutgers
- Host: GitHub
- URL: https://github.com/oss/placesindex
- Owner: oss
- Created: 2013-08-23T15:18:04.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2016-11-11T20:55:38.000Z (over 9 years ago)
- Last Synced: 2025-02-08T10:21:15.518Z (over 1 year ago)
- Language: JavaScript
- Size: 239 KB
- Stars: 1
- Watchers: 10
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# placesindex
Takes a list of places and indexes it. Then, `completer.js` can be used to
perform autocompletion & nearby queries using this index.
## Testing
The API for getting all data about buildings requires a key. I've included a
copy of the database in the github repo for easy testing (`all`). You can
test the indexing by running `test.js`
```
$ node test
```
which will do some simple tests, including a nearby query with `kdtree`. You
can also then run manual_test
```
$ node manual_test
```
for an interactive autocompletion test.
## Client-side Usage
To get place completion & nearby queries, grab the database from the
RU Mobile API server and
```javascript
var completer = require('./completer');
var matches = completer.complete(database, "hill");
// Returns places matching Hill
matches = completer.nearby(database, 40.521800, -74.460820);
// Returns places nearby 40.521800, -74.460820
```
See [api.rutgers.edu](api.rutgers.edu) for more information.
## Projects used
[lunr.js](https://github.com/olivernn/lunr.js)
[kd-tree-javascript](https://github.com/ubilabs/kd-tree-javascript)