PostGIS  2.5.0beta1dev-r@@SVN_REVISION@@

◆ ST_MinimumClearance()

Datum ST_MinimumClearance ( PG_FUNCTION_ARGS  )

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

3395 {
3396 #if POSTGIS_GEOS_VERSION < 36
3397  lwpgerror("The GEOS version this PostGIS binary "
3398  "was compiled against (%d) doesn't support "
3399  "'ST_MinimumClearance' function (3.6.0+ required)",
3401  PG_RETURN_NULL();
3402 #else /* POSTGIS_GEOS_VERSION >= 36 */
3403  GSERIALIZED* input;
3404  GEOSGeometry* input_geos;
3405  int error;
3406  double result;
3407 
3408  initGEOS(lwpgnotice, lwgeom_geos_error);
3409 
3410  input = PG_GETARG_GSERIALIZED_P(0);
3411  input_geos = POSTGIS2GEOS(input);
3412  if (!input_geos)
3413  HANDLE_GEOS_ERROR("Geometry could not be converted to GEOS");
3414 
3415  error = GEOSMinimumClearance(input_geos, &result);
3416  GEOSGeom_destroy(input_geos);
3417  if (error) HANDLE_GEOS_ERROR("Error computing minimum clearance");
3418 
3419  PG_FREE_IF_COPY(input, 0);
3420  PG_RETURN_FLOAT8(result);
3421 #endif
3422 }
#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: