PostGIS  2.2.7dev-r@@SVN_REVISION@@
LWCOLLECTION* lwcollection_construct_empty ( uint8_t  type,
int  srid,
char  hasz,
char  hasm 
)

Definition at line 81 of file lwcollection.c.

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

Referenced by 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(), 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().

82 {
83  LWCOLLECTION *ret;
84  if( ! lwtype_is_collection(type) )
85  lwerror("Non-collection type specified in collection constructor!");
86 
87  ret = lwalloc(sizeof(LWCOLLECTION));
88  ret->type = type;
89  ret->flags = gflags(hasz,hasm,0);
90  ret->srid = srid;
91  ret->ngeoms = 0;
92  ret->maxgeoms = 1; /* Allocate room for sub-members, just in case. */
93  ret->geoms = lwalloc(ret->maxgeoms * sizeof(LWGEOM*));
94  ret->bbox = NULL;
95 
96  return ret;
97 }
uint8_t type
Definition: liblwgeom.h:487
GBOX * bbox
Definition: liblwgeom.h:489
uint8_t flags
Definition: liblwgeom.h:488
LWGEOM ** geoms
Definition: liblwgeom.h:493
int lwtype_is_collection(uint8_t type)
Determine whether a type number is a collection or not.
Definition: lwgeom.c:999
int32_t srid
Definition: liblwgeom.h:490
uint8_t gflags(int hasz, int hasm, int geodetic)
Construct a new flags char.
Definition: g_util.c:130
void * lwalloc(size_t size)
Definition: lwutil.c:199
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74

Here is the call graph for this function: