PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ 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:77
void ptarray_free(POINTARRAY *pa)
Definition: ptarray.c:328
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
Definition: lwline.c:42
LWLINE * lwline_clone(const LWLINE *lwgeom)
Definition: lwline.c:102
int lwline_is_empty(const LWLINE *line)
Definition: lwline.c:511
static POINTARRAY * ptarray_chaikin(POINTARRAY *inpts, int preserve_endpoint, int isclosed)
Definition: lwchaikins.c:31
POINTARRAY * points
Definition: liblwgeom.h:425
uint8_t type
Definition: liblwgeom.h:421
int32_t srid
Definition: liblwgeom.h:424

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: