Commit bdeafe18 authored by Paul Ramsey's avatar Paul Ramsey

Avoid final point duplicates for circle stroking

References #4283




git-svn-id: http://svn.osgeo.org/postgis/branches/2.5@17186 b70326c6-7e19-0410-871a-916f4a2858ee
parent 191d01d7
Pipeline #43936429 passed with stage
in 23 minutes and 38 seconds
......@@ -42,6 +42,12 @@ XXXX/XX/XX
- #4296, Use `server_version_num` instead of parsing `version()` (Raúl Marín)
- #4290, More robust geography distance (Paul Ramsey)
- #4283, Avoid final point duplicates for circle stroking
PostGIS 2.5.1
2018/11/18
......
......@@ -345,9 +345,9 @@ lwarc_linearize(POINTARRAY *to,
/* Override angles for circle case */
if( is_circle )
{
increment = fabs(increment);
a3 = a1 + 2.0 * M_PI;
a2 = a1 + M_PI;
increment = fabs(increment);
clockwise = LW_FALSE;
}
......@@ -380,7 +380,15 @@ lwarc_linearize(POINTARRAY *to,
angle_shift = 0;
}
if ( reverse ) {{
/* Ensure the final point is EXACTLY the same as the first for the circular case */
if ( is_circle )
{
ptarray_remove_point(pa, pa->npoints - 1);
ptarray_append_point(pa, p1, LW_FALSE);
}
if ( reverse )
{
int i;
ptarray_append_point(to, p3, LW_FALSE);
for ( i=pa->npoints; i>0; i-- ) {
......@@ -388,7 +396,7 @@ lwarc_linearize(POINTARRAY *to,
ptarray_append_point(to, &pt, LW_FALSE);
}
ptarray_free(pa);
}}
}
return points_added;
}
......@@ -447,7 +455,7 @@ lwcircstring_linearize(const LWCIRCSTRING *icurve, double tol,
}
}
getPoint4d_p(icurve->points, icurve->points->npoints-1, &p1);
ptarray_append_point(ptarray, &p1, LW_TRUE);
ptarray_append_point(ptarray, &p1, LW_FALSE);
oline = lwline_construct(icurve->srid, NULL, ptarray);
return oline;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment