[postgis-tickets] [PostGIS] #4149: MVT: Be able to tweak simplification in St_AsMVTGeom

PostGIS trac at osgeo.org
Thu Aug 16 01:02:49 PDT 2018


#4149: MVT: Be able to tweak simplification in St_AsMVTGeom
-------------------------+---------------------------
 Reporter:  Algunenano   |      Owner:  Algunenano
     Type:  enhancement  |     Status:  assigned
 Priority:  medium       |  Milestone:  PostGIS 3.0.0
Component:  postgis      |    Version:  trunk
 Keywords:               |
-------------------------+---------------------------
 In some situations you want a big extent (e.g. 4096) to represent the
 geometries in a MVT with precision for the current zoom and, until the
 request arrives, to temporarily render the next zoom level too, but you
 don't want the big tile size that having the geometry ready for 4 zoom
 levels implies since you aren't skipping zoom levels (a.k.a. overzooming).

 For those cases it's interesting to have the possibility of simplifying
 the geometry for a zoom level but keep the main extent to a higher
 precision. For example, if you use a 4096 extent for the layer and 512 for
 simplification, any points falling inside the same 512 grid can be
 considered duplicated, but the final points keep the 4096 precision.

 For these use cases what I'm currently doing is simplifying
 (`ST_Simplify(ST_RemoveRepeatedPoints(${geomColumn}, ${tol}), ${tol},
 true`)) the geometry before entering St_AsMVTGeom. This  works but it
 means that there are 2 simplification processes going on, the external and
 the (now unnecessary) internal.

 I see 2 valid options to handle this:

 - Add the simplify_extent option to St_AsMVTGeom so the simplification
 process and the final snapping can be detached. This would probably be the
 option with the best performance.

 - Add the option of disabling the simplification process in St_AsMVTGeom
 and keep only the external simplification. This is the most future safe
 option: if you can disable simplification and add you own, you are able
 not only to change tolerance levels but also change simplification
 functions (ST_SimplifyPreserveTopology instead of St_Simplify for
 example).

 There is also the option of adding some kind of hook to the St_AsMVTGeom
 to set the simplification functions on the fly, but I feel that that's
 just too much complexity.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4149>
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