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

Definition at line 714 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().

715 {
716  switch(geom->type)
717  {
718  case POINTTYPE:
719  return lwpoint_as_lwgeom(lwpoint_force_dims((LWPOINT*)geom, hasz, hasm));
720  case CIRCSTRINGTYPE:
721  case LINETYPE:
722  case TRIANGLETYPE:
723  return lwline_as_lwgeom(lwline_force_dims((LWLINE*)geom, hasz, hasm));
724  case POLYGONTYPE:
725  return lwpoly_as_lwgeom(lwpoly_force_dims((LWPOLY*)geom, hasz, hasm));
726  case COMPOUNDTYPE:
727  case CURVEPOLYTYPE:
728  case MULTICURVETYPE:
729  case MULTISURFACETYPE:
730  case MULTIPOINTTYPE:
731  case MULTILINETYPE:
732  case MULTIPOLYGONTYPE:
734  case TINTYPE:
735  case COLLECTIONTYPE:
736  return lwcollection_as_lwgeom(lwcollection_force_dims((LWCOLLECTION*)geom, hasz, hasm));
737  default:
738  lwerror("lwgeom_force_2d: unsupported geom type: %s", lwtype_name(geom->type));
739  return NULL;
740  }
741 }
#define LINETYPE
Definition: liblwgeom.h:71
LWPOINT * lwpoint_force_dims(const LWPOINT *lwpoint, int hasz, int hasm)
Definition: lwpoint.c:240
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
Definition: lwgeom.c:239
#define MULTICURVETYPE
Definition: liblwgeom.h:80
#define POLYGONTYPE
Definition: liblwgeom.h:72
#define CURVEPOLYTYPE
Definition: liblwgeom.h:79
#define COMPOUNDTYPE
Definition: liblwgeom.h:78
#define MULTIPOINTTYPE
Definition: liblwgeom.h:73
#define TRIANGLETYPE
Definition: liblwgeom.h:83
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:82
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
Definition: lwgeom.c:254
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:188
LWPOLY * lwpoly_force_dims(const LWPOLY *lwpoly, int hasz, int hasm)
Definition: lwpoly.c:308
#define TINTYPE
Definition: liblwgeom.h:84
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
Definition: lwgeom.c:219
LWCOLLECTION * lwcollection_force_dims(const LWCOLLECTION *lwcol, int hasz, int hasm)
Definition: lwcollection.c:458
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:75
LWLINE * lwline_force_dims(const LWLINE *lwline, int hasz, int hasm)
Definition: lwline.c:477
#define MULTISURFACETYPE
Definition: liblwgeom.h:81
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:70
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:249
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77
#define MULTILINETYPE
Definition: liblwgeom.h:74
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
#define COLLECTIONTYPE
Definition: liblwgeom.h:76

Here is the call graph for this function:

Here is the caller graph for this function: