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

◆ lwcollection_construct_empty()

LWCOLLECTION * lwcollection_construct_empty ( uint8_t  type,
int32_t  srid,
char  hasz,
char  hasm 
)
extern

Definition at line 92 of file lwcollection.c.

93{
94 LWCOLLECTION *ret;
95
96 if( ! lwtype_is_collection(type) )
97 {
98 lwerror("Non-collection type specified in collection constructor!");
99 return NULL;
100 }
101
102 ret = lwalloc(sizeof(LWCOLLECTION));
103 ret->type = type;
104 ret->flags = lwflags(hasz,hasm,0);
105 ret->srid = srid;
106 ret->ngeoms = 0;
107 ret->maxgeoms = 1; /* Allocate room for sub-members, just in case. */
108 ret->geoms = lwalloc(ret->maxgeoms * sizeof(LWGEOM*));
109 ret->bbox = NULL;
110
111 return ret;
112}
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
Definition lwgeom.c:1196
void * lwalloc(size_t size)
Definition lwutil.c:227
lwflags_t lwflags(int hasz, int hasm, int geodetic)
Construct a new flags bitmask.
Definition lwutil.c:477
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
lwflags_t flags
Definition liblwgeom.h:577
uint32_t ngeoms
Definition liblwgeom.h:580
uint32_t maxgeoms
Definition liblwgeom.h:581
uint8_t type
Definition liblwgeom.h:578
GBOX * bbox
Definition liblwgeom.h:574
LWGEOM ** geoms
Definition liblwgeom.h:575
int32_t srid
Definition liblwgeom.h:576

References LWCOLLECTION::bbox, LWCOLLECTION::flags, LWCOLLECTION::geoms, lwalloc(), lwerror(), lwflags(), lwtype_is_collection(), LWCOLLECTION::maxgeoms, LWCOLLECTION::ngeoms, LWCOLLECTION::srid, and LWCOLLECTION::type.

Referenced by geography_centroid(), lw_dist2d_distanceline(), lw_dist2d_distancepoint(), lw_dist3d_distanceline(), lw_dist3d_distancepoint(), lwcollection_build_buffer(), lwcollection_chaikin(), lwcollection_clip_to_ordinate_range(), lwcollection_extract(), lwcollection_filterm(), lwcollection_force_dims(), lwcollection_from_twkb_state(), lwcollection_from_wkb_state(), lwcollection_homogenize(), lwcollection_offsetcurve(), lwcollection_set_effective_area(), lwcompound_construct_empty(), lwgeom_as_multi(), lwgeom_boundary(), lwgeom_clip_to_ordinate_range(), lwgeom_construct_empty(), lwgeom_filter_m(), lwgeom_homogenize(), lwgeom_node(), lwgeom_segmentize_sphere(), lwgeom_subdivide_prec(), lwgeom_voronoi_diagram(), lwline_clip_to_ordinate_range(), lwmline_construct_empty(), lwmline_measured_from_lwmline(), lwmpoint_clip_to_ordinate_range(), lwmpoint_construct(), lwmpoint_construct_empty(), lwmpoly_construct_empty(), lwmultiline_from_twkb_state(), lwmultipoint_from_twkb_state(), lwmultipoly_from_twkb_state(), lwpoint_clip_to_ordinate_range(), lwpoly_clip_to_ordinate_range(), lwpoly_split_by_line(), lwtriangle_clip_to_ordinate_range(), parse_geojson_geometrycollection(), parse_geojson_multilinestring(), parse_geojson_multipoint(), parse_geojson_multipolygon(), parse_gml_coll(), parse_gml_mcurve(), parse_gml_mline(), parse_gml_mpoint(), parse_gml_mpoly(), parse_gml_msurface(), parse_gml_psurface(), parse_gml_tin(), parse_kml_multi(), parse_marc21(), pta_unstroke(), rect_tree_to_lwgeom(), TWKBFromLWGEOMArray(), and wkt_parser_collection_finalize().

Here is the call graph for this function: