292 #if POSTGIS_GEOS_VERSION < 37 294 lwpgerror(
"The GEOS version this PostGIS binary " 295 "was compiled against (%d) doesn't support " 296 "'GEOSFechetDistance' function (3.7.0+ required)",
309 geom1 = PG_GETARG_GSERIALIZED_P(0);
310 geom2 = PG_GETARG_GSERIALIZED_P(1);
311 densifyFrac = PG_GETARG_FLOAT8(2);
329 GEOSGeom_destroy(g1);
333 if (densifyFrac <= 0.0)
335 retcode = GEOSFrechetDistance(g1, g2, &result);
339 retcode = GEOSFrechetDistanceDensify(g1, g2, densifyFrac, &result);
342 GEOSGeom_destroy(g1);
343 GEOSGeom_destroy(g2);
351 PG_FREE_IF_COPY(geom1, 0);
352 PG_FREE_IF_COPY(geom2, 1);
354 PG_RETURN_FLOAT8(result);
#define POSTGIS_GEOS_VERSION
int gserialized_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
void lwgeom_geos_error(const char *fmt,...)
GEOSGeometry * POSTGIS2GEOS(GSERIALIZED *pglwgeom)
#define HANDLE_GEOS_ERROR(label)