PostGIS  2.4.9dev-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.

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

Referenced by geography_centroid(), lw_dist2d_distanceline(), lw_dist2d_distancepoint(), lw_dist3d_distanceline(), lw_dist3d_distancepoint(), lwcollection_build_buffer(), lwcollection_extract(), lwcollection_force_dims(), lwcollection_from_twkb_state(), lwcollection_from_wkb_state(), lwcollection_grid(), lwcollection_homogenize(), lwcollection_set_effective_area(), lwcollection_simplify(), lwcompound_construct_empty(), lwgeom_as_multi(), lwgeom_clip_to_ordinate_range(), lwgeom_construct_empty(), lwgeom_homogenize(), lwgeom_linemerge(), 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(), 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(), TWKBFromLWGEOMArray(), and wkt_parser_collection_finalize().

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 type
Definition: liblwgeom.h:503
GBOX * bbox
Definition: liblwgeom.h:505
uint8_t flags
Definition: liblwgeom.h:504
LWGEOM ** geoms
Definition: liblwgeom.h:509
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
Definition: lwgeom.c:1048
int32_t srid
Definition: liblwgeom.h:506
uint8_t gflags(int hasz, int hasm, int geodetic)
Construct a new flags char.
Definition: g_util.c:145
type
Definition: ovdump.py:41
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
Here is the call graph for this function: