PostGIS  2.1.10dev-r@@SVN_REVISION@@
BOX3D* box3d_from_gbox ( const GBOX gbox)

Definition at line 47 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().

48 {
49  BOX3D *b;
50  assert(gbox);
51 
52  b = lwalloc(sizeof(BOX3D));
53 
54  b->xmin = gbox->xmin;
55  b->xmax = gbox->xmax;
56  b->ymin = gbox->ymin;
57  b->ymax = gbox->ymax;
58 
59  if ( FLAGS_GET_Z(gbox->flags) )
60  {
61  b->zmin = gbox->zmin;
62  b->zmax = gbox->zmax;
63  }
64  else
65  {
66  b->zmin = b->zmax = 0.0;
67  }
68 
69  b->srid = SRID_UNKNOWN;
70  return b;
71 }
int32_t srid
Definition: liblwgeom.h:235
double xmax
Definition: liblwgeom.h:249
double ymin
Definition: liblwgeom.h:233
double zmax
Definition: liblwgeom.h:253
double ymin
Definition: liblwgeom.h:250
double xmin
Definition: liblwgeom.h:248
double xmin
Definition: liblwgeom.h:233
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:154
double ymax
Definition: liblwgeom.h:251
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:106
uint8_t flags
Definition: liblwgeom.h:247
double xmax
Definition: liblwgeom.h:234
double zmin
Definition: liblwgeom.h:252
void * lwalloc(size_t size)
Definition: lwutil.c:175
double ymax
Definition: liblwgeom.h:234
double zmax
Definition: liblwgeom.h:234
double zmin
Definition: liblwgeom.h:233

Here is the call graph for this function:

Here is the caller graph for this function: