PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ptarray_copy_point()

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

Definition at line 1432 of file ptarray.c.

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

Referenced by ptarray_remove_repeated_points_in_place().

1433 {
1434  int ndims = FLAGS_NDIMS(pa->flags);
1435  switch (ndims)
1436  {
1437  case 2:
1438  {
1439  POINT2D *p_from = (POINT2D*)(getPoint_internal(pa, from));
1440  POINT2D *p_to = (POINT2D*)(getPoint_internal(pa, to));
1441  *p_to = *p_from;
1442  return;
1443  }
1444  case 3:
1445  {
1446  POINT3D *p_from = (POINT3D*)(getPoint_internal(pa, from));
1447  POINT3D *p_to = (POINT3D*)(getPoint_internal(pa, to));
1448  *p_to = *p_from;
1449  return;
1450  }
1451  case 4:
1452  {
1453  POINT4D *p_from = (POINT4D*)(getPoint_internal(pa, from));
1454  POINT4D *p_to = (POINT4D*)(getPoint_internal(pa, to));
1455  *p_to = *p_from;
1456  return;
1457  }
1458  default:
1459  {
1460  lwerror("%s: unsupported number of dimensions - %d", __func__, ndims);
1461  return;
1462  }
1463  }
1464  return;
1465 }
uint8_t flags
Definition: liblwgeom.h:369
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:152
uint8_t * getPoint_internal(const POINTARRAY *pa, int n)
Definition: ptarray.c:1753
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: