PostGIS  2.2.7dev-r@@SVN_REVISION@@
LWCOMPOUND* lwcompound_construct_from_lwline ( const LWLINE lwpoly)

Construct an equivalent compound curve from a linestring.

Compound curves can have linear components, so this works fine

Definition at line 191 of file lwcompound.c.

References LWLINE::flags, FLAGS_GET_M, FLAGS_GET_Z, lwcompound_add_lwgeom(), lwcompound_construct_empty(), lwgeom_clone(), and LWLINE::srid.

Referenced by lwgeom_as_curve().

192 {
193  LWCOMPOUND* ogeom = lwcompound_construct_empty(lwline->srid, FLAGS_GET_Z(lwline->flags), FLAGS_GET_M(lwline->flags));
194  lwcompound_add_lwgeom(ogeom, lwgeom_clone((LWGEOM*)lwline));
195  /* ogeom->bbox = lwline->bbox; */
196  return ogeom;
197 }
int32_t srid
Definition: liblwgeom.h:405
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:124
int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom)
Add a component, allocating extra space if necessary.
Definition: lwcompound.c:75
LWCOMPOUND * lwcompound_construct_empty(int srid, char hasz, char hasm)
Definition: lwcompound.c:110
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:395
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:125
uint8_t flags
Definition: liblwgeom.h:403

Here is the call graph for this function:

Here is the caller graph for this function: