PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ptarray_close2d()

static POINTARRAY * ptarray_close2d ( POINTARRAY ring)
static

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

127{
128 POINTARRAY* newring;
129
130 /* close the ring if not already closed (2d only) */
131 if (!ptarray_is_closed_2d(ring))
132 {
133 /* close it up */
134 newring = ptarray_addPoint(ring, getPoint_internal(ring, 0), FLAGS_NDIMS(ring->flags), ring->npoints);
135 ring = newring;
136 }
137 return ring;
138}
#define FLAGS_NDIMS(flags)
Definition liblwgeom.h:179
POINTARRAY * ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where)
Add a point in a pointarray.
Definition ptarray.c:530
int ptarray_is_closed_2d(const POINTARRAY *pa)
Definition ptarray.c:710
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
Definition lwinline.h:75
lwflags_t flags
Definition liblwgeom.h:431
uint32_t npoints
Definition liblwgeom.h:427

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: