[postgis-tickets] [PostGIS] #4336: ST_LineToCurve generates wrong Arcs for Epsilon 1E-1 (+ potential fix)

PostGIS trac at osgeo.org
Thu Feb 28 08:05:05 PST 2019


#4336: ST_LineToCurve generates wrong Arcs for Epsilon  1E-1 (+ potential fix)
------------------------+---------------------------
 Reporter:  tvijlbrief  |      Owner:  pramsey
     Type:  defect      |     Status:  new
 Priority:  medium      |  Milestone:  PostGIS 2.5.2
Component:  postgis     |    Version:  2.4.x
 Keywords:              |
------------------------+---------------------------
 See also https://github.com/tomtor/postgis/blob/master/patch

 The two attached images show the issues.

 The first image shows that the large light blue arc which clearly exceeds
 the 0.1m tolerance. This is caused by line 23 in the diff file: comparing
 an angle difference in radians to the EPSILON value 0.1 (m).

 I opted for excepting angles which differ by at most 25% but it would
 probably be more consistent to compare the distances between a2/a3 and
 a3/candidate so that they are within (2*) Epsilon.

 The second image shows another issue. The current code requires that
 points which EXTENT the candidate arc have similar angles.
 However, we do not have such a constraint for a1/a2/a3 which form the
 ORIGINAL candidate arc. This is inconsistent.

 I added a test which require that difference in distance between a1/a2 and
 a2/a3 is at most 2 * Epsilon.

 These errors will be much rarer when using the default 1E-8 epsilon, but
 the issues are the same.

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