PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ ptarray_copy_point()

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

Definition at line 395 of file lwgeom_api.c.

396 {
397  int ndims = FLAGS_NDIMS(pa->flags);
398  switch (ndims)
399  {
400  case 2:
401  {
402  POINT2D *p_from = (POINT2D*)(getPoint_internal(pa, from));
403  POINT2D *p_to = (POINT2D*)(getPoint_internal(pa, to));
404  *p_to = *p_from;
405  return;
406  }
407  case 3:
408  {
409  POINT3D *p_from = (POINT3D*)(getPoint_internal(pa, from));
410  POINT3D *p_to = (POINT3D*)(getPoint_internal(pa, to));
411  *p_to = *p_from;
412  return;
413  }
414  case 4:
415  {
416  POINT4D *p_from = (POINT4D*)(getPoint_internal(pa, from));
417  POINT4D *p_to = (POINT4D*)(getPoint_internal(pa, to));
418  *p_to = *p_from;
419  return;
420  }
421  default:
422  {
423  lwerror("%s: unsupported number of dimensions - %d", __func__, ndims);
424  return;
425  }
426  }
427  return;
428 }
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:194
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:77
lwflags_t flags
Definition: liblwgeom.h:446

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

Referenced by lwgeom_simplify_in_place().

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