PostGIS  3.2.2dev-r@@SVN_REVISION@@

◆ lwgeom_is_simple()

int lwgeom_is_simple ( const LWGEOM geom)

Definition at line 1411 of file liblwgeom/lwgeom_geos.c.

1412 {
1413  GEOSGeometry* g;
1414  int simple;
1415 
1416  /* Empty is always simple */
1417  if (lwgeom_is_empty(geom)) return LW_TRUE;
1418 
1419  initGEOS(lwnotice, lwgeom_geos_error);
1420 
1421  if (!(g = LWGEOM2GEOS(geom, AUTOFIX))) return -1;
1422 
1423  simple = GEOSisSimple(g);
1424  GEOSGeom_destroy(g);
1425 
1426  if (simple == 2) /* exception thrown */
1427  {
1428  lwerror("lwgeom_is_simple: %s", lwgeom_geos_errmsg);
1429  return -1;
1430  }
1431 
1432  return simple ? LW_TRUE : LW_FALSE;
1433 }
#define AUTOFIX
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, uint8_t autofix)
void lwgeom_geos_error(const char *fmt,...)
#define LW_FALSE
Definition: liblwgeom.h:108
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:107
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:177
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
Definition: lwinline.h:203

References AUTOFIX, LW_FALSE, LW_TRUE, lwerror(), LWGEOM2GEOS(), lwgeom_geos_errmsg, lwgeom_geos_error(), lwgeom_is_empty(), and lwnotice().

Referenced by _lwt_AddEdge(), issimple(), lwt_AddIsoEdge(), and lwt_ChangeEdgeGeom().

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