[PostGIS] #5654: Missing line segment with self-intersection and MVT

PostGIS trac at osgeo.org
Tue Apr 16 16:10:20 PDT 2024


#5654: Missing line segment with self-intersection and MVT
-----------------------+------------------------------------
  Reporter:  mhkeller  |      Owner:  pramsey
      Type:  defect    |     Status:  new
  Priority:  medium    |  Milestone:  PostGIS 3.4.3
 Component:  postgis   |    Version:  3.4.x
Resolution:            |   Keywords:  mvt, self-intersection
-----------------------+------------------------------------
Comment (by pramsey):

 This fixed the particular case, but I cannot run all tests at the moment
 to see what else it might break.
 {{{
 diff --git a/liblwgeom/ptarray.c b/liblwgeom/ptarray.c
 index 7d9c8c0cd..b331c9558 100644
 --- a/liblwgeom/ptarray.c
 +++ b/liblwgeom/ptarray.c
 @@ -1685,7 +1685,11 @@ ptarray_simplify_in_place_tolerance0(POINTARRAY
 *pa)
                 double dot_ac_ab = ca_x * ba_x + ca_y * ba_y;
                 double s_numerator = ca_x * ba_y - ca_y * ba_x;

 -               if (dot_ac_ab < 0.0 || dot_ac_ab > ab_length_sqr ||
 s_numerator != 0)
 +               if (p2d_same(kept_pt, next_pt) ||
 +                       dot_ac_ab < 0.0 ||
 +                       dot_ac_ab > ab_length_sqr ||
 +                       s_numerator != 0)
 +
                 {
                         kept_it++;
                         kept_pt = curr_pt;
 }}}
-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/5654#comment:8>
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