PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ lwgeom_construct_empty()

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

Definition at line 2085 of file lwgeom.c.

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, and TRIANGLETYPE.

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

2086 {
2087  switch(type)
2088  {
2089  case POINTTYPE:
2090  return lwpoint_as_lwgeom(lwpoint_construct_empty(srid, hasz, hasm));
2091  case LINETYPE:
2092  return lwline_as_lwgeom(lwline_construct_empty(srid, hasz, hasm));
2093  case POLYGONTYPE:
2094  return lwpoly_as_lwgeom(lwpoly_construct_empty(srid, hasz, hasm));
2095  case CURVEPOLYTYPE:
2096  return lwcurvepoly_as_lwgeom(lwcurvepoly_construct_empty(srid, hasz, hasm));
2097  case CIRCSTRINGTYPE:
2098  return lwcircstring_as_lwgeom(lwcircstring_construct_empty(srid, hasz, hasm));
2099  case TRIANGLETYPE:
2100  return lwtriangle_as_lwgeom(lwtriangle_construct_empty(srid, hasz, hasm));
2101  case COMPOUNDTYPE:
2102  case MULTIPOINTTYPE:
2103  case MULTILINETYPE:
2104  case MULTIPOLYGONTYPE:
2105  case COLLECTIONTYPE:
2106  return lwcollection_as_lwgeom(lwcollection_construct_empty(type, srid, hasz, hasm));
2107  default:
2108  lwerror("lwgeom_construct_empty: unsupported geometry type: %s",
2109  lwtype_name(type));
2110  return NULL;
2111  }
2112 }
#define LINETYPE
Definition: liblwgeom.h:86
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
Definition: lwgeom.c:320
LWLINE * lwline_construct_empty(int srid, char hasz, char hasm)
Definition: lwline.c:64
LWTRIANGLE * lwtriangle_construct_empty(int srid, char hasz, char hasm)
Definition: lwtriangle.c:58
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define TRIANGLETYPE
Definition: liblwgeom.h:98
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
Definition: lwgeom.c:335
LWPOINT * lwpoint_construct_empty(int srid, char hasz, char hasm)
Definition: lwpoint.c:151
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
LWCIRCSTRING * lwcircstring_construct_empty(int srid, char hasz, char hasm)
Definition: lwcircstring.c:79
LWGEOM * lwcurvepoly_as_lwgeom(const LWCURVEPOLY *obj)
Definition: lwgeom.c:310
LWCURVEPOLY * lwcurvepoly_construct_empty(int srid, char hasz, char hasm)
Definition: lwcurvepoly.c:36
LWGEOM * lwcircstring_as_lwgeom(const LWCIRCSTRING *obj)
Definition: lwgeom.c:305
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
Definition: lwgeom.c:300
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
LWPOLY * lwpoly_construct_empty(int srid, char hasz, char hasm)
Definition: lwpoly.c:161
type
Definition: ovdump.py:41
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:330
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
LWGEOM * lwtriangle_as_lwgeom(const LWTRIANGLE *obj)
Definition: lwgeom.c:325
#define MULTILINETYPE
Definition: liblwgeom.h:89
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:94
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
Here is the call graph for this function:
Here is the caller graph for this function: