PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwcompound_construct_from_lwline()

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

205 {
206  LWCOMPOUND* ogeom = lwcompound_construct_empty(lwline->srid, FLAGS_GET_Z(lwline->flags), FLAGS_GET_M(lwline->flags));
207  lwcompound_add_lwgeom(ogeom, lwgeom_clone((LWGEOM*)lwline));
208  /* ogeom->bbox = lwline->bbox; */
209  return ogeom;
210 }
int32_t srid
Definition: liblwgeom.h:421
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom)
Add a component, allocating extra space if necessary.
Definition: lwcompound.c:88
LWCOMPOUND * lwcompound_construct_empty(int srid, char hasz, char hasm)
Definition: lwcompound.c:123
LWGEOM * lwgeom_clone(const LWGEOM *lwgeom)
Clone LWGEOM object.
Definition: lwgeom.c:444
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
uint8_t flags
Definition: liblwgeom.h:419
Here is the call graph for this function:
Here is the caller graph for this function: