PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ wkt_parser_collection_new()

LWGEOM * wkt_parser_collection_new ( LWGEOM geom)

Definition at line 698 of file lwin_wkt.c.

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, int32_t srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
#define COLLECTIONTYPE
Definition liblwgeom.h:108
#define PARSER_ERROR_OTHER
Definition liblwgeom.h:2181
void * lwalloc(size_t size)
Definition lwutil.c:227
#define SRID_UNKNOWN
Unknown SRID value.
Definition liblwgeom.h:215
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
Definition lwgeom.c:337
#define LWDEBUG(level, msg)
Definition lwgeom_log.h:101
#define SET_PARSER_ERROR(errno)
Definition lwin_wkt.c:52

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

Here is the call graph for this function: