Definition at line 2429 of file lwgeom_functions_basic.c.
References LWGEOM::bbox, error_if_srid_mismatch(), FALSE, gserialized_get_gbox_p(), LWGEOM_affine(), lwgeom_from_gserialized(), LWGEOM_mindistance2d(), MULTIPOLYGONTYPE, PG_FUNCTION_INFO_V1(), POLYGONTYPE, LWGEOM::srid, LWGEOM::type, GBOX::xmax, GBOX::xmin, GBOX::ymax, and GBOX::ymin.
Referenced by LWGEOM_azimuth().
2431 GSERIALIZED *pg_geom1 = PG_GETARG_GSERIALIZED_P(0);
2432 GSERIALIZED *pg_geom2 = PG_GETARG_GSERIALIZED_P(1);
2433 double dist = PG_GETARG_FLOAT8(2);
2444 elog(ERROR,
"optimistic_overlap: first arg isn't a polygon\n");
2450 elog(ERROR,
"optimistic_overlap: 2nd arg isn't a [multi-]polygon\n");
2457 g1_bvol.
xmin = g1_bvol.
xmin - dist;
2458 g1_bvol.
ymin = g1_bvol.
ymin - dist;
2459 g1_bvol.
xmax = g1_bvol.
xmax + dist;
2460 g1_bvol.
ymax = g1_bvol.
ymax + dist;
2467 PG_RETURN_BOOL(
FALSE);
2474 calc_dist = DatumGetFloat8 ( DirectFunctionCall2(
LWGEOM_mindistance2d, PointerGetDatum( pg_geom1 ), PointerGetDatum( pg_geom2 )));
2476 PG_RETURN_BOOL(calc_dist < dist);
int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *box)
Read the bounding box off a serialization and calculate one if it is not already there.
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void error_if_srid_mismatch(int srid1, int srid2)
Datum LWGEOM_mindistance2d(PG_FUNCTION_ARGS)