PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ cmp_point_y()

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

Definition at line 1587 of file lwgeom.c.

1588 {
1589  LWPOINT *p1 = *((LWPOINT **)pa);
1590  LWPOINT *p2 = *((LWPOINT **)pb);
1591 
1592  const POINT2D *pt1 = getPoint2d_cp(p1->point, 0);
1593  const POINT2D *pt2 = getPoint2d_cp(p2->point, 0);
1594 
1595  if (pt1 && pt2)
1596  return (pt1->y > pt2->y) ? 1 : ((pt1->y < pt2->y) ? -1 : 0);
1597 
1598  if (pt1) return -1;
1599  if (pt2) return 1;
1600  return 0;
1601 }
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:101
POINTARRAY * point
Definition: liblwgeom.h:486
double y
Definition: liblwgeom.h:405

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

Referenced by lwgeom_remove_repeated_points_in_place().

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