PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwline_set_effective_area()

static LWLINE* lwline_set_effective_area ( const LWLINE iline,
int  set_area,
double  trshld 
)
static

Definition at line 451 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().

452 {
453  LWDEBUG(2, "Entered lwline_set_effective_area");
454 
455  /* Skip empty case or too small to simplify */
456  if( lwline_is_empty(iline) || iline->points->npoints<3)
457  return lwline_clone(iline);
458 
459  int set_m;
460  if(set_area)
461  set_m=1;
462  else
463  set_m=FLAGS_GET_M(iline->flags);
464 
465  LWLINE *oline = lwline_construct_empty(iline->srid, FLAGS_GET_Z(iline->flags), set_m);
466 
467 
468 
469  oline = lwline_construct(iline->srid, NULL, ptarray_set_effective_area(iline->points,2,set_area,trshld));
470 
471  oline->type = iline->type;
472  return oline;
473 
474 }
uint8_t type
Definition: liblwgeom.h:418
LWLINE * lwline_construct_empty(int srid, char hasz, char hasm)
Definition: lwline.c:64
LWLINE * lwline_clone(const LWLINE *lwgeom)
Definition: lwline.c:102
int npoints
Definition: liblwgeom.h:371
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
static POINTARRAY * ptarray_set_effective_area(POINTARRAY *inpts, int avoid_collaps, int set_area, double trshld)
int32_t srid
Definition: liblwgeom.h:421
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
Definition: lwline.c:42
#define FLAGS_GET_Z(flags)
Macros for manipulating the &#39;flags&#39; byte.
Definition: liblwgeom.h:140
int lwline_is_empty(const LWLINE *line)
Definition: lwline.c:525
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
uint8_t flags
Definition: liblwgeom.h:419
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: