{"name":"vt-pbf","version":"2.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/anandthakker/vt-pbf.git"},"dependencies":{"pbf":"^1.3.2","point-geometry":"0.0.0","vector-tile":"^1.1.3"},"devDependencies":{"benchmark":"^1.0.0","geojson-equality":"^0.1.5","geojson-vt":"^2.1.1","standard":"^4.5.4","tape":"^4.0.1"},"gitHead":"f7d10e241f1d0fb17e0d459e5dd2d6d582c98ab4","bugs":{"url":"https://github.com/anandthakker/vt-pbf/issues"},"homepage":"https://github.com/anandthakker/vt-pbf#readme","_id":"vt-pbf@2.1.0","_shasum":"1e00587ac11b8b0133a64704c2dd34286bd77c30","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"anandthakker","email":"vestibule@anandthakker.net"},"dist":{"shasum":"1e00587ac11b8b0133a64704c2dd34286bd77c30","tarball":"http://registry-npm.ywwl.com/vt-pbf/download/vt-pbf-2.1.0.tgz","integrity":"sha512-9LLtlmftaVdOiOFhKZfE3PCAw8wmZaonCPDi1NGq2luMS/bY8hqQ+ipbB+FKCtjzSx70ALFzzaoWKwlF7lz6Mg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE553iR44mNtKUjzNpoJDRedtsKU2sYy+1J7vXKOy8zaAiAHon4EpWtHitSE335JEovZSh0DDScTF04yJ+lFPdUXMg=="}],"size":10709,"noattachment":false,"key":"/vt-pbf/-/vt-pbf-2.1.0.tgz"},"maintainers":[{"name":"1ec5","email":"mxn@1ec5.org"},{"name":"aaronlidman","email":"aaronlidman@gmail.com"},{"name":"ajashton","email":"aj.ashton@gmail.com"},{"name":"anandthakker","email":"vestibule@anandthakker.net"},{"name":"ansis","email":"ansis.brammanis@gmail.com"},{"name":"bergwerkgis","email":"wb@bergwerk-gis.at"},{"name":"bhousel","email":"bryan@mapbox.com"},{"name":"bsudekum","email":"bobby@mapbox.com"},{"name":"camilleanne","email":"camille@mapbox.com"},{"name":"dnomadb","email":"damon@mapbox.com"},{"name":"edenh","email":"eden.halperin@gmail.com"},{"name":"emilymcafee","email":"emily@mapbox.com"},{"name":"flippmoke","email":"flippmoke@gmail.com"},{"name":"freenerd","email":"spam@freenerd.de"},{"name":"gretacb","email":"carol@mapbox.com"},{"name":"ian29","email":"ian.villeda@gmail.com"},{"name":"ianshward","email":"ian@mapbox.com"},{"name":"ingalls","email":"nicholas.ingalls@gmail.com"},{"name":"jfirebaugh","email":"john.firebaugh@gmail.com"},{"name":"jrpruit1","email":"jake@jakepruitt.com"},{"name":"karenzshea","email":"karen@mapbox.com"},{"name":"lbud","email":"lauren@mapbox.com"},{"name":"lucaswoj","email":"lucas@lucaswoj.com"},{"name":"lxbarth","email":"alex@mapbox.com"},{"name":"lyzidiamond","email":"lyzi@mapbox.com"},{"name":"mateov","email":"matt@mapbox.com"},{"name":"mcwhittemore","email":"mcwhittemore@gmail.com"},{"name":"miccolis","email":"jeff@miccolis.net"},{"name":"mikemorris","email":"michael.patrick.morris@gmail.com"},{"name":"morganherlocker","email":"morgan.herlocker@gmail.com"},{"name":"mourner","email":"agafonkin@gmail.com"},{"name":"mtirwin","email":"irwin@mapbox.com"},{"name":"nickidlugash","email":"nicki@mapbox.com"},{"name":"planemad","email":"arun.planemad@gmail.com"},{"name":"rclark","email":"ryan.clark.j@gmail.com"},{"name":"samanbb","email":"saman@mapbox.com"},{"name":"sbma44","email":"tlee@mapbox.com"},{"name":"scothis","email":"scothis@gmail.com"},{"name":"sgillies","email":"sean@mapbox.com"},{"name":"themarex","email":"patrick@mapbox.com"},{"name":"tristen","email":"tristen.brown@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/vt-pbf-2.1.0.tgz_1471263292722_0.7257868007291108"},"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":1471263294388,"_cnpm_publish_time":1471263294388,"dist-tags":{"latest":"3.1.3"}}