PostGIS  3.7.0dev-r@@SVN_REVISION@@

◆ box2df_penalty_single()

static float box2df_penalty_single ( const BOX2DF *  box)
inlinestatic

Definition at line 1264 of file gserialized_gist_2d.c.

1265 {
1266  float boxxmin = box->xmin, boxxmax = box->xmax;
1267  float boxymin = box->ymin, boxymax = box->ymax;
1268 
1269  float dx = boxxmax - boxxmin, dy = boxymax - boxymin;
1270 
1271  float area = dx * dy;
1272  float edge = dx + dy;
1273 
1274  /* REALM 1: Area is nonzero, return it */
1275  if (area > FLT_EPSILON)
1276  return pack_float(area, 1);
1277  /* REALM 0: Area is zero, return edge */
1278  else if (edge > FLT_EPSILON)
1279  return pack_float(edge, 0);
1280 
1281  return 0;
1282 }
static float pack_float(const float value, const uint8_t realm)

References pack_float().

Referenced by gserialized_gist_picksplit_2d().

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