PostGIS  2.1.10dev-r@@SVN_REVISION@@
LWGEOM* lwgeom_construct_empty ( uint8_t  type,
int  srid,
char  hasz,
char  hasm 
)

Definition at line 1662 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(), and ST_CollectionExtract().

1663 {
1664  switch(type)
1665  {
1666  case POINTTYPE:
1667  return lwpoint_as_lwgeom(lwpoint_construct_empty(srid, hasz, hasm));
1668  case LINETYPE:
1669  return lwline_as_lwgeom(lwline_construct_empty(srid, hasz, hasm));
1670  case POLYGONTYPE:
1671  return lwpoly_as_lwgeom(lwpoly_construct_empty(srid, hasz, hasm));
1672  case CURVEPOLYTYPE:
1673  return lwcurvepoly_as_lwgeom(lwcurvepoly_construct_empty(srid, hasz, hasm));
1674  case CIRCSTRINGTYPE:
1675  return lwcircstring_as_lwgeom(lwcircstring_construct_empty(srid, hasz, hasm));
1676  case TRIANGLETYPE:
1677  return lwtriangle_as_lwgeom(lwtriangle_construct_empty(srid, hasz, hasm));
1678  case COMPOUNDTYPE:
1679  case MULTIPOINTTYPE:
1680  case MULTILINETYPE:
1681  case MULTIPOLYGONTYPE:
1682  case COLLECTIONTYPE:
1683  return lwcollection_as_lwgeom(lwcollection_construct_empty(type, srid, hasz, hasm));
1684  default:
1685  lwerror("lwgeom_construct_empty: unsupported geometry type: %s",
1686  lwtype_name(type));
1687  return NULL;
1688  }
1689 }
#define LINETYPE
Definition: liblwgeom.h:61
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
Definition: lwgeom.c:239
LWLINE * lwline_construct_empty(int srid, char hasz, char hasm)
Definition: lwline.c:51
LWTRIANGLE * lwtriangle_construct_empty(int srid, char hasz, char hasm)
Definition: lwtriangle.c:45
#define POLYGONTYPE
Definition: liblwgeom.h:62
#define CURVEPOLYTYPE
Definition: liblwgeom.h:69
#define COMPOUNDTYPE
Definition: liblwgeom.h:68
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
#define TRIANGLETYPE
Definition: liblwgeom.h:73
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
Definition: lwgeom.c:254
LWPOINT * lwpoint_construct_empty(int srid, char hasz, char hasm)
Definition: lwpoint.c:118
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:164
LWCIRCSTRING * lwcircstring_construct_empty(int srid, char hasz, char hasm)
Definition: lwcircstring.c:67
LWGEOM * lwcurvepoly_as_lwgeom(const LWCURVEPOLY *obj)
Definition: lwgeom.c:229
LWCURVEPOLY * lwcurvepoly_construct_empty(int srid, char hasz, char hasm)
Definition: lwcurvepoly.c:23
LWGEOM * lwcircstring_as_lwgeom(const LWCIRCSTRING *obj)
Definition: lwgeom.c:224
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
Definition: lwgeom.c:219
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:65
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:60
LWPOLY * lwpoly_construct_empty(int srid, char hasz, char hasm)
Definition: lwpoly.c:66
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:249
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:67
LWGEOM * lwtriangle_as_lwgeom(const LWTRIANGLE *obj)
Definition: lwgeom.c:244
#define MULTILINETYPE
Definition: liblwgeom.h:64
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:81
#define COLLECTIONTYPE
Definition: liblwgeom.h:66

Here is the call graph for this function:

Here is the caller graph for this function: