PostGIS  2.2.7dev-r@@SVN_REVISION@@
int lwgeom_is_simple ( const LWGEOM lwgeom)

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

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

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

1362 {
1363  GEOSGeometry* geos_in;
1364  int simple;
1365 
1366  /* Empty is always simple */
1367  if ( lwgeom_is_empty(geom) )
1368  {
1369  return 1;
1370  }
1371 
1372  initGEOS(lwnotice, lwgeom_geos_error);
1373 
1374  geos_in = LWGEOM2GEOS(geom, 0);
1375  if ( 0 == geos_in ) /* exception thrown at construction */
1376  {
1377  lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
1378  return -1;
1379  }
1380  simple = GEOSisSimple(geos_in);
1381  GEOSGeom_destroy(geos_in);
1382 
1383  if ( simple == 2 ) /* exception thrown */
1384  {
1385  lwerror("lwgeom_is_simple: %s", lwgeom_geos_errmsg);
1386  return -1;
1387  }
1388 
1389  return simple ? 1 : 0;
1390 }
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:61
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
void lwgeom_geos_error(const char *fmt,...)
GEOSGeometry * LWGEOM2GEOS(const LWGEOM *lwgeom, int 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:1297
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74

Here is the call graph for this function:

Here is the caller graph for this function: