kartotherian/tilelive

Name: tilelive

Owner: kartotherian

Description: fast interface to tiles with pluggable backends

Created: 2016-04-08 01:08:03.0

Updated: 2016-04-08 01:08:04.0

Pushed: 2016-04-06 09:30:49.0

Homepage:

Size: 4112

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

tilelive.js

Coverage Status

Build Status

Implementing modules
Usage

Tilelive doesn't ship with any implementing modules by default. To register a module as one tilelive recognizes:

require('[implementation]').registerProtocols(tilelive);

"world-light": "mbtiles:///path/to/file/world-light.mbtiles",
"mapquest": "tilejson:///path/to/file/mapquest.tilejson"

Read/write streams

Tilelive provides an implementation of node object streams for copying tiles from one source to another.

// Copy all tiles and metadata from source A to source B.
var get = tilelive.createReadStream(sourceA);
var put = tilelive.createWriteStream(sourceB);
get.pipe(put);
put.on('finish', function() {
    console.log('done!');
});

See tilelive-copy and the streams tests for example usage of copy streams.

Parallel read streams

Tilelive can split a read operation into an arbitrary number of jobs. Pass a job parameter to options when using tilelive.createReadStream or tilelive.deserialize:

readable = tilelive.createReadStream(src, { type: 'scanline', job: { total: 4, num: 1 } });

This instructs tilelive to only read tiles that would fall into job 1 of 4. A complete read would mean four calls each with a different num.

bin/tilelive-copy

tilelive can be used to copy data between tilestores. For a full list of options, run tilelive-copy.

Tests

To run the tests

npm test

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.