PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ST_MinimumClearance()

Datum ST_MinimumClearance ( PG_FUNCTION_ARGS  )

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

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

Referenced by ST_Voronoi().

3704 {
3705 #if POSTGIS_GEOS_VERSION < 36
3706  lwpgerror("The GEOS version this PostGIS binary "
3707  "was compiled against (%d) doesn't support "
3708  "'ST_MinimumClearance' function (3.6.0+ required)",
3710  PG_RETURN_NULL();
3711 #else /* POSTGIS_GEOS_VERSION >= 36 */
3712  GSERIALIZED* input;
3713  GEOSGeometry* input_geos;
3714  int error;
3715  double result;
3716 
3717  initGEOS(lwpgnotice, lwgeom_geos_error);
3718 
3719  input = PG_GETARG_GSERIALIZED_P(0);
3720  input_geos = POSTGIS2GEOS(input);
3721  if (!input_geos) /* exception thrown at construction */
3722  {
3723  HANDLE_GEOS_ERROR("Geometry could not be converted to GEOS");
3724  PG_RETURN_NULL();
3725  }
3726 
3727  error = GEOSMinimumClearance(input_geos, &result);
3728  GEOSGeom_destroy(input_geos);
3729  if (error)
3730  {
3731  HANDLE_GEOS_ERROR("Error computing minimum clearance");
3732  PG_RETURN_NULL();
3733  }
3734 
3735  PG_FREE_IF_COPY(input, 0);
3736  PG_RETURN_FLOAT8(result);
3737 #endif
3738 }
#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:
Here is the caller graph for this function: