276 #if POSTGIS_GEOS_VERSION < 37
278 lwpgerror(
"The GEOS version this PostGIS binary "
279 "was compiled against (%d) doesn't support "
280 "'GEOSFechetDistance' function (3.7.0+ required)",
293 geom1 = PG_GETARG_GSERIALIZED_P(0);
294 geom2 = PG_GETARG_GSERIALIZED_P(1);
295 densifyFrac = PG_GETARG_FLOAT8(2);
309 GEOSGeom_destroy(g1);
313 if (densifyFrac <= 0.0)
315 retcode = GEOSFrechetDistance(g1, g2, &result);
319 retcode = GEOSFrechetDistanceDensify(g1, g2, densifyFrac, &result);
322 GEOSGeom_destroy(g1);
323 GEOSGeom_destroy(g2);
327 PG_FREE_IF_COPY(geom1, 0);
328 PG_FREE_IF_COPY(geom2, 1);
330 PG_RETURN_FLOAT8(result);
int gserialized_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
void lwgeom_geos_error(const char *fmt,...)
#define HANDLE_GEOS_ERROR(label)
GEOSGeometry * POSTGIS2GEOS(GSERIALIZED *pglwgeom)
#define POSTGIS_GEOS_VERSION