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

◆ lwline_chaikin()

static LWLINE * lwline_chaikin ( const LWLINE iline,
int  n_iterations 
)
static

Definition at line 101 of file lwchaikins.c.

102{
103 POINTARRAY *pa, *pa_new;
104 int j;
105 LWLINE *oline;
106
107 if( lwline_is_empty(iline))
108 return lwline_clone(iline);
109
110 pa = iline->points;
111 for (j=0;j<n_iterations;j++)
112 {
113 pa_new = ptarray_chaikin(pa,1,LW_FALSE);
114 if(j>0)
115 ptarray_free(pa);
116 pa=pa_new;
117 }
118 oline = lwline_construct(iline->srid, NULL, pa);
119
120 oline->type = iline->type;
121 return oline;
122
123}
#define LW_FALSE
Definition liblwgeom.h:94
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
Definition lwline.c:42
void ptarray_free(POINTARRAY *pa)
Definition ptarray.c:327
int lwline_is_empty(const LWLINE *line)
LWLINE * lwline_clone(const LWLINE *lwgeom)
Definition lwline.c:93
static POINTARRAY * ptarray_chaikin(POINTARRAY *inpts, int preserve_endpoint, int isclosed)
Definition lwchaikins.c:31
POINTARRAY * points
Definition liblwgeom.h:483
uint8_t type
Definition liblwgeom.h:486
int32_t srid
Definition liblwgeom.h:484

References LW_FALSE, lwline_clone(), lwline_construct(), lwline_is_empty(), LWLINE::points, ptarray_chaikin(), ptarray_free(), LWLINE::srid, and LWLINE::type.

Referenced by lwgeom_chaikin().

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