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

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

References HANDLE_GEOS_ERROR, lwgeom_geos_error(), POSTGIS2GEOS(), and POSTGIS_GEOS_VERSION.

3555 {
3556 #if POSTGIS_GEOS_VERSION < 36
3557  lwpgerror("The GEOS version this PostGIS binary "
3558  "was compiled against (%d) doesn't support "
3559  "'ST_MinimumClearance' function (3.6.0+ required)",
3561  PG_RETURN_NULL();
3562 #else /* POSTGIS_GEOS_VERSION >= 36 */
3563  GSERIALIZED* input;
3564  GEOSGeometry* input_geos;
3565  int error;
3566  double result;
3567 
3568  initGEOS(lwpgnotice, lwgeom_geos_error);
3569 
3570  input = PG_GETARG_GSERIALIZED_P(0);
3571  input_geos = POSTGIS2GEOS(input);
3572  if (!input_geos)
3573  HANDLE_GEOS_ERROR("Geometry could not be converted to GEOS");
3574 
3575  error = GEOSMinimumClearance(input_geos, &result);
3576  GEOSGeom_destroy(input_geos);
3577  if (error) HANDLE_GEOS_ERROR("Error computing minimum clearance");
3578 
3579  PG_FREE_IF_COPY(input, 0);
3580  PG_RETURN_FLOAT8(result);
3581 #endif
3582 }
#define POSTGIS_GEOS_VERSION
Definition: sqldefines.h:10
void lwgeom_geos_error(const char *fmt,...)
GEOSGeometry * POSTGIS2GEOS(GSERIALIZED *pglwgeom)
#define HANDLE_GEOS_ERROR(label)

Here is the call graph for this function: