PostGIS  2.5.0dev-r@@SVN_REVISION@@
Datum isvalidreason ( PG_FUNCTION_ARGS  )

Definition at line 1538 of file postgis/lwgeom_geos.c.

References dumpnode::geom, HANDLE_GEOS_ERROR, lwgeom_geos_errmsg, lwgeom_geos_error(), and POSTGIS2GEOS().

1539 {
1540  GSERIALIZED *geom = NULL;
1541  char *reason_str = NULL;
1542  text *result = NULL;
1543  const GEOSGeometry *g1 = NULL;
1544 
1545  geom = PG_GETARG_GSERIALIZED_P(0);
1546 
1547  initGEOS(lwpgnotice, lwgeom_geos_error);
1548 
1549  g1 = (GEOSGeometry *)POSTGIS2GEOS(geom);
1550  if ( g1 )
1551  {
1552  reason_str = GEOSisValidReason(g1);
1553  GEOSGeom_destroy((GEOSGeometry *)g1);
1554  if (!reason_str) HANDLE_GEOS_ERROR("GEOSisValidReason");
1555  result = cstring2text(reason_str);
1556  GEOSFree(reason_str);
1557  }
1558  else
1559  {
1560  result = cstring2text(lwgeom_geos_errmsg);
1561  }
1562 
1563  PG_FREE_IF_COPY(geom, 0);
1564  PG_RETURN_POINTER(result);
1565 }
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
LWGEOM * geom
void lwgeom_geos_error(const char *fmt,...)
GEOSGeometry * POSTGIS2GEOS(GSERIALIZED *pglwgeom)
#define HANDLE_GEOS_ERROR(label)

Here is the call graph for this function: