PostGIS  2.2.7dev-r@@SVN_REVISION@@
static LWLINE* lwline_set_effective_area ( const LWLINE iline,
int  set_area,
double  trshld 
)
static

Definition at line 437 of file effectivearea.c.

References LWLINE::flags, FLAGS_GET_M, FLAGS_GET_Z, LWDEBUG, lwline_clone(), lwline_construct(), lwline_construct_empty(), lwline_is_empty(), POINTARRAY::npoints, LWLINE::points, ptarray_set_effective_area(), LWLINE::srid, and LWLINE::type.

Referenced by lwgeom_set_effective_area().

438 {
439  LWDEBUG(2, "Entered lwline_set_effective_area");
440 
441  /* Skip empty case or too small to simplify */
442  if( lwline_is_empty(iline) || iline->points->npoints<3)
443  return lwline_clone(iline);
444 
445  int set_m;
446  if(set_area)
447  set_m=1;
448  else
449  set_m=FLAGS_GET_M(iline->flags);
450 
451  LWLINE *oline = lwline_construct_empty(iline->srid, FLAGS_GET_Z(iline->flags), set_m);
452 
453 
454 
455  oline = lwline_construct(iline->srid, NULL, ptarray_set_effective_area(iline->points,2,set_area,trshld));
456 
457  oline->type = iline->type;
458  return oline;
459 
460 }
uint8_t type
Definition: liblwgeom.h:402
LWLINE * lwline_construct_empty(int srid, char hasz, char hasm)
Definition: lwline.c:51
LWLINE * lwline_clone(const LWLINE *lwgeom)
Definition: lwline.c:89
int npoints
Definition: liblwgeom.h:355
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
static POINTARRAY * ptarray_set_effective_area(POINTARRAY *inpts, int avoid_collaps, int set_area, double trshld)
int32_t srid
Definition: liblwgeom.h:405
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
Definition: lwline.c:29
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:124
int lwline_is_empty(const LWLINE *line)
Definition: lwline.c:496
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:125
uint8_t flags
Definition: liblwgeom.h:403
POINTARRAY * points
Definition: liblwgeom.h:406

Here is the call graph for this function:

Here is the caller graph for this function: