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

◆ lwcollection_build_buffer()

static void lwcollection_build_buffer ( const LWCOLLECTION col,
HomogenizeBuffer buffer 
)
static

Definition at line 76 of file lwhomogenize.c.

77{
78 uint32_t i;
79
80 if (!col || lwcollection_is_empty(col))
81 return;
82
83 for (i = 0; i < col->ngeoms; i++)
84 {
85 LWGEOM *geom = col->geoms[i];
86 switch (geom->type)
87 {
88 case POINTTYPE:
89 case LINETYPE:
90 case CIRCSTRINGTYPE:
91 case COMPOUNDTYPE:
92 case TRIANGLETYPE:
93 case CURVEPOLYTYPE:
94 case POLYGONTYPE:
95 /* Init if necessary */
96 if (!buffer->buf[geom->type])
97 {
100 bufcol->type = lwtype_get_collectiontype(geom->type);
101 buffer->buf[geom->type] = bufcol;
102 }
103 /* Add sub-geom to buffer */
105 /* Increment count for this singleton type */
106 buffer->cnt[geom->type]++;
107 break;
108 default:
110 break;
111 }
112 }
113}
uint32_t lwtype_get_collectiontype(uint8_t type)
Given an lwtype number, what homogeneous collection can hold it?
Definition lwgeom.c:1222
#define COLLECTIONTYPE
Definition liblwgeom.h:108
#define COMPOUNDTYPE
Definition liblwgeom.h:110
#define CURVEPOLYTYPE
Definition liblwgeom.h:111
#define LINETYPE
Definition liblwgeom.h:103
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition lwgeom.c:261
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition liblwgeom.h:102
#define FLAGS_GET_Z(flags)
Definition liblwgeom.h:165
#define POLYGONTYPE
Definition liblwgeom.h:104
#define CIRCSTRINGTYPE
Definition liblwgeom.h:109
#define FLAGS_GET_M(flags)
Definition liblwgeom.h:166
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
#define TRIANGLETYPE
Definition liblwgeom.h:115
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
LWGEOM * lwgeom_clone_deep(const LWGEOM *lwgeom)
Deep clone an LWGEOM, everything is copied.
Definition lwgeom.c:557
int lwcollection_is_empty(const LWCOLLECTION *col)
static void lwcollection_build_buffer(const LWCOLLECTION *col, HomogenizeBuffer *buffer)
Datum buffer(PG_FUNCTION_ARGS)
lwflags_t flags
Definition liblwgeom.h:577
uint32_t ngeoms
Definition liblwgeom.h:580
uint8_t type
Definition liblwgeom.h:578
LWGEOM ** geoms
Definition liblwgeom.h:575
int32_t srid
Definition liblwgeom.h:576
uint8_t type
Definition liblwgeom.h:462

References buffer(), CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LWCOLLECTION::flags, FLAGS_GET_M, FLAGS_GET_Z, LWCOLLECTION::geoms, LINETYPE, lwcollection_add_lwgeom(), lwcollection_build_buffer(), lwcollection_construct_empty(), lwcollection_is_empty(), lwgeom_as_lwcollection(), lwgeom_clone_deep(), lwtype_get_collectiontype(), LWCOLLECTION::ngeoms, POINTTYPE, POLYGONTYPE, LWCOLLECTION::srid, TRIANGLETYPE, LWGEOM::type, and LWCOLLECTION::type.

Referenced by lwcollection_build_buffer(), and lwcollection_homogenize().

Here is the call graph for this function:
Here is the caller graph for this function: