{"id":19850223,"url":"https://github.com/trailbehind/tilelive-asmvt","last_synced_at":"2026-05-14T03:36:47.826Z","repository":{"id":36682038,"uuid":"220856955","full_name":"trailbehind/tilelive-AsMVT","owner":"trailbehind","description":"Tilelive module for generating Mapbox Vector Tiles from a Postgres DB using ST_AsMVT.","archived":false,"fork":false,"pushed_at":"2023-06-22T17:19:36.000Z","size":21,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-02-11T18:51:34.413Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trailbehind.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2019-11-10T22:00:18.000Z","updated_at":"2020-11-23T01:43:21.000Z","dependencies_parsed_at":"2022-08-08T16:31:09.450Z","dependency_job_id":null,"html_url":"https://github.com/trailbehind/tilelive-AsMVT","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailbehind%2Ftilelive-AsMVT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailbehind%2Ftilelive-AsMVT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailbehind%2Ftilelive-AsMVT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trailbehind%2Ftilelive-AsMVT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trailbehind","download_url":"https://codeload.github.com/trailbehind/tilelive-AsMVT/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241231287,"owners_count":19931127,"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-11-12T13:24:57.685Z","updated_at":"2025-11-24T07:02:27.133Z","avatar_url":"https://github.com/trailbehind.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tilelive-AsMVT\n\nTilelive module for generating Mapbox Vector Tiles from a Postgres DB using ST_AsMVT.\n\nRequires a postgres function that takes 3 int arguments(zoom, x, y) and returns vector tile data to exist. It is suitable for use with functions generated by the [generate-sqltomvt tool](https://github.com/openmaptiles/openmaptiles-tools/blob/master/bin/generate-sqltomvt) from the [OpenMapTiles](https://github.com/openmaptiles/) project, or other a custom function with a similar signature.\n\n## Example function\n\n```\nCREATE OR REPLACE FUNCTION gettile(zoom integer, x integer, y integer)\nRETURNS bytea AS $$\n    ST_AsMVT(t, 'admin', 4096, 'mvtgeometry'), '') as mvtl FROM (\n        SELECT ST_AsMVTGeom(geometry, ST_TileEnvelope(zoom, x, y), 4096, 4, true) AS mvtgeometry, id, name\n        FROM my_table WHERE geometry \u0026\u0026 ST_TileEnvelope(zoom, x, y);\n$$ LANGUAGE SQL STABLE RETURNS NULL ON NULL INPUT;\n```\n\n## Example source url:\n\n`asmvt:///?host=localhost\u0026user=postgres\u0026database=osm\u0026port=15432\u0026function=gettile`\n\n## Query parameters:\n\n- `user` - postgres user, defaults to `PGUSER` environment variable if not provided.\n- `host` - postgres host, defaults to `PGHOST` environment variable if not provided.\n- `database` - database name, defaults to `PGDATABASE` environment variable if not provided.\n- `password` - postgres password, defaults to `PGPASSWORD` environment variable if not provided.\n- `port` - postgres port, defaults to `PGPORT` environment variable if not provided.\n- `function` - REQUIRED - name of database function that returns tile data.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrailbehind%2Ftilelive-asmvt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrailbehind%2Ftilelive-asmvt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrailbehind%2Ftilelive-asmvt/lists"}