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

◆ cmp_point_x()

static int cmp_point_x ( const void *  pa,
const void *  pb 
)
static

Definition at line 1661 of file lwgeom.c.

1662{
1663 LWPOINT *p1 = *((LWPOINT **)pa);
1664 LWPOINT *p2 = *((LWPOINT **)pb);
1665
1666 const POINT2D *pt1 = getPoint2d_cp(p1->point, 0);
1667 const POINT2D *pt2 = getPoint2d_cp(p2->point, 0);
1668
1669 if (pt1 && pt2)
1670 return (pt1->x > pt2->x) ? 1 : ((pt1->x < pt2->x) ? -1 : 0);
1671
1672 if (pt1) return -1;
1673 if (pt2) return 1;
1674 return 0;
1675}
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Definition lwinline.h:97
POINTARRAY * point
Definition liblwgeom.h:471
double x
Definition liblwgeom.h:390

References getPoint2d_cp(), LWPOINT::point, and POINT2D::x.

Referenced by lwgeom_remove_repeated_points_in_place().

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