PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ ST_MinimumClearance()

Datum ST_MinimumClearance ( PG_FUNCTION_ARGS  )

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

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