PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwcollection_construct_empty()

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

Definition at line 94 of file lwcollection.c.

95 {
96  LWCOLLECTION *ret;
97  if( ! lwtype_is_collection(type) )
98  lwerror("Non-collection type specified in collection constructor!");
99 
100  ret = lwalloc(sizeof(LWCOLLECTION));
101  ret->type = type;
102  ret->flags = gflags(hasz,hasm,0);
103  ret->srid = srid;
104  ret->ngeoms = 0;
105  ret->maxgeoms = 1; /* Allocate room for sub-members, just in case. */
106  ret->geoms = lwalloc(ret->maxgeoms * sizeof(LWGEOM*));
107  ret->bbox = NULL;
108 
109  return ret;
110 }
uint8_t gflags(int hasz, int hasm, int geodetic)
Construct a new flags char.
Definition: g_util.c:145
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
Definition: lwgeom.c:1093
void * lwalloc(size_t size)
Definition: lwutil.c:229
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
type
Definition: ovdump.py:41
uint32_t ngeoms
Definition: liblwgeom.h:510
uint32_t maxgeoms
Definition: liblwgeom.h:511
uint8_t type
Definition: liblwgeom.h:506
GBOX * bbox
Definition: liblwgeom.h:508
uint8_t flags
Definition: liblwgeom.h:507
LWGEOM ** geoms
Definition: liblwgeom.h:512
int32_t srid
Definition: liblwgeom.h:509

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

Referenced by geography_centroid(), lw_dist2d_distanceline(), lw_dist2d_distancepoint(), lw_dist3d_distanceline(), lw_dist3d_distancepoint(), lwcollection_build_buffer(), lwcollection_chaikin(), 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_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_split_by_line(), 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: