PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ isvalidreason()

Datum isvalidreason ( PG_FUNCTION_ARGS  )

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

1687 {
1688  GSERIALIZED *geom = NULL;
1689  char *reason_str = NULL;
1690  text *result = NULL;
1691  const GEOSGeometry *g1 = NULL;
1692 
1693  geom = PG_GETARG_GSERIALIZED_P(0);
1694 
1695  initGEOS(lwpgnotice, lwgeom_geos_error);
1696 
1697  g1 = POSTGIS2GEOS(geom);
1698  if ( g1 )
1699  {
1700  reason_str = GEOSisValidReason(g1);
1701  GEOSGeom_destroy((GEOSGeometry *)g1);
1702  if (!reason_str) HANDLE_GEOS_ERROR("GEOSisValidReason");
1703  result = cstring_to_text(reason_str);
1704  GEOSFree(reason_str);
1705  }
1706  else
1707  {
1708  result = cstring_to_text(lwgeom_geos_errmsg);
1709  }
1710 
1711  PG_FREE_IF_COPY(geom, 0);
1712  PG_RETURN_POINTER(result);
1713 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:262
char lwgeom_geos_errmsg[LWGEOM_GEOS_ERRMSG_MAXSIZE]
void lwgeom_geos_error(const char *fmt,...)
GEOSGeometry * POSTGIS2GEOS(const GSERIALIZED *pglwgeom)
#define HANDLE_GEOS_ERROR(label)

References HANDLE_GEOS_ERROR, lwgeom_geos_errmsg, lwgeom_geos_error(), POSTGIS2GEOS(), and result.

Here is the call graph for this function: