PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ cmpfunc()

static int cmpfunc ( const void *  a,
const void *  b 
)
static

We create the minheap by ordering the minheap array by the areas in the areanode structs that the minheap keys refer to.

Definition at line 105 of file effectivearea.c.

106 {
107  double v1 = (*(areanode**)a)->area;
108  double v2 = (*(areanode**)b)->area;
109  /*qsort gives unpredictable results when comparing identical values.
110  If two values is the same we force returning the last point in the point array.
111  That way we get the same ordering on different machines and platforms*/
112  if (v1==v2)
113  return (*(areanode**)a)-(*(areanode**)b);
114  else
115  return (v1 > v2) ? 1 : ((v1 < v2) ? -1 : 0);
116 }
This structure is placed in an array with one member per point.
Definition: effectivearea.h:39

Referenced by tune_areas().

Here is the caller graph for this function: