@mapbox/vt2geojson

1.1.5 • Public • Published

Dump vector tiles to GeoJSON from remote URLs or local system files.

Installation

npm install -g @mapbox/vt2geojson

Usage

Node.js

var vt2geojson = require('@mapbox/vt2geojson');

// remote file
vt2geojson({
    uri: 'http://api.example.com/9/150/194.mvt',
    layer: 'layer_name'
}, function (err, result) {
    if (err) throw err;
    console.log(result); // => GeoJSON FeatureCollection
});

// local file
vt2geojson({
    uri: './local/file/buffer.mvt',
    layer: 'layer_name',
    z: 9,
    x: 150,
    y: 194
}, function (err, result) {
    if (err) throw err;
    console.log(result); // => GeoJSON FeatureCollection
});

CLI

Usage: vt2geojson [options] URI

Options:
  -l, --layer  include only the specified layer
  -x           tile x coordinate (normally inferred from the URI)
  -y           tile y coordinate (normally inferred from the URI)
  -z           tile z coordinate (normally inferred from the URI)
  -h, --help   Show help  [boolean]

Examples:
  vt2geojson --layer state_label https://api.mapbox.com/v4/mapbox.mapbox-streets-v6/9/150/194.vector.pbf?access_token=${MAPBOX_ACCESS_TOKEN}

Dependents (5)

Package Sidebar

Install

npm i @mapbox/vt2geojson

Weekly Downloads

468

Version

1.1.5

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