gazetteer database for periodo data
var pdb = require('periodo-db')
var hyperdrive = require('hyperdrive')
var hyperlog = require('hyperlog')
var level = require('level')
var p = pdb({
archive: hyperdrive('pdb.data'),
db: level('pdb.db'),
log: hyperlog(level('pdb.log'), { valueEncoding: 'json' })
})
process.stdin.pipe(p.load())
The import file format consists of lines of newline-separated json.
Each line of json should be geojson, except that Feature and FeatureCollections refer to geometry by id instead of including the geometry inline.
This avoids huge amounts of data duplication.
var pdb = require('periodo-db')
Create a new periodo-db instance p
from:
opts.archive
- hyperdrive archiveopts.db
- levelup instanceopts.log
- hyperlog instance (must set a valueEncoding of 'json')
Import data with the writable stream wstream
.
The data should be formatted according to the data format
section above.
q
- search labels using this search valueq.bbox
-[west,south,east,north]
bounding box to limit query
If the search value is a...
- string - every word in the string must be present in the labels
- function(s) - return true or false if the label text
s
matches - regex - matches label text
Load geojson geometry by id
with the readable stream rstream
.
Emitted whenever a feature is added.
npm install periodo-db
public domain