{"id":13784354,"url":"https://github.com/mapbox/tilelive-bridge","last_synced_at":"2025-05-11T19:32:56.841Z","repository":{"id":7459753,"uuid":"8805076","full_name":"mapbox/tilelive-bridge","owner":"mapbox","description":"Implements the tilelive API for generating mapnik vector tiles from traditional mapnik datasources.","archived":false,"fork":false,"pushed_at":"2020-12-01T02:07:43.000Z","size":9372,"stargazers_count":63,"open_issues_count":11,"forks_count":46,"subscribers_count":130,"default_branch":"master","last_synced_at":"2024-11-04T20:05:29.528Z","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-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mapbox.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-03-15T17:32:16.000Z","updated_at":"2024-10-25T21:47:47.000Z","dependencies_parsed_at":"2022-08-30T06:52:26.414Z","dependency_job_id":null,"html_url":"https://github.com/mapbox/tilelive-bridge","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Ftilelive-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Ftilelive-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Ftilelive-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mapbox%2Ftilelive-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mapbox","download_url":"https://codeload.github.com/mapbox/tilelive-bridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225086616,"owners_count":17418764,"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:40.892Z","updated_at":"2024-11-17T20:31:53.572Z","avatar_url":"https://github.com/mapbox.png","language":"JavaScript","funding_links":[],"categories":["Parsers \u0026 Generators","Uncategorized"],"sub_categories":["Uncategorized"],"readme":"tilelive-bridge\n---------------\nImplements the tilelive API for generating mapnik vector tiles from traditional mapnik datasources.\n\n[![Build Status](https://travis-ci.com/mapbox/tilelive-bridge.svg?branch=master)](http://travis-ci.com/mapbox/tilelive-bridge)\n\n### new Bridge(options, callback)\n\n- *xml*: a Mapnik XML string that will be used to generate vector tiles.\n- *base*: Optional, basepath for Mapnik map. Defaults to `__dirname`.\n\n## Installation\n\n    npm install @mapbox/tilelive-bridge\n\nThough `tilelive` is not a dependency of `tilelive-bridge` you will want to\ninstall it to actually make use of `tilelive-bridge` through a reasonable\nAPI.\n\n## Usage\n\n```javascript\nvar tilelive = require('tilelive');\nrequire('@mapbox/tilelive-bridge').registerProtocols(tilelive);\n\ntilelive.load('bridge:///path/to/file.xml', function(err, source) {\n    if (err) throw err;\n\n    // Interface is in XYZ/Google coordinates.\n    // Use `y = (1 \u003c\u003c z) - 1 - y` to flip TMS coordinates.\n    source.getTile(0, 0, 0, function(err, tile, headers) {\n        // `err` is an error object when generation failed, otherwise null.\n        // `tile` contains the compressed image file as a Buffer\n        // `headers` is a hash with HTTP headers for the image.\n    });\n\n    // The `.getGrid` is implemented accordingly.\n});\n```\n\n### Limiting tile sizes\n\nYou can set a limit to the size of vector tiles created (in bytes) by setting the `BRIDGE_MAX_VTILE_BYTES_COMPRESSED=n` environment variable. If a tile is generated and larger than the threshold, the process will return `Tile \u003e= max allowed size` as an error.\n\nIf you'd like to get statistics about tiles above a certain byte size (before limiting with the above), you can provide the `BRIDGE_LOG_MAX_VTILE_BYTES_COMPRESSED=n` environment variable in your tilelive-driven application and this will generate a stats object on you file system named `tilelive-bridge-stats.json` which includes the average tile size, the maximum tile size, and the number of tiles greater than the threshold set with the environment variable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Ftilelive-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapbox%2Ftilelive-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapbox%2Ftilelive-bridge/lists"}