PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ ST_MinimumClearance()

Datum ST_MinimumClearance ( PG_FUNCTION_ARGS  )

Definition at line 3632 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().

3633 {
3634 #if POSTGIS_GEOS_VERSION < 36
3635  lwpgerror("The GEOS version this PostGIS binary "
3636  "was compiled against (%d) doesn't support "
3637  "'ST_MinimumClearance' function (3.6.0+ required)",
3639  PG_RETURN_NULL();
3640 #else /* POSTGIS_GEOS_VERSION >= 36 */
3641  GSERIALIZED* input;
3642  GEOSGeometry* input_geos;
3643  int error;
3644  double result;
3645 
3646  initGEOS(lwpgnotice, lwgeom_geos_error);
3647 
3648  input = PG_GETARG_GSERIALIZED_P(0);
3649  input_geos = POSTGIS2GEOS(input);
3650  if (!input_geos) /* exception thrown at construction */
3651  {
3652  HANDLE_GEOS_ERROR("Geometry could not be converted to GEOS");
3653  PG_RETURN_NULL();
3654  }
3655 
3656  error = GEOSMinimumClearance(input_geos, &result);
3657  GEOSGeom_destroy(input_geos);
3658  if (error)
3659  {
3660  HANDLE_GEOS_ERROR("Error computing minimum clearance");
3661  PG_RETURN_NULL();
3662  }
3663 
3664  PG_FREE_IF_COPY(input, 0);
3665  PG_RETURN_FLOAT8(result);
3666 #endif
3667 }
#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: