PostGIS  2.3.7dev-r@@SVN_REVISION@@
LWGEOM* lwpoly_remove_repeated_points ( const LWPOLY poly,
double  tolerance 
)

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

361 {
362  uint32_t i;
363  POINTARRAY **newrings;
364 
365  newrings = lwalloc(sizeof(POINTARRAY *)*poly->nrings);
366  for (i=0; i<poly->nrings; i++)
367  {
368  newrings[i] = ptarray_remove_repeated_points_minpoints(poly->rings[i], tolerance, 4);
369  }
370 
371  return (LWGEOM*)lwpoly_construct(poly->srid,
372  poly->bbox ? gbox_copy(poly->bbox) : NULL,
373  poly->nrings, newrings);
374 
375 }
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:1437
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: