Skip to content

Instantly share code, notes, and snippets.

@ustroetz
Last active September 8, 2017 12:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ustroetz/401de3e62e97352a625fe9b8de5f5495 to your computer and use it in GitHub Desktop.
Save ustroetz/401de3e62e97352a625fe9b8de5f5495 to your computer and use it in GitHub Desktop.
Get MVT from Postgis
SELECT ST_AsMVT('test', 4096, 'geom', q)
FROM (
SELECT
ST_AsMVTGeom(
geom,
TileBBox(z, x, y, 3857), /* https://github.com/mapbox/postgis-vt-util/blob/master/src/TileBBox.sql */
4096,
0,
false
) geom
FROM test
) q
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment