PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ box3d_from_gbox()

BOX3D* box3d_from_gbox ( const GBOX gbox)

Definition at line 64 of file g_box.c.

References GBOX::flags, FLAGS_GET_Z, lwalloc(), BOX3D::srid, SRID_UNKNOWN, BOX3D::xmax, GBOX::xmax, BOX3D::xmin, GBOX::xmin, BOX3D::ymax, GBOX::ymax, BOX3D::ymin, GBOX::ymin, BOX3D::zmax, GBOX::zmax, BOX3D::zmin, and GBOX::zmin.

Referenced by BOX2D_to_BOX3D(), BOX3D_combine(), and LWGEOM_to_BOX3D().

65 {
66  BOX3D *b;
67  assert(gbox);
68 
69  b = lwalloc(sizeof(BOX3D));
70 
71  b->xmin = gbox->xmin;
72  b->xmax = gbox->xmax;
73  b->ymin = gbox->ymin;
74  b->ymax = gbox->ymax;
75 
76  if ( FLAGS_GET_Z(gbox->flags) )
77  {
78  b->zmin = gbox->zmin;
79  b->zmax = gbox->zmax;
80  }
81  else
82  {
83  b->zmin = b->zmax = 0.0;
84  }
85 
86  b->srid = SRID_UNKNOWN;
87  return b;
88 }
int32_t srid
Definition: liblwgeom.h:279
double xmax
Definition: liblwgeom.h:293
double ymin
Definition: liblwgeom.h:277
double zmax
Definition: liblwgeom.h:297
double ymin
Definition: liblwgeom.h:294
double xmin
Definition: liblwgeom.h:292
double xmin
Definition: liblwgeom.h:277
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:188
double ymax
Definition: liblwgeom.h:295
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
uint8_t flags
Definition: liblwgeom.h:291
double xmax
Definition: liblwgeom.h:278
double zmin
Definition: liblwgeom.h:296
void * lwalloc(size_t size)
Definition: lwutil.c:229
double ymax
Definition: liblwgeom.h:278
double zmax
Definition: liblwgeom.h:278
double zmin
Definition: liblwgeom.h:277
Here is the call graph for this function:
Here is the caller graph for this function: