PostGIS  2.1.10dev-r@@SVN_REVISION@@
LWGEOM* lwpoly_remove_repeated_points ( LWPOLY in)

Definition at line 284 of file lwpoly.c.

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

Referenced by lwgeom_remove_repeated_points().

285 {
286  uint32_t i;
287  POINTARRAY **newrings;
288 
289  newrings = lwalloc(sizeof(POINTARRAY *)*poly->nrings);
290  for (i=0; i<poly->nrings; i++)
291  {
292  newrings[i] = ptarray_remove_repeated_points(poly->rings[i]);
293  }
294 
295  return (LWGEOM*)lwpoly_construct(poly->srid,
296  poly->bbox ? gbox_copy(poly->bbox) : NULL,
297  poly->nrings, newrings);
298 
299 }
GBOX * gbox_copy(const GBOX *box)
Return a copy of the GBOX, based on dimensionality of flags.
Definition: g_box.c:362
LWPOLY * lwpoly_construct(int srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
Definition: lwpoly.c:29
void * lwalloc(size_t size)
Definition: lwutil.c:175
POINTARRAY * ptarray_remove_repeated_points(POINTARRAY *in)
Definition: ptarray.c:1401

Here is the call graph for this function:

Here is the caller graph for this function: