PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ ptarray_reverse_in_place()

void ptarray_reverse_in_place ( POINTARRAY pa)

Definition at line 341 of file ptarray.c.

342 {
343  int i;
344  int last = pa->npoints-1;
345  int mid = pa->npoints/2;
346 
347  double *d = (double*)(pa->serialized_pointlist);
348  int j;
349  int ndims = FLAGS_NDIMS(pa->flags);
350  for (i = 0; i < mid; i++)
351  {
352  for (j = 0; j < ndims; j++)
353  {
354  double buf;
355  buf = d[i*ndims+j];
356  d[i*ndims+j] = d[(last-i)*ndims+j];
357  d[(last-i)*ndims+j] = buf;
358  }
359  }
360  return;
361 }
#define FLAGS_NDIMS(flags)
Definition: liblwgeom.h:152
uint32_t npoints
Definition: liblwgeom.h:374
uint8_t * serialized_pointlist
Definition: liblwgeom.h:369
uint8_t flags
Definition: liblwgeom.h:372

References POINTARRAY::flags, FLAGS_NDIMS, POINTARRAY::npoints, and POINTARRAY::serialized_pointlist.

Referenced by _lwt_HealEdges(), _lwt_MakeRingShell(), lwgeom_reverse_in_place(), lwpoly_force_clockwise(), and lwtriangle_force_clockwise().

Here is the caller graph for this function: