{"id":13784634,"url":"https://github.com/developmentseed/vt-geojson","last_synced_at":"2025-06-23T21:40:56.812Z","repository":{"id":30443397,"uuid":"33996805","full_name":"developmentseed/vt-geojson","owner":"developmentseed","description":"Extract GeoJSON from Mapbox vector tiles.","archived":false,"fork":false,"pushed_at":"2016-01-27T07:19:59.000Z","size":99,"stargazers_count":60,"open_issues_count":3,"forks_count":13,"subscribers_count":61,"default_branch":"master","last_synced_at":"2025-05-23T14:19:23.411Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developmentseed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-15T13:54:15.000Z","updated_at":"2024-03-11T02:44:26.000Z","dependencies_parsed_at":"2022-08-18T07:56:52.412Z","dependency_job_id":null,"html_url":"https://github.com/developmentseed/vt-geojson","commit_stats":null,"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/developmentseed/vt-geojson","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fvt-geojson","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fvt-geojson/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fvt-geojson/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fvt-geojson/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developmentseed","download_url":"https://codeload.github.com/developmentseed/vt-geojson/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developmentseed%2Fvt-geojson/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261561182,"owners_count":23177544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T19:00:49.941Z","updated_at":"2025-06-23T21:40:56.781Z","avatar_url":"https://github.com/developmentseed.png","language":"JavaScript","readme":"# vt-geojson\n\n[![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\n[![Build Status](https://travis-ci.org/developmentseed/vt-geojson.svg)](https://travis-ci.org/developmentseed/vt-geojson)\n\nExtract GeoJSON from Mapbox vector tiles.\n\n# Usage\n\n## CLI\n\nInstall with `npm install -g vt-geojson`, and then:\n\n```bash\nvt-geojson /path/to/tiles.mbtiles --bounds minx miny maxx maxy\ncat bounding_polygon.geojson | vt-geojson tilejson+http://api.tiles.mapbox.com/v4/YOUR-MAPID?access_token=YOUR_MAPBOX_TOKEN -z 12\nvt-geojson someone.blahblah --tile tilex tiley tilez # ('someone.blahblah' is a mapid)\n```\n\n## Node\n\nFirst `npm install vt-geojson` and then:\n\n```javascript\nvar cover = require('tile-cover')\nvar vtGeoJson = require('vt-geojson')\n\nvar polygon = JSON.parse(fs.readFileSync('my-polygon.geojson'))\nvar source = 'tilejson+http://api.tiles.mapbox.com/v4/YOUR-MAPID?access_token=YOUR_MAPBOX_TOKEN'\n\n// get an array of tiles ([x, y, z]) that we want to pull data from.\nvar tiles = cover.tiles(polygon.geometry, { min_zoom: 10, max_zoom: 12 })\n\n// stream geojson from the chosen tiles:\nvtGeoJson(source, tiles)\n  .on('data', function (feature) {\n    console.log(\"it's a GeoJSON feature!\", feature.geometry.type, feature.properties)\n  })\n  .on('end', function () {\n    console.log('all done')\n  })\n```\n\n## Browser\n\nThis module should work with browserify.  There's a minimal example of\nusing it in the browser\n[here](https://github.com/developmentseed/vt-geojson/blob/master/example/browser.js).\nTry it with:\n\n    npm install -g budo\n    budo example/browser.js\n\nThen go to \u003chttp://localhost:9966/?mapid=mapbox.mapbox-streets-v6\u0026tile=73/97/8\u0026layers=road\u0026access_token=YOUR_MAPBOX_ACCESS_TOKEN\u003e\n\n# API\n\n## vtgeojson\n\nStream GeoJSON from a Mapbox Vector Tile source\n\n**Parameters**\n\n-   `uri` **string** the tilelive URI for the vector tile source to use.\n-   `options` **object** options\n    -   `options.layers` **Array\u0026lt;string\u0026gt;** An array of layer names to read from tiles.  If empty, read all layers\n    -   `options.tiles` **Array** The tiles to read from the tilelive source.  If empty, use `options.bounds` instead.\n    -   `options.bounds` **Array** The [minx, miny, maxx, maxy] bounds or a GeoJSON Feature, FeatureCollection, or Geometry defining the region to read from source. Ignored if `options.tiles` is set.  If empty, use the bounds from the input source's metadata.\n    -   `options.minzoom` **number** Defaults to the source metadata minzoom.  Ignored if `options.tiles` is set.\n    -   `options.maxzoom` **number** Defaults to the source metadata minzoom.  Ignored if `options.tiles` is set.\n    -   `options.tilesOnly` **boolean** Output [z, y, x] tile coordinates instead of actually reading tiles.  Useful for debugging.\n    -   `options.strict` **boolean** Emit an error and end the stream if a tile is not found or can't be read\n\nReturns **ReadableStream\u0026lt;Feature\u0026gt;** A stream of GeoJSON Feature objects. Emits `warning` events with `{ tile, error }` when a tile from the requested set is not found or can't be read.\n\n# [Contributing](CONTRIBUTING.md)\n\nThis is an [OPEN Open Source](http://openopensource.org/) Project. This means that:\n\nIndividuals making significant and valuable contributions are given commit-access to the project to contribute as they see fit. This project is more like an open wiki than a standard guarded open source project.\n","funding_links":[],"categories":["CLI Utilities"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fvt-geojson","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopmentseed%2Fvt-geojson","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopmentseed%2Fvt-geojson/lists"}