get_turns_linear_linear.cpp 42 KB

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