Comparing version 4.5.3 to 5.0.0
@@ -0,1 +1,6 @@ | ||
## 5.0.0 | ||
* Refactor CopyTask into read/write streams | ||
* Register tilelive protocols globally | ||
## 4.5.3 | ||
@@ -2,0 +7,0 @@ |
@@ -6,15 +6,9 @@ var tilelive = exports; | ||
var os = require('os'); | ||
var Queue = require('./queue'); | ||
var EventEmitter = require('events').EventEmitter; | ||
var CopyTask = require('./copytask'); | ||
var Scheme = require('./scheme'); | ||
var sm = new (require('sphericalmercator')); | ||
tilelive.CopyTask = CopyTask; | ||
tilelive.Scheme = Scheme; | ||
global.tileliveProtocols = global.tileliveProtocols || {}; | ||
tilelive.protocols = { | ||
// Add your protocol handlers here. | ||
// 'mbtiles:': require('mbtiles') | ||
}; | ||
// Add your protocol handlers here. | ||
// 'mbtiles:': require('mbtiles') | ||
tilelive.protocols = global.tileliveProtocols; | ||
@@ -95,3 +89,3 @@ tilelive.defaults = { | ||
if (!tilelive.protocols[uri.protocol]) { | ||
return callback(new Error('Invalid tilesource protocol')); | ||
return callback(new Error('Invalid tilesource protocol: ' + uri.protocol)); | ||
} | ||
@@ -233,1 +227,21 @@ | ||
// tilelive implementation of node readable/writable stream. | ||
tilelive.createReadStream = function(source, options) { | ||
options = options || {}; | ||
options.type = options.type || 'scanline'; | ||
return new tilelive.streamTypes[options.type](source, options); | ||
}; | ||
tilelive.createWriteStream = function(source, options) { | ||
options = options || {}; | ||
options.type = options.type || 'put'; | ||
return new tilelive.streamTypes[options.type](source, options); | ||
}; | ||
tilelive.stream = require('./stream-util'); | ||
tilelive.streamTypes = {}; | ||
tilelive.streamTypes.put = require('./stream-put'); | ||
tilelive.streamTypes.pyramid = require('./stream-pyramid'); | ||
tilelive.streamTypes.scanline = require('./stream-scanline'); | ||
tilelive.streamTypes.list = require('./stream-list'); |
{ | ||
"name" : "tilelive", | ||
"version" : "4.5.3", | ||
"main" : "./lib/tilelive.js", | ||
"description" : "Frontend for various tile backends, mapnik and mbtiles", | ||
"url" : "http://github.com/mapbox/tilelive.js", | ||
"keywords" : ["map", "server", "mapnik", "tms"], | ||
"licenses" : [{ | ||
"type": "BSD" | ||
}], | ||
"name": "tilelive", | ||
"version": "5.0.0", | ||
"main": "./lib/tilelive.js", | ||
"description": "API for various map tile backends", | ||
"url": "http://github.com/mapbox/tilelive.js", | ||
"keywords": [ | ||
"map", | ||
"mapnik", | ||
"tiles" | ||
], | ||
"licenses": [ | ||
{ | ||
"type": "BSD" | ||
} | ||
], | ||
"repository": { | ||
@@ -16,5 +22,5 @@ "type": "git", | ||
"author": { | ||
"name": "MapBox", | ||
"url": "http://mapbox.com/", | ||
"email": "info@mapbox.com" | ||
"name": "Mapbox", | ||
"url": "https://www.mapbox.com/", | ||
"email": "info@mapbox.com" | ||
}, | ||
@@ -29,19 +35,20 @@ "contributors": [ | ||
"dependencies": { | ||
"optimist": "~0.6.0", | ||
"minimist": "~0.2.0", | ||
"speedometer": "~0.1.2", | ||
"sphericalmercator": "~1.0.1" | ||
}, | ||
"devDependencies": { | ||
"mbtiles": "~0.2.8", | ||
"tilejson": "~0.6.0", | ||
"tilelive-mapnik": "~0.6.2" | ||
"tape": "2.13.3", | ||
"mbtiles": "~0.4.3", | ||
"tilejson": "~0.8.0" | ||
}, | ||
"bin": { | ||
"tilelive-copy": "./bin/copy" | ||
"tilelive-copy": "./bin/tilelive-copy" | ||
}, | ||
"engines": { | ||
"node": ">= 0.6.0 < 0.11.0" | ||
"node": ">= 0.10.0 < 0.11.0" | ||
}, | ||
"scripts": { | ||
"test": "mocha -R spec -t 10000" | ||
"test": "tape test/*.test.js" | ||
} | ||
} |
# tilelive.js | ||
tilelive.js is an interface for tilestore modules for [node.js](http://nodejs.org/). It defines an [API](https://github.com/mapbox/tilelive.js/blob/master/API.md) to interact with implementations for a particular tile store. | ||
- Tilelive is a module to help interactions between tilelive source modules. | ||
- A tilelive source is an interface implemented by node modules that deal with reading and writing map tiles. | ||
[![Build Status](https://secure.travis-ci.org/mapbox/tilelive.js.png)](http://travis-ci.org/mapbox/tilelive.js) | ||
## Backends | ||
## Implementing modules | ||
- [MBTiles](https://github.com/mapbox/node-mbtiles) | ||
- [TileJSON](https://github.com/mapbox/node-tilejson) | ||
- [Mapnik](https://github.com/mapbox/tilelive-mapnik) | ||
- [node-mbtiles](https://github.com/mapbox/node-mbtiles) | ||
- [node-tilejson](https://github.com/mapbox/node-tilejson) | ||
- [tilelive-mapnik](https://github.com/mapbox/tilelive-mapnik) | ||
- [tilelive-vector](https://github.com/mapbox/tilelive-vector) | ||
- [tilelive-bridge](https://github.com/mapbox/tilelive-bridge) | ||
## Usage | ||
Tilelive doesn't ship with any Tilestore backends by default. To use a particular backend, register it with tilelive using `require('[implementation]').registerProtocols(tilelive);`. | ||
Tilelive doesn't ship with any implementing modules by default. To register a module as one tilelive recognizes: | ||
require('[implementation]').registerProtocols(tilelive); | ||
* `tilelive.list(source, callback)`: Lists all tilesets in a directory. `source` is a folder that is used by registered implementations to search for individual tilesets. `callback` receives an error object (or `null`) and a hash hash with keys being Tilestore IDs and values being Tilestore URIs. Example: | ||
@@ -35,34 +40,22 @@ | ||
* `tilelive.verify(tilejson)`: Validates a TileJSON object and returns error objects for invalid entries. | ||
* `tilelive.copy(args, callback)`: Copies data from one tilestore into another tilestore. `args` is a configuration hash with these keys: | ||
## Read/write streams | ||
* `source`: a Tilestore object that implements the Tilesource interface | ||
* `sink`: a Tilestore object that implements the Tilesink interface | ||
* `bbox`: an array with W/S/E/N boundaries in WGS84 format (-180...180, -90...90) | ||
* `minZoom`: the minimum zoom for data to be copied (inclusive) | ||
* `maxZoom`: the maximum zoom for data to be copied (inclusive) | ||
* `concurrency`: (default: `100`) how many data objects should be copied simultaneously. | ||
* `callback`: (optional) called when copying is complete | ||
* `tiles`: copy tiles (`true` or `false`) | ||
* `grids`: copy grids (`true` or `false`) | ||
Tilelive provides an implementation of node object streams for copying tiles from one source to another. | ||
This function returns an EventEmitter that has these events emitted: | ||
// 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!'); | ||
}); | ||
* `warning`: An error occurred during copying. `err` is the first argument. | ||
* `error`: An error occured while initializing the tilesource/tilesink. | ||
* `finished`: Copying completed | ||
See `tilelive-copy` and the streams tests for example usage of copy streams. | ||
The EventEmitter also has these properties. They are updated continuously while copying. Check them occassionally to report status to the user. | ||
## bin/tilelive-copy | ||
* `copied`: Number of elements that have been copied so far | ||
* `failed`: Number of elements that couldn't be copied. | ||
* `total`: Total number of elements to be copied. | ||
* `started`: Timestamp of when the action started in milliseconds after epoch | ||
tilelive can be used to copy data between tilestores. For a full list of options, run `tilelive-copy`. | ||
## bin/tilelive | ||
tilelive can be used to copy data between tilestores. For a full list of options, run `bin/tilelive`. | ||
## Tests | ||
@@ -74,4 +67,1 @@ | ||
## Usage | ||
See `examples` for examples of a tilelive powered server. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 5 instances in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
2
1
43112
3
14
697
66
+ Addedminimist@~0.2.0
+ Addedspeedometer@~0.1.2
+ Addedminimist@0.2.4(transitive)
+ Addedspeedometer@0.1.4(transitive)
- Removedoptimist@~0.6.0
- Removedminimist@0.0.10(transitive)
- Removedoptimist@0.6.1(transitive)
- Removedwordwrap@0.0.3(transitive)