PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_is_simple()

int lwgeom_is_simple ( const LWGEOM lwgeom)

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

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