PostGIS  2.5.0dev-r@@SVN_REVISION@@
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  uint32_t 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:85
#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 LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
#define TRIANGLETYPE
Definition: liblwgeom.h:97
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:96
uint32_t ngeoms
Definition: liblwgeom.h:506
unsigned int uint32_t
Definition: uthash.h:78
#define LW_FALSE
Definition: liblwgeom.h:76
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:75
LWGEOM ** geoms
Definition: liblwgeom.h:508
#define TINTYPE
Definition: liblwgeom.h:98
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
int lwgeom_has_arc(const LWGEOM *geom)
Definition: lwstroke.c:54
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:395
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:88

Here is the caller graph for this function: