PostGIS  3.2.2dev-r@@SVN_REVISION@@

◆ lwgeom_construct_empty()

LWGEOM* lwgeom_construct_empty ( uint8_t  type,
int32_t  srid,
char  hasz,
char  hasm 
)

Definition at line 2111 of file lwgeom.c.

2112 {
2113  switch(type)
2114  {
2115  case POINTTYPE:
2116  return lwpoint_as_lwgeom(lwpoint_construct_empty(srid, hasz, hasm));
2117  case LINETYPE:
2118  return lwline_as_lwgeom(lwline_construct_empty(srid, hasz, hasm));
2119  case POLYGONTYPE:
2120  return lwpoly_as_lwgeom(lwpoly_construct_empty(srid, hasz, hasm));
2121  case CURVEPOLYTYPE:
2122  return lwcurvepoly_as_lwgeom(lwcurvepoly_construct_empty(srid, hasz, hasm));
2123  case CIRCSTRINGTYPE:
2124  return lwcircstring_as_lwgeom(lwcircstring_construct_empty(srid, hasz, hasm));
2125  case TRIANGLETYPE:
2126  return lwtriangle_as_lwgeom(lwtriangle_construct_empty(srid, hasz, hasm));
2127  case COMPOUNDTYPE:
2128  case MULTIPOINTTYPE:
2129  case MULTILINETYPE:
2130  case MULTIPOLYGONTYPE:
2131  case COLLECTIONTYPE:
2132  return lwcollection_as_lwgeom(lwcollection_construct_empty(type, srid, hasz, hasm));
2133  default:
2134  lwerror("lwgeom_construct_empty: unsupported geometry type: %s",
2135  lwtype_name(type));
2136  return NULL;
2137  }
2138 }
LWPOINT * lwpoint_construct_empty(int32_t srid, char hasz, char hasm)
Definition: lwpoint.c:151
#define COLLECTIONTYPE
Definition: liblwgeom.h:122
#define COMPOUNDTYPE
Definition: liblwgeom.h:124
#define CURVEPOLYTYPE
Definition: liblwgeom.h:125
#define MULTILINETYPE
Definition: liblwgeom.h:120
#define LINETYPE
Definition: liblwgeom.h:117
#define MULTIPOINTTYPE
Definition: liblwgeom.h:119
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:116
LWTRIANGLE * lwtriangle_construct_empty(int32_t srid, char hasz, char hasm)
Definition: lwtriangle.c:58
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:121
#define POLYGONTYPE
Definition: liblwgeom.h:118
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:123
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
Definition: lwcollection.c:92
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:216
#define TRIANGLETYPE
Definition: liblwgeom.h:129
LWCURVEPOLY * lwcurvepoly_construct_empty(int32_t srid, char hasz, char hasm)
Definition: lwcurvepoly.c:35
LWPOLY * lwpoly_construct_empty(int32_t srid, char hasz, char hasm)
Definition: lwpoly.c:161
LWCIRCSTRING * lwcircstring_construct_empty(int32_t srid, char hasz, char hasm)
Definition: lwcircstring.c:79
LWLINE * lwline_construct_empty(int32_t srid, char hasz, char hasm)
Definition: lwline.c:55
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:322
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
Definition: lwgeom.c:292
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
Definition: lwgeom.c:312
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
Definition: lwgeom.c:327
LWGEOM * lwcurvepoly_as_lwgeom(const LWCURVEPOLY *obj)
Definition: lwgeom.c:302
LWGEOM * lwcircstring_as_lwgeom(const LWCIRCSTRING *obj)
Definition: lwgeom.c:297
LWGEOM * lwtriangle_as_lwgeom(const LWTRIANGLE *obj)
Definition: lwgeom.c:317
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
type
Definition: ovdump.py:42

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LINETYPE, lwcircstring_as_lwgeom(), lwcircstring_construct_empty(), lwcollection_as_lwgeom(), lwcollection_construct_empty(), lwcurvepoly_as_lwgeom(), lwcurvepoly_construct_empty(), lwerror(), lwline_as_lwgeom(), lwline_construct_empty(), lwpoint_as_lwgeom(), lwpoint_construct_empty(), lwpoly_as_lwgeom(), lwpoly_construct_empty(), lwtriangle_as_lwgeom(), lwtriangle_construct_empty(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, POINTTYPE, POLYGONTYPE, TRIANGLETYPE, and ovdump::type.

Referenced by lwgeom_boundary(), pgis_geometry_union_finalfn(), pgis_union_geometry_array(), ST_BoundingDiagonal(), ST_ClipByBox2d(), and ST_CollectionExtract().

Here is the call graph for this function:
Here is the caller graph for this function: