PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ wkt_parser_compound_add_geom()

LWGEOM* wkt_parser_compound_add_geom ( LWGEOM col,
LWGEOM geom 
)

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

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_INCONTINUOUS
Definition: liblwgeom.h:2042
uint8_t flags
Definition: liblwgeom.h:397
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
#define PARSER_ERROR_MIXDIMS
Definition: liblwgeom.h:2039
#define LW_FAILURE
Definition: liblwgeom.h:79
#define SET_PARSER_ERROR(errno)
Definition: lwin_wkt.c:52
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:152
#define PARSER_ERROR_OTHER
Definition: liblwgeom.h:2045
int lwcompound_add_lwgeom(LWCOMPOUND *comp, LWGEOM *geom)
Add a component, allocating extra space if necessary.
Definition: lwcompound.c:88
Here is the call graph for this function:
Here is the caller graph for this function: