PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ lwpoly_remove_repeated_points()

LWGEOM* lwpoly_remove_repeated_points ( const LWPOLY poly,
double  tolerance 
)

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

363 {
364  uint32_t i;
365  POINTARRAY **newrings;
366 
367  newrings = lwalloc(sizeof(POINTARRAY *)*poly->nrings);
368  for (i=0; i<poly->nrings; i++)
369  {
370  newrings[i] = ptarray_remove_repeated_points_minpoints(poly->rings[i], tolerance, 4);
371  }
372 
373  return (LWGEOM*)lwpoly_construct(poly->srid,
374  poly->bbox ? gbox_copy(poly->bbox) : NULL,
375  poly->nrings, newrings);
376 
377 }
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
Definition: g_box.c:438
GBOX * bbox
Definition: liblwgeom.h:452
LWPOLY * lwpoly_construct(int srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
Definition: lwpoly.c:43
POINTARRAY ** rings
Definition: liblwgeom.h:456
int nrings
Definition: liblwgeom.h:454
int32_t srid
Definition: liblwgeom.h:453
POINTARRAY * ptarray_remove_repeated_points_minpoints(const POINTARRAY *in, double tolerance, int minpoints)
Definition: ptarray.c:1444
void * lwalloc(size_t size)
Definition: lwutil.c:227
Here is the call graph for this function:
Here is the caller graph for this function: