PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ptarray_reverse_in_place()

void ptarray_reverse_in_place ( POINTARRAY pa)

Definition at line 339 of file ptarray.c.

340{
341 if (!pa->npoints)
342 return;
343 uint32_t i;
344 uint32_t last = pa->npoints - 1;
345 uint32_t 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:179
lwflags_t flags
Definition liblwgeom.h:431
uint32_t npoints
Definition liblwgeom.h:427
uint8_t * serialized_pointlist
Definition liblwgeom.h:434

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

Referenced by _lwt_HealEdges(), _lwt_MakeRingShell(), _lwt_SnapEdge_checkMotion(), lwgeom_reverse_in_place(), lwpoly_force_orientation(), and lwtriangle_force_orientation().

Here is the caller graph for this function: