PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ BOX3D_expand()

Datum BOX3D_expand ( PG_FUNCTION_ARGS  )

Definition at line 382 of file lwgeom_box3d.c.

References expand_box3d(), expand_box3d_xyz(), LWGEOM_to_BOX3D(), and PG_FUNCTION_INFO_V1().

Referenced by expand_box3d_xyz().

383 {
384  BOX3D *box = (BOX3D *)PG_GETARG_POINTER(0);
385  BOX3D *result = (BOX3D *)palloc(sizeof(BOX3D));
386  memcpy(result, box, sizeof(BOX3D));
387 
388  if (PG_NARGS() == 2) {
389  /* Expand the box the same amount in all directions */
390  double d = PG_GETARG_FLOAT8(1);
391  expand_box3d(result, d);
392  }
393  else
394  {
395  double dx = PG_GETARG_FLOAT8(1);
396  double dy = PG_GETARG_FLOAT8(2);
397  double dz = PG_GETARG_FLOAT8(3);
398 
399  expand_box3d_xyz(result, dx, dy, dz);
400  }
401 
402  PG_RETURN_POINTER(result);
403 }
static void expand_box3d_xyz(BOX3D *box, double dx, double dy, double dz)
Definition: lwgeom_box3d.c:371
void expand_box3d(BOX3D *box, double d)
Expand given box of 'd' units in all directions.
Definition: lwgeom_box3d.c:359
Here is the call graph for this function:
Here is the caller graph for this function: