PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ lwpoint_get_ordinate()

double lwpoint_get_ordinate ( const POINT4D p,
char  ordinate 
)
inline

Given a POINT4D and an ordinate number, return the value of the ordinate.

Parameters
pinput point
ordinatenumber (1=x, 2=y, 3=z, 4=m)
Returns
d value at that ordinate

Definition at line 255 of file lwlinearreferencing.c.

256 {
257  if (!p)
258  {
259  lwerror("Null input geometry.");
260  return 0.0;
261  }
262 
263  switch (ordinate)
264  {
265  case 'X':
266  return p->x;
267  case 'Y':
268  return p->y;
269  case 'Z':
270  return p->z;
271  case 'M':
272  return p->m;
273  }
274  lwerror("Cannot extract %c ordinate.", ordinate);
275  return 0.0;
276 }
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
double m
Definition: liblwgeom.h:400
double x
Definition: liblwgeom.h:400
double z
Definition: liblwgeom.h:400
double y
Definition: liblwgeom.h:400

References lwerror(), POINT4D::m, POINT4D::x, POINT4D::y, and POINT4D::z.

Referenced by lwline_clip_to_ordinate_range(), lwmpoint_clip_to_ordinate_range(), lwpoint_clip_to_ordinate_range(), point_interpolate(), ptarray_clamp_to_ordinate_range(), and test_lwpoint_get_ordinate().

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