PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ gserialized_distance_box_2d()

Datum gserialized_distance_box_2d ( PG_FUNCTION_ARGS  )

Definition at line 692 of file gserialized_gist_2d.c.

693 {
694  BOX2DF b1, b2;
695  Datum gs1 = PG_GETARG_DATUM(0);
696  Datum gs2 = PG_GETARG_DATUM(1);
697 
698  POSTGIS_DEBUG(3, "entered function");
699 
700  /* Must be able to build box for each argument (ie, not empty geometry). */
701  if ( (gserialized_datum_get_box2df_p(gs1, &b1) == LW_SUCCESS) &&
703  {
704  double distance = box2df_distance(&b1, &b2);
705  POSTGIS_DEBUGF(3, "got boxes %s and %s", box2df_to_string(&b1), box2df_to_string(&b2));
706  PG_RETURN_FLOAT8(distance);
707  }
708  PG_RETURN_FLOAT8(FLT_MAX);
709 }
static char * box2df_to_string(const BOX2DF *a)
static double box2df_distance(const BOX2DF *a, const BOX2DF *b)
Calculate the box->box distance.
int gserialized_datum_get_box2df_p(Datum gsdatum, BOX2DF *box2df)
#define LW_SUCCESS
Definition: liblwgeom.h:97
static double distance(double x1, double y1, double x2, double y2)
Definition: lwtree.c:1032

References box2df_distance(), box2df_to_string(), distance(), gserialized_datum_get_box2df_p(), and LW_SUCCESS.

Here is the call graph for this function: