<div dir="ltr">I've now added changes to my asmvt branch to allow for non square bounds, which I hope can resolve your issues.<div><br></div><div>/Björn</div><div><div class="gmail_extra"><br><div class="gmail_quote">2016-11-26 9:59 GMT+01:00 Nikolai Bezdna <span dir="ltr"><<a href="mailto:mofoyoda@gmail.com" target="_blank">mofoyoda@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>I’m trying to use ST_AsMVT to respond to client tile requests with MVT-fromatted response.</div><div><br></div><div>From the client side I’m getting standard web mercator tile coordinates as z, x, y. To transfer these numbers to proper BBox, I’m using this Mapbox helper function for PostGIS (TileBBox):</div><div><a href="https://github.com/mapbox/postgis-vt-util/blob/master/postgis-vt-util.sql#L541" target="_blank">https://github.com/mapbox/<wbr>postgis-vt-util/blob/master/<wbr>postgis-vt-util.sql#L541</a></div><div> </div><div>When I use it's output geometry as a BBox parameter for ST_AsMVT function, I get an error:</div><div><br></div><div>[XX000] ERROR: mvt_agg_init_context: bounds must be square</div><div><br></div><div>Both CRS of BBox and the input geometry is 3857.</div><div>ST_AsMVT runs without this error only when x and y are the same, e.g: ST_AsMVT('test’, TileBBox(10, 1279, 1279), 4096, 0, false, ‘geom’, q)...</div><div>In all other cases ST_AsMVT returns this error. </div><div>I guess the returned BBox geometry is absolutely square only when x = y.</div><div><br></div><div>But how can I calculate the proper bounding box for each tile request? </div><div>TileBBox function looks pretty straightforward. Looks like there are no errors in it.</div></div><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="http://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/postgis-users</a><br></blockquote></div><br></div></div></div>