PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ lwgeom_is_simple()

int lwgeom_is_simple ( const LWGEOM lwgeom)

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

1442 {
1443  GEOSGeometry* geos_in;
1444  int simple;
1445 
1446  /* Empty is always simple */
1447  if ( lwgeom_is_empty(geom) )
1448  {
1449  return 1;
1450  }
1451 
1452  initGEOS(lwnotice, lwgeom_geos_error);
1453 
1454  geos_in = LWGEOM2GEOS(geom, 0);
1455  if ( 0 == geos_in ) /* exception thrown at construction */
1456  {
1457  lwerror("First argument geometry could not be converted to GEOS: %s", lwgeom_geos_errmsg);
1458  return -1;
1459  }
1460  simple = GEOSisSimple(geos_in);
1461  GEOSGeom_destroy(geos_in);
1462 
1463  if ( simple == 2 ) /* exception thrown */
1464  {
1465  lwerror("lwgeom_is_simple: %s", lwgeom_geos_errmsg);
1466  return -1;
1467  }
1468 
1469  return simple ? 1 : 0;
1470 }
void lwnotice(const char *fmt,...)
Write a notice out to the notice handler.
Definition: lwutil.c:89
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:1310
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:102
Here is the call graph for this function:
Here is the caller graph for this function: