PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwpoint_get_z()

double lwpoint_get_z ( const LWPOINT point)

Definition at line 89 of file lwpoint.c.

90 {
91  POINT4D pt;
92  if ( lwpoint_is_empty(point) )
93  {
94  lwerror("lwpoint_get_z called with empty geometry");
95  return 0;
96  }
97  if ( ! FLAGS_GET_Z(point->flags) )
98  {
99  lwerror("lwpoint_get_z called without z dimension");
100  return 0;
101  }
102  getPoint4d_p(point->point, 0, &pt);
103  return pt.z;
104 }
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
Definition: liblwgeom.h:140
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
Definition: lwgeom_api.c:123
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
int lwpoint_is_empty(const LWPOINT *point)
Definition: lwpoint.c:291
POINTARRAY * point
Definition: liblwgeom.h:414
uint8_t flags
Definition: liblwgeom.h:411
double z
Definition: liblwgeom.h:355

References LWPOINT::flags, FLAGS_GET_Z, getPoint4d_p(), lwerror(), lwpoint_is_empty(), LWPOINT::point, and POINT4D::z.

Here is the call graph for this function: