PostGIS  2.1.10dev-r@@SVN_REVISION@@
LWGEOM* wkt_parser_collection_new ( LWGEOM geom)

Definition at line 671 of file lwin_wkt.c.

References COLLECTIONTYPE, lwalloc(), lwcollection_as_lwgeom(), lwcollection_construct(), LWDEBUG, PARSER_ERROR_OTHER, SET_PARSER_ERROR, and SRID_UNKNOWN.

Referenced by yyparse().

672 {
673  LWCOLLECTION *col;
674  LWGEOM **geoms;
675  static int ngeoms = 1;
676  LWDEBUG(4,"entered");
677 
678  /* Toss error on null geometry input */
679  if( ! geom )
680  {
682  return NULL;
683  }
684 
685  /* Create our geometry array */
686  geoms = lwalloc(sizeof(LWGEOM*) * ngeoms);
687  geoms[0] = geom;
688 
689  /* Make a new collection */
690  col = lwcollection_construct(COLLECTIONTYPE, SRID_UNKNOWN, NULL, ngeoms, geoms);
691 
692  /* Return the result. */
693  return lwcollection_as_lwgeom(col);
694 }
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
Definition: lwcollection.c:30
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
LWGEOM * geom
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:154
#define SET_PARSER_ERROR(errno)
Definition: lwin_wkt.c:38
void * lwalloc(size_t size)
Definition: lwutil.c:175
#define PARSER_ERROR_OTHER
Definition: liblwgeom.h:1738
#define COLLECTIONTYPE
Definition: liblwgeom.h:66
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: