PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ lwgeom_is_simple()

int lwgeom_is_simple ( const LWGEOM geom)

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

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

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

1223 {
1224  GEOSGeometry* g;
1225  int simple;
1226 
1227  /* Empty is always simple */
1228  if (lwgeom_is_empty(geom)) return LW_TRUE;
1229 
1230  initGEOS(lwnotice, lwgeom_geos_error);
1231 
1232  if (!input_lwgeom_to_geos(&g, geom, __func__)) return -1;
1233 
1234  simple = GEOSisSimple(g);
1235  GEOSGeom_destroy(g);
1236 
1237  if (simple == 2) /* exception thrown */
1238  {
1239  lwerror("lwgeom_is_simple: %s", lwgeom_geos_errmsg);
1240  return -1;
1241  }
1242 
1243  return simple ? LW_TRUE : LW_FALSE;
1244 }
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]
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
static uint8_t input_lwgeom_to_geos(GEOSGeometry **g, const LWGEOM *geom, const char *funcname)
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: