PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ test_rect_tree_distance_tree()

static void test_rect_tree_distance_tree ( void  )
static

Definition at line 502 of file cu_measures.c.

503 {
504  const char *wkt;
505 
506  wkt = "MULTIPOLYGON(((-123.35702791281 48.4232302445918,-123.35689654493 48.4237265810249,-123.354053908057 48.4234039978588,-123.35417179975 48.4229151379279,-123.354369811539 48.4220987102936,-123.355779071731 48.4222571534228,-123.357238860904 48.4224209369449,-123.35702791281 48.4232302445918)))";
507  TDT(wkt, "MULTIPOLYGON(((-123.353452578038 48.4259519079838,-123.35072012771 48.4256699150083,-123.347337809991 48.4254740864963,-123.347469111645 48.4245757659326,-123.349409235923 48.4246224093429,-123.349966167324 48.4246562342604,-123.353650661317 48.4250703224683,-123.353452578038 48.4259519079838)))", 0.0017144228293396);
508 
509  wkt = "POINT(0 0)";
510  TDT(wkt, "MULTIPOINT(0 1.5,0 2,0 2.5)", 1.5);
511  TDT(wkt, "GEOMETRYCOLLECTION(POINT(3 4))", 5.0);
512  TDT(wkt, "GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(3 4)))", 5.0);
513  TDT(wkt, "GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(POINT(3 4))))", 5.0);
514  TDT(wkt, "GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(GEOMETRYCOLLECTION(MULTIPOINT(3 4))))", 5.0);
515 
516  TDT("LINESTRING(-2 0, -0.2 0)", "POINT(-2 0)", 0);
517  TDT("LINESTRING(-0.2 0, -2 0)", "POINT(-2 0)", 0);
518  TDT("LINESTRING(-1e-8 0, -0.2 0)", "POINT(-1e-8 0)", 0);
519  TDT("LINESTRING(-0.2 0, -1e-8 0)", "POINT(-1e-8 0)", 0);
520 
521  wkt = "CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(1 6, 6 1, 9 7),(9 7, 3 13, 1 6)),COMPOUNDCURVE((3 6, 5 4, 7 4, 7 6),CIRCULARSTRING(7 6,5 8,3 6)))";
522  TDT(wkt, "POINT(3 14)", 1);
523  TDT(wkt, "POINT(3 8)", 0);
524  TDT(wkt, "POINT(6 5)", 1);
525  TDT(wkt, "POINT(6 4)", 0);
526 
527  wkt = "MULTISURFACE(POLYGON((0 0,0 4,4 4,4 0,0 0)),CURVEPOLYGON(CIRCULARSTRING(8 2,10 4,12 2,10 0,8 2)))";
528  TDT(wkt, "CURVEPOLYGON(CIRCULARSTRING(5 7,6 8,7 7,6 6,5 7))", 2.60555);
529  TDT(wkt, "CURVEPOLYGON(CIRCULARSTRING(5 2,6 3,7 2,6 1,5 2))", 1);
530  TDT(wkt, "CURVEPOLYGON(CIRCULARSTRING(4 2,5 3,6 2,5 1,4 2))", 0);
531  TDT(wkt, "CURVEPOLYGON(CIRCULARSTRING(5 3,6 2,5 1,4 2,5 3))", 0);
532  TDT(wkt, "CURVEPOLYGON(CIRCULARSTRING(4.5 3,5.5 2,4.5 1,3.5 2,4.5 3))", 0);
533  TDT(wkt, "CURVEPOLYGON(CIRCULARSTRING(5.5 3,6.5 2,5.5 1,4.5 2,5.5 3))", 0.5);
534  TDT(wkt, "CURVEPOLYGON(CIRCULARSTRING(10 3,11 2,10 1,9 2,10 3))", 0);
535  TDT(wkt, "CURVEPOLYGON(CIRCULARSTRING(2 3,3 2,2 1,1 2,2 3))", 0);
536 
537  wkt = "CURVEPOLYGON(COMPOUNDCURVE(CIRCULARSTRING(0 0,5 0,0 0)))";
538  TDT(wkt, "POINT(3 0)", 0.0);
539  TDT(wkt, "POINT(5 0)", 0.0);
540  TDT(wkt, "POINT(7 0)", 2.0);
541  TDT(wkt, "POINT(2.5 3.5)", 1.0);
542 
543  wkt = "POINT(0 0)";
544  TDT(wkt, "POINT(0 1)", 1.0);
545  TDT(wkt, "POINT(1 0)", 1.0);
546 
547  wkt = "LINESTRING(0 0,1 0)";
548  TDT(wkt, "LINESTRING(1 0,1 1)", 0.0);
549  TDT(wkt, "LINESTRING(0 1,1 1)", 1.0);
550 
551  wkt = "POLYGON((0 0,0 1,1 1,1 0,0 0))";
552  TDT(wkt, "POINT(2 2)", sqrt(2));
553  TDT(wkt, "POINT(0.5 0.5)", 0);
554  TDT(wkt, "POINT(1 1)", 0);
555 
556  wkt = "POLYGON((0 0,0 10,10 10,10 0,0 0), (4 4,4 6,6 6,6 4,4 4))";
557  TDT(wkt, "POINT(5 5)", 1);
558  TDT(wkt, "POLYGON((5 5,5 5.5,5.5 5.5,5.5 5, 5 5))", 0.5);
559 }
#define TDT(w1, w2, d)
Definition: cu_measures.c:499

References TDT.

Referenced by measures_suite_setup().

Here is the caller graph for this function: