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

Definition at line 729 of file lwin_wkt.c.

References LWGEOM::flags, FLAGS_NDIMS, lwcollection_add_lwgeom(), lwcollection_as_lwgeom(), LWDEBUG, lwgeom_as_lwcollection(), lwgeom_free(), PARSER_ERROR_MIXDIMS, PARSER_ERROR_OTHER, and SET_PARSER_ERROR.

Referenced by yyparse().

730 {
731  LWDEBUG(4,"entered");
732 
733  /* Toss error on null geometry input */
734  if( ! (geom && col) )
735  {
737  return NULL;
738  }
739 
740  /* All the elements must agree on dimensionality */
741  if( FLAGS_NDIMS(col->flags) != FLAGS_NDIMS(geom->flags) )
742  {
743  lwgeom_free(col);
744  lwgeom_free(geom);
746  return NULL;
747  }
748 
750 }
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
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition: lwgeom.c:143
#define SET_PARSER_ERROR(errno)
Definition: lwin_wkt.c:38
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:118
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:174
#define PARSER_ERROR_OTHER
Definition: liblwgeom.h:1738
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
Definition: lwgeom.c:219

Here is the call graph for this function:

Here is the caller graph for this function: