Giter Club home page Giter Club logo

tylr's Introduction

tylr

Create a cache vector tiles from GeoJSON files.

Install

npm install -g tylr

Usage

Using tylr can be done in 2 ways, either as a command line utility or as a node module.

Command Line

# using a -f to pass in features 
tylr -f ./examples/us-states.json -d ./output -n states -l 0,5 -t pbf

# OR stream features in like this
cat ./examples/us-states.json | tylr -d ./out -n states

Node Module

var options = {
  d: './out',
  n: 'layer-name',
  t: 'pbf',
  l: '0,5'
}
 
// pass the options into tylr
var tylr = require('tylr')(options)

// add array of features to tile
var features = [...]

// add each feature to tylr
feature.forEach(function (f) {
  tylr.addFeature(f);
})

// finally dump the features out to disk
tylr.writeTiles() 

Options

  • -f input geojson
  • -n name of tiles (for client side rendering / styling)
  • -t output type ('pbf', 'json')
  • -d output dir
  • -l zoom levels ( 0 to 20 )

Formats

Using the -t options you can have tylr create either protocol buffer tiles adhering to the Mapbox Vector Tile Spec or as GeoJSON tiles.

tylr's People

Contributors

benheb avatar chelm avatar christophe-marteau avatar geographist avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tylr's Issues

Add multipolygon support

Right now the centroid calc is using the first polygon. We need to send them all and recurse.

states fixture not checked in

tylr (master) > node test/*.js | tap-spec
fs.js:584
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/Users/kueda/projects/tylr/test/fixtures/states.json'
    at Error (native)
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:431:33)
    at Object.<anonymous> (/Users/kueda/projects/tylr/test/index.js:12:26)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Function.Module.runMain (module.js:447:10)
    at startup (node.js:141:18)

Write geoms once for GeoJSON

We are currently generating geojson tiles that will over lap geoms that span multiple tiles. This should be fixed to use the centroid when building up the tile index.

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.