PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ gserialized_expand()

GSERIALIZED * gserialized_expand ( GSERIALIZED g,
double  distance 
)

Return a GSERIALIZED with an expanded bounding box.

Definition at line 621 of file gserialized_gist_nd.c.

622{
623 GBOX gbox;
624 gbox_init(&gbox);
625
626 /* Get our bounding box out of the geography, return right away if
627 input is an EMPTY geometry. */
628 if (gserialized_get_gbox_p(g, &gbox) == LW_FAILURE)
629 return g;
630
631 gbox_expand(&gbox, distance);
632
633 return gserialized_set_gbox(g, &gbox);
634}
void gbox_expand(GBOX *g, double d)
Move the box minimums down and the maximums up by the distance provided.
Definition gbox.c:97
void gbox_init(GBOX *gbox)
Zero out all the entries in the GBOX.
Definition gbox.c:40
GSERIALIZED * gserialized_set_gbox(GSERIALIZED *g, GBOX *gbox)
Copy a new bounding box into an existing gserialized.
Definition gserialized.c:60
int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *gbox)
Read the box from the GSERIALIZED or calculate it if necessary.
Definition gserialized.c:94
#define LW_FAILURE
Definition liblwgeom.h:96
static double distance(double x1, double y1, double x2, double y2)
Definition lwtree.c:1032

References distance(), gbox_expand(), gbox_init(), gserialized_get_gbox_p(), gserialized_set_gbox(), and LW_FAILURE.

Referenced by geography_expand().

Here is the call graph for this function:
Here is the caller graph for this function: