PostGIS  2.5.7dev-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.

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 }
static POINTARRAY * ptarray_set_effective_area(POINTARRAY *inpts, int avoid_collaps, int set_area, double trshld)
LWLINE * lwline_construct_empty(int srid, char hasz, char hasm)
Definition: lwline.c:64
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
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
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
uint8_t flags
Definition: liblwgeom.h:422
POINTARRAY * points
Definition: liblwgeom.h:425
uint8_t type
Definition: liblwgeom.h:421
int32_t srid
Definition: liblwgeom.h:424
uint32_t npoints
Definition: liblwgeom.h:374

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().

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