[postgis-tickets] [PostGIS] #5382: ST_AsMVTGeom output is snapped to grid incorrectly

PostGIS trac at osgeo.org
Thu Aug 10 10:32:01 PDT 2023


#5382: ST_AsMVTGeom output is snapped to grid incorrectly
----------------------+----------------------------
  Reporter:  mknycha  |      Owner:  pramsey
      Type:  defect   |     Status:  closed
  Priority:  medium   |  Milestone:  PostGIS 3.1.10
 Component:  postgis  |    Version:  3.3.x
Resolution:  wontfix  |   Keywords:
----------------------+----------------------------
Changes (by pramsey):

 * status:  new => closed
 * resolution:   => wontfix

Comment:

 While there is a grid operation in the pre-processing step, the issue you
 are seeing is happening in the wagyu library, and I'd posit because wagyu
 implementation is templated and working in the integer domain, so the
 result of the clipping intersection if floored to the nearest integral
 coordinate (which, because the whole coordinate space is flipped in 'y'
 results in the intersection point being generated downwards). In any
 event, it's not something we're going to attempt to change, as it's a
 pixel-level difference that is applied usually on a 4800x4800 grid, in a
 vendored library.

 Interestingly, you can see a completely different behaviour if you push a
 LINESTRING example through just like your POLYGON, since for non-polygons
 the GEOS clipping library is used. Another approach would be to use the
 GEOS new overlay NG with precision set on it. We could probably get
 "expected" results for you with that approach, but probably at a
 performance penalty -- previous attempts to strip out wagyu for GEOS found
 that waygyu was quite noticeably faster.
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5382#comment:4>
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