PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwpoly_remove_repeated_points()

LWGEOM* lwpoly_remove_repeated_points ( const LWPOLY in,
double  tolerance 
)

Definition at line 402 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().

403 {
404  uint32_t i;
405  POINTARRAY **newrings;
406 
407  newrings = lwalloc(sizeof(POINTARRAY *)*poly->nrings);
408  for (i=0; i<poly->nrings; i++)
409  {
410  newrings[i] = ptarray_remove_repeated_points_minpoints(poly->rings[i], tolerance, 4);
411  }
412 
413  return (LWGEOM*)lwpoly_construct(poly->srid,
414  poly->bbox ? gbox_copy(poly->bbox) : NULL,
415  poly->nrings, newrings);
416 
417 }
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
Definition: g_box.c:438
unsigned int uint32_t
Definition: uthash.h:78
LWPOLY * lwpoly_construct(int srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
Definition: lwpoly.c:43
POINTARRAY * ptarray_remove_repeated_points_minpoints(const POINTARRAY *in, double tolerance, int minpoints)
Definition: ptarray.c:1538
void * lwalloc(size_t size)
Definition: lwutil.c:229
Here is the call graph for this function:
Here is the caller graph for this function: