PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ wkt_parser_collection_new()

LWGEOM* wkt_parser_collection_new ( LWGEOM geom)

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

699 {
700  LWCOLLECTION *col;
701  LWGEOM **geoms;
702  static int ngeoms = 1;
703  LWDEBUG(4,"entered");
704 
705  /* Toss error on null geometry input */
706  if( ! geom )
707  {
709  return NULL;
710  }
711 
712  /* Create our geometry array */
713  geoms = lwalloc(sizeof(LWGEOM*) * ngeoms);
714  geoms[0] = geom;
715 
716  /* Make a new collection */
717  col = lwcollection_construct(COLLECTIONTYPE, SRID_UNKNOWN, NULL, ngeoms, geoms);
718 
719  /* Return the result. */
720  return lwcollection_as_lwgeom(col);
721 }
LWCOLLECTION * lwcollection_construct(uint8_t type, int srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
Definition: lwcollection.c:43
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:188
#define SET_PARSER_ERROR(errno)
Definition: lwin_wkt.c:52
void * lwalloc(size_t size)
Definition: lwutil.c:229
#define PARSER_ERROR_OTHER
Definition: liblwgeom.h:2045
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
Definition: lwgeom.c:268
Here is the call graph for this function:
Here is the caller graph for this function: