PostGIS  3.0.0dev-r@@SVN_REVISION@@

◆ ST_MinimumClearance()

Datum ST_MinimumClearance ( PG_FUNCTION_ARGS  )

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

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