PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_has_arc()

int lwgeom_has_arc ( const LWGEOM geom)

Definition at line 54 of file lwstroke.c.

References CIRCSTRINGTYPE, COMPOUNDTYPE, CURVEPOLYTYPE, LWCOLLECTION::geoms, LINETYPE, LW_FALSE, LW_TRUE, LWDEBUG, MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, POINTTYPE, POLYGONTYPE, POLYHEDRALSURFACETYPE, TINTYPE, TRIANGLETYPE, and LWGEOM::type.

Referenced by LWGEOM2GEOS(), and LWGEOM_has_arc().

55 {
56  LWCOLLECTION *col;
57  int i;
58 
59  LWDEBUG(2, "lwgeom_has_arc called.");
60 
61  switch (geom->type)
62  {
63  case POINTTYPE:
64  case LINETYPE:
65  case POLYGONTYPE:
66  case TRIANGLETYPE:
67  case MULTIPOINTTYPE:
68  case MULTILINETYPE:
69  case MULTIPOLYGONTYPE:
71  case TINTYPE:
72  return LW_FALSE;
73  case CIRCSTRINGTYPE:
74  case CURVEPOLYTYPE:
75  case COMPOUNDTYPE:
76  return LW_TRUE;
77  /* It's a collection that MAY contain an arc */
78  default:
79  col = (LWCOLLECTION *)geom;
80  for (i=0; i<col->ngeoms; i++)
81  {
82  if (lwgeom_has_arc(col->geoms[i]) == LW_TRUE)
83  return LW_TRUE;
84  }
85  return LW_FALSE;
86  }
87 }
#define LINETYPE
Definition: liblwgeom.h:86
#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 LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
#define TRIANGLETYPE
Definition: liblwgeom.h:98
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:97
#define LW_FALSE
Definition: liblwgeom.h:77
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:76
LWGEOM ** geoms
Definition: liblwgeom.h:509
#define TINTYPE
Definition: liblwgeom.h:99
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
int lwgeom_has_arc(const LWGEOM *geom)
Definition: lwstroke.c:54
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
uint8_t type
Definition: liblwgeom.h:396
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
#define MULTILINETYPE
Definition: liblwgeom.h:89
Here is the caller graph for this function: