Nervously Practice Multithreading
    Wondering what’s next for npm?Check out our public roadmap! »

    @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.

    Keywords

    none

    Install

    npm i @mapbox/vtinfo

    DownloadsWeekly Downloads

    1

    Version

    0.1.2

    License

    ISC

    Last publish

    Collaborators

    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar
    • avatar