PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwpoint_get_m()

double lwpoint_get_m ( const LWPOINT point)

Definition at line 107 of file lwpoint.c.

108 {
109  POINT4D pt;
110  if ( lwpoint_is_empty(point) )
111  {
112  lwerror("lwpoint_get_m called with empty geometry");
113  return 0;
114  }
115  if ( ! FLAGS_GET_M(point->flags) )
116  {
117  lwerror("lwpoint_get_m called without m dimension");
118  return 0;
119  }
120  getPoint4d_p(point->point, 0, &pt);
121  return pt.m;
122 }
#define FLAGS_GET_M(flags)
Definition: liblwgeom.h:141
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 m
Definition: liblwgeom.h:355

References LWPOINT::flags, FLAGS_GET_M, getPoint4d_p(), lwerror(), lwpoint_is_empty(), POINT4D::m, and LWPOINT::point.

Referenced by lwmpoint_locate_along(), and lwpoint_locate_along().

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