PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ ptarray_copy_point()

void ptarray_copy_point ( POINTARRAY pa,
uint32_t  from,
uint32_t  to 
)

Definition at line 401 of file lwgeom_api.c.

402 {
403  int ndims = FLAGS_NDIMS(pa->flags);
404  switch (ndims)
405  {
406  case 2:
407  {
408  POINT2D *p_from = (POINT2D*)(getPoint_internal(pa, from));
409  POINT2D *p_to = (POINT2D*)(getPoint_internal(pa, to));
410  *p_to = *p_from;
411  return;
412  }
413  case 3:
414  {
415  POINT3D *p_from = (POINT3D*)(getPoint_internal(pa, from));
416  POINT3D *p_to = (POINT3D*)(getPoint_internal(pa, to));
417  *p_to = *p_from;
418  return;
419  }
420  case 4:
421  {
422  POINT4D *p_from = (POINT4D*)(getPoint_internal(pa, from));
423  POINT4D *p_to = (POINT4D*)(getPoint_internal(pa, to));
424  *p_to = *p_from;
425  return;
426  }
427  default:
428  {
429  lwerror("%s: unsupported number of dimensions - %d", __func__, ndims);
430  return;
431  }
432  }
433  return;
434 }
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:193
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
Definition: lwinline.h:67
lwflags_t flags
Definition: liblwgeom.h:417

References POINTARRAY::flags, FLAGS_NDIMS, getPoint_internal(), and lwerror().

Referenced by lwgeom_remove_repeated_points_in_place(), and lwgeom_simplify_in_place().

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