{"name":"vt-pbf","version":"3.1.0","description":"Serialize mapbox vector tiles to binary protobufs in javascript.","main":"index.js","scripts":{"test":"standard index.js test/*.js && tape test/*.js"},"author":{"name":"Anand Thakker","email":"vestibule@anandthakker.net","url":"http://anandthakker.net/"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/mapbox/vt-pbf.git"},"dependencies":{"@mapbox/point-geometry":"0.1.0","@mapbox/vector-tile":"^1.3.0","pbf":"^3.0.5"},"devDependencies":{"benchmark":"^1.0.0","geojson-equality":"^0.1.5","geojson-vt":"^2.1.1","standard":"^4.5.4","tape":"^4.0.1"},"gitHead":"ad933a6492425a0d2eb56744fa1623345dad4cc9","bugs":{"url":"https://github.com/mapbox/vt-pbf/issues"},"homepage":"https://github.com/mapbox/vt-pbf#readme","_id":"vt-pbf@3.1.0","_npmVersion":"5.5.1","_nodeVersion":"8.3.0","_npmUser":{"name":"anandthakker","email":"vestibule@anandthakker.net"},"dist":{"integrity":"sha512-UUCGPkpT1P/bm3R3/HX0SCnRSto44xXx0WuLFVG6C7KspdfQfU+84etoO6cITAGCdq8V5DjuWfDhvk/pyTyt3Q==","shasum":"d7e63f585b362cbff6b84fcd052c159112e0acc7","tarball":"http://registry-npm.ywwl.com/vt-pbf/download/vt-pbf-3.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD3yrjY7ehNRNG0LcAIGGussg3tZDP8k4am519AskM2MgIhANhv/ZFj7wY7qzuOhMO4YZfd8r5ctbSXJ2iaD+UtY8Yw"}],"size":833704,"noattachment":false,"key":"/vt-pbf/-/vt-pbf-3.1.0.tgz"},"maintainers":[{"email":"ulsh@mapbox.com","name":"alulsh"},{"email":"accounts@mapbox.com","name":"mapbox-admin"},{"email":"ryan.clark.j@gmail.com","name":"rclark"},{"email":"morgan.herlocker@gmail.com","name":"morganherlocker"},{"email":"jeff@miccolis.net","name":"miccolis"},{"email":"john.firebaugh@gmail.com","name":"jfirebaugh"},{"email":"ansis.brammanis@gmail.com","name":"ansis"},{"email":"nicholas.ingalls@gmail.com","name":"ingalls"},{"email":"tristen.brown@gmail.com","name":"tristen"},{"email":"agafonkin@gmail.com","name":"mourner"},{"email":"ian@mapbox.com","name":"ianshward"},{"email":"alex@mapbox.com","name":"lxbarth"},{"email":"aj@mapbox.com","name":"ajashton"},{"email":"saman@mapbox.com","name":"samanbb"},{"email":"nicki@mapbox.com","name":"nickidlugash"},{"email":"ian.villeda@gmail.com","name":"ian29"},{"email":"damon@mapbox.com","name":"dnomadb"},{"email":"bobby@mapbox.com","name":"bsudekum"},{"email":"lauren@mapbox.com","name":"lbud"},{"email":"sean@mapbox.com","name":"sgillies"},{"email":"karen@mapbox.com","name":"karenzshea"},{"email":"spam@freenerd.de","name":"freenerd"},{"email":"flippmoke@gmail.com","name":"flippmoke"},{"email":"wb@bergwerk-gis.at","name":"bergwerkgis"},{"email":"patrick@mapbox.com","name":"themarex"},{"email":"emily@mapbox.com","name":"emilymcafee"},{"email":"jake@jakepruitt.com","name":"jrpruit1"},{"email":"arun.planemad@gmail.com","name":"planemad"},{"email":"thomas.j.lee@gmail.com","name":"sbma44"},{"email":"lyzi@mapbox.com","name":"lyzidiamond"},{"email":"bryan@mapbox.com","name":"bhousel"},{"email":"mcwhittemore@gmail.com","name":"mcwhittemore"},{"email":"irwin@mapbox.com","name":"mtirwin"},{"email":"mxn@1ec5.org","name":"1ec5"},{"email":"carol@mapbox.com","name":"gretacb"},{"email":"vestibule@anandthakker.net","name":"anandthakker"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/vt-pbf-3.1.0.tgz_1509563496976_0.5698678432963789"},"directories":{},"readme":"# vt-pbf [![CircleCI](https://circleci.com/gh/mapbox/vt-pbf.svg?style=svg)](https://circleci.com/gh/mapbox/vt-pbf)\n\nSerialize [Mapbox vector tiles](https://github.com/mapbox/vector-tile-spec) to binary protobufs in javascript.\n\n## Usage\n\nAs far as I know, the two places you might get a JS representation of a vector\ntile are [geojson-vt](https://github.com/mapbox/geojson-vt) and\n[vector-tile-js](https://github.com/mapbox/vector-tile-js).  These both use\nslightly different internal representations, so serializing each looks slightly\ndifferent:\n\n## From vector-tile-js\n\n```javascript\nvar vtpbf = require('vt-pbf')\nvar VectorTile = require('@mapbox/vector-tile').VectorTile\nvar Protobuf = require('pbf')\n\nvar data = fs.readFileSync(__dirname + '/fixtures/rectangle-1.0.0.pbf')\nvar tile = new VectorTile(new Protobuf(data))\nvar orig = tile.layers['geojsonLayer'].feature(0).toGeoJSON(0, 0, 1)\n\nvar buff = vtpbf(tile)\nfs.writeFileSync('my-tile.pbf', buff)\n```\n\n## From geojson-vt\n\n```javascript\nvar vtpbf = require('vt-pbf')\nvar geojsonVt = require('geojson-vt')\n\nvar orig = JSON.parse(fs.readFileSync(__dirname + '/fixtures/rectangle.geojson'))\nvar tileindex = geojsonVt(orig)\nvar tile = tileindex.getTile(1, 0, 0)\n\n// pass in an object mapping layername -> tile object\nvar buff = vtpbf.fromGeojsonVt({ 'geojsonLayer': tile })\nfs.writeFileSync('my-tile.pbf', buff)\n```\n\n`vtpbf.fromGeojsonVt` takes two arguments:\n- `layerMap` is an object where keys are layer names and values are a geojson-vt tile,\n- `options` is an object (optional argument). There are 2 supported keys: `version` to define the version of the mvt spec used and `extent` to define the extent of the tile. `version` defaults to 1 and `extent` to 4096.\n\n","publish_time":1509563518559,"_cnpm_publish_time":1509563518559,"dist-tags":{"latest":"3.1.3"}}