PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ box3d_from_gbox()

BOX3D* box3d_from_gbox ( const GBOX gbox)

Definition at line 60 of file g_box.c.

61 {
62  BOX3D *b;
63  assert(gbox);
64 
65  b = lwalloc(sizeof(BOX3D));
66 
67  b->xmin = gbox->xmin;
68  b->xmax = gbox->xmax;
69  b->ymin = gbox->ymin;
70  b->ymax = gbox->ymax;
71 
72  if ( FLAGS_GET_Z(gbox->flags) )
73  {
74  b->zmin = gbox->zmin;
75  b->zmax = gbox->zmax;
76  }
77  else
78  {
79  b->zmin = b->zmax = 0.0;
80  }
81 
82  b->srid = SRID_UNKNOWN;
83  return b;
84 }
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
void * lwalloc(size_t size)
Definition: lwutil.c:229
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:188
double xmax
Definition: liblwgeom.h:281
double zmin
Definition: liblwgeom.h:280
double ymax
Definition: liblwgeom.h:281
double ymin
Definition: liblwgeom.h:280
double zmax
Definition: liblwgeom.h:281
double xmin
Definition: liblwgeom.h:280
int32_t srid
Definition: liblwgeom.h:282
double ymax
Definition: liblwgeom.h:298
double zmax
Definition: liblwgeom.h:300
double xmax
Definition: liblwgeom.h:296
double zmin
Definition: liblwgeom.h:299
double ymin
Definition: liblwgeom.h:297
double xmin
Definition: liblwgeom.h:295
uint8_t flags
Definition: liblwgeom.h:294

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().

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