PostGIS  2.5.0dev-r@@SVN_REVISION@@
void lwpoint_set_ordinate ( POINT4D p,
char  ordinate,
double  value 
)

Given a point, ordinate number and value, set that ordinate on the point.

Definition at line 284 of file lwlinearreferencing.c.

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

Referenced by point_interpolate(), and test_lwpoint_set_ordinate().

285 {
286  if ( ! p )
287  {
288  lwerror("Null input geometry.");
289  return;
290  }
291 
292  if ( ! ( ordinate == 'X' || ordinate == 'Y' || ordinate == 'Z' || ordinate == 'M' ) )
293  {
294  lwerror("Cannot set %c ordinate.", ordinate);
295  return;
296  }
297 
298  LWDEBUGF(4, " setting ordinate %c to %g", ordinate, value);
299 
300  switch ( ordinate )
301  {
302  case 'X':
303  p->x = value;
304  return;
305  case 'Y':
306  p->y = value;
307  return;
308  case 'Z':
309  p->z = value;
310  return;
311  case 'M':
312  p->m = value;
313  return;
314  }
315 }
double x
Definition: liblwgeom.h:351
double m
Definition: liblwgeom.h:351
double z
Definition: liblwgeom.h:351
double y
Definition: liblwgeom.h:351
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190

Here is the call graph for this function:

Here is the caller graph for this function: