PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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)
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:165
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
Definition lwline.c:42
#define FLAGS_GET_M(flags)
Definition liblwgeom.h:166
LWLINE * lwline_construct_empty(int32_t srid, char hasz, char hasm)
Definition lwline.c:55
int lwline_is_empty(const LWLINE *line)
LWLINE * lwline_clone(const LWLINE *lwgeom)
Definition lwline.c:93
#define LWDEBUG(level, msg)
Definition lwgeom_log.h:101
lwflags_t flags
Definition liblwgeom.h:485
POINTARRAY * points
Definition liblwgeom.h:483
uint8_t type
Definition liblwgeom.h:486
int32_t srid
Definition liblwgeom.h:484
uint32_t npoints
Definition liblwgeom.h:427

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: