<div dir="ltr">Seems you found a solution, but to be clear the second argument to ST_AsMVTGeom should be the geographic coordinates and the docs should probably refer to "geographic bounds" rather than "geometric bounds".<div><br></div><div>/Björn<br><div class="gmail_extra"><br><div class="gmail_quote">2017-08-06 17:05 GMT+02:00 zimmicz <span dir="ltr"><<a href="mailto:zimmicz+nabble@gmail.com" target="_blank">zimmicz+nabble@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Moved a bit forward and got stuck with<br>
[ST_AsMVTGeom](<a href="https://postgis.net/docs/manual-dev/ST_AsMVTGeom.html" rel="noreferrer" target="_blank">https://<wbr>postgis.net/docs/manual-dev/<wbr>ST_AsMVTGeom.html</a>).<br>
<br>
All the tile queries sent to PostGIS looks like<br>
<br>
SELECT<br>
    name,<br>
    ST_AsText(ST_AsMVTGeom(<br>
        geom,<br>
        ST_MakeBox2D(ST_Point(0, 0), ST_Point(4096, 4096)),<br>
        4096,<br>
        0,<br>
        false<br>
    )) geom<br>
FROM cadastre_area<br>
WHERE ST_Intersects(geom, (SELECT<br>
ST_Transform(ST_SetSRID(ST_<wbr>MakeEnvelope(17.55615234375, 48.980216985374994,<br>
17.578125, 48.99463598353408), 4326), 3857)))<br>
<br>
I'm not really sure what the second argument stands for. The docs say<br>
"bounds is the geometric bounds of the tile contents without buffer." So are<br>
these the abstract coordinates of the tile space, or geographic ones<br>
(defined in 3857?).<br>
<br>
The queries now pass just fine, but return the data shifted to the south of<br>
the map.<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://postgis.17.x6.nabble.com/How-to-use-ST-AsMVT-to-serve-MVT-to-web-clients-tp5011416p5011417.html" rel="noreferrer" target="_blank">http://postgis.17.x6.nabble.<wbr>com/How-to-use-ST-AsMVT-to-<wbr>serve-MVT-to-web-clients-<wbr>tp5011416p5011417.html</a><br>
<div class="gmail-HOEnZb"><div class="gmail-h5">Sent from the PostGIS - User mailing list archive at Nabble.com.<br>
______________________________<wbr>_________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a></div></div></blockquote></div><br></div></div></div>