PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ lwgeom_is_simple()

int lwgeom_is_simple ( const LWGEOM lwgeom)

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

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().

1272 {
1273  GEOSGeometry* g;
1274  int simple;
1275 
1276  /* Empty is always simple */
1277  if (lwgeom_is_empty(geom)) return LW_TRUE;
1278 
1279  initGEOS(lwnotice, lwgeom_geos_error);
1280 
1281  if (!(g = LWGEOM2GEOS(geom, AUTOFIX))) return -1;
1282 
1283  simple = GEOSisSimple(g);
1284  GEOSGeom_destroy(g);
1285 
1286  if (simple == 2) /* exception thrown */
1287  {
1288  lwerror("lwgeom_is_simple: %s", lwgeom_geos_errmsg);
1289  return -1;
1290  }
1291 
1292  return simple ? LW_TRUE : LW_FALSE;
1293 }
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:177
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
#define AUTOFIX
void lwgeom_geos_error(const char *fmt,...)
#define LW_FALSE
Definition: liblwgeom.h:76
#define LW_TRUE
Return types for functions with status returns.
Definition: liblwgeom.h:75
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, uint8_t autofix)
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
Definition: lwgeom.c:1393
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
Here is the call graph for this function:
Here is the caller graph for this function: