277 #if POSTGIS_GEOS_VERSION < 37
279 lwpgerror(
"The GEOS version this PostGIS binary "
280 "was compiled against (%d) doesn't support "
281 "'GEOSFechetDistance' function (3.7.0+ required)",
294 geom1 = PG_GETARG_GSERIALIZED_P(0);
295 geom2 = PG_GETARG_GSERIALIZED_P(1);
296 densifyFrac = PG_GETARG_FLOAT8(2);
310 GEOSGeom_destroy(g1);
314 if (densifyFrac <= 0.0)
316 retcode = GEOSFrechetDistance(g1, g2, &result);
320 retcode = GEOSFrechetDistanceDensify(g1, g2, densifyFrac, &result);
323 GEOSGeom_destroy(g1);
324 GEOSGeom_destroy(g2);
328 PG_FREE_IF_COPY(geom1, 0);
329 PG_FREE_IF_COPY(geom2, 1);
331 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