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

◆ wkt_parser_compound_add_geom()

LWGEOM * wkt_parser_compound_add_geom ( LWGEOM col,
LWGEOM geom 
)

Definition at line 759 of file lwin_wkt.c.

760{
761 LWDEBUG(4,"entered");
762
763 /* Toss error on null geometry input */
764 if( ! (geom && col) )
765 {
767 return NULL;
768 }
769
770 /* All the elements must agree on dimensionality */
771 if( FLAGS_NDIMS(col->flags) != FLAGS_NDIMS(geom->flags) )
772 {
773 lwgeom_free(col);
774 lwgeom_free(geom);
776 return NULL;
777 }
778
779 if( LW_FAILURE == lwcompound_add_lwgeom((LWCOMPOUND*)col, geom) )
780 {
781 lwgeom_free(col);
782 lwgeom_free(geom);
784 return NULL;
785 }
786
787 return col;
788}
#define PARSER_ERROR_MIXDIMS
Definition liblwgeom.h:2086
#define LW_FAILURE
Definition liblwgeom.h:110
void lwgeom_free(LWGEOM *geom)
Definition lwgeom.c:1138
#define PARSER_ERROR_INCONTINUOUS
Definition liblwgeom.h:2089
#define PARSER_ERROR_OTHER
Definition liblwgeom.h:2092
#define FLAGS_NDIMS(flags)
Definition liblwgeom.h:193
int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom)
Add a component, allocating extra space if necessary.
Definition lwcompound.c:88
#define LWDEBUG(level, msg)
Definition lwgeom_log.h:83
#define SET_PARSER_ERROR(errno)
Definition lwin_wkt.c:52
lwflags_t flags
Definition liblwgeom.h:447

References LWGEOM::flags, FLAGS_NDIMS, LW_FAILURE, lwcompound_add_lwgeom(), LWDEBUG, lwgeom_free(), PARSER_ERROR_INCONTINUOUS, PARSER_ERROR_MIXDIMS, PARSER_ERROR_OTHER, and SET_PARSER_ERROR.

Here is the call graph for this function: