I have been following a post here to create vector tiles direct from my database. My data is in WebMercator.
I am using the query:
SELECT ST_AsMVT(tile) FROM (SELECT dh_id, ST_AsMVTGeom(geom_go_mer, ST_MakeEnvelope(%(xmin)s,%(ymin)s,%(xmax)s,%(ymax)s, 3857), 4036, 256, true) AS geom FROM temp.buildings_google_mercator WHERE geom_go_mer && (SELECT ST_MakeEnvelope(%(xmin)s,%(ymin)s,%(xmax)s,%(ymax)s, 3857)) ) AS tile
in Postgis 2.4.4 and parametising it with the webmercator coordinates calculated from the z,y,z tileschema (see here).
I get results, but as I zoom in, there are visibly more boundary disjoints. I looked at the resulting tiles, and it seems that the tiles are not calculated as I would expect.
In this diagram, the pink is the original geometry, the purple and green are two different adjacent tiles. Not only is the resulting tile geometry different from the original, but adjacent tiles do not overlap at all - the line within the green polygon should overlap the line within the purple polygon below.
I am confused whether
- this is expected bahaviour for MVT
- a bug / feature in Postgis MVT, or
- something wrong with my interpretation of it.
I haven't seen bahaviour like this for other MVT maps, so I am not sure it's no. 1.