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

◆ ptarray_remove_dim_helper()

static void ptarray_remove_dim_helper ( POINTARRAY points,
double  mindx,
double  mindy 
)
static

Definition at line 40 of file lwgeom_remove_small_parts.c.

40 {
41
42 int r;
43 double xmin = 0, ymin = 0, xmax = 0, ymax = 0;
44 double x, y;
45 POINT4D point;
46
47 int npoints = points->npoints;
48 for (r=0; r < npoints; r++) {
49
50 getPoint4d_p(points, r, &point);
51
52 x = point.x;
53 y = point.y;
54
55 if (mindx > 0) {
56 if (!r || xmin > x) xmin = x;
57 if (!r || xmax < x) xmax = x;
58 }
59 if (mindy > 0) {
60 if (!r || ymin > y) ymin = y;
61 if (!r || ymax < y) ymax = y;
62 }
63 }
64
65 if ((mindx > 0 && xmax - xmin < mindx) ||
66 (mindy > 0 && ymax - ymin < mindy)) {
67 // skip part
68 points->npoints = 0;
69 }
70}
char * r
Definition cu_in_wkt.c:24
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
Definition lwgeom_api.c:125
double x
Definition liblwgeom.h:414
double y
Definition liblwgeom.h:414
uint32_t npoints
Definition liblwgeom.h:427

References getPoint4d_p(), POINTARRAY::npoints, r, POINT4D::x, and POINT4D::y.

Referenced by ST_RemoveSmallParts().

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