Configure ttmath with CMake.
ttmath is header-only library, but for Visual C++ 64-bit compiler
requires compilation of ttmathuint_x86_64_msvc.asm file (Microsoft
doesn't provide the inline assembler in its 64bit compiler).
ttmath will be used as Java/JTS DoubleDouble analog of
quadruple precision float-point.
Two methods have been added orientationIndex and orientationIndexFilter.
The implementation uses either ttmath or doubledouble libraries as the
JTS DoubleDouble implementation analog.
In CGAlgorithmsDD.cpp, two defines provided to control which one is used:
GEOS_ENABLE_DD_TMNATH and GEOS_ENABLE_DD_DOUBLEDOUBLE.
(Uncomment one or the other and rebuild GEOS.)
Change CGalgorithms::orientationIndex to call CGAlgorithmsDD
(Note, previous calculations have been kept for comparison and testing
purposes, see TODO comments.)
The test case comes from comment in JTS r626 file
IMPORTANT: Both, JTS as well as GEOS with CGAlgorithmsDD support (through
either ttmath or doubledouble), pass this orientationIndex test case.
See test<3> in computeOrientationTest.cpp.
Both tests have been added in two forms:
1) C++ version based on geometries in binary (WKB) format.
2) XML version based on geometry in textual (WKT) format.
IMPORTANT: Both, JTS 1.14 and GEOS with DD support (either through ttmath,
or doubledouble), fail on the point on segment test case, but pass on
the point on vertex test case.
The quadruple precision float-point support (DD) does not help in the
point on segment test case, so both, JTS and GEOS, seem to
have robustness issues algorithmically.
Add simple test based on area of triangle created by three points
of the given segment and test point.
The point intersects the segment, if area of the triangle is
zero or close to zero: insignificant relatively to length of the segment.
Two interesting observations:
1) The fix allows to pass the "point on segment" test discussed in
http://trac.osgeo.org/geos/ticket/591 and PR: libgeos/libgeos#40
2) All GEOS tests pass apart from (testA, test<13>):
which is opposite to the "point on segment" test:
segment located as close and parallel as possible to X axis,
so it seems on X axis (so 0,0 intersects), but
JTS/GEOS are expected to detect it's not on X axis.
Curious detail of the tests is that points of interest have nearly exact X of tested points, the values differ after 14th decimal place.
The tests provided test geometries for intersection with and without coordinates trimming after the 14th place (as per Martin Davis suggestion).
It has been extensively discussed in Ticket #591 and #40 with Martin Davis' input.
git-svn-id: http://svn.osgeo.org/geos/trunk@4038 5242fede-7e19-0410-aef8-94bd7d2200fb