PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ ST_MinimumClearance()

Datum ST_MinimumClearance ( PG_FUNCTION_ARGS  )

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

3392 {
3393 #if POSTGIS_GEOS_VERSION < 36
3394  lwpgerror("The GEOS version this PostGIS binary "
3395  "was compiled against (%d) doesn't support "
3396  "'ST_MinimumClearance' function (3.6.0+ required)",
3398  PG_RETURN_NULL();
3399 #else /* POSTGIS_GEOS_VERSION >= 36 */
3400  GSERIALIZED* input;
3401  GEOSGeometry* input_geos;
3402  int error;
3403  double result;
3404 
3405  initGEOS(lwpgnotice, lwgeom_geos_error);
3406 
3407  input = PG_GETARG_GSERIALIZED_P(0);
3408  input_geos = POSTGIS2GEOS(input);
3409  if (!input_geos)
3410  HANDLE_GEOS_ERROR("Geometry could not be converted to GEOS");
3411 
3412  error = GEOSMinimumClearance(input_geos, &result);
3413  GEOSGeom_destroy(input_geos);
3414  if (error) HANDLE_GEOS_ERROR("Error computing minimum clearance");
3415 
3416  PG_FREE_IF_COPY(input, 0);
3417  PG_RETURN_FLOAT8(result);
3418 #endif
3419 }
void lwgeom_geos_error(const char *fmt,...)
#define HANDLE_GEOS_ERROR(label)
GEOSGeometry * POSTGIS2GEOS(GSERIALIZED *pglwgeom)
#define POSTGIS_GEOS_VERSION
Definition: sqldefines.h:10

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

Here is the call graph for this function: