PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwgeom_force_dims()

LWGEOM* lwgeom_force_dims ( const LWGEOM lwgeom,
int  hasz,
int  hasm 
)

Definition at line 808 of file lwgeom.c.

809 {
810  switch(geom->type)
811  {
812  case POINTTYPE:
813  return lwpoint_as_lwgeom(lwpoint_force_dims((LWPOINT*)geom, hasz, hasm));
814  case CIRCSTRINGTYPE:
815  case LINETYPE:
816  case TRIANGLETYPE:
817  return lwline_as_lwgeom(lwline_force_dims((LWLINE*)geom, hasz, hasm));
818  case POLYGONTYPE:
819  return lwpoly_as_lwgeom(lwpoly_force_dims((LWPOLY*)geom, hasz, hasm));
820  case COMPOUNDTYPE:
821  case CURVEPOLYTYPE:
822  case MULTICURVETYPE:
823  case MULTISURFACETYPE:
824  case MULTIPOINTTYPE:
825  case MULTILINETYPE:
826  case MULTIPOLYGONTYPE:
828  case TINTYPE:
829  case COLLECTIONTYPE:
830  return lwcollection_as_lwgeom(lwcollection_force_dims((LWCOLLECTION*)geom, hasz, hasm));
831  default:
832  lwerror("lwgeom_force_2d: unsupported geom type: %s", lwtype_name(geom->type));
833  return NULL;
834  }
835 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
#define CURVEPOLYTYPE
Definition: liblwgeom.h:94
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define MULTISURFACETYPE
Definition: liblwgeom.h:96
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define TINTYPE
Definition: liblwgeom.h:99
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
#define MULTICURVETYPE
Definition: liblwgeom.h:95
#define TRIANGLETYPE
Definition: liblwgeom.h:98
LWPOINT * lwpoint_force_dims(const LWPOINT *lwpoint, int hasz, int hasm)
Definition: lwpoint.c:271
LWPOLY * lwpoly_force_dims(const LWPOLY *lwpoly, int hasz, int hasm)
Definition: lwpoly.c:394
LWCOLLECTION * lwcollection_force_dims(const LWCOLLECTION *lwcol, int hasz, int hasm)
Definition: lwcollection.c:485
LWLINE * lwline_force_dims(const LWLINE *lwline, int hasz, int hasm)
Definition: lwline.c:492
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:330
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
Definition: lwgeom.c:300
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
Definition: lwgeom.c:320
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
Definition: lwgeom.c:335
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190

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, LWGEOM::type, and LWPOINT::type.

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

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