PostGIS  2.2.7dev-r@@SVN_REVISION@@
LWGEOM* wkt_parser_compound_add_geom ( LWGEOM col,
LWGEOM geom 
)

Definition at line 745 of file lwin_wkt.c.

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.

Referenced by yyparse().

746 {
747  LWDEBUG(4,"entered");
748 
749  /* Toss error on null geometry input */
750  if( ! (geom && col) )
751  {
753  return NULL;
754  }
755 
756  /* All the elements must agree on dimensionality */
757  if( FLAGS_NDIMS(col->flags) != FLAGS_NDIMS(geom->flags) )
758  {
759  lwgeom_free(col);
760  lwgeom_free(geom);
762  return NULL;
763  }
764 
765  if( LW_FAILURE == lwcompound_add_lwgeom((LWCOMPOUND*)col, geom) )
766  {
767  lwgeom_free(col);
768  lwgeom_free(geom);
770  return NULL;
771  }
772 
773  return col;
774 }
#define PARSER_ERROR_INCONTINUOUS
Definition: liblwgeom.h:1898
uint8_t flags
Definition: liblwgeom.h:381
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
#define PARSER_ERROR_MIXDIMS
Definition: liblwgeom.h:1895
#define LW_FAILURE
Definition: liblwgeom.h:64
#define SET_PARSER_ERROR(errno)
Definition: lwin_wkt.c:38
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:136
#define PARSER_ERROR_OTHER
Definition: liblwgeom.h:1901
int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom)
Add a component, allocating extra space if necessary.
Definition: lwcompound.c:75

Here is the call graph for this function:

Here is the caller graph for this function: