PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ rect_node_cmp()

static int rect_node_cmp ( const void *  pn1,
const void *  pn2 
)
static

Definition at line 41 of file lwtree.c.

42 {
43  GBOX b1, b2;
44  RECT_NODE *n1 = *((RECT_NODE**)pn1);
45  RECT_NODE *n2 = *((RECT_NODE**)pn2);
46  uint64_t h1, h2;
47  b1.flags = 0;
48  b1.xmin = n1->xmin;
49  b1.xmax = n1->xmax;
50  b1.ymin = n1->ymin;
51  b1.ymax = n1->ymax;
52 
53  b2.flags = 0;
54  b2.xmin = n2->xmin;
55  b2.xmax = n2->xmax;
56  b2.ymin = n2->ymin;
57  b2.ymax = n2->ymax;
58 
59  h1 = gbox_get_sortable_hash(&b1);
60  h2 = gbox_get_sortable_hash(&b2);
61  return h1 < h2 ? -1 : (h1 > h2 ? 1 : 0);
62 }
uint64_t gbox_get_sortable_hash(const GBOX *g)
Return a sortable key based on the center point of the GBOX.
Definition: g_serialized.c:259
double ymax
Definition: liblwgeom.h:298
double xmax
Definition: liblwgeom.h:296
double ymin
Definition: liblwgeom.h:297
double xmin
Definition: liblwgeom.h:295
uint8_t flags
Definition: liblwgeom.h:294
double ymin
Definition: lwtree.h:71
double xmax
Definition: lwtree.h:70
double ymax
Definition: lwtree.h:72
double xmin
Definition: lwtree.h:69

References GBOX::flags, gbox_get_sortable_hash(), GBOX::xmax, rect_node::xmax, GBOX::xmin, rect_node::xmin, GBOX::ymax, rect_node::ymax, GBOX::ymin, and rect_node::ymin.

Referenced by rect_tree_from_lwcollection(), and rect_tree_from_lwcurvepoly().

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