#5758 closed defect (fixed)
Documentation bug in SQL query example for ST_AsMVTGeom
Reported by: | azakh | Owned by: | robe |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 3.5.1 |
Component: | documentation | Version: | 3.4.x |
Keywords: | MVT, ST_AsMVTGeom | Cc: |
Description
Currently:
SELECT ST_AsMVTGeom( ST_Transform( geom, 3857 ), ST_TileEnvelope(12, 513, 412), extent => 4096, buffer => 64) AS geom FROM data WHERE geom && ST_TileEnvelope(12, 513, 412, margin => (64.0 / 4096))
Should be:
SELECT ST_AsMVTGeom( ST_Transform( geom, 3857 ), ST_TileEnvelope(12, 513, 412), extent => 4096, buffer => 64) AS geom FROM data WHERE ST_Transform(geom, 3857) && ST_TileEnvelope(12, 513, 412, margin => (64.0 / 4096))
Namely, the geom
column should be transformed both in SELECT and WHERE clauses.
Related issue: https://trac.osgeo.org/postgis/ticket/5198
Change History (5)
comment:1 by , 6 months ago
comment:2 by , 4 months ago
Milestone: | PostGIS 3.4.3 → PostGIS 3.4.4 |
---|
comment:3 by , 9 days ago
Milestone: | PostGIS 3.4.4 → PostGIS 3.5.1 |
---|
Note:
See TracTickets
for help on using tickets.
I think it's better to transform the ST_TileEnvelope rather than the geom, cause otherwise no index would be used unless there is a functional index on the ST_Transform(geom,3857)
@pramsey @mdavis - you agree?