]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // Boost.Geometry (aka GGL, Generic Geometry Library) |
2 | // Unit Test | |
3 | ||
4 | // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. | |
5 | // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. | |
6 | // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. | |
7 | ||
8 | // This file was modified by Oracle on 2014, 2015. | |
9 | // Modifications copyright (c) 2014-2015 Oracle and/or its affiliates. | |
10 | ||
11 | // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle | |
12 | ||
13 | // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library | |
14 | // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. | |
15 | ||
16 | // Use, modification and distribution is subject to the Boost Software License, | |
17 | // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at | |
18 | // http://www.boost.org/LICENSE_1_0.txt) | |
19 | ||
20 | #include "test_get_turns.hpp" | |
21 | #include <boost/geometry/geometries/geometries.hpp> | |
22 | ||
23 | //TEST | |
24 | //#include <to_svg.hpp> | |
25 | ||
26 | template <typename T> | |
27 | void test_all() | |
28 | { | |
29 | typedef bg::model::point<T, 2, bg::cs::cartesian> pt; | |
30 | typedef bg::model::linestring<pt> ls; | |
31 | typedef bg::model::multi_linestring<ls> mls; | |
32 | ||
33 | // NOTE: currently for the first endpoint of the Linestring on collinear segment | |
34 | // is_collinear flags are set to FALSE! | |
35 | // E.g. in the first test tii++, NOT tii== | |
36 | ||
37 | test_geometry<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(0 0,2 0)", "tii++", "txx=="); | |
38 | test_geometry<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(2 0,0 0)", "tix+=", "txi=+"); | |
39 | ||
40 | test_geometry<ls, ls>("LINESTRING(1 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++"); | |
41 | test_geometry<ls, ls>("LINESTRING(1 0,0 0)", "LINESTRING(0 0,1 0,2 0)", "txi=+", "tiu+="); | |
42 | test_geometry<ls, ls>("LINESTRING(1 0,2 0)", "LINESTRING(0 0,1 0,2 0)", "tii++", "txx=="); | |
43 | test_geometry<ls, ls>("LINESTRING(1 1,1 0)", "LINESTRING(0 0,1 0,2 0)", "txu++"); | |
44 | test_geometry<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "tii++", "txu=="); | |
45 | test_geometry<ls, ls>("LINESTRING(2 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "txi=+", "tix+="); | |
46 | ||
47 | test_geometry<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,1 1)", "tuu++"); | |
48 | test_geometry<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,0 0)", "tix+=", "tui=+"); | |
49 | test_geometry<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,2 0)", "tii++", "txx=="); | |
50 | test_geometry<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 1,1 0)", "tux++"); | |
51 | test_geometry<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(0 0,1 0)", "tii++", "tux=="); | |
52 | test_geometry<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(2 0,1 0)", "tix+=", "txi=+"); | |
53 | ||
54 | test_geometry<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 1,1 0,3 0,3 1)", "mii++", "ccc==", "muu=="); | |
55 | test_geometry<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 -1,1 0,3 0,3 -1)", "mii++", "ccc==", "muu=="); | |
56 | test_geometry<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 1,3 0,1 0,1 1)", "miu+=", "mui=+"); | |
57 | test_geometry<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 -1,3 0,1 0,1 -1)", "miu+=", "mui=+"); | |
58 | 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=="); | |
59 | 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=="); | |
60 | 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=+"); | |
61 | 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=+"); | |
62 | ||
63 | // same as above - TODO: reverse manually or automatically for all tests | |
64 | /*test_geometry<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 1,1 0,2 0,3 0,3 1)", "mii", "ecc", "muu"); | |
65 | test_geometry<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 -1,1 0,2 0,3 0,3 -1)", "mii", "ecc", "muu"); | |
66 | test_geometry<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 1,3 0,2 0,1 0,1 1)", "miu", "ecc", "mui"); | |
67 | test_geometry<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 -1,3 0,2 0,1 0,1 -1)", "miu", "ecc", "mui"); | |
68 | test_geometry<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 1,2 0,3 0,4 0,4 1)", "tii", "ecc", "tuu"); | |
69 | test_geometry<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 -1,2 0,3 0,4 0,4 -1)", "tii", "ecc", "tuu"); | |
70 | test_geometry<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 1,4 0,3 0,2 0,2 1)", "tiu", "ecc", "tui"); | |
71 | test_geometry<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 -1,4 0,3 0,2 0,2 -1)", "tiu", "ecc", "tui");*/ | |
72 | ||
73 | 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=="); | |
74 | 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=+"); | |
75 | 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++"); | |
76 | 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=+"); | |
77 | ||
78 | test_geometry<ls, ls>("LINESTRING(0 0,10 0)", "LINESTRING(-1 -1,1 0,10 0,20 -1)", "mii++", "txu=="); | |
79 | test_geometry<ls, ls>("LINESTRING(0 0,10 0)", "LINESTRING(20 -1,10 0,1 0,-1 -1)", "miu+=", "txi=+"); | |
80 | test_geometry<ls, ls>("LINESTRING(-1 -1,1 0,10 0,20 -1)", "LINESTRING(0 0,10 0)", "mii++", "tux=="); | |
81 | test_geometry<ls, ls>("LINESTRING(20 -1,10 0,1 0,-1 -1)", "LINESTRING(0 0,10 0)", "mui=+", "tix+="); | |
82 | ||
83 | test_geometry<ls, ls>("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", | |
84 | "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", | |
85 | expected("tii++")("ecc==")("muu==")("mii++")("muu==")("mii++")("mux==")); | |
86 | test_geometry<ls, ls>("LINESTRING(-1 1,0 0,1 0,4 0,5 5,10 5,15 0,31 0)", | |
87 | "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", | |
88 | expected("tiu+=")("ecc==")("mui=+")("miu+=")("mui=+")("miu+=")("mui=+")); | |
89 | test_geometry<ls, ls>("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", | |
90 | "LINESTRING(-1 -1,0 0,1 0,2 0,2.5 1,3 0,30 0)", | |
91 | expected("tui=+")("ecc==")("miu+=")("mui=+")("miu+=")("mui=+")("mix+=")); | |
92 | test_geometry<ls, ls>("LINESTRING(31 0,15 0,10 5,5 5,4 0,1 0,0 0,-1 1)", | |
93 | "LINESTRING(30 0,3 0,2.5 1,2 0,1 0,0 0,-1 -1)", | |
94 | expected("tuu==")("ecc==")("mii++")("muu==")("mii++")("muu==")("mii++")); | |
95 | ||
96 | test_geometry<ls, ls>("LINESTRING(-1 0,1 0,2 1,3 2)", "LINESTRING(4 5,3 2,1 0,0 0)", "mix+=", "txi=+", "ecc=="); | |
97 | test_geometry<ls, ls>("LINESTRING(4 5,3 2,1 0,0 0)", "LINESTRING(-1 0,1 0,2 1,3 2)", "mxi=+", "tix+=", "ecc=="); | |
98 | ||
99 | test_geometry<ls, ls>("LINESTRING(30 1,20 1,10 0,0 0)", "LINESTRING(1 1,2 0,3 1,20 1,25 1)", "mix+=", "tui=+", "muu++"); | |
100 | test_geometry<ls, ls>("LINESTRING(1 1,2 0,3 1,20 1,25 1)", "LINESTRING(30 1,20 1,10 0,0 0)", "mxi=+", "tiu+=", "muu++"); | |
101 | ||
102 | test_geometry<ls, ls>("LINESTRING(0 0,30 0)", "LINESTRING(4 0,4 1,20 1,5 0,1 0)", "muu++", "mui=+", "mix+="); | |
103 | test_geometry<ls, ls>("LINESTRING(4 0,4 1,20 1,5 0,1 0)", "LINESTRING(0 0,30 0)", "muu++", "miu+=", "mxi=+"); | |
104 | ||
105 | test_geometry<ls, ls>("LINESTRING(30 0,0 0)", "LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)", | |
106 | expected("mui=+")("miu+=")("mui=+")("mix+=")); | |
107 | test_geometry<ls, ls>("LINESTRING(1 0,5 0,20 1,4 1,4 0,5 0)", "LINESTRING(30 0,0 0)", | |
108 | expected("miu+=")("mui=+")("miu+=")("mxi=+")); | |
109 | ||
110 | test_geometry<ls, ls>("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,4 -1)", | |
111 | expected("mii++")("iuu++")("muu==")); | |
112 | test_geometry<ls, ls>("LINESTRING(1 0,7 0,8 1)", "LINESTRING(0 0,10 0,10 10,5 0,4 1)", | |
113 | expected("mii++")("muu++")("muu==")); | |
114 | ||
115 | // non-collinear | |
116 | test_geometry<ls, ls>("LINESTRING(0 1,0 0)", "LINESTRING(0 0,1 0,2 0)", "txu++"); | |
117 | test_geometry<ls, ls>("LINESTRING(0 1,0 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++"); | |
118 | test_geometry<ls, ls>("LINESTRING(0 1,1 0,2 1)", "LINESTRING(0 0,1 0,2 0)", "tuu++"); | |
119 | ||
120 | // SPIKE - NON-ENDPOINT - NON-OPPOSITE | |
121 | ||
122 | // spike - neq eq | |
123 | test_geometry<ls, ls>("LINESTRING(2 2,4 4,1 1)", "LINESTRING(0 0,4 4,6 3)", | |
124 | expected("mii++")("txu==")("tiu==")("mxi=+")); | |
125 | // spike - eq eq | |
126 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,1 1)", "LINESTRING(0 0,4 4,6 3)", | |
127 | expected("tii++")("txu==")("tiu==")("mxi=+")); | |
128 | // spike - eq neq | |
129 | test_geometry<ls, ls>("LINESTRING(0 0,3 3,1 1)", "LINESTRING(0 0,4 4,6 3)", | |
130 | expected("tii++")("mxu==")("miu==")("mxi=+")); | |
131 | // spike - neq neq | |
132 | test_geometry<ls, ls>("LINESTRING(1 1,3 3,2 2)", "LINESTRING(0 0,4 4,6 3)", | |
133 | expected("mii++")("mxu==")("miu==")("mxi=+")); | |
134 | // spike - out neq | |
135 | test_geometry<ls, ls>("LINESTRING(0 0,3 3,2 2)", "LINESTRING(1 1,4 4,6 3)", | |
136 | expected("mii++")("mxu==")("miu==")("mxi=+")); | |
137 | // spike - out eq | |
138 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(1 1,4 4,6 3)", | |
139 | expected("mii++")("txu==")("tiu==")("mxi=+")); | |
140 | // spike - out out/eq | |
141 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(1 0,4 4,6 3)", | |
142 | expected("tuu++")); | |
143 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(0 1,4 4,6 3)", | |
144 | expected("tuu++")); | |
145 | // spike - out out/neq | |
146 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(4 0,4 5,6 3)", | |
147 | expected("muu++")); | |
148 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(0 4,5 4,6 3)", | |
149 | expected("muu++")); | |
150 | ||
151 | // SPIKE - NON-ENDPOINT - OPPOSITE | |
152 | ||
153 | // opposite - eq eq | |
154 | test_geometry<ls, ls>("LINESTRING(6 6,4 4,0 0,2 2)", "LINESTRING(-1 -1,0 0,4 4,6 3)", | |
155 | expected("tiu+=")("txi=+")("tii=+")("mxu==")); | |
156 | test_geometry<ls, ls>("LINESTRING(-1 -1,0 0,4 4,6 3)", "LINESTRING(6 6,4 4,0 0,2 2)", | |
157 | expected("tui=+")("tix+=")("tii+=")("mux==")); | |
158 | // opposite - neq eq | |
159 | test_geometry<ls, ls>("LINESTRING(6 6,4 4,0 0,2 2)", "LINESTRING(-1 -1,0 0,5 5,6 3)", | |
160 | expected("miu+=")("txi=+")("tii=+")("mxu==")); | |
161 | // opposite - eq neq | |
162 | test_geometry<ls, ls>("LINESTRING(6 6,4 4,0 0,2 2)", "LINESTRING(-2 -2,-1 -1,4 4,6 3)", | |
163 | expected("tiu+=")("mxi=+")("mii=+")("mxu==")); | |
164 | // opposite - neq neq | |
165 | test_geometry<ls, ls>("LINESTRING(6 6,4 4,0 0,2 2)", "LINESTRING(-2 -2,-1 -1,3 3,6 3)", | |
166 | expected("miu+=")("mxi=+")("mii=+")("mxu==")); | |
167 | // opposite - neq neq | |
168 | test_geometry<ls, ls>("LINESTRING(6 6,4 4,0 0,2 2)", "LINESTRING(-2 -2,-1 -1,3 3,5 5,6 3)", | |
169 | expected("miu+=")("mxi=+")("mii=+")("mxu==")); | |
170 | // opposite - neq eq | |
171 | test_geometry<ls, ls>("LINESTRING(6 3,3 3,0 0)", "LINESTRING(0 0,2 2,3 3,1 1)", | |
172 | expected("txi=+")("tix+=")("tii+=")("mux==")); | |
173 | ||
174 | // SPIKE - ENDPOINT - NON-OPPOSITE | |
175 | ||
176 | // spike - neq eq | |
177 | test_geometry<ls, ls>("LINESTRING(2 2,4 4,1 1)", "LINESTRING(0 0,4 4)", | |
178 | expected("mii++")("txx==")("tix==")("mxi=+")); | |
179 | test_geometry<ls, ls>("LINESTRING(2 2,4 4,1 1)", "LINESTRING(4 4,0 0)", | |
180 | expected("miu+=")("txi=+")("tii=+")("mxu==")); | |
181 | // spike - eq eq | |
182 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,1 1)", "LINESTRING(0 0,4 4)", | |
183 | expected("tii++")("txx==")("tix==")("mxi=+")); | |
184 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,1 1)", "LINESTRING(4 4,0 0)", | |
185 | expected("tix+=")("txi=+")("tii=+")("mxu==")); | |
186 | // spike - eq neq | |
187 | test_geometry<ls, ls>("LINESTRING(0 0,3 3,1 1)", "LINESTRING(0 0,4 4)", | |
188 | expected("tii++")("mxu==")("miu==")("mxi=+")); | |
189 | test_geometry<ls, ls>("LINESTRING(0 0,3 3,1 1)", "LINESTRING(4 4,0 0)", | |
190 | expected("tix+=")("mxi=+")("mii=+")("mxu==")); | |
191 | // spike - neq neq | |
192 | test_geometry<ls, ls>("LINESTRING(1 1,3 3,2 2)", "LINESTRING(0 0,4 4)", | |
193 | expected("mii++")("mxu==")("miu==")("mxi=+")); | |
194 | test_geometry<ls, ls>("LINESTRING(1 1,3 3,2 2)", "LINESTRING(4 4,0 0)", | |
195 | expected("miu+=")("mxi=+")("mii=+")("mxu==")); | |
196 | // spike - out neq | |
197 | test_geometry<ls, ls>("LINESTRING(0 0,3 3,2 2)", "LINESTRING(1 1,4 4)", | |
198 | expected("mii++")("mxu==")("miu==")("mxi=+")); | |
199 | test_geometry<ls, ls>("LINESTRING(0 0,3 3,2 2)", "LINESTRING(4 4,1 1)", | |
200 | expected("mix+=")("mxi=+")("mii=+")("mxu==")); | |
201 | // spike - out eq | |
202 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(1 1,4 4)", | |
203 | expected("mii++")("txx==")("tix==")("mxi=+")); | |
204 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(4 4,1 1)", | |
205 | expected("mix+=")("txi=+")("tii=+")("mxu==")); | |
206 | // spike - out out/eq | |
207 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(1 0,4 4)", | |
208 | expected("tux++")); | |
209 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(0 1,4 4)", | |
210 | expected("tux++")); | |
211 | // spike - out out/neq | |
212 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(4 0,4 5)", | |
213 | expected("muu++")); | |
214 | test_geometry<ls, ls>("LINESTRING(0 0,4 4,2 2)", "LINESTRING(0 4,5 4)", | |
215 | expected("muu++")); | |
216 | ||
217 | // 29.01.2015 | |
218 | if ( BOOST_GEOMETRY_CONDITION((boost::is_same<T, double>::value)) ) | |
219 | { | |
220 | // FAILING - possibly wrong IPs | |
221 | test_geometry<ls, ls>("LINESTRING(3 -0.6,0 -0.9)", | |
222 | "LINESTRING(4 2.232432,1 -0.8,9 0)", | |
223 | expected("mui=+")("miu+=")); | |
224 | ||
225 | test_geometry<ls, ls>("LINESTRING(3 -0.6,1 -0.8,0 -0.9)", | |
226 | "LINESTRING(4 2.232432,1 -0.8,9 0)", | |
227 | expected("tui=+")("miu+=")); | |
228 | ||
229 | test_geometry<ls, ls>("LINESTRING(3 -0.6, 0 -0.9, -1 -1)", | |
230 | "LINESTRING(4 2.232432, 0 -0.9, 9 0)", | |
231 | expected("tui=+")("miu+=")); | |
232 | ||
233 | test_geometry<ls, ls>("LINESTRING(3 -0.6, 0 -0.9, -1 -1, -2 -2)", | |
234 | "LINESTRING(4 2.232432,-1 -1, 0 -0.9, 9 0)", | |
235 | expected("tui=+")("ecc==")("miu+=")); | |
236 | } | |
237 | ||
238 | test_geometry<ls, ls>("LINESTRING(3 0,0 0)", | |
239 | "LINESTRING(4 2,1 0,9 0)", | |
240 | expected("mui=+")("miu+=")); | |
241 | ||
242 | ||
243 | // 01.02.2015 | |
244 | test_geometry<ls, ls>("LINESTRING(6 0,0 0,5 0)", | |
245 | "LINESTRING(2 0,0 0,-10 0)", | |
246 | expected("mii++")("txu==")("tiu==")("mui=+")); | |
247 | // the reversal could be automatic... | |
248 | test_geometry<ls, ls>("LINESTRING(2 0,0 0,-10 0)", | |
249 | "LINESTRING(6 0,0 0,5 0)", | |
250 | expected("mii++")("tux==")("tui==")("miu+=")); | |
251 | // sanity check | |
252 | test_geometry<ls, ls>("LINESTRING(6 0,0 0)", | |
253 | "LINESTRING(2 0,0 0,-10 0)", | |
254 | expected("mii++")("txu==")); | |
255 | test_geometry<ls, ls>("LINESTRING(0 0,5 0)", | |
256 | "LINESTRING(2 0,0 0,-10 0)", | |
257 | expected("tiu+=")("mui=+")); | |
258 | ||
259 | // 03.02.2015 | |
260 | test_geometry<ls, ls>("LINESTRING(-7 -8,3 0,4 -1,-7 10)", | |
261 | "LINESTRING(-5 -4,3 0,4 -1,7 -4,2 -1)", | |
262 | expected("tii++")("txu==")("tiu==")("mui=+")); | |
263 | test_geometry<ls, ls>("LINESTRING(-7 -8,3 0,4 -1,-7 10)", | |
264 | "LINESTRING(-5 -4,3 0,7 -4,2 -1)", | |
265 | expected("tii++")("mxu==")("miu==")("mui=+")); | |
266 | ||
267 | if ( BOOST_GEOMETRY_CONDITION((boost::is_same<T, double>::value)) ) | |
268 | { | |
269 | // BUG - the operations are correct but IP coordinates are wrong | |
270 | // ok now also the 3rd turn is wrong | |
92f5a8d4 | 271 | #ifdef BOOST_GEOMETRY_TEST_FAILURES |
7c673cae FG |
272 | test_geometry<ls, ls>("LINESTRING(8 5,5 1,-2 3,1 10)", |
273 | "LINESTRING(1.9375 1.875, 1.7441860465116283 1.9302325581395348, -0.7692307692307692 2.6483516483516487, -2 3, -1.0071942446043165 5.316546762589928)", | |
274 | expected("mii++")("ccc==")("ccc==")("mux==")); | |
275 | // Now tii++ is generated instead of ccc== | |
276 | ||
277 | test_geometry<ls, ls>("LINESTRING(8 5,5 1,-2 3,1 10)", | |
278 | "LINESTRING(1.9375 1.875, 1.7441860465116283 1.9302325581395348, -0.7692307692307692 2.6483516483516487, -2 3, -0.5 6.5)", | |
279 | expected("mii++")("ccc==")("ccc==")("mux==")); | |
280 | // Now tii++ is generated instead of ccc== | |
281 | ||
282 | #endif | |
283 | ||
284 | test_geometry<ls, ls>("LINESTRING(-0.5 7,8 1,0 -0.2)", | |
285 | "LINESTRING(2 8,4 0.4,8 1,0 5)", | |
286 | expected("iuu++")("mui=+")("tiu+=")); | |
287 | ||
288 | #if ! ( defined(BOOST_CLANG) && defined(BOOST_GEOMETRY_COMPILER_MODE_RELEASE) ) | |
289 | ||
290 | // In clang/release mode this testcase gives other results | |
291 | ||
292 | // assertion failure in 1.57 | |
293 | // FAILING - no assertion failure but the result is not very good | |
294 | test_geometry<ls, ls>("LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)", | |
295 | "LINESTRING(31 -97, -46 57, -20 -4)", | |
296 | expected("")("")); | |
297 | test_geometry<ls, ls>("LINESTRING(31 -97, -46 57, -20 -4)", | |
298 | "LINESTRING(-2305843009213693956 4611686018427387906, -33 -92, 78 83)", | |
299 | expected("")("")); | |
300 | ||
301 | #endif | |
302 | ||
303 | } | |
304 | ||
305 | // In 1.57 the results of those combinations was different for MinGW | |
306 | // (probably also QCC and GCC5.0) and MSVC/GCC. The results was depending | |
307 | // on the instructions generated by the compiler when calculating the | |
308 | // determinants. | |
309 | // See also: https://svn.boost.org/trac/boost/ticket/8379 | |
310 | // https://github.com/boostorg/geometry/pull/259 | |
311 | if ( BOOST_GEOMETRY_CONDITION((boost::is_same<T, double>::value)) ) | |
312 | { | |
313 | test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)", | |
314 | "LINESTRING(12 10, 13 0.3, 14 0.4, 15 0.5)", | |
315 | expected("mii++")("ccc==")("mux==")); | |
316 | test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 110 1)", | |
317 | "LINESTRING(12 10, 13 0.03, 14 0.04, 15 0.05)", | |
318 | expected("mii++")("ccc==")("mux==")); | |
319 | test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 110 1)", | |
320 | "LINESTRING(102 10, 103 0.93, 104 0.94, 105 0.95)", | |
321 | expected("mii++")("ccc==")("mux==")); | |
322 | test_geometry<ls, ls>("LINESTRING(100 0, 110 0, 120 1)", | |
323 | "LINESTRING(112 10, 113 0.3, 114 0.4, 115 0.5)", | |
324 | expected("mii++")("ccc==")("mux==")); | |
325 | test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)", | |
326 | "LINESTRING(15 0.5, 14 0.4, 13 0.3, 12 10)", | |
327 | expected("miu+=")("mui=+")); | |
328 | test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)", | |
329 | "LINESTRING(12 10, 13 0.3, 14 0.4, 15 0.5)", | |
330 | expected("mui=+")("mix+=")); | |
331 | test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)", | |
332 | "LINESTRING(15 0.5, 14 0.4, 13 0.3, 12 10)", | |
333 | expected("muu==")("ccc==")("mii++")); | |
334 | ||
335 | test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)", | |
336 | "LINESTRING(13 0.3, 14 0.4, 15 0.5)", | |
337 | expected("mii++")("ccc==")("mux==")); | |
338 | test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)", | |
339 | "LINESTRING(15 0.5, 14 0.4, 13 0.3)", | |
340 | expected("mix+=")("mui=+")); | |
341 | test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)", | |
342 | "LINESTRING(13 0.3, 14 0.4, 15 0.5)", | |
343 | expected("mui=+")("mix+=")); | |
344 | test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)", | |
345 | "LINESTRING(15 0.5, 14 0.4, 13 0.3)", | |
346 | expected("mux==")("ccc==")("mii++")); | |
347 | ||
348 | test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)", | |
349 | "LINESTRING(12 10, 13 0.3, 14 0.4)", | |
350 | expected("mii++")("mux==")); | |
351 | test_geometry<ls, ls>("LINESTRING(0 0, 10 0, 20 1)", | |
352 | "LINESTRING(14 0.4, 13 0.3, 12 10)", | |
353 | expected("miu+=")("mui=+")); | |
354 | test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)", | |
355 | "LINESTRING(12 10, 13 0.3, 14 0.4)", | |
356 | expected("mui=+")("mix+=")); | |
357 | test_geometry<ls, ls>("LINESTRING(20 1, 10 0, 0 0)", | |
358 | "LINESTRING(14 0.4, 13 0.3, 12 10)", | |
359 | expected("muu==")("mii++")); | |
360 | } | |
361 | ||
362 | // TODO: | |
363 | //test_geometry<ls, ls>("LINESTRING(0 0,2 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102"); | |
364 | //test_geometry<ls, ls>("LINESTRING(2 0,0 0,1 0)", "LINESTRING(0 1,0 0,2 0)", "1FF00F102"); | |
365 | ||
366 | //test_geometry<ls, ls>("LINESTRING(0 0,3 3,1 1)", "LINESTRING(3 0,3 3,3 1)", "0F1FF0102"); | |
367 | //test_geometry<ls, ls>("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 3,2 1)", "0F1FF0102"); | |
368 | //test_geometry<ls, ls>("LINESTRING(0 0,3 3,1 1)", "LINESTRING(2 0,2 2,2 1)", "0F1FF0102"); | |
369 | ||
370 | //test_geometry<ls, ls>("LINESTRING(0 0,2 2,3 3,4 4)", "LINESTRING(0 0,1 1,4 4)", "1FFF0FFF2"); | |
371 | ||
372 | ||
373 | //if ( boost::is_same<T, double>::value ) | |
374 | //{ | |
375 | // 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"); | |
376 | // 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"); | |
377 | // 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"); | |
378 | // 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"); | |
379 | ||
380 | // 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"); | |
381 | // 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"); | |
382 | // 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"); | |
383 | // 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"); | |
384 | //} | |
385 | ||
386 | // duplicated | |
387 | test_geometry<mls, mls>("MULTILINESTRING((0 0,10 0,30 0))", | |
388 | "MULTILINESTRING((0 10,5 0,20 0,20 0,30 0),(2 0,2 0),(3 0,3 0,3 0))", | |
389 | expected("mii++")("ccc==")("ccc==")("txx==")); | |
390 | ||
391 | // spike | |
392 | test_geometry<ls, ls>("LINESTRING(2 2,5 -1,15 2,18 0,20 0)", | |
393 | "LINESTRING(30 0,19 0,18 0,0 0)", | |
394 | expected("iuu++")("iuu++")("tiu+=")("mxi=+")); | |
395 | // spike | |
396 | test_geometry<mls, mls>("MULTILINESTRING((0 0,10 0,5 0))", | |
397 | "MULTILINESTRING((1 0,8 0,4 0))", | |
398 | expected("mii++")("mix+=")("mux==")("mui==")("mix+=")("mii+=")("mxu==")("mxi=+")); | |
399 | ||
400 | /*test_geometry<mls, mls>("MULTILINESTRING((0 0,10 0,5 0))", | |
401 | "MULTILINESTRING((1 0,8 0,4 0),(2 0,9 0,5 0))", | |
402 | expected("mii")("ccc")("ccc")("txx"));*/ | |
403 | ||
404 | // spike vs endpoint | |
405 | test_geometry<mls, mls>("MULTILINESTRING((0 0,10 0))", | |
406 | "MULTILINESTRING((-1 0,0 0,-2 0),(11 0,10 0,12 0))", | |
407 | expected("tuu++")("txu++")); | |
408 | // internal turning R vs spike | |
409 | test_geometry<mls, mls>("MULTILINESTRING((1 0,1 1,2 1))", | |
410 | "MULTILINESTRING((0 1,1 1,0 1))", | |
411 | expected("tuu++")); | |
412 | test_geometry<mls, mls>("MULTILINESTRING((1 0,1 1,2 1))", | |
413 | "MULTILINESTRING((1 2,1 1,1 2))", | |
414 | expected("tuu++")); | |
415 | test_geometry<mls, mls>("MULTILINESTRING((0 0,1 0,0 0))", | |
416 | "MULTILINESTRING((2 0,1 0,2 0))", | |
417 | expected("tuu++")); | |
418 | test_geometry<mls, mls>("MULTILINESTRING((1 0,1 1,2 1))", | |
419 | "MULTILINESTRING((0 2,1 1,0 2))", | |
420 | expected("tuu++")); | |
421 | test_geometry<mls, mls>("MULTILINESTRING((1 0,1 1,2 1))", | |
422 | "MULTILINESTRING((2 0,1 1,2 0))", | |
423 | expected("tuu++")); | |
424 | test_geometry<mls, mls>("MULTILINESTRING((1 0,1 1,2 1))", | |
425 | "MULTILINESTRING((2 1,1 1,2 1))", | |
426 | expected("txi=+")("tix+=")("tii+=")("txx==")); | |
427 | // internal turning L vs spike | |
428 | test_geometry<mls, mls>("MULTILINESTRING((1 0,1 1,0 1))", | |
429 | "MULTILINESTRING((2 1,1 1,2 1))", | |
430 | expected("tuu++")); | |
431 | test_geometry<mls, mls>("MULTILINESTRING((1 0,1 1,0 1))", | |
432 | "MULTILINESTRING((1 2,1 1,1 2))", | |
433 | expected("tuu++")); | |
434 | test_geometry<mls, mls>("MULTILINESTRING((1 0,1 1,0 1))", | |
435 | "MULTILINESTRING((2 2,1 1,2 2))", | |
436 | expected("tuu++")); | |
437 | test_geometry<mls, mls>("MULTILINESTRING((1 0,1 1,0 1))", | |
438 | "MULTILINESTRING((0 0,1 1,0 0))", | |
439 | expected("tuu++")); | |
440 | test_geometry<mls, mls>("MULTILINESTRING((1 0,1 1,0 1))", | |
441 | "MULTILINESTRING((0 1,1 1,0 1))", | |
442 | expected("txi=+")("tix+=")("tii+=")("txx==")); | |
443 | // spike vs internal turning R | |
444 | test_geometry<mls, mls>("MULTILINESTRING((0 1,1 1,0 1))", | |
445 | "MULTILINESTRING((1 0,1 1,2 1))", | |
446 | expected("tuu++")); | |
447 | test_geometry<mls, mls>("MULTILINESTRING((1 2,1 1,1 2))", | |
448 | "MULTILINESTRING((1 0,1 1,2 1))", | |
449 | expected("tuu++")); | |
450 | test_geometry<mls, mls>("MULTILINESTRING((2 0,1 0,2 0))", | |
451 | "MULTILINESTRING((0 0,1 0,0 0))", | |
452 | expected("tuu++")); | |
453 | test_geometry<mls, mls>("MULTILINESTRING((0 2,1 1,0 2))", | |
454 | "MULTILINESTRING((1 0,1 1,2 1))", | |
455 | expected("tuu++")); | |
456 | test_geometry<mls, mls>("MULTILINESTRING((2 0,1 1,2 0))", | |
457 | "MULTILINESTRING((1 0,1 1,2 1))", | |
458 | expected("tuu++")); | |
459 | test_geometry<mls, mls>("MULTILINESTRING((2 1,1 1,2 1))", | |
460 | "MULTILINESTRING((1 0,1 1,2 1))", | |
461 | expected("tix+=")("txi=+")("tii=+")("txx==")); | |
462 | // spike vs internal turning L | |
463 | test_geometry<mls, mls>("MULTILINESTRING((2 1,1 1,2 1))", | |
464 | "MULTILINESTRING((1 0,1 1,0 1))", | |
465 | expected("tuu++")); | |
466 | test_geometry<mls, mls>("MULTILINESTRING((1 2,1 1,1 2))", | |
467 | "MULTILINESTRING((1 0,1 1,0 1))", | |
468 | expected("tuu++")); | |
469 | test_geometry<mls, mls>("MULTILINESTRING((2 2,1 1,2 2))", | |
470 | "MULTILINESTRING((1 0,1 1,0 1))", | |
471 | expected("tuu++")); | |
472 | test_geometry<mls, mls>("MULTILINESTRING((0 0,1 1,0 0))", | |
473 | "MULTILINESTRING((1 0,1 1,0 1))", | |
474 | expected("tuu++")); | |
475 | test_geometry<mls, mls>("MULTILINESTRING((0 1,1 1,0 1))", | |
476 | "MULTILINESTRING((1 0,1 1,0 1))", | |
477 | expected("tix+=")("txi=+")("tii=+")("txx==")); | |
478 | // spike vs internal collinear | |
479 | test_geometry<mls, mls>("MULTILINESTRING((0 1,1 1,0 1))", | |
480 | "MULTILINESTRING((2 1,1 1,0 1))", | |
481 | expected("tix+=")("txi=+")("tii=+")("txx==")); | |
482 | // internal collinear vs spike | |
483 | test_geometry<mls, mls>("MULTILINESTRING((2 1,1 1,0 1))", | |
484 | "MULTILINESTRING((0 1,1 1,0 1))", | |
485 | expected("txi=+")("tix+=")("tii+=")("txx==")); | |
486 | // spike vs spike | |
487 | test_geometry<mls, mls>("MULTILINESTRING((0 0,1 1,0 0))", | |
488 | "MULTILINESTRING((2 2,1 1,2 2))", | |
489 | expected("tuu++")); | |
490 | test_geometry<mls, mls>("MULTILINESTRING((0 0,1 1,0 0))", | |
491 | "MULTILINESTRING((2 0,1 1,2 0))", | |
492 | expected("tuu++")); | |
493 | test_geometry<mls, mls>("MULTILINESTRING((0 0,1 1,0 0))", | |
494 | "MULTILINESTRING((2 1,1 1,2 1))", | |
495 | expected("tuu++")); | |
496 | test_geometry<mls, mls>("MULTILINESTRING((0 0,1 1,0 0))", | |
497 | "MULTILINESTRING((0 1,1 1,0 1))", | |
498 | expected("tuu++")); | |
499 | // collinear spikes | |
500 | test_geometry<mls, mls>("MULTILINESTRING((0 0,1 1,0 0))", | |
501 | "MULTILINESTRING((0 0,1 1,0 0))", | |
502 | expected("tii++")("tix+=")("txi=+")("txx==") | |
503 | ("ecc==")); | |
504 | test_geometry<mls, mls>("MULTILINESTRING((0 0,1 1,0 0))", | |
505 | "MULTILINESTRING((1 1,0 0,1 1))", | |
506 | expected("tix+=")("tii+=")("txx==")("txi==") | |
507 | ("txi=+")("tii=+")("txx==")("tix==")); | |
508 | // non-spike similar | |
509 | test_geometry<mls, mls>("MULTILINESTRING((0 0,10 0))", | |
510 | "MULTILINESTRING((-1 0,0 0,2 0))", | |
511 | expected("tii++")("mux==")); | |
512 | test_geometry<mls, mls>("MULTILINESTRING((0 0,10 0))", | |
513 | "MULTILINESTRING((-1 -1,0 0,2 0))", | |
514 | expected("tii++")("mux==")); | |
515 | test_geometry<mls, mls>("MULTILINESTRING((0 0,10 0))", | |
516 | "MULTILINESTRING((2 0,0 0,-1 0))", | |
517 | expected("tiu+=")("mui=+")); | |
518 | test_geometry<mls, mls>("MULTILINESTRING((0 0,10 0))", | |
519 | "MULTILINESTRING((2 0,0 0,-1 -1))", | |
520 | expected("tiu+=")("mui=+")); | |
521 | ||
522 | // parts of boundaries taken from union A/A buffer_mp1 | |
523 | if ( BOOST_GEOMETRY_CONDITION((boost::is_same<T, double>::value)) ) | |
524 | { | |
525 | test_geometry<ls, ls>("LINESTRING(6.95629520146761 5.415823381635526,6.989043790736545 5.209056926535316,7 5,6.989043790736547 4.790943073464693,6.956295201467611 4.584176618364482)", | |
526 | "LINESTRING(7.415823381635519 5.043704798532389,7.209056926535308 5.010956209263453,7.000000000000001 5,6.790943073464693 5.010956209263453,6.584176618364483 5.043704798532389)", | |
527 | expected("tuu++")); | |
528 | // the above should give the same result as this: | |
529 | test_geometry<ls, ls>("LINESTRING(6.95629520146761 5.415823381635526,6.989043790736545 5.209056926535316,7 5,6.989043790736547 4.790943073464693,6.956295201467611 4.584176618364482)", | |
530 | "LINESTRING(7.415823381635519 5.043704798532389,7.209056926535308 5.010956209263453,7 5,6.790943073464693 5.010956209263453,6.584176618364483 5.043704798532389)", | |
531 | expected("tuu++")); | |
532 | } | |
533 | } | |
534 | ||
535 | int test_main(int, char* []) | |
536 | { | |
537 | test_all<float>(); | |
538 | test_all<double>(); | |
539 | ||
540 | #if ! defined(_MSC_VER) | |
541 | test_all<long double>(); | |
542 | #endif | |
543 | ||
7c673cae FG |
544 | return 0; |
545 | } | |
546 | ||
547 | /* | |
548 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(1 0,3 0)", "lsls0000.svg"); | |
549 | to_svg<ls, ls>("LINESTRING(1 0,3 0)", "LINESTRING(2 0,0 0)", "lsls0001.svg"); | |
550 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(3 0,1 0)", "lsls0002.svg"); | |
551 | ||
552 | to_svg<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(1 0,2 0)", "lsls0003.svg"); | |
553 | to_svg<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(2 0,1 0)", "lsls0004.svg"); | |
554 | to_svg<ls, ls>("LINESTRING(1 0,2 0)", "LINESTRING(1 0,0 0)", "lsls0005.svg"); | |
555 | ||
556 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(0 0,2 0)", "lsls0006.svg"); | |
557 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(2 0,0 0)", "lsls0007.svg"); | |
558 | ||
559 | to_svg<ls, ls>("LINESTRING(0 0,3 0)", "LINESTRING(1 0,2 0)", "lsls0008.svg"); | |
560 | to_svg<ls, ls>("LINESTRING(0 0,3 0)", "LINESTRING(2 0,1 0)", "lsls0009.svg"); | |
561 | ||
562 | to_svg<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(1 0,1 1)", "lsls00010.svg"); | |
563 | to_svg<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(1 1,1 0)", "lsls00011.svg"); | |
564 | to_svg<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(0 0,0 1)", "lsls00012.svg"); | |
565 | to_svg<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(0 1,0 0)", "lsls00013.svg"); | |
566 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(1 0,1 1)", "lsls00014.svg"); | |
567 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(1 1,1 0)", "lsls00015.svg"); | |
568 | ||
569 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(1 0,3 1)", "lsls00016.svg"); | |
570 | ||
571 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(2 0,1 0)", "lsls00017.svg"); | |
572 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(0 0,1 0)", "lsls00018.svg"); | |
573 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(1 0,0 0)", "lsls00019.svg"); | |
574 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(1 0,2 0)", "lsls00020.svg"); | |
575 | ||
576 | to_svg<ls, ls>("LINESTRING(0 0,2 0)", "LINESTRING(0 0,2 0)", "lsls000.svg"); | |
577 | to_svg<ls, ls>("LINESTRING(0 0,2 0,2 0,3 0)", "LINESTRING(0 0,2 0)", "lsls001.svg"); | |
578 | to_svg<ls, ls>("LINESTRING(1 0,1 1)", "LINESTRING(0 0,1 0,2 0)", "lsls0020.svg"); | |
579 | to_svg<ls, ls>("LINESTRING(1 0,0 0)", "LINESTRING(0 0,1 0,2 0)", "lsls0021.svg"); | |
580 | to_svg<ls, ls>("LINESTRING(1 0,2 0)", "LINESTRING(0 0,1 0,2 0)", "lsls0022.svg"); | |
581 | to_svg<ls, ls>("LINESTRING(1 1,1 0)", "LINESTRING(0 0,1 0,2 0)", "lsls0023.svg"); | |
582 | to_svg<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "lsls0024.svg"); | |
583 | to_svg<ls, ls>("LINESTRING(2 0,1 0)", "LINESTRING(0 0,1 0,2 0)", "lsls0025.svg"); | |
584 | to_svg<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,1 1)", "lsls00200.svg"); | |
585 | to_svg<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,0 0)", "lsls00211.svg"); | |
586 | to_svg<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 0,2 0)", "lsls00222.svg"); | |
587 | to_svg<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(1 1,1 0)", "lsls00233.svg"); | |
588 | to_svg<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(0 0,1 0)", "lsls00244.svg"); | |
589 | to_svg<ls, ls>("LINESTRING(0 0,1 0,2 0)", "LINESTRING(2 0,1 0)", "lsls00255.svg"); | |
590 | ||
591 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0,6 0,8 0)", "LINESTRING(1 0,3 0,5 0,6 0,9 0)", "lsls01.svg"); | |
592 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(1 0,3 0,4 0,4 2,4 5)", "lsls02.svg"); | |
593 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(1 0,4 0,4 4)", "lsls031.svg"); | |
594 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,2 0,0 0)", "lsls032.svg"); | |
595 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,2 2,0 2)", "lsls0321.svg"); | |
596 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,2 0)", "lsls033.svg"); | |
597 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,4 4)", "lsls034.svg"); | |
598 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,3 1)", "lsls035.svg"); | |
599 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(4 0,4 -1)", "lsls036.svg"); | |
600 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0,4 4)", "LINESTRING(1 0,4 0,4 3)", "lsls04.svg"); | |
601 | to_svg<ls, ls>("LINESTRING(1 0,2 0,4 0,6 0,8 0)", "LINESTRING(0 0,3 0,5 0,6 0,9 0)", "lsls05.svg"); | |
602 | ||
603 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,10 9)", "lsls061.svg"); | |
604 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,10 -9)", "lsls062.svg"); | |
605 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,-10 9)", "lsls063.svg"); | |
606 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,-10 -9)", "lsls064.svg"); | |
607 | to_svg<ls, ls>("LINESTRING(0 0,1 0,10 9,10 10)", "LINESTRING(1 0,10 9)", "lsls065.svg"); | |
608 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,9 9)", "lsls071.svg"); | |
609 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,9 -9)", "lsls072.svg"); | |
610 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,-9 9)", "lsls073.svg"); | |
611 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 0,-9 -9)", "lsls074.svg"); | |
612 | to_svg<ls, ls>("LINESTRING(0 0,1 0,10 0,10 10)", "LINESTRING(1 0,9 9)", "lsls081.svg"); | |
613 | to_svg<ls, ls>("LINESTRING(0 0,1 0,10 0,10 10)", "LINESTRING(0 0,9 9)", "lsls082.svg"); | |
614 | to_svg<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(1 0,9 9)", "lsls083.svg"); | |
615 | to_svg<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(9 9,1 0)", "lsls084.svg"); | |
616 | to_svg<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(1 0,2 0)", "lsls085.svg"); | |
617 | to_svg<ls, ls>("LINESTRING(0 0,1 0)", "LINESTRING(2 0,1 0)", "lsls086.svg"); | |
618 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10)", "LINESTRING(1 1,10 5)", "lsls091.svg"); | |
619 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 5,10 10)", "LINESTRING(1 1,10 5)", "lsls092.svg"); | |
620 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10)", "LINESTRING(19 1,10 5)", "lsls093.svg"); | |
621 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 5,10 10)", "LINESTRING(19 1,10 5)", "lsls094.svg"); | |
622 | ||
623 | to_svg<ls, ls>("LINESTRING(5 3,1 1,3 3,2 2,0 0)", "LINESTRING(0 0,3 3,6 3)", "1F100F10T.svg"); | |
624 | ||
625 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 1,1 0,3 0,3 1)", "lsls_01.svg"); | |
626 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 -1,1 0,3 0,3 -1)", "lsls_02.svg"); | |
627 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 1,3 0,1 0,1 1)", "lsls_03.svg"); | |
628 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 -1,3 0,1 0,1 -1)", "lsls_04.svg"); | |
629 | to_svg<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 1,2 0,4 0,4 1)", "lsls_05.svg"); | |
630 | to_svg<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 -1,2 0,4 0,4 -1)", "lsls_06.svg"); | |
631 | to_svg<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 1,4 0,2 0,2 1)", "lsls_07.svg"); | |
632 | to_svg<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 -1,4 0,2 0,2 -1)", "lsls_08.svg"); | |
633 | ||
634 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 1,1 0,2 0,3 0,3 1)", "lsls_11.svg"); | |
635 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(1 -1,1 0,2 0,3 0,3 -1)", "lsls_12.svg"); | |
636 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 1,3 0,2 0,1 0,1 1)", "lsls_13.svg"); | |
637 | to_svg<ls, ls>("LINESTRING(0 0,2 0,4 0)", "LINESTRING(3 -1,3 0,2 0,1 0,1 -1)", "lsls_14.svg"); | |
638 | to_svg<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 1,2 0,3 0,4 0,4 1)", "lsls_15.svg"); | |
639 | to_svg<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(2 -1,2 0,3 0,4 0,4 -1)", "lsls_16.svg"); | |
640 | to_svg<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 1,4 0,3 0,2 0,2 1)", "lsls_17.svg"); | |
641 | to_svg<ls, ls>("LINESTRING(0 0,2 0,3 0,4 0,6 0)", "LINESTRING(4 -1,4 0,3 0,2 0,2 -1)", "lsls_18.svg"); | |
642 | ||
643 | to_svg<ls, ls>("LINESTRING(0 5,5 5,10 5,10 10,5 10,5 5,5 0)", "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", "lsls11.svg"); | |
644 | to_svg<ls, ls>("LINESTRING(0 5,5 5,10 5,10 10,5 10,5 5,5 0)", "LINESTRING(5 0,5 5,10 5,10 10,5 10,5 5,0 5)", "lsls12.svg"); | |
645 | to_svg<ls, ls>("LINESTRING(5 0,5 5,5 10,10 10,10 5,5 5,0 5)", "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", "lsls13.svg"); | |
646 | to_svg<ls, ls>("LINESTRING(5 0,5 5,5 10,10 10,10 5,5 5,0 5)", "LINESTRING(5 0,5 5,10 5,10 10,5 10,5 5,0 5)", "lsls14.svg"); | |
647 | ||
648 | to_svg<ls, ls>("LINESTRING(0 5,10 5,10 10,5 10,5 0)", "LINESTRING(0 5,5 5,5 10,10 10,10 5,5 5,5 0)", "lsls15.svg"); | |
649 | to_svg<ls, ls>("LINESTRING(0 5,10 5,10 10,5 10,5 0)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls16.svg"); | |
650 | to_svg<ls, ls>("LINESTRING(0 5,10 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls161.svg"); | |
651 | to_svg<ls, ls>("LINESTRING(0 5,8 5,10 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls162.svg"); | |
652 | to_svg<ls, ls>("LINESTRING(0 5,8 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1631.svg"); | |
653 | to_svg<ls, ls>("LINESTRING(0 5,1 5,7 5,8 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1632.svg"); | |
654 | to_svg<ls, ls>("LINESTRING(0 5,1 5,7 5,8 5)", "LINESTRING(5 10,10 10,10 5,0 5)", "lsls1633.svg"); | |
655 | to_svg<ls, ls>("LINESTRING(0 5,8 4)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1641.svg"); | |
656 | to_svg<ls, ls>("LINESTRING(0 5,8 6)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1642.svg"); | |
657 | to_svg<ls, ls>("LINESTRING(1 5,8 4)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1643.svg"); | |
658 | to_svg<ls, ls>("LINESTRING(1 5,8 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls1644.svg"); | |
659 | to_svg<ls, ls>("LINESTRING(0 5,5 5,8 4)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls165.svg"); | |
660 | to_svg<ls, ls>("LINESTRING(0 5,5 5,8 5)", "LINESTRING(5 0,5 10,10 10,10 5,0 5)", "lsls166.svg"); | |
661 | to_svg<ls, ls>("LINESTRING(0 5,5 5,8 5)", "LINESTRING(0 10,10 0,5 0,5 10,10 10,10 5,0 5)", "lsls167.svg"); | |
662 | to_svg<ls, ls>("LINESTRING(0 5,5 5,8 5)", "LINESTRING(0 10,5 5,10 0,5 0,5 5,5 10,10 10,10 5,0 5)", "lsls168.svg"); | |
663 | ||
664 | to_svg<ls, ls>("LINESTRING(0 0,0 10,10 10,10 0,0 0)", "LINESTRING(0 2,0 0,10 0,10 10,0 10,0 8,0 2)", "lsls1690.svg"); | |
665 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10,0 10,0 0)", "LINESTRING(0 8,0 0,10 0,10 10,0 10,0 8)", "lsls1691.svg"); | |
666 | to_svg<ls, ls>("LINESTRING(0 0,10 0,10 10,0 10,0 0)", "LINESTRING(0 2,0 0,10 0,10 10,0 10,0 8)", "lsls1692.svg"); | |
667 | to_svg<ls, ls>("LINESTRING(0 0,0 10,10 10,10 0,0 0)", "LINESTRING(0 2,0 0,10 0,10 10,0 10,0 8)", "lsls1693.svg"); | |
668 | to_svg<ls, ls>("LINESTRING(0 2,0 0,10 0,10 10,0 10,0 8)", "LINESTRING(0 0,10 0,10 10,0 10,0 0)", "lsls1694.svg"); | |
669 | to_svg<ls, ls>("LINESTRING(0 2,0 0,10 0,10 10,0 10,0 8)", "LINESTRING(0 0,0 10,10 10,10 0,0 0)", "lsls1695.svg"); | |
670 | ||
671 | to_svg<ls>("LINESTRING(0 8,0 0,10 0,10 10,0 10,0 2)", "ls1.svg"); | |
672 | to_svg<ls>("LINESTRING(8 8,0 0,10 0,10 10,0 10,8 2)", "ls2.svg"); | |
673 | ||
674 | typedef bg::model::multi_linestring<ls> mls; | |
675 | to_svg<ls, mls>("LINESTRING(0 5,10 5,10 10,5 10,5 0)", "MULTILINESTRING((5 0,5 7),(5 8,5 10,10 10,10 5,0 5))", "lsls17.svg"); | |
676 | to_svg<ls, mls>("LINESTRING(0 5,10 5,10 10,5 10,5 0)", "MULTILINESTRING((5 0,5 4,5 6,5 7),(5 8,5 10,10 10,10 5,0 5))", "lsls18.svg"); | |
677 | to_svg<ls, mls>("LINESTRING(0 5,10 5,10 10,5 10,5 0)", "MULTILINESTRING((5 0,5 8),(5 7,5 10,10 10,10 5,0 5))", "lsls19.svg"); | |
678 | to_svg<mls, ls>("MULTILINESTRING((5 0,5 7),(5 8,5 10,10 10,10 5,0 5))", "LINESTRING(0 5,10 5,10 10,5 10,5 0)", "lsls20.svg"); | |
679 | to_svg<mls, ls>("MULTILINESTRING((5 0,5 8),(5 7,5 10,10 10,10 5,0 5))", "LINESTRING(0 5,10 5,10 10,5 10,5 0)", "lsls21.svg"); | |
680 | ||
681 | to_svg<ls, ls>("LINESTRING(0 5,5 5,10 5,10 10,5 10,5 5,5 0)", "LINESTRING(0 5,5 5,0 10,10 10,10 5,5 5,5 0)", "lsls100.svg"); | |
682 | ||
683 | to_svg<ls, ls>("LINESTRING(5 0,5 5,5 0)", "LINESTRING(0 5,5 5,0 10,2 10,5 5,5 10,10 10,10 5,5 5,10 2,10 0,8 0,5 5,5 0)", "lsls101.svg"); | |
684 | */ |