1538 double tolsq = tolerance * tolerance;
1541 uint32_t n_points = pa->
npoints;
1542 uint32_t n_points_out = 1;
1545 double dsq = FLT_MAX;
1548 if ( n_points <= min_points )
return;
1551 void *p_to = ((
char *)last) + pt_size;
1552 for (i = 1; i < n_points; i++)
1554 int last_point = (i == n_points - 1);
1560 if (n_points + n_points_out > min_points + i)
1562 if (tolerance > 0.0)
1567 if (!last_point && dsq <= tolsq)
1575 if (memcmp((
char*)pt, (
char*)last, pt_size) == 0)
1583 if (last_point && n_points_out > 1 && tolerance > 0.0 && dsq <= tolsq)
1586 p_to = (
char*)p_to - pt_size;
1591 memcpy(p_to, pt, pt_size);
1593 p_to = (
char*)p_to + pt_size;
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
static double distance2d_sqr_pt_pt(const POINT2D *p1, const POINT2D *p2)
static size_t ptarray_point_size(const POINTARRAY *pa)