PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwpoly_remove_repeated_points()

LWGEOM* lwpoly_remove_repeated_points ( LWPOLY in,
double  tolerance 
)

Definition at line 289 of file lwpoly.c.

References LWPOLY::bbox, gbox_copy(), lwalloc(), lwpoly_construct(), LWPOLY::nrings, ptarray_remove_repeated_points_minpoints(), LWPOLY::rings, and LWPOLY::srid.

Referenced by lwgeom_remove_repeated_points().

290 {
291  uint32_t i;
292  POINTARRAY **newrings;
293 
294  newrings = lwalloc(sizeof(POINTARRAY *)*poly->nrings);
295  for (i=0; i<poly->nrings; i++)
296  {
297  newrings[i] = ptarray_remove_repeated_points_minpoints(poly->rings[i], tolerance, 4);
298  }
299 
300  return (LWGEOM*)lwpoly_construct(poly->srid,
301  poly->bbox ? gbox_copy(poly->bbox) : NULL,
302  poly->nrings, newrings);
303 
304 }
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
Definition: g_box.c:403
POINTARRAY * ptarray_remove_repeated_points_minpoints(POINTARRAY *in, double tolerance, int minpoints)
Definition: ptarray.c:1437
LWPOLY * lwpoly_construct(int srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
Definition: lwpoly.c:29
void * lwalloc(size_t size)
Definition: lwutil.c:199
Here is the call graph for this function:
Here is the caller graph for this function: