https://github.com/mapbox/vt2geojson
Dump vector tiles to GeoJSON
https://github.com/mapbox/vt2geojson
conversion geojson mapbox serialization tile vector vector-tile view
Last synced: about 1 month ago
JSON representation
Dump vector tiles to GeoJSON
- Host: GitHub
- URL: https://github.com/mapbox/vt2geojson
- Owner: mapbox
- License: isc
- Created: 2015-10-09T00:03:28.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2025-07-03T13:48:34.000Z (6 months ago)
- Last Synced: 2025-10-04T06:00:29.146Z (3 months ago)
- Topics: conversion, geojson, mapbox, serialization, tile, vector, vector-tile, view
- Language: JavaScript
- Homepage:
- Size: 137 KB
- Stars: 151
- Watchers: 117
- Forks: 32
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-vector-tiles - vt2geojson - Command line tool and npm package for converting vector tiles into GeoJSON. (CLI Utilities)
README
Dump vector tiles to GeoJSON from remote URLs or local system files.
## Installation
```
npm install -g @mapbox/vt2geojson
```
## Usage
Node.js
```javascript
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}
```