PostGIS  2.1.10dev-r@@SVN_REVISION@@
static void do_test_mindistance2d_tolerance ( char *  in1,
char *  in2,
double  expected_res,
int  line 
)
static

Definition at line 33 of file cu_measures.c.

References distance(), LW_PARSER_CHECK_NONE, lwgeom_free(), lwgeom_from_wkt(), and lwgeom_mindistance2d_tolerance().

34 {
35  LWGEOM *lw1;
36  LWGEOM *lw2;
37  double distance;
38  char *msg1 = "test_mindistance2d_tolerance failed (got %g expected %g) at line %d\n";
39  char *msg2 = "\n\ndo_test_mindistance2d_tolerance: NULL lwgeom generated from WKT\n %s\n\n";
40 
43 
44  if ( ! lw1 )
45  {
46  printf(msg2, in1);
47  exit(1);
48  }
49  if ( ! lw2 )
50  {
51  printf(msg2, in2);
52  exit(1);
53  }
54 
55  distance = lwgeom_mindistance2d_tolerance(lw1, lw2, 0.0);
56  lwgeom_free(lw1);
57  lwgeom_free(lw2);
58 
59  if ( fabs(distance - expected_res) > 0.00001 )
60  {
61  printf(msg1, distance, expected_res, line);
62  CU_FAIL();
63  }
64  else
65  {
66  CU_PASS();
67  }
68 
69 }
double lwgeom_mindistance2d_tolerance(LWGEOM *lw1, LWGEOM *lw2, double tolerance)
Function handling min distance calculations and dwithin calculations.
Definition: measures.c:173
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1006
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
Definition: lwin_wkt.c:844
#define LW_PARSER_CHECK_NONE
Definition: liblwgeom.h:1706
Datum distance(PG_FUNCTION_ARGS)

Here is the call graph for this function: