get_turns_linear_linear_geo.cpp 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Boost.Geometry
  2. // Unit Test
  3. // Copyright (c) 2017, Oracle and/or its affiliates.
  4. // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
  5. // Use, modification and distribution is subject to the Boost Software License,
  6. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  7. // http://www.boost.org/LICENSE_1_0.txt)
  8. #include "test_get_turns.hpp"
  9. #include <boost/geometry/geometries/geometries.hpp>
  10. template <typename T>
  11. void test_radian()
  12. {
  13. typedef bg::model::point<T, 2, bg::cs::geographic<bg::radian> > pt;
  14. typedef bg::model::linestring<pt> ls;
  15. typedef bg::model::multi_linestring<ls> mls;
  16. bg::srs::spheroid<double> sph_wgs84(6378137.0, 6356752.3142451793);
  17. boost::geometry::strategy::intersection::geographic_segments<> wgs84(sph_wgs84);
  18. test_geometry<ls, mls>(
  19. "LINESTRING(0 0, -3.14159265358979 0)",
  20. "MULTILINESTRING((-2.1467549799530232 -0.12217304763960295,"
  21. "-2.5481807079117185 -0.90757121103705041,"
  22. "-2.6529004630313784 0.85521133347722067,"
  23. " 0.92502450355699373 0.62831853071795796,"
  24. "-2.5307274153917754 0,"
  25. " 2.8099800957108676 1.0646508437165401,"
  26. "-1.6057029118347816 -1.5009831567151219,"
  27. " 0.2268928027592626 1.0646508437165401,"
  28. "-2.199114857512853 -0.017453292519943278,"
  29. " 0 0.31415926535897898,"
  30. " 0 0.57595865315812822,"
  31. " 1.0471975511965967 -0.73303828583761765,"
  32. " 2.1118483949131366 -0.54105206811824158))",
  33. expected("mii++")("muu==")("iuu++")("iuu++")("iuu++")("iuu++"),
  34. wgs84);
  35. }
  36. int test_main(int, char* [])
  37. {
  38. test_radian<double>();
  39. return 0;
  40. }