GithubHelp home page GithubHelp logo

isabella232 / tilelive Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tilemill-project/tilelive

0.0 0.0 0.0 3.62 MB

fast interface to tiles with pluggable backends

License: BSD 3-Clause "New" or "Revised" License

Makefile 0.21% JavaScript 99.79%

tilelive's Introduction

tilelive.js

IMPORTANT: This was forked from an older mapbox version of tilelive that still worked with tilemill. It has also had minor enhnacements had had all of its dependent modules upgraded.

The original readme is below.


tilelive.js is an interface for tilestore modules for node.js. It defines an API to interact with implementations for a particular tile store.

Build Status

Backends

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.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:
{
    "world-light": "mbtiles:///path/to/file/world-light.mbtiles",
    "mapquest": "tilejson:///path/to/file/mapquest.tilejson"
}
  • tilelive.findID(source, id, callback): Looks for a particular tileset ID in a directory. callback receives an error object (or null) and the URI of the tileset.

  • tilelive.load(uri, callback): Loads the Tilestore object associated with the specified uri. callback receives an error object (or null) and the Tilestore object.

  • tilelive.info(uri, callback): Loads the Tilestore object associated with the specified uri and retrieves its metadata in a TileJSON compliant format. callback receives an error object (or null), the metadata hash and the Tilestore object.

  • tilelive.all(source, callback): Loads metadata in a TileJSON compliant format for all tilesets in the source directory. callback receives an error object (or null) and an array with TileJSON metadata about each tileset in that directory.

  • 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:

    • 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)

    This function returns an EventEmitter that has these events emitted:

    • warning: An error occurred during copying. err is the first argument.
    • error: An error occured while initializing the tilesource/tilesink.
    • finished: Copying completed

    The EventEmitter also has these properties. They are updated continuously while copying. Check them occassionally to report status to the user.

    • 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

bin/tilelive

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

Tests

To run the tests

npm test

Usage

See examples for examples of a tilelive powered server.

tilelive's People

Contributors

dmitrig01 avatar florianf avatar kkaefer avatar paulovieira avatar tmcw avatar tomhughes avatar tpotter7 avatar willwhite avatar wrynearson avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.