PostGIS  2.5.0dev-r@@SVN_REVISION@@
int lwgeom_is_simple ( const LWGEOM geom)

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

1466 {
1467  GEOSGeometry* geos_in;
1468  int simple;
1469 
1470  /* Empty is always simple */
1471  if ( lwgeom_is_empty(geom) )
1472  {
1473  return 1;
1474  }
1475 
1476  initGEOS(lwnotice, lwgeom_geos_error);
1477 
1478  geos_in = LWGEOM2GEOS(geom, 0);
1479  if ( 0 == geos_in ) /* exception thrown at construction */
1480  {
1481  lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
1482  return -1;
1483  }
1484  simple = GEOSisSimple(geos_in);
1485  GEOSGeom_destroy(geos_in);
1486 
1487  if ( simple == 2 ) /* exception thrown */
1488  {
1489  lwerror("lwgeom_is_simple: %s", lwgeom_geos_errmsg);
1490  return -1;
1491  }
1492 
1493  return simple ? 1 : 0;
1494 }
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,...)
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:1386
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: