PostGIS 3.0.6dev-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 if( ! lwtype_is_collection(type) )
96 {
97 lwerror("Non-collection type specified in collection constructor!");
98 return NULL;
99 }
100
101 ret = lwalloc(sizeof(LWCOLLECTION));
102 ret->type = type;
103 ret->flags = lwflags(hasz,hasm,0);
104 ret->srid = srid;
105 ret->ngeoms = 0;
106 ret->maxgeoms = 1; /* Allocate room for sub-members, just in case. */
107 ret->geoms = lwalloc(ret->maxgeoms * sizeof(LWGEOM*));
108 ret->bbox = NULL;
109
110 return ret;
111}
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
Definition lwgeom.c:1087
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:471
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition lwutil.c:190
lwflags_t flags
Definition liblwgeom.h:563
uint32_t ngeoms
Definition liblwgeom.h:566
uint32_t maxgeoms
Definition liblwgeom.h:567
uint8_t type
Definition liblwgeom.h:564
GBOX * bbox
Definition liblwgeom.h:560
LWGEOM ** geoms
Definition liblwgeom.h:561
int32_t srid
Definition liblwgeom.h:562

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_clip_to_ordinate_range(), lwgeom_construct_empty(), lwgeom_filter_m(), lwgeom_homogenize(), LWGEOM_locate_between_m(), lwgeom_node(), lwgeom_segmentize_sphere(), lwgeom_subdivide(), 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(), mvt_iterate_clip_by_box_geos(), 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(), pta_unstroke(), rect_tree_to_lwgeom(), TWKBFromLWGEOMArray(), and wkt_parser_collection_finalize().

Here is the call graph for this function: