PostGIS  2.1.10dev-r@@SVN_REVISION@@
LWLINE* lwline_simplify ( const LWLINE iline,
double  dist 
)

Definition at line 480 of file lwline.c.

References LWDEBUG, lwline_clone(), lwline_construct(), lwline_is_empty(), LWLINE::points, ptarray_simplify(), LWLINE::srid, and LWLINE::type.

Referenced by lwgeom_simplify().

481 {
482  LWLINE *oline;
483 
484  LWDEBUG(2, "function called");
485 
486  /* Skip empty case */
487  if( lwline_is_empty(iline) )
488  return lwline_clone(iline);
489 
490  static const int minvertices = 0; /* TODO: allow setting this */
491  oline = lwline_construct(iline->srid, NULL, ptarray_simplify(iline->points, dist, minvertices));
492  oline->type = iline->type;
493  return oline;
494 }
uint8_t type
Definition: liblwgeom.h:374
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
int lwline_is_empty(const LWLINE *line)
Definition: lwline.c:464
int32_t srid
Definition: liblwgeom.h:377
LWLINE * lwline_clone(const LWLINE *g)
Definition: lwline.c:89
POINTARRAY * ptarray_simplify(POINTARRAY *inpts, double epsilon, unsigned int minpts)
Definition: ptarray.c:1495
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
Definition: lwline.c:29
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: