PostGIS  2.3.7dev-r@@SVN_REVISION@@
LWGEOM* lwgeom_force_dims ( const LWGEOM lwgeom,
int  hasz,
int  hasm 
)

Definition at line 727 of file lwgeom.c.

References CIRCSTRINGTYPE, COLLECTIONTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LINETYPE, lwcollection_as_lwgeom(), lwcollection_force_dims(), lwerror(), lwline_as_lwgeom(), lwline_force_dims(), lwpoint_as_lwgeom(), lwpoint_force_dims(), lwpoly_as_lwgeom(), lwpoly_force_dims(), lwtype_name(), MULTICURVETYPE, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, MULTISURFACETYPE, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, and LWGEOM::type.

Referenced by lwcollection_force_dims(), lwgeom_force_2d(), lwgeom_force_3dm(), lwgeom_force_3dz(), and lwgeom_force_4d().

728 {
729  switch(geom->type)
730  {
731  case POINTTYPE:
732  return lwpoint_as_lwgeom(lwpoint_force_dims((LWPOINT*)geom, hasz, hasm));
733  case CIRCSTRINGTYPE:
734  case LINETYPE:
735  case TRIANGLETYPE:
736  return lwline_as_lwgeom(lwline_force_dims((LWLINE*)geom, hasz, hasm));
737  case POLYGONTYPE:
738  return lwpoly_as_lwgeom(lwpoly_force_dims((LWPOLY*)geom, hasz, hasm));
739  case COMPOUNDTYPE:
740  case CURVEPOLYTYPE:
741  case MULTICURVETYPE:
742  case MULTISURFACETYPE:
743  case MULTIPOINTTYPE:
744  case MULTILINETYPE:
745  case MULTIPOLYGONTYPE:
747  case TINTYPE:
748  case COLLECTIONTYPE:
749  return lwcollection_as_lwgeom(lwcollection_force_dims((LWCOLLECTION*)geom, hasz, hasm));
750  default:
751  lwerror("lwgeom_force_2d: unsupported geom type: %s", lwtype_name(geom->type));
752  return NULL;
753  }
754 }
#define LINETYPE
Definition: liblwgeom.h:85
LWPOINT * lwpoint_force_dims(const LWPOINT *lwpoint, int hasz, int hasm)
Definition: lwpoint.c:253
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
Definition: lwgeom.c:252
#define MULTICURVETYPE
Definition: liblwgeom.h:94
#define POLYGONTYPE
Definition: liblwgeom.h:86
#define CURVEPOLYTYPE
Definition: liblwgeom.h:93
#define COMPOUNDTYPE
Definition: liblwgeom.h:92
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
#define TRIANGLETYPE
Definition: liblwgeom.h:97
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:96
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
Definition: lwgeom.c:267
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:216
LWPOLY * lwpoly_force_dims(const LWPOLY *lwpoly, int hasz, int hasm)
Definition: lwpoly.c:379
#define TINTYPE
Definition: liblwgeom.h:98
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
Definition: lwgeom.c:232
LWCOLLECTION * lwcollection_force_dims(const LWCOLLECTION *lwcol, int hasz, int hasm)
Definition: lwcollection.c:471
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
LWLINE * lwline_force_dims(const LWLINE *lwline, int hasz, int hasm)
Definition: lwline.c:506
#define MULTISURFACETYPE
Definition: liblwgeom.h:95
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:262
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:102
#define COLLECTIONTYPE
Definition: liblwgeom.h:90

Here is the call graph for this function:

Here is the caller graph for this function: