PostGIS  2.5.1dev-r@@SVN_REVISION@@

◆ lwgeom_has_arc()

int lwgeom_has_arc ( const LWGEOM geom)

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

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