[PostGIS] #5758: Documentation bug in SQL query example for ST_AsMVTGeom

PostGIS trac at osgeo.org
Sat Jul 6 12:06:18 PDT 2024


#5758: Documentation bug in SQL query example for ST_AsMVTGeom
----------------------------+-------------------------------
  Reporter:  azakh          |      Owner:  robe
      Type:  defect         |     Status:  new
  Priority:  medium         |  Milestone:  PostGIS 3.4.3
 Component:  documentation  |    Version:  3.4.x
Resolution:                 |   Keywords:  MVT, ST_AsMVTGeom
----------------------------+-------------------------------
Comment (by robe):

 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)


 {{{
 -- this assumes the geom has a 4326 srid
 SELECT ST_AsMVTGeom(
             ST_Transform( geom, 3857 ),
             ST_TileEnvelope(12, 513, 412), extent => 4096, buffer => 64)
 AS geom
   FROM data
   WHERE geom && ST_Transform(ST_TileEnvelope(12, 513, 412, margin => (64.0
 / 4096)),4326)
 }}}

 @pramsey @mdavis - you agree?
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5758#comment:1>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list