PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ ptarray_close2d()

POINTARRAY * ptarray_close2d ( POINTARRAY ring)

Definition at line 175 of file liblwgeom/lwgeom_geos_clean.c.

176 {
177  POINTARRAY* newring;
178 
179  /* close the ring if not already closed (2d only) */
180  if (!ptarray_is_closed_2d(ring))
181  {
182  /* close it up */
183  newring = ptarray_addPoint(ring, getPoint_internal(ring, 0), FLAGS_NDIMS(ring->flags), ring->npoints);
184  ring = newring;
185  }
186  return ring;
187 }
uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
Definition: ptarray.c:1750
POINTARRAY * ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where)
Add a point in a pointarray.
Definition: ptarray.c:503
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:152
int ptarray_is_closed_2d(const POINTARRAY *pa)
Definition: ptarray.c:695
uint32_t npoints
Definition: liblwgeom.h:374
uint8_t flags
Definition: liblwgeom.h:372

References POINTARRAY::flags, FLAGS_NDIMS, getPoint_internal(), POINTARRAY::npoints, ptarray_addPoint(), and ptarray_is_closed_2d().

Referenced by ring_make_geos_friendly().

Here is the call graph for this function:
Here is the caller graph for this function: