gbox_geocentric_slow = LW_FALSE;
lwgeom_free(lwg);
#if 0
- printf("\nCALC: %s\n", gbox_to_string(gbox));
- printf("GOOD: %s\n", gbox_to_string(gbox_slow));
- printf("line %d: diff %.9g\n", i, fabs(gbox->xmin - gbox_slow->xmin)+fabs(gbox->ymin - gbox_slow->ymin)+fabs(gbox->zmin - gbox_slow->zmin));
+ printf("\nCALC: %s\n", gbox_to_string(&gbox));
+ printf("GOOD: %s\n", gbox_to_string(&gbox_slow));
+ printf("line %d: diff %.9g\n", i, fabs(gbox.xmin - gbox_slow.xmin)+fabs(gbox.ymin - gbox_slow.ymin)+fabs(gbox.zmin - gbox_slow.zmin));
printf("------------\n");
#endif
CU_ASSERT_DOUBLE_EQUAL(gbox.xmin, gbox_slow.xmin, 0.000001);
{
"LINESTRING(-0 40,0 -30)",
"LINESTRING(-180 90,180 -80)",
- "LINESTRING(-0 90,0 -90)",
- "LINESTRING(0 90,80 -90)",
+ "LINESTRING(-0 90,0 -89)",
+ "LINESTRING(0 90,80 -89)",
"LINESTRING(0 -5,0 -5)",
"LINESTRING(180 -35,180 45)",
"LINESTRING(158 -85,-57 86)",
"LINESTRING(-3.083333333333333333333333333333333 9.83333333333333333333333333333333,15.5 -5.25)",
"LINESTRING(86.85 9.85,105.5 -5.25)",
"LINESTRING(-120.0 62.55,-120.0 62.55)",
- "LINESTRING(-135.0 40.0,45.0 -40.0)",
+ "LINESTRING(-135.0 40.0,45.0 -39.0)",
"LINESTRING(-120.0 62.55,60.0 73.25)",
"LINESTRING(-120.0 -62.55,60.0 -73.25)",
"LINESTRING(-120.0 20.0,-120.5 20.0)",
LWDEBUG(4, "edge is antipodal. setting to maximum size box, and returning");
gbox->xmin = gbox->ymin = gbox->zmin = -1.0;
gbox->xmax = gbox->ymax = gbox->zmax = 1.0;
- return LW_SUCCESS;
+ return LW_SUCCESS;
}
/* Walk along the chord between start and end incrementally,
set the box to contain the whole world and return */
if ( FP_EQUALS(distance, M_PI) )
{
- LWDEBUG(4, "edge is antipodal. setting to maximum size box, and returning");
+ lwerror("Invalid geography. Antipodal edge (180 degrees long) detected: (%g %g,%g %g)",
+ rad2deg(e->start.lon),rad2deg(e->start.lat),rad2deg(e->end.lon),rad2deg(e->end.lat) );
+ return LW_FAILURE;
+
+/* LWDEBUG(4, "edge is antipodal. setting to maximum size box, and returning");
gbox->xmin = gbox->ymin = gbox->zmin = -1.0;
gbox->xmax = gbox->ymax = gbox->zmax = 1.0;
- return LW_SUCCESS;
+
+ return LW_SUCCESS; */
}
/* Calculate the difference in longitude between the two points. */