PostGIS  2.1.10dev-r@@SVN_REVISION@@
POINTARRAY * ptarray_close2d ( POINTARRAY ring)

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

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

Referenced by ring_make_geos_friendly().

188 {
189  POINTARRAY* newring;
190 
191  /* close the ring if not already closed (2d only) */
192  if ( ! ptarray_is_closed_2d(ring) )
193  {
194  /* close it up */
195  newring = ptarray_addPoint(ring,
196  getPoint_internal(ring, 0),
197  FLAGS_NDIMS(ring->flags),
198  ring->npoints);
199  ring = newring;
200  }
201  return ring;
202 }
int npoints
Definition: liblwgeom.h:327
int ptarray_is_closed_2d(const POINTARRAY *pa)
Definition: ptarray.c:672
POINTARRAY * ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where)
Add a point in a pointarray.
Definition: ptarray.c:481
uint8_t flags
Definition: liblwgeom.h:325
uint8_t * getPoint_internal(const POINTARRAY *pa, int n)
Definition: ptarray.c:1645
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:118

Here is the call graph for this function:

Here is the caller graph for this function: