]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/geometry/test/algorithms/overlay/get_turns_linear_linear_sph.cpp
4 // Copyright (c) 2016, Oracle and/or its affiliates.
5 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
7 // Use, modification and distribution is subject to the Boost Software License,
8 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
9 // http://www.boost.org/LICENSE_1_0.txt)
12 #include "test_get_turns.hpp"
13 #include <boost/geometry/geometries/geometries.hpp>
19 typedef bg::model::point
<T
, 2, bg::cs::spherical_equatorial
<bg::degree
> > pt
;
20 typedef bg::model::linestring
<pt
> ls
;
21 typedef bg::model::multi_linestring
<ls
> mls
;
23 // NOTE: currently for the first endpoint of the Linestring on collinear segment
24 // is_collinear flags are set to FALSE!
25 // E.g. in the first test tii++, NOT tii==
27 test_geometry
<ls
, ls
>("LINESTRING(0 0,2 0)", "LINESTRING(0 0,2 0)", "tii++", "txx==");
28 test_geometry
<ls
, ls
>("LINESTRING(0 0,2 0)", "LINESTRING(2 0,0 0)", "tix+=", "txi=+");
30 test_geometry
<ls
, ls
>("LINESTRING(1 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++");
31 test_geometry
<ls
, ls
>("LINESTRING(1 0,0 0)", "LINESTRING(0 0,1 0,2 0)", "txi=+", "tiu+=");
32 test_geometry
<ls
, ls
>("LINESTRING(1 0,2 0)", "LINESTRING(0 0,1 0,2 0)", "tii++", "txx==");
33 test_geometry
<ls
, ls
>("LINESTRING(1 1,1 0)", "LINESTRING(0 0,1 0,2 0)", "txu++");
34 test_geometry
<ls
, ls
>("LINESTRING(0 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "tii++", "txu==");
35 test_geometry
<ls
, ls
>("LINESTRING(2 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "txi=+", "tix+=");
37 test_geometry
<ls
, ls
>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,1 1)", "tuu++");
38 test_geometry
<ls
, ls
>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,0 0)", "tix+=", "tui=+");
39 test_geometry
<ls
, ls
>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,2 0)", "tii++", "txx==");
40 test_geometry
<ls
, ls
>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 1,1 0)", "tux++");
41 test_geometry
<ls
, ls
>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(0 0,1 0)", "tii++", "tux==");
42 test_geometry
<ls
, ls
>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(2 0,1 0)", "tix+=", "txi=+");
44 test_geometry
<ls
, ls
>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 1,1 0,3 0,3 1)", "mii++", "ccc==", "muu==");
45 test_geometry
<ls
, ls
>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 -1,1 0,3 0,3 -1)", "mii++", "ccc==", "muu==");
46 test_geometry
<ls
, ls
>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 1,3 0,1 0,1 1)", "miu+=", "mui=+");
47 test_geometry
<ls
, ls
>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 -1,3 0,1 0,1 -1)", "miu+=", "mui=+");
48 test_geometry
<ls
, ls
>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 1,2 0,4 0,4 1)", "tii++", "ccc==", "tuu==");
49 test_geometry
<ls
, ls
>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 -1,2 0,4 0,4 -1)", "tii++", "ccc==", "tuu==");
50 test_geometry
<ls
, ls
>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 1,4 0,2 0,2 1)", "tiu+=", "tui=+");
51 test_geometry
<ls
, ls
>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 -1,4 0,2 0,2 -1)", "tiu+=", "tui=+");
53 test_geometry
<ls
, ls
>("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(1 0,2 1,3 5)", "tii++", "ecc==", "tux==");
54 test_geometry
<ls
, ls
>("LINESTRING(0 0,1 0,2 1,3 5,4 0)", "LINESTRING(3 5,2 1,1 0)", "tix+=", "ecc==", "tui=+");
55 test_geometry
<ls
, ls
>("LINESTRING(1 0,2 1,3 5)", "LINESTRING(0 0,1 0,2 1,3 5,4 0)", "txu==", "ecc==", "tii++");
56 test_geometry
<ls
, ls
>("LINESTRING(3 5,2 1,1 0)", "LINESTRING(0 0,1 0,2 1,3 5,4 0)", "tiu+=", "ecc==", "txi=+");
58 test_geometry
<ls
, ls
>("LINESTRING(0 0,10 0)", "LINESTRING(-1 -1,1 0,10 0,20 -1)", "mii++", "txu==");
59 test_geometry
<ls
, ls
>("LINESTRING(0 0,10 0)", "LINESTRING(20 -1,10 0,1 0,-1 -1)", "miu+=", "txi=+");
60 test_geometry
<ls
, ls
>("LINESTRING(-1 -1,1 0,10 0,20 -1)", "LINESTRING(0 0,10 0)", "mii++", "tux==");
61 test_geometry
<ls
, ls
>("LINESTRING(20 -1,10 0,1 0,-1 -1)", "LINESTRING(0 0,10 0)", "mui=+", "tix+=");
63 test_geometry
<ls
, ls
>("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)",
64 "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)",
65 expected("tii++")("ecc==")("muu==")("mii++")("muu==")("mii++")("mux=="));
66 test_geometry
<ls
, ls
>("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)",
67 "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)",
68 expected("tiu+=")("ecc==")("mui=+")("miu+=")("mui=+")("miu+=")("mui=+"));
69 test_geometry
<ls
, ls
>("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)",
70 "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)",
71 expected("tui=+")("ecc==")("miu+=")("mui=+")("miu+=")("mui=+")("mix+="));
72 test_geometry
<ls
, ls
>("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)",
73 "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)",
74 expected("tuu==")("ecc==")("mii++")("muu==")("mii++")("muu==")("mii++"));
76 test_geometry
<ls
, ls
>("LINESTRING(-1 0,1 0,2 1.0004570537241201524198894179384922,3 2)",
77 "LINESTRING(4 5,3 2,1 0,0 0)",
78 "mix+=", "txi=+", "ecc==");
79 test_geometry
<ls
, ls
>("LINESTRING(4 5,3 2,1 0,0 0)",
80 "LINESTRING(-1 0,1 0,2 1.0004570537241201524198894179384922,3 2)",
81 "mxi=+", "tix+=", "ecc==");
83 test_geometry
<ls
, ls
>("LINESTRING(30 0,20 0,1 1,-1 -1)", "LINESTRING(0 -1,0 0,1 -1,20 0,25 0)", "mix+=", "tui=+", "muu++");
84 test_geometry
<ls
, ls
>("LINESTRING(0 -1,0 0,1 -1,20 0,25 0)", "LINESTRING(30 0,20 0,1 1,-1 -1)", "mxi=+", "tiu+=", "muu++");
86 test_geometry
<ls
, ls
>("LINESTRING(0 0,30 0)", "LINESTRING(4 0,4 1,20 1,5 0,1 0)", "muu++", "mui=+", "mix+=");
87 test_geometry
<ls
, ls
>("LINESTRING(4 0,4 1,20 1,5 0,1 0)", "LINESTRING(0 0,30 0)", "muu++", "miu+=", "mxi=+");
89 test_geometry
<ls
, ls
>("LINESTRING(30 0,0 0)", "LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)",
90 expected("mui=+")("miu+=")("mui=+")("mix+="));
91 test_geometry
<ls
, ls
>("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)", "LINESTRING(30 0,0 0)",
92 expected("miu+=")("mui=+")("miu+=")("mxi=+"));
94 test_geometry
<ls
, ls
>("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,4 -1)",
95 expected("mii++")("iuu++")("muu=="));
96 test_geometry
<ls
, ls
>("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,5 0,4 1)",
97 expected("mii++")("muu++")("muu=="));
100 test_geometry
<ls
, ls
>("LINESTRING(0 1,0 0)", "LINESTRING(0 0,1 0,2 0)", "txu++");
101 test_geometry
<ls
, ls
>("LINESTRING(0 1,0 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++");
102 test_geometry
<ls
, ls
>("LINESTRING(0 1,1 0,2 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++");
104 // SPIKE - NON-ENDPOINT - NON-OPPOSITE
107 test_geometry
<ls
, ls
>("LINESTRING(0 2,0 4,0 1)", "LINESTRING(0 0,0 4,6 3)",
108 expected("mii++")("txu==")("tiu==")("mxi=+"));
110 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 4,0 1)", "LINESTRING(0 0,0 4,6 3)",
111 expected("tii++")("txu==")("tiu==")("mxi=+"));
113 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 3,0 1)", "LINESTRING(0 0,0 4,6 3)",
114 expected("tii++")("mxu==")("miu==")("mxi=+"));
116 test_geometry
<ls
, ls
>("LINESTRING(0 1,0 3,0 2)", "LINESTRING(0 0,0 4,6 3)",
117 expected("mii++")("mxu==")("miu==")("mxi=+"));
119 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 3,0 2)", "LINESTRING(0 1,0 4,6 3)",
120 expected("mii++")("mxu==")("miu==")("mxi=+"));
122 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 4,0 2)", "LINESTRING(0 1,0 4,6 3)",
123 expected("mii++")("txu==")("tiu==")("mxi=+"));
124 // spike - out out/eq
125 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 4,0 2)", "LINESTRING(1 0,0 4,6 3)",
127 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 4,0 2)", "LINESTRING(-1 0,0 4,6 3)",
129 // spike - out out/neq
130 test_geometry
<ls
, ls
>("LINESTRING(0 -2,0 0,0 -1)", "LINESTRING(-1 0,1 0,6 3)",
132 test_geometry
<ls
, ls
>("LINESTRING(0 -2,0 0,0 -1)", "LINESTRING(-1 0,1 0,6 3)",
135 // SPIKE - NON-ENDPOINT - OPPOSITE
138 test_geometry
<ls
, ls
>("LINESTRING(0 6,0 4,0 0,0 2)", "LINESTRING(0 -1,0 0,0 4,6 3)",
139 expected("tiu+=")("txi=+")("tii=+")("mxu=="));
140 test_geometry
<ls
, ls
>("LINESTRING(0 -1,0 0,0 4,6 3)", "LINESTRING(0 6,0 4,0 0,0 2)",
141 expected("tui=+")("tix+=")("tii+=")("mux=="));
143 test_geometry
<ls
, ls
>("LINESTRING(0 6,0 4,0 0,0 2)", "LINESTRING(0 -1,0 0,0 5,6 3)",
144 expected("miu+=")("txi=+")("tii=+")("mxu=="));
146 test_geometry
<ls
, ls
>("LINESTRING(0 6,0 4,0 0,0 2)", "LINESTRING(0 -2,0 -1,0 4,6 3)",
147 expected("tiu+=")("mxi=+")("mii=+")("mxu=="));
148 // opposite - neq neq
149 test_geometry
<ls
, ls
>("LINESTRING(0 6,0 4,0 0,0 2)", "LINESTRING(0 -2,0 -1,0 3,6 3)",
150 expected("miu+=")("mxi=+")("mii=+")("mxu=="));
151 // opposite - neq neq
152 test_geometry
<ls
, ls
>("LINESTRING(0 6,0 4,0 0,0 2)", "LINESTRING(0 -2,0 -1,0 3,0 5,6 3)",
153 expected("miu+=")("mxi=+")("mii=+")("mxu=="));
155 test_geometry
<ls
, ls
>("LINESTRING(6 3,0 3,0 0)", "LINESTRING(0 0,0 2,0 3,0 1)",
156 expected("txi=+")("tix+=")("tii+=")("mux=="));
158 // SPIKE - ENDPOINT - NON-OPPOSITE
161 test_geometry
<ls
, ls
>("LINESTRING(0 2,0 4,0 1)", "LINESTRING(0 0,0 4)",
162 expected("mii++")("txx==")("tix==")("mxi=+"));
163 test_geometry
<ls
, ls
>("LINESTRING(0 2,0 4,0 1)", "LINESTRING(0 4,0 0)",
164 expected("miu+=")("txi=+")("tii=+")("mxu=="));
166 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 4,0 1)", "LINESTRING(0 0,0 4)",
167 expected("tii++")("txx==")("tix==")("mxi=+"));
168 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 4,0 1)", "LINESTRING(0 4,0 0)",
169 expected("tix+=")("txi=+")("tii=+")("mxu=="));
171 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 3,0 1)", "LINESTRING(0 0,0 4)",
172 expected("tii++")("mxu==")("miu==")("mxi=+"));
173 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 3,0 1)", "LINESTRING(0 4,0 0)",
174 expected("tix+=")("mxi=+")("mii=+")("mxu=="));
176 test_geometry
<ls
, ls
>("LINESTRING(0 1,0 3,0 2)", "LINESTRING(0 0,0 4)",
177 expected("mii++")("mxu==")("miu==")("mxi=+"));
178 test_geometry
<ls
, ls
>("LINESTRING(0 1,0 3,0 2)", "LINESTRING(0 4,0 0)",
179 expected("miu+=")("mxi=+")("mii=+")("mxu=="));
181 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 3,0 2)", "LINESTRING(0 1,0 4)",
182 expected("mii++")("mxu==")("miu==")("mxi=+"));
183 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 3,0 2)", "LINESTRING(0 4,0 1)",
184 expected("mix+=")("mxi=+")("mii=+")("mxu=="));
186 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 4,0 2)", "LINESTRING(0 1,0 4)",
187 expected("mii++")("txx==")("tix==")("mxi=+"));
188 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 4,0 2)", "LINESTRING(0 4,0 1)",
189 expected("mix+=")("txi=+")("tii=+")("mxu=="));
190 // spike - out out/eq
191 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 4,0 2)", "LINESTRING(1 0,0 4)",
193 test_geometry
<ls
, ls
>("LINESTRING(0 0,0 4,0 2)", "LINESTRING(-1 0,0 4)",
195 // spike - out out/neq
196 test_geometry
<ls
, ls
>("LINESTRING(0 -2,0 0,0 -1)", "LINESTRING(-1 0,1 0)",
198 test_geometry
<ls
, ls
>("LINESTRING(0 -2,0 0,0 -1)", "LINESTRING(1 0,-1 0)",
202 test_geometry
<ls
, ls
>("LINESTRING(3 0,0 0)",
203 "LINESTRING(4 2,1 0,9 0)",
204 expected("mui=+")("miu+="));
208 test_geometry
<ls
, ls
>("LINESTRING(6 0,0 0,5 0)",
209 "LINESTRING(2 0,0 0,-10 0)",
210 expected("mii++")("txu==")("tiu==")("mui=+"));
211 // the reversal could be automatic...
212 test_geometry
<ls
, ls
>("LINESTRING(2 0,0 0,-10 0)",
213 "LINESTRING(6 0,0 0,5 0)",
214 expected("mii++")("tux==")("tui==")("miu+="));
216 test_geometry
<ls
, ls
>("LINESTRING(6 0,0 0)",
217 "LINESTRING(2 0,0 0,-10 0)",
218 expected("mii++")("txu=="));
219 test_geometry
<ls
, ls
>("LINESTRING(0 0,5 0)",
220 "LINESTRING(2 0,0 0,-10 0)",
221 expected("tiu+=")("mui=+"));
223 if ( BOOST_GEOMETRY_CONDITION((boost::is_same
<T
, double>::value
)) )
225 test_geometry
<ls
, ls
>("LINESTRING(0 -1, 10 -1, 20 1)",
226 "LINESTRING(12 10, 12.5 -0.50051443471392, 15 0, 17.5 0.50051443471392)",
227 expected("mii++")("ccc==")("mux=="));
228 test_geometry
<ls
, ls
>("LINESTRING(0 -1, 10 -1, 20 1)",
229 "LINESTRING(17.5 0.50051443471392, 15 0, 12.5 -0.50051443471392, 12 10)",
230 expected("miu+=")("mui=+"));
231 test_geometry
<ls
, ls
>("LINESTRING(20 1, 10 -1, 0 -1)",
232 "LINESTRING(12 10, 12.5 -0.50051443471392, 15 0, 17.5 0.50051443471392)",
233 expected("mui=+")("mix+="));
234 test_geometry
<ls
, ls
>("LINESTRING(20 1, 10 -1, 0 0)",
235 "LINESTRING(17.5 0.50051443471392, 15 0, 12.5 -0.50051443471392, 12 10)",
236 expected("muu==")("ccc==")("mii++"));
238 test_geometry
<ls
, ls
>("LINESTRING(0 -1, 10 -1, 20 1)",
239 "LINESTRING(12.5 -0.50051443471392, 15 0, 17.5 0.50051443471392)",
240 expected("mii++")("ccc==")("mux=="));
241 test_geometry
<ls
, ls
>("LINESTRING(0 -1, 10 -1, 20 1)",
242 "LINESTRING(17.5 0.50051443471392, 15 0, 12.5 -0.50051443471392)",
243 expected("mix+=")("mui=+"));
244 test_geometry
<ls
, ls
>("LINESTRING(20 1, 10 -1, 0 -1)",
245 "LINESTRING(12.5 -0.50051443471392, 15 0, 17.5 0.50051443471392)",
246 expected("mui=+")("mix+="));
247 test_geometry
<ls
, ls
>("LINESTRING(20 1, 10 -1, 0 -1)",
248 "LINESTRING(17.5 0.50051443471392, 15 0, 12.5 -0.50051443471392)",
249 expected("mux==")("ccc==")("mii++"));
251 test_geometry
<ls
, ls
>("LINESTRING(0 -1, 10 -1, 20 1)",
252 "LINESTRING(12 10, 12.5 -0.50051443471392, 15 0)",
253 expected("mii++")("mux=="));
254 test_geometry
<ls
, ls
>("LINESTRING(0 -1, 10 -1, 20 1)",
255 "LINESTRING(15 0, 12.5 -0.50051443471392, 12 10)",
256 expected("miu+=")("mui=+"));
257 test_geometry
<ls
, ls
>("LINESTRING(20 1, 10 -1, 0 -1)",
258 "LINESTRING(12 10, 12.5 -0.50051443471392, 15 0)",
259 expected("mui=+")("mix+="));
260 test_geometry
<ls
, ls
>("LINESTRING(20 1, 10 -1, 0 -1)",
261 "LINESTRING(15 0, 12.5 -0.50051443471392, 12 10)",
262 expected("muu==")("mii++"));
266 //test_geometry<ls, ls>("LINESTRING(0 0,2 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102");
267 //test_geometry<ls, ls>("LINESTRING(2 0,0 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102");
269 //test_geometry<ls, ls>("LINESTRING(0 0,3 3,1 1)", "LINESTRING(3 0,3 3,3 1)", "0F1FF0102");
270 //test_geometry<ls, ls>("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 3,2 1)", "0F1FF0102");
271 //test_geometry<ls, ls>("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 2,2 1)", "0F1FF0102");
273 //test_geometry<ls, ls>("LINESTRING(0 0,2 2,3 3,4 4)", "LINESTRING(0 0,1 1,4 4)", "1FFF0FFF2");
276 //if ( boost::is_same<T, double>::value )
278 // to_svg<ls, ls>("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)", "LINESTRING(0 0,2 0,2.5 0,3 1)", "test11.svg");
279 // to_svg<ls, ls>("LINESTRING(0 0,1 0,2 0,2.5 0,3 1)", "LINESTRING(3 1,2.5 0,2 0,0 0)", "test12.svg");
280 // to_svg<ls, ls>("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,20 0,30 0,31 1)", "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", "test21.svg");
281 // to_svg<ls, ls>("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,20 0,30 0,31 1)", "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", "test22.svg");
283 // to_svg<ls, ls>("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", "test31.svg");
284 // to_svg<ls, ls>("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", "test32.svg");
285 // to_svg<ls, ls>("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", "test33.svg");
286 // to_svg<ls, ls>("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", "test34.svg");
290 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,10 0,30 0))",
291 "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0),(2 0,2 0),(3 0,3 0,3 0))",
292 expected("mii++")("ccc==")("ccc==")("txx=="));
295 test_geometry
<ls
, ls
>("LINESTRING(2 2,5 -1,15 2,18 0,20 0)",
296 "LINESTRING(30 0,19 0,18 0,0 0)",
297 expected("iuu++")("iuu++")("tiu+=")("mxi=+"));
299 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,10 0,5 0))",
300 "MULTILINESTRING((1 0,8 0,4 0))",
301 expected("mii++")("mix+=")("mux==")("mui==")("mix+=")("mii+=")("mxu==")("mxi=+"));
303 /*test_geometry<mls, mls>("MULTILINESTRING((0 0,10 0,5 0))",
304 "MULTILINESTRING((1 0,8 0,4 0),(2 0,9 0,5 0))",
305 expected("mii")("ccc")("ccc")("txx"));*/
308 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,10 0))",
309 "MULTILINESTRING((-1 0,0 0,-2 0),(11 0,10 0,12 0))",
310 expected("tuu++")("txu++"));
311 // internal turning R vs spike
312 test_geometry
<mls
, mls
>("MULTILINESTRING((1 0,1 1,2 1))",
313 "MULTILINESTRING((0 1,1 1,0 1))",
315 test_geometry
<mls
, mls
>("MULTILINESTRING((1 0,1 1,2 1))",
316 "MULTILINESTRING((1 2,1 1,1 2))",
318 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,1 0,0 0))",
319 "MULTILINESTRING((2 0,1 0,2 0))",
321 test_geometry
<mls
, mls
>("MULTILINESTRING((1 0,1 1,2 1))",
322 "MULTILINESTRING((0 2,1 1,0 2))",
324 test_geometry
<mls
, mls
>("MULTILINESTRING((1 0,1 1,2 1))",
325 "MULTILINESTRING((2 0,1 1,2 0))",
327 test_geometry
<mls
, mls
>("MULTILINESTRING((1 0,1 1,2 1))",
328 "MULTILINESTRING((2 1,1 1,2 1))",
329 expected("txi=+")("tix+=")("tii+=")("txx=="));
330 // internal turning L vs spike
331 test_geometry
<mls
, mls
>("MULTILINESTRING((1 0,1 1,0 1))",
332 "MULTILINESTRING((2 1,1 1,2 1))",
334 test_geometry
<mls
, mls
>("MULTILINESTRING((1 0,1 1,0 1))",
335 "MULTILINESTRING((1 2,1 1,1 2))",
337 test_geometry
<mls
, mls
>("MULTILINESTRING((1 0,1 1,0 1))",
338 "MULTILINESTRING((2 2,1 1,2 2))",
340 test_geometry
<mls
, mls
>("MULTILINESTRING((1 0,1 1,0 1))",
341 "MULTILINESTRING((0 0,1 1,0 0))",
343 test_geometry
<mls
, mls
>("MULTILINESTRING((1 0,1 1,0 1))",
344 "MULTILINESTRING((0 1,1 1,0 1))",
345 expected("txi=+")("tix+=")("tii+=")("txx=="));
346 // spike vs internal turning R
347 test_geometry
<mls
, mls
>("MULTILINESTRING((0 1,1 1,0 1))",
348 "MULTILINESTRING((1 0,1 1,2 1))",
350 test_geometry
<mls
, mls
>("MULTILINESTRING((1 2,1 1,1 2))",
351 "MULTILINESTRING((1 0,1 1,2 1))",
353 test_geometry
<mls
, mls
>("MULTILINESTRING((2 0,1 0,2 0))",
354 "MULTILINESTRING((0 0,1 0,0 0))",
356 test_geometry
<mls
, mls
>("MULTILINESTRING((0 2,1 1,0 2))",
357 "MULTILINESTRING((1 0,1 1,2 1))",
359 test_geometry
<mls
, mls
>("MULTILINESTRING((2 0,1 1,2 0))",
360 "MULTILINESTRING((1 0,1 1,2 1))",
362 test_geometry
<mls
, mls
>("MULTILINESTRING((2 1,1 1,2 1))",
363 "MULTILINESTRING((1 0,1 1,2 1))",
364 expected("tix+=")("txi=+")("tii=+")("txx=="));
365 // spike vs internal turning L
366 test_geometry
<mls
, mls
>("MULTILINESTRING((2 1,1 1,2 1))",
367 "MULTILINESTRING((1 0,1 1,0 1))",
369 test_geometry
<mls
, mls
>("MULTILINESTRING((1 2,1 1,1 2))",
370 "MULTILINESTRING((1 0,1 1,0 1))",
372 test_geometry
<mls
, mls
>("MULTILINESTRING((2 2,1 1,2 2))",
373 "MULTILINESTRING((1 0,1 1,0 1))",
375 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,1 1,0 0))",
376 "MULTILINESTRING((1 0,1 1,0 1))",
378 test_geometry
<mls
, mls
>("MULTILINESTRING((0 1,1 1,0 1))",
379 "MULTILINESTRING((1 0,1 1,0 1))",
380 expected("tix+=")("txi=+")("tii=+")("txx=="));
381 // spike vs internal collinear
382 test_geometry
<mls
, mls
>("MULTILINESTRING((0 1,1 1,0 1))",
383 "MULTILINESTRING((2 1,1 1,0 1))",
384 expected("tix+=")("txi=+")("tii=+")("txx=="));
385 // internal collinear vs spike
386 test_geometry
<mls
, mls
>("MULTILINESTRING((2 1,1 1,0 1))",
387 "MULTILINESTRING((0 1,1 1,0 1))",
388 expected("txi=+")("tix+=")("tii+=")("txx=="));
390 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,1 1,0 0))",
391 "MULTILINESTRING((2 2,1 1,2 2))",
393 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,1 1,0 0))",
394 "MULTILINESTRING((2 0,1 1,2 0))",
396 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,1 1,0 0))",
397 "MULTILINESTRING((2 1,1 1,2 1))",
399 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,1 1,0 0))",
400 "MULTILINESTRING((0 1,1 1,0 1))",
403 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,1 1,0 0))",
404 "MULTILINESTRING((0 0,1 1,0 0))",
405 expected("tii++")("tix+=")("txi=+")("txx==")
407 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,1 1,0 0))",
408 "MULTILINESTRING((1 1,0 0,1 1))",
409 expected("tix+=")("tii+=")("txx==")("txi==")
410 ("txi=+")("tii=+")("txx==")("tix=="));
412 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,10 0))",
413 "MULTILINESTRING((-1 0,0 0,2 0))",
414 expected("tii++")("mux=="));
415 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,10 0))",
416 "MULTILINESTRING((-1 -1,0 0,2 0))",
417 expected("tii++")("mux=="));
418 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,10 0))",
419 "MULTILINESTRING((2 0,0 0,-1 0))",
420 expected("tiu+=")("mui=+"));
421 test_geometry
<mls
, mls
>("MULTILINESTRING((0 0,10 0))",
422 "MULTILINESTRING((2 0,0 0,-1 -1))",
423 expected("tiu+=")("mui=+"));
426 int test_main(int, char* [])
431 #if ! defined(_MSC_VER)
432 test_all
<long double>();
435 #if defined(HAVE_TTMATH)
436 test_all
<ttmath_big
>();