Problem:
geom is required by ST_AsMVTGeom to create an envelope from which to form tiles. However, geom then remains as an artifact in the query output sent out to the client.
Example:
WITH mvtgeom AS (
SELECT ST_AsMVTGeom(ST_Transform(geom, 3857), ST_TileEnvelope(
1,1,1
)) AS mvtgeom, *
FROM (SELECT gid, geom FROM sch.table) AS dat --geom included in query is used by ST_AsMVTGeom
WHERE ST_Intersects(geom, ST_Transform(ST_TileEnvelope(
1,1,1
), 4269))
)
SELECT ST_AsMVT(mvtgeom.*) AS mvt FROM mvtgeom; --geom included in output tuple
resulting output tuple will include both gid and geom [(<gid>, <geom>), ...]. This means more bytes sent to the client, even if they are never used.
Solution:
- eliminate geom from output? How? But then how do we add it back if it is actually wanted?
- leave as is? But then we are potentially sending more data to the client than is actually needed.
Problem:
geomis required byST_AsMVTGeomto create an envelope from which to form tiles. However,geomthen remains as an artifact in the query output sent out to the client.Example:
resulting output tuple will include both gid and geom
[(<gid>, <geom>), ...]. This means more bytes sent to the client, even if they are never used.Solution: