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

◆ 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, 0);
60 h2 = gbox_get_sortable_hash(&b2, 0);
61 return h1 < h2 ? -1 : (h1 > h2 ? 1 : 0);
62}
uint64_t gbox_get_sortable_hash(const GBOX *g, const int32_t srid)
Return a sortable key based on the center point of the GBOX.
Definition gbox.c:808
double ymax
Definition liblwgeom.h:357
double xmax
Definition liblwgeom.h:355
double ymin
Definition liblwgeom.h:356
double xmin
Definition liblwgeom.h:354
lwflags_t flags
Definition liblwgeom.h:353
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: