PostGIS  2.1.10dev-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 261 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().

262 {
263  if ( ! p )
264  {
265  lwerror("Null input geometry.");
266  return;
267  }
268 
269  if ( ! ( ordinate == 'X' || ordinate == 'Y' || ordinate == 'Z' || ordinate == 'M' ) )
270  {
271  lwerror("Cannot set %c ordinate.", ordinate);
272  return;
273  }
274 
275  LWDEBUGF(4, " setting ordinate %c to %g", ordinate, value);
276 
277  switch ( ordinate )
278  {
279  case 'X':
280  p->x = value;
281  return;
282  case 'Y':
283  p->y = value;
284  return;
285  case 'Z':
286  p->z = value;
287  return;
288  case 'M':
289  p->m = value;
290  return;
291  }
292 }
double x
Definition: liblwgeom.h:308
double m
Definition: liblwgeom.h:308
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
double z
Definition: liblwgeom.h:308
double y
Definition: liblwgeom.h:308
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55

Here is the call graph for this function:

Here is the caller graph for this function: