-
-
Save mhkeller/05d7eafc43966a2b3b5b2d41784b300b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH tilebounds (geom) AS (SELECT ST_TileEnvelope($1, $2, $3)), | |
query AS ( | |
SELECT ST_Makeline(geom ORDER BY field_order) as geom FROM path_test | |
) | |
SELECT ST_AsMVT(q, 'default', 4096, 'mvtgeom') | |
FROM ( | |
SELECT | |
*, | |
ST_AsMVTGeom( | |
ST_Transform(query.geom, 3857), | |
tileBounds.geom, | |
4096, | |
256, | |
true | |
) mvtgeom | |
FROM query, tilebounds | |
WHERE ST_Transform(query.geom, 3857) && tilebounds.geom | |
) q |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment