PostGIS  2.2.7dev-r@@SVN_REVISION@@
LWLINE* lwline_force_dims ( const LWLINE line,
int  hasz,
int  hasm 
)

Definition at line 477 of file lwline.c.

References lwline_construct(), lwline_construct_empty(), lwline_is_empty(), LWLINE::points, ptarray_force_dims(), LWLINE::srid, and LWLINE::type.

Referenced by lwgeom_force_dims().

478 {
479  POINTARRAY *pdims = NULL;
480  LWLINE *lineout;
481 
482  /* Return 2D empty */
483  if( lwline_is_empty(line) )
484  {
485  lineout = lwline_construct_empty(line->srid, hasz, hasm);
486  }
487  else
488  {
489  pdims = ptarray_force_dims(line->points, hasz, hasm);
490  lineout = lwline_construct(line->srid, NULL, pdims);
491  }
492  lineout->type = line->type;
493  return lineout;
494 }
uint8_t type
Definition: liblwgeom.h:402
LWLINE * lwline_construct_empty(int srid, char hasz, char hasm)
Definition: lwline.c:51
int lwline_is_empty(const LWLINE *line)
Definition: lwline.c:496
int32_t srid
Definition: liblwgeom.h:405
POINTARRAY * ptarray_force_dims(const POINTARRAY *pa, int hasz, int hasm)
Definition: ptarray.c:1035
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
Definition: lwline.c:29
POINTARRAY * points
Definition: liblwgeom.h:406

Here is the call graph for this function:

Here is the caller graph for this function: