@mapbox/vtinfo

0.1.2 • Public • Published

vtinfo

Get general information and stats about a particular vector tile buffer. Meant as a lightweight replacement to Node Mapnik's mapnik.VectorTile.info(). Useful for testing!

Build Status codecov

Usage

Installation

npm install @mapbox/vtinfo

Get information as JSON

var fs = require('fs');
var vtinfo = require('@mapbox/vtinfo');

// get a vector tile buffer
var buffer = fs.readFileSync('/path/to/tile.vector.pbf');

// get info about the buffer
var info = vtinfo(buffer);
console.log(info);
// { layers: 
//    [ { name: 'landuse',
//        version: 2,
//        features: 5,
//        unknown_features: 0,
//        point_features: 0,
//        line_features: 0,
//        polygon_features: 5,
//        invalid_features: 0 },
//      { name: 'water',
//        version: 2,
//        features: 3,
//        unknown_features: 0,
//        point_features: 0,
//        line_features: 0,
//        polygon_features: 3,
//        invalid_features: 0 } 
//   ]
// }

Command line (assumes you've installed the module globally with -g)

vtinfo <path to tile>

Develop & Test

Set up your environment by running make, which will install dependencies and build binaries.

Run tests with npm test.

/@mapbox/vtinfo/

    Package Sidebar

    Install

    npm i @mapbox/vtinfo

    Weekly Downloads

    2

    Version

    0.1.2

    License

    ISC

    Last publish

    Collaborators

    • mbx-npm-ci-production
    • mbx-npm-ci-staging
    • mbx-npm-advanced-actions-production
    • mbx-npm-advanced-actions-staging
    • mbx-npm-09-production
    • mbx-npm-08-production
    • mbx-npm-07-production
    • mbx-npm-06-production
    • mbx-npm-05-production
    • mbx-npm-04-production
    • mbx-npm-03-production
    • mbx-npm-02-production
    • mbx-npm-01-production
    • mbx-npm-02-staging
    • mapbox-npm-01
    • mapbox-npm-02
    • mapbox-npm-07
    • mapbox-npm-03
    • mapbox-npm-04
    • mapbox-npm-09
    • mapbox-npm-05
    • mapbox-npm-06
    • mapbox-npm-08
    • mapbox-npm-advanced-actions
    • mapbox-npm-ci
    • mapbox-npm
    • mapbox-admin
    • mapbox-machine-user