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

Definition at line 697 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().

698 {
699  LWDEBUG(4,"entered");
700 
701  /* Toss error on null geometry input */
702  if( ! (geom && col) )
703  {
705  return NULL;
706  }
707 
708  /* All the elements must agree on dimensionality */
709  if( FLAGS_NDIMS(col->flags) != FLAGS_NDIMS(geom->flags) )
710  {
711  lwgeom_free(col);
712  lwgeom_free(geom);
714  return NULL;
715  }
716 
717  if( LW_FAILURE == lwcompound_add_lwgeom((LWCOMPOUND*)col, geom) )
718  {
719  lwgeom_free(col);
720  lwgeom_free(geom);
722  return NULL;
723  }
724 
725  return col;
726 }
#define PARSER_ERROR_INCONTINUOUS
Definition: liblwgeom.h:1735
uint8_t flags
Definition: liblwgeom.h:353
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
#define PARSER_ERROR_MIXDIMS
Definition: liblwgeom.h:1732
#define LW_FAILURE
Definition: liblwgeom.h:54
#define SET_PARSER_ERROR(errno)
Definition: lwin_wkt.c:38
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:118
#define PARSER_ERROR_OTHER
Definition: liblwgeom.h:1738
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: