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

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

685 {
686  LWCOLLECTION *col;
687  LWGEOM **geoms;
688  static int ngeoms = 1;
689  LWDEBUG(4,"entered");
690 
691  /* Toss error on null geometry input */
692  if( ! geom )
693  {
695  return NULL;
696  }
697 
698  /* Create our geometry array */
699  geoms = lwalloc(sizeof(LWGEOM*) * ngeoms);
700  geoms[0] = geom;
701 
702  /* Make a new collection */
703  col = lwcollection_construct(COLLECTIONTYPE, SRID_UNKNOWN, NULL, ngeoms, geoms);
704 
705  /* Return the result. */
706  return lwcollection_as_lwgeom(col);
707 }
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
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:172
#define SET_PARSER_ERROR(errno)
Definition: lwin_wkt.c:38
void * lwalloc(size_t size)
Definition: lwutil.c:199
#define PARSER_ERROR_OTHER
Definition: liblwgeom.h:1901
#define COLLECTIONTYPE
Definition: liblwgeom.h:76
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: